code
stringlengths 3
10M
| language
stringclasses 31
values |
|---|---|
/**
Audio module
Copyright: (c) Enalye 2017
License: Zlib
Authors: Enalye
*/
module atelier.audio;
public {
import atelier.audio.music;
import atelier.audio.sound;
}
|
D
|
import thBase.io;
import thBase.string;
import thBase.container.stack;
import thBase.container.hashmap;
import thBase.container.vector;
import thBase.policies.hashing;
import thBase.scoped;
import thBase.file;
import thBase.chunkfile;
import thBase.format;
import thBase.math;
import thBase.math3d.all;
import thBase.math3d.mats;
import thBase.math3d.vecs;
import assimp.assimp;
import modeltypes;
import core.stdc.stdlib;
rcstring g_workDir;
bool g_debug = false;
bool g_includeMissingTextures = false;
static ~this()
{
g_workDir = rcstring();
}
struct MaterialTextureInfo
{
uint id;
TextureType semantic;
}
void Warning(string fmt, ...)
{
StdOutPutPolicy put;
formatDo!StdOutPutPolicy(put, "Warning: ", [], null);
formatDo(put, fmt, _arguments, _argptr);
put.put('\r');
put.put('\n');
put.flush();
}
void Error(string fmt, ...)
{
auto dummy = NothingPutPolicy!char();
size_t needed = formatDo(dummy,fmt,_arguments,_argptr);
auto result = rcstring(needed);
auto put = BufferPutPolicy!char(cast(char[])result[]);
formatDo(put,fmt,_arguments,_argptr);
throw New!RCException(result);
}
TextureType MapTextureType(aiTextureType type)
{
switch(type)
{
case aiTextureType.NONE:
return TextureType.UNKNOWN;
case aiTextureType.DIFFUSE:
return TextureType.DIFFUSE;
case aiTextureType.SPECULAR:
return TextureType.SPECULAR;
case aiTextureType.EMISSIVE:
return TextureType.EMISSIVE;
case aiTextureType.HEIGHT:
return TextureType.HEIGHT;
case aiTextureType.NORMALS:
return TextureType.NORMALS;
case aiTextureType.LIGHTMAP:
return TextureType.LIGHTMAP;
case aiTextureType.REFLECTION:
return TextureType.REFLECTION;
default:
return TextureType.UNKNOWN;
}
}
short CompressFloat(float f)
{
if(f < -1.0f || f > 1.0f)
Error("out of range compression");
return cast(short)(cast(float)short.max * f);
}
mat4 Convert(ref const(aiMatrix4x4) pData){
mat4 result;
with(result){
f[ 0] = pData.a1; f[ 1] = pData.a2; f[ 2] = pData.a3; f[ 3] = pData.a4;
f[ 4] = pData.b1; f[ 5] = pData.b2; f[ 6] = pData.b3; f[ 7] = pData.b4;
f[ 8] = pData.c1; f[ 9] = pData.c2; f[10] = pData.c3; f[11] = pData.c4;
f[12] = pData.d1; f[13] = pData.d2; f[14] = pData.d3; f[15] = pData.d4;
}
result = result.Transpose();
return result;
}
void ProgressModel(string path)
{
try
{
const(aiScene)* scene = Assimp.ImportFile(toCString(path),
aiPostProcessSteps.CalcTangentSpace |
aiPostProcessSteps.Triangulate |
aiPostProcessSteps.JoinIdenticalVertices |
aiPostProcessSteps.FlipUVs);// |
//aiPostProcessSteps.MakeLeftHanded); // |
//aiPostProcessSteps.PreTransformVertices );
if(scene is null){
Error("Couldn't load model from file '%s'", path);
}
scope(exit)
{
Assimp.ReleaseImport(cast(aiScene*)scene);
scene = null;
}
rcstring outputFilename = path[0..$-4];
outputFilename ~= ".thModel";
auto outFile = scopedRef!Chunkfile(New!Chunkfile(outputFilename, Chunkfile.Operation.Write, g_debug ? Chunkfile.DebugMode.On : Chunkfile.DebugMode.Off ));
outFile.startWriting("thModel", ModelFormatVersion.max);
scope(exit) outFile.endWriting();
auto textureFiles = scopedRef!(Hashmap!(const(char)[], uint, StringHashPolicy))(New!(Hashmap!(const(char)[], uint, StringHashPolicy))());
auto materialTextures = scopedRef!(Vector!MaterialTextureInfo)(New!(Vector!MaterialTextureInfo)());
auto textures = scopedRef!(Vector!(const(char)[]))(New!(Vector!(const(char)[]))());
auto materialNames = scopedRef!(Vector!(const(char)[]))(New!(Vector!(const(char)[]))());
uint numTextureReferences;
// Collect Textures
{
uint nextTextureId = 0;
if(scene.mMaterials !is null)
{
//collect all textures from all materials
for(size_t i=0; i<scene.mNumMaterials; i++)
{
bool foundMatName = false;
const(aiMaterial*) mat = scene.mMaterials[i];
for(int j=0; j < mat.mNumProperties; j++)
{
const(aiMaterialProperty*) prop = mat.mProperties[j];
if(prop.mKey.data[0..prop.mKey.length] == "$tex.file")
{
const(char)[] textureFilename = prop.mData[4..prop.mDataLength-1];
rcstring texturePath;
if(textureFilename[0..2] == ".\\" || textureFilename[0..2] == "./")
texturePath = textureFilename[2..$];
else
texturePath = textureFilename;
texturePath = g_workDir ~ texturePath;
if(textureFilename != "$texture.png")
{
if(!g_includeMissingTextures && !thBase.file.exists(texturePath[]))
{
Warning("Couldn't find file '%s' at '%s' ignoring...", textureFilename, texturePath[]);
}
else if(MapTextureType(cast(aiTextureType)prop.mSemantic) == TextureType.UNKNOWN)
{
Warning("Texture '%s' has non supported semantic, ignoring...", textureFilename);
}
else {
numTextureReferences++;
if(!textureFiles.exists(textureFilename))
{
uint index = cast(uint)textures.length;
textureFiles[textureFilename] = index;
textures ~= textureFilename;
}
}
}
}
else if(prop.mKey.data[0..prop.mKey.length] == "?mat.name")
{
const(char)[] materialName = prop.mData[4..prop.mDataLength-1];
materialNames ~= materialName;
foundMatName = true;
}
}
if(!foundMatName)
{
Warning("Couldn't find name for material %d using 'default'", i);
materialNames ~= "default";
}
}
}
}
//Size information
{
outFile.startWriteChunk("sizeinfo");
scope(exit) outFile.endWriteChunk();
outFile.write(cast(uint)textures.length);
uint texturePathMemory = 0;
foreach(const(char)[] filename; textures){
texturePathMemory += filename.length;
}
outFile.write(texturePathMemory);
uint materialNameMemory = 0;
foreach(const(char)[] materialName; materialNames)
{
materialNameMemory += materialName.length;
}
outFile.write(materialNameMemory);
outFile.write(scene.mNumMaterials);
outFile.write(scene.mNumMeshes);
for(size_t i=0; i<scene.mNumMeshes; i++)
{
const(aiMesh*) aimesh = scene.mMeshes[i];
outFile.write(aimesh.mNumVertices);
uint PerVertexFlags = PerVertexData.Position;
if(aimesh.mNormals !is null)
PerVertexFlags |= PerVertexData.Normal;
if(aimesh.mTangents !is null)
PerVertexFlags |= PerVertexData.Tangent;
if(aimesh.mTangents !is null)
PerVertexFlags |= PerVertexData.Bitangent;
if(aimesh.mTextureCoords[0] !is null)
PerVertexFlags |= PerVertexData.TexCoord0;
if(aimesh.mTextureCoords[1] !is null)
PerVertexFlags |= PerVertexData.TexCoord1;
if(aimesh.mTextureCoords[2] !is null)
PerVertexFlags |= PerVertexData.TexCoord2;
if(aimesh.mTextureCoords[3] !is null)
PerVertexFlags |= PerVertexData.TexCoord3;
outFile.write(PerVertexFlags);
for(int j=0; j<4; j++)
{
if(aimesh.mTextureCoords[j] !is null)
{
ubyte numUVComponents = cast(ubyte)aimesh.mNumUVComponents[j];
if(numUVComponents == 0)
numUVComponents = 2;
outFile.write(numUVComponents);
}
}
outFile.write(aimesh.mNumFaces);
}
uint numNodes = 0;
uint numNodeReferences = 0;
uint numMeshReferences = 0;
uint nodeNameMemory = 0;
void nodeSizeHelper(const(aiNode*) node)
{
if(node is null)
return;
numNodes++;
numNodeReferences += node.mNumChildren;
numMeshReferences += node.mNumMeshes;
nodeNameMemory += node.mName.length;
foreach(child; node.mChildren[0..node.mNumChildren])
{
nodeSizeHelper(child);
}
}
nodeSizeHelper(scene.mRootNode);
outFile.write(numNodes);
outFile.write(numNodeReferences);
outFile.write(nodeNameMemory);
outFile.write(numMeshReferences);
outFile.write(numTextureReferences);
}
//Write textures
{
outFile.startWriteChunk("textures");
scope(exit){
size_t size = outFile.endWriteChunk();
writefln("textures %d kb", size/1024);
}
//Write the collected results to the chunkfile
outFile.write(cast(uint)textures.length);
foreach(const(char)[] filename; textures)
{
outFile.writeArray(filename);
}
}
//Materials
{
outFile.startWriteChunk("materials");
scope(exit) {
size_t size = outFile.endWriteChunk();
writefln("materials %d kb", size/1024);
}
outFile.write(cast(uint)scene.mNumMaterials);
if(scene.mMaterials !is null)
{
for(size_t i=0; i<scene.mNumMaterials; i++)
{
materialTextures.resize(0);
outFile.startWriteChunk("mat");
scope(exit) outFile.endWriteChunk();
const(aiMaterial*) mat = scene.mMaterials[i];
for(size_t j=0; j<mat.mNumProperties; j++)
{
const(aiMaterialProperty*) prop = mat.mProperties[j];
if(prop.mKey.data[0..prop.mKey.length] == "$tex.file")
{
const(char)[] textureFilename = prop.mData[4..prop.mDataLength-1];
if(textureFiles.exists(textureFilename))
{
MaterialTextureInfo info;
info.id = textureFiles[textureFilename];
info.semantic = MapTextureType(cast(aiTextureType)prop.mSemantic);
if(info.semantic != TextureType.UNKNOWN)
materialTextures ~= info;
}
}
}
outFile.writeArray(materialNames[i]);
outFile.write(cast(uint)materialTextures.length);
foreach(ref MaterialTextureInfo info; materialTextures)
{
outFile.write(info.id);
outFile.write(info.semantic);
}
}
}
}
//Meshes
{
outFile.startWriteChunk("meshes");
scope(exit){
size_t size = outFile.endWriteChunk();
writefln("meshes %d kb", size/1024);
}
outFile.write(cast(uint)scene.mNumMeshes);
for(size_t i=0; i<scene.mNumMeshes; i++)
{
outFile.startWriteChunk("mesh");
scope(exit)
{
size_t size = outFile.endWriteChunk();
writefln("mesh %d size %d kb", i, size / 1024);
}
const(aiMesh*) aimesh = scene.mMeshes[i];
//Material index
outFile.write(cast(uint)aimesh.mMaterialIndex);
//min, max
auto minBounds = vec3(float.max, float.max, float.max);
auto maxBounds = vec3(-float.max, -float.max, -float.max);
foreach(ref v; (cast(const(vec3*))aimesh.mVertices)[0..aimesh.mNumVertices])
{
minBounds = thBase.math3d.all.min(minBounds, v);
maxBounds = thBase.math3d.all.max(maxBounds, v);
}
outFile.write(minBounds.f[]);
outFile.write(maxBounds.f[]);
//Num vertices
writefln("%d vertices", aimesh.mNumVertices);
outFile.write(cast(uint)aimesh.mNumVertices);
//vertices
outFile.startWriteChunk("vertices");
outFile.write((cast(const(float*))aimesh.mVertices)[0..aimesh.mNumVertices * 3]);
writefln("mesh %d vertices %d kb", i, outFile.endWriteChunk()/1024);
if(aimesh.mNormals !is null && (aimesh.mTangents is null || aimesh.mBitangents is null))
{
Error("Mesh does have normals but no tangents or bitangents");
}
//normals
if(aimesh.mNormals !is null)
{
outFile.startWriteChunk("normals");
for(size_t j=0; j<aimesh.mNumVertices; j++)
{
auto data = (cast(const(float*))(aimesh.mNormals + j))[0..3];
outFile.write(CompressFloat(data[0]));
outFile.write(CompressFloat(data[1]));
outFile.write(CompressFloat(data[2]));
}
writefln("mesh %d normals %d kb", i, outFile.endWriteChunk()/1024);
}
//tangents
if(aimesh.mTangents !is null)
{
outFile.startWriteChunk("tangents");
for(size_t j=0; j<aimesh.mNumVertices; j++)
{
auto data = (cast(const(float*))(aimesh.mTangents + j))[0..3];
outFile.write(CompressFloat(data[0]));
outFile.write(CompressFloat(data[1]));
outFile.write(CompressFloat(data[2]));
}
writefln("mesh %d tangents %d kb", i, outFile.endWriteChunk()/1024);
}
//bitangents
if(aimesh.mBitangents !is null)
{
outFile.startWriteChunk("bitangents");
for(size_t j=0; j<aimesh.mNumVertices; j++)
{
auto data = (cast(const(float*))(aimesh.mBitangents + j))[0..3];
outFile.write(CompressFloat(data[0]));
outFile.write(CompressFloat(data[1]));
outFile.write(CompressFloat(data[2]));
}
writefln("mesh %d bitangents %d kb", i, outFile.endWriteChunk()/1024);
}
//Texture coordinates
{
outFile.startWriteChunk("texcoords");
scope(exit)
{
size_t size = outFile.endWriteChunk();
writefln("mesh %d texcoords %d kb", i, size/1024);
}
ubyte numTexCoords = 0;
static assert(AI_MAX_NUMBER_OF_TEXTURECOORDS >= 4);
while(numTexCoords < 4 && aimesh.mTextureCoords[numTexCoords] !is null)
numTexCoords++;
outFile.write(numTexCoords);
for(ubyte j=0; j<numTexCoords; j++)
{
ubyte numUVComponents = cast(ubyte)aimesh.mNumUVComponents[j];
if(numUVComponents == 0)
numUVComponents = 2;
outFile.write(numUVComponents);
if(numUVComponents == 3)
{
outFile.write((cast(const(float*))aimesh.mTextureCoords[j])[0..aimesh.mNumVertices*3]);
}
else
{
for(size_t k=0; k<aimesh.mNumVertices; k++)
{
outFile.write((cast(const(float*))&aimesh.mTextureCoords[j][k].x)[0..numUVComponents]);
}
}
}
}
//Faces
{
outFile.startWriteChunk("faces");
outFile.write(cast(uint)aimesh.mNumFaces);
if(aimesh.mNumVertices > ushort.max)
{
for(size_t j=0; j<aimesh.mNumFaces; j++)
{
if(aimesh.mFaces[j].mNumIndices != 3)
Error("Non triangle face in mesh");
outFile.write(aimesh.mFaces[j].mIndices[0..3]);
}
}
else
{
for(size_t j=0; j<aimesh.mNumFaces; j++)
{
if(aimesh.mFaces[j].mNumIndices != 3)
Error("Non triangle face in mesh");
outFile.write(cast(ushort)aimesh.mFaces[j].mIndices[0]);
outFile.write(cast(ushort)aimesh.mFaces[j].mIndices[1]);
outFile.write(cast(ushort)aimesh.mFaces[j].mIndices[2]);
}
}
writefln("mesh %d faces %d kb", i, outFile.endWriteChunk()/1024);
}
}
}
//Nodes
{
outFile.startWriteChunk("nodes");
scope(exit) {
size_t size = outFile.endWriteChunk();
writefln("nodes %d kb",size/1024);
}
auto nodeLookup = scopedRef!(Hashmap!(void*, uint))(New!(Hashmap!(void*, uint))());
uint nextNodeId = 0;
uint countNodes(const(aiNode*) node)
{
if(node is null)
return 0;
nodeLookup[cast(void*)node] = nextNodeId++;
if(node.mNumChildren == 0)
return 0;
uint count = node.mNumChildren;
foreach(child; node.mChildren[0..node.mNumChildren])
{
count += countNodes(child);
}
return count;
}
uint numNodes = countNodes(scene.mRootNode) + 1;
outFile.write(numNodes);
void writeNode(const(aiNode*) node)
{
if(node is null)
return;
outFile.writeArray(node.mName.data[0..node.mName.length]);
auto transform = Convert(node.mTransformation);
outFile.write(transform.f[]);
if(node.mParent is null)
outFile.write(uint.max);
else
outFile.write(nodeLookup[cast(void*)node.mParent]);
outFile.writeArray(node.mMeshes[0..node.mNumMeshes]);
outFile.write(node.mNumChildren);
for(uint i=0; i<node.mNumChildren; i++)
{
outFile.write(nodeLookup[cast(void*)node.mChildren[i]]);
}
foreach(child; node.mChildren[0..node.mNumChildren])
{
writeNode(child);
}
}
writeNode(scene.mRootNode);
}
}
catch(Exception ex)
{
writefln("Error progressing model '%s': %s", path, ex.toString()[]);
Delete(ex);
}
}
int main(string[] args)
{
Assimp.Load("assimp.dll","");
auto models = scopedRef!(Stack!string)(New!(Stack!string)());
for(size_t i=1; i<args.length; i++)
{
if(args[i] == "--workdir")
{
if(i + 1 > args.length)
{
writefln("Error: Missing argument after --workdir");
return -1;
}
g_workDir = args[++i];
if(g_workDir[g_workDir.length-1] != '\\' && g_workDir[g_workDir.length-1] != '/')
g_workDir ~= '\\';
}
else if(args[i] == "--debug")
{
g_debug = true;
}
else if(args[i] == "--includeMissingTextures")
{
g_includeMissingTextures = true;
}
else if(args[i].endsWith(".dae", CaseSensitive.no))
{
if(thBase.file.exists(args[i]))
models.push(args[i]);
else
{
writefln("File: %s does not exist", args[i]);
}
}
else
{
writefln("Error: Unkown command line option %s", args[i]);
}
}
if(models.size == 0)
{
writefln("No model specified");
return 1;
}
try {
while(models.size > 0)
{
ProgressModel(models.pop());
}
}
catch(Throwable ex)
{
writefln("Fatal error: %s", ex.toString()[]);
Delete(ex);
return -1;
}
system("pause");
return 0;
}
|
D
|
/Users/gbs/Xcode/souless/DerivedData/souless/Build/Intermediates.noindex/souless.build/Debug-iphonesimulator/souless.build/Objects-normal/x86_64/SignInView.o : /Users/gbs/Xcode/souless/souless/Data/UserMassageData.swift /Users/gbs/Xcode/souless/souless/Data/PostsData.swift /Users/gbs/Xcode/souless/souless/AuthService.swift /Users/gbs/Xcode/souless/souless/ViewController/NewMessage.swift /Users/gbs/Xcode/souless/souless/AppDelegate.swift /Users/gbs/Xcode/souless/souless/Config.swift /Users/gbs/Xcode/souless/souless/Cell/UsersCell.swift /Users/gbs/Xcode/souless/souless/Cell/PostViewCell.swift /Users/gbs/Xcode/souless/souless/ViewController/MessageController.swift /Users/gbs/Xcode/souless/souless/ViewController/ChatLogController.swift /Users/gbs/Xcode/souless/souless/ViewController/HomeViewController.swift /Users/gbs/Xcode/souless/souless/ViewController/CameraView.swift /Users/gbs/Xcode/souless/souless/ViewController/ProfileView.swift /Users/gbs/Xcode/souless/souless/ViewController/SignInView.swift /Users/gbs/Xcode/souless/souless/ViewController/MainView.swift /Users/gbs/Xcode/souless/souless/ViewController/SignUpView.swift /Users/gbs/Xcode/souless/souless/ViewController/Activity.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/os.apinotesc /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/Kingfisher.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Accelerate.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/os.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/gbs/Xcode/souless/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FIRInstanceID.h /Users/gbs/Xcode/souless/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h /Users/gbs/Xcode/souless/souless/ProgreesHUD/ProgressHUD.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FirebaseStorage-umbrella.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FirebaseCore-umbrella.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FirebaseDatabase-umbrella.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FirebaseAuth-umbrella.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-umbrella.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRMutableData.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageMetadata.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRUserMetadata.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageReference.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRDatabaseReference.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorage.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FirebaseStorage.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthAPNSTokenType.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRDataEventType.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FirebaseCore.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRDatabase.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FirebaseDatabase.h /Users/gbs/Xcode/souless/Pods/Firebase/CoreOnly/Sources/Firebase.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthUIDelegate.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRServerValue.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuth.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FirebaseAuth.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageDownloadTask.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageUploadTask.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageTask.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageObservableTask.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthCredential.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRPhoneAuthCredential.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FIRLoggerLevel.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FirebaseAuthVersion.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FIRConfiguration.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRUserInfo.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAdditionalUserInfo.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FIRApp.h /Users/gbs/Xcode/souless/souless/ProgreesHUD/souless-Bridging-Header.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIROAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRGitHubAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRGoogleAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRPhoneAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRFacebookAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIREmailAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRTwitterAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRUser.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRActionCodeSettings.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthSettings.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FIROptions.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthErrors.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageConstants.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-Swift.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthDataResult.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthTokenResult.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRTransactionResult.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRDataSnapshot.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageTaskSnapshot.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRDatabaseQuery.h /Users/gbs/Xcode/souless/Pods/Firebase/CoreOnly/Sources/module.modulemap /Users/gbs/Xcode/souless/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/gbs/Xcode/souless/DerivedData/souless/Build/Intermediates.noindex/souless.build/Debug-iphonesimulator/souless.build/Objects-normal/x86_64/SignInView~partial.swiftmodule : /Users/gbs/Xcode/souless/souless/Data/UserMassageData.swift /Users/gbs/Xcode/souless/souless/Data/PostsData.swift /Users/gbs/Xcode/souless/souless/AuthService.swift /Users/gbs/Xcode/souless/souless/ViewController/NewMessage.swift /Users/gbs/Xcode/souless/souless/AppDelegate.swift /Users/gbs/Xcode/souless/souless/Config.swift /Users/gbs/Xcode/souless/souless/Cell/UsersCell.swift /Users/gbs/Xcode/souless/souless/Cell/PostViewCell.swift /Users/gbs/Xcode/souless/souless/ViewController/MessageController.swift /Users/gbs/Xcode/souless/souless/ViewController/ChatLogController.swift /Users/gbs/Xcode/souless/souless/ViewController/HomeViewController.swift /Users/gbs/Xcode/souless/souless/ViewController/CameraView.swift /Users/gbs/Xcode/souless/souless/ViewController/ProfileView.swift /Users/gbs/Xcode/souless/souless/ViewController/SignInView.swift /Users/gbs/Xcode/souless/souless/ViewController/MainView.swift /Users/gbs/Xcode/souless/souless/ViewController/SignUpView.swift /Users/gbs/Xcode/souless/souless/ViewController/Activity.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/os.apinotesc /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/Kingfisher.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Accelerate.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/os.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/gbs/Xcode/souless/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FIRInstanceID.h /Users/gbs/Xcode/souless/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h /Users/gbs/Xcode/souless/souless/ProgreesHUD/ProgressHUD.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FirebaseStorage-umbrella.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FirebaseCore-umbrella.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FirebaseDatabase-umbrella.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FirebaseAuth-umbrella.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-umbrella.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRMutableData.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageMetadata.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRUserMetadata.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageReference.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRDatabaseReference.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorage.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FirebaseStorage.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthAPNSTokenType.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRDataEventType.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FirebaseCore.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRDatabase.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FirebaseDatabase.h /Users/gbs/Xcode/souless/Pods/Firebase/CoreOnly/Sources/Firebase.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthUIDelegate.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRServerValue.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuth.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FirebaseAuth.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageDownloadTask.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageUploadTask.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageTask.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageObservableTask.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthCredential.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRPhoneAuthCredential.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FIRLoggerLevel.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FirebaseAuthVersion.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FIRConfiguration.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRUserInfo.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAdditionalUserInfo.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FIRApp.h /Users/gbs/Xcode/souless/souless/ProgreesHUD/souless-Bridging-Header.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIROAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRGitHubAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRGoogleAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRPhoneAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRFacebookAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIREmailAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRTwitterAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRUser.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRActionCodeSettings.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthSettings.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FIROptions.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthErrors.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageConstants.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-Swift.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthDataResult.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthTokenResult.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRTransactionResult.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRDataSnapshot.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageTaskSnapshot.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRDatabaseQuery.h /Users/gbs/Xcode/souless/Pods/Firebase/CoreOnly/Sources/module.modulemap /Users/gbs/Xcode/souless/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/gbs/Xcode/souless/DerivedData/souless/Build/Intermediates.noindex/souless.build/Debug-iphonesimulator/souless.build/Objects-normal/x86_64/SignInView~partial.swiftdoc : /Users/gbs/Xcode/souless/souless/Data/UserMassageData.swift /Users/gbs/Xcode/souless/souless/Data/PostsData.swift /Users/gbs/Xcode/souless/souless/AuthService.swift /Users/gbs/Xcode/souless/souless/ViewController/NewMessage.swift /Users/gbs/Xcode/souless/souless/AppDelegate.swift /Users/gbs/Xcode/souless/souless/Config.swift /Users/gbs/Xcode/souless/souless/Cell/UsersCell.swift /Users/gbs/Xcode/souless/souless/Cell/PostViewCell.swift /Users/gbs/Xcode/souless/souless/ViewController/MessageController.swift /Users/gbs/Xcode/souless/souless/ViewController/ChatLogController.swift /Users/gbs/Xcode/souless/souless/ViewController/HomeViewController.swift /Users/gbs/Xcode/souless/souless/ViewController/CameraView.swift /Users/gbs/Xcode/souless/souless/ViewController/ProfileView.swift /Users/gbs/Xcode/souless/souless/ViewController/SignInView.swift /Users/gbs/Xcode/souless/souless/ViewController/MainView.swift /Users/gbs/Xcode/souless/souless/ViewController/SignUpView.swift /Users/gbs/Xcode/souless/souless/ViewController/Activity.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/os.apinotesc /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/Kingfisher.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Accelerate.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/os.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/gbs/Xcode/souless/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FIRInstanceID.h /Users/gbs/Xcode/souless/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h /Users/gbs/Xcode/souless/souless/ProgreesHUD/ProgressHUD.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FirebaseStorage-umbrella.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FirebaseCore-umbrella.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FirebaseDatabase-umbrella.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FirebaseAuth-umbrella.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-umbrella.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRMutableData.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageMetadata.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRUserMetadata.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageReference.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRDatabaseReference.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorage.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FirebaseStorage.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthAPNSTokenType.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRDataEventType.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FirebaseCore.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRDatabase.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FirebaseDatabase.h /Users/gbs/Xcode/souless/Pods/Firebase/CoreOnly/Sources/Firebase.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthUIDelegate.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRServerValue.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuth.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FirebaseAuth.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageDownloadTask.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageUploadTask.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageTask.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageObservableTask.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthCredential.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRPhoneAuthCredential.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FIRLoggerLevel.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FirebaseAuthVersion.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FIRConfiguration.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRUserInfo.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAdditionalUserInfo.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FIRApp.h /Users/gbs/Xcode/souless/souless/ProgreesHUD/souless-Bridging-Header.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIROAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRGitHubAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRGoogleAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRPhoneAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRFacebookAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIREmailAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRTwitterAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRUser.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRActionCodeSettings.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthSettings.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FIROptions.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthErrors.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageConstants.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-Swift.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthDataResult.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthTokenResult.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRTransactionResult.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRDataSnapshot.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageTaskSnapshot.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRDatabaseQuery.h /Users/gbs/Xcode/souless/Pods/Firebase/CoreOnly/Sources/module.modulemap /Users/gbs/Xcode/souless/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
import core.stdc.stdio : printf;
//------------------------------------------------------------------------------
T enforce7452(T, string file = __FILE__, size_t line = __LINE__)
(T value, lazy const(char)[] msg = null) @safe pure
{
if (!value)
throw new Exception(msg ? msg.idup : "Enforcement failed", file, line);
return value;
}
int f7452()(int x)
{
enforce7452(x > 0);
return x;
}
void g7452() @safe pure
{
assert(4 == f7452(4));
}
//------------------------------------------------------------------------------
void e7452b(int, lazy int) pure nothrow @safe {}
int f7452b()(int x)
{
e7452b(x, 0);
return x;
}
void g7452b() pure nothrow @safe
{
assert(4 == f7452b(4));
}
//------------------------------------------------------------------------------
int f7452c()(int x)
{
auto y = function int() { return 0; };
return x;
}
void g7452c() pure nothrow @safe
{
assert(4 == f7452c(4));
}
//------------------------------------------------------------------------------
auto f6332a()() { return 1; }
int f6332b()() { return 1; }
void g6332() pure nothrow @safe
{
auto x = f6332b();
auto y = f6332a();
assert(x == y);
}
//------------------------------------------------------------------------------
int main()
{
g7452();
g7452b();
g7452c();
g6332();
printf("Success\n");
return 0;
}
|
D
|
/* THIS FILE GENERATED BY bcd.gen */
module bcd.fltk2.DoubleBufferWindow;
align(4):
public import bcd.bind;
public import bcd.fltk2.Window;
public import bcd.fltk2.Group;
public import bcd.fltk2.Widget;
public import bcd.fltk2.Style;
public import bcd.fltk2.FL_API;
public import bcd.fltk2.Rectangle;
public import bcd.fltk2.Color;
public import bcd.fltk2.Flags;
extern (C) void _BCD_delete_N4fltk18DoubleBufferWindowE(void *);
extern (C) void *_BCD_new__ZN4fltk18DoubleBufferWindowC1EiiiiPKc(int, int, int, int, char *);
extern (C) void *_BCD_new__ZN4fltk18DoubleBufferWindowC1EiiPKc(int, int, char *);
extern (C) void _BCD_RI_N4fltk18DoubleBufferWindowE(void *cd, void *dd);
extern (C) void _BCD_delete_N4fltk18DoubleBufferWindowE__DoubleBufferWindow_R(void *This);
extern (C) void *_BCD_new__ZN4fltk18DoubleBufferWindowC1EiiiiPKc_R(int, int, int, int, char *);
extern (C) void *_BCD_new__ZN4fltk18DoubleBufferWindowC1EiiPKc_R(int, int, char *);
alias void function(Widget *, int) _BCD_func__158;
alias void function(Widget *) _BCD_func__160;
alias void function(Widget *, void *) _BCD_func__164;
alias bool function() _BCD_func__392;
class DoubleBufferWindow : Window {
this(ifloat ignore) {
super(ignore);
}
this(ifloat ignore, void *x) {
super(ignore);
__C_data = x;
__C_data_owned = false;
}
~this() {
if (__C_data && __C_data_owned) _BCD_delete_N4fltk18DoubleBufferWindowE(__C_data);
__C_data = null;
}
this(int x, int y, int w, int h, char * l = null) {
super(cast(ifloat) 0);
__C_data = _BCD_new__ZN4fltk18DoubleBufferWindowC1EiiiiPKc(x, y, w, h, l);
__C_data_owned = true;
}
this(int w, int h, char * l = null) {
super(cast(ifloat) 0);
__C_data = _BCD_new__ZN4fltk18DoubleBufferWindowC1EiiPKc(w, h, l);
__C_data_owned = true;
}
}
class DoubleBufferWindow_R : DoubleBufferWindow {
~this() {
if (__C_data && __C_data_owned) _BCD_delete_N4fltk18DoubleBufferWindowE__DoubleBufferWindow_R(__C_data);
__C_data = null;
}
this(int x, int y, int w, int h, char * l = null) {
super(cast(ifloat) 0);
__C_data = _BCD_new__ZN4fltk18DoubleBufferWindowC1EiiiiPKc_R(x, y, w, h, l);
__C_data_owned = true;
_BCD_RI_N4fltk18DoubleBufferWindowE(__C_data, cast(void *) this);
}
this(int w, int h, char * l = null) {
super(cast(ifloat) 0);
__C_data = _BCD_new__ZN4fltk18DoubleBufferWindowC1EiiPKc_R(w, h, l);
__C_data_owned = true;
_BCD_RI_N4fltk18DoubleBufferWindowE(__C_data, cast(void *) this);
}
}
|
D
|
/Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Validation.build/Validators/NilIgnoringValidator.swift.o : /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validatable.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/ValidatorType.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/ValidationError.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validator.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/AndValidator.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/RangeValidator.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/NilIgnoringValidator.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/NilValidator.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/EmailValidator.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/InValidator.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/OrValidator.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/CharacterSetValidator.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/CountValidator.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/NotValidator.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validations.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Exports.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /Users/work/Projects/Hello/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Validation.build/NilIgnoringValidator~partial.swiftmodule : /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validatable.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/ValidatorType.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/ValidationError.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validator.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/AndValidator.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/RangeValidator.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/NilIgnoringValidator.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/NilValidator.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/EmailValidator.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/InValidator.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/OrValidator.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/CharacterSetValidator.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/CountValidator.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/NotValidator.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validations.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Exports.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /Users/work/Projects/Hello/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Validation.build/NilIgnoringValidator~partial.swiftdoc : /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validatable.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/ValidatorType.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/ValidationError.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validator.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/AndValidator.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/RangeValidator.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/NilIgnoringValidator.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/NilValidator.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/EmailValidator.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/InValidator.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/OrValidator.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/CharacterSetValidator.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/CountValidator.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/NotValidator.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validations.swift /Users/work/Projects/Hello/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Exports.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /Users/work/Projects/Hello/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
|
D
|
; Copyright (C) 2008 The Android Open Source Project
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
.source T_new_instance_2.java
.class public dot.junit.opcodes.new_instance.d.T_new_instance_2
.super java/lang/Object
.field i I
.method public <init>()V
.limit regs 1
invoke-direct {v0}, java/lang/Object/<init>()V
return-void
.end method
.method public static run()I
.limit regs 5
new-instance v0, dot/junit/opcodes/new_instance/d/T_new_instance_2
; invoke-direct {v0}, dot/junit/opcodes/new_instance/d/T_new_instance_2/<init>()V
iget v1, v0, dot.junit.opcodes.new_instance.d.T_new_instance_2.i I
return v1
.end method
|
D
|
/Users/rick/home/0_Languages/2_Rust/Tutorials/guessing_game/target/debug/deps/libc-7fdb86a2677b135b.rmeta: /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/lib.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/macros.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/fixed_width_ints.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/windows/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/cloudabi/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/fuchsia/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/switch.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/vxworks/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/hermit/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/sgx.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/wasi.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/uclibc/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/newlib/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/linux_like/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/solarish/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/solarish/compat.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/haiku/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/hermit/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/redox/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/apple/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/netbsdlike/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/freebsdlike/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/apple/b32.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/apple/b64.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/align.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/no_align.rs
/Users/rick/home/0_Languages/2_Rust/Tutorials/guessing_game/target/debug/deps/libc-7fdb86a2677b135b.d: /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/lib.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/macros.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/fixed_width_ints.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/windows/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/cloudabi/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/fuchsia/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/switch.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/vxworks/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/hermit/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/sgx.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/wasi.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/uclibc/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/newlib/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/linux_like/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/solarish/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/solarish/compat.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/haiku/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/hermit/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/redox/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/apple/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/netbsdlike/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/freebsdlike/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/apple/b32.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/apple/b64.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/align.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/no_align.rs
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/lib.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/macros.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/fixed_width_ints.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/windows/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/cloudabi/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/fuchsia/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/switch.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/vxworks/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/hermit/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/sgx.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/wasi.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/uclibc/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/newlib/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/linux_like/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/solarish/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/solarish/compat.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/haiku/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/hermit/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/redox/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/apple/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/netbsdlike/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/freebsdlike/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/apple/b32.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/apple/b64.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/align.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/no_align.rs:
|
D
|
/* Copyright (c) 2007 Scott Lembcke
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import chipmunk;
import ChipmunkDemo;
import std.math;
import std.random;
static cpFloat pentagon_mass = 0.0f;
static cpFloat pentagon_moment = 0.0f;
// Iterate over all of the bodies and reset the ones that have fallen offscreen.
extern(C) static void
eachBody(cpBody *body_, void *unused)
{
cpVect pos = cpBodyGetPosition(body_);
if(pos.y < -260 || cpfabs(pos.x) > 340){
cpFloat x = uniform01()*640 - 320;
cpBodySetPosition(body_, cpv(x, 260));
}
}
static void
update(cpSpace *space, double dt)
{
if(ChipmunkDemoRightDown){
cpShape *nearest = cpSpacePointQueryNearest(space, ChipmunkDemoMouse, 0.0, GRAB_FILTER, null);
if(nearest){
cpBody *body_ = cpShapeGetBody(nearest);
if(cpBodyGetType(body_) == cpBodyType.CP_BODY_TYPE_STATIC){
cpBodySetType(body_, cpBodyType.CP_BODY_TYPE_DYNAMIC);
cpBodySetMass(body_, pentagon_mass);
cpBodySetMoment(body_, pentagon_moment);
} else if(cpBodyGetType(body_) == cpBodyType.CP_BODY_TYPE_DYNAMIC) {
cpBodySetType(body_, cpBodyType.CP_BODY_TYPE_STATIC);
}
}
}
cpSpaceEachBody(space, &eachBody, null);
cpSpaceStep(space, dt);
}
enum NUM_VERTS = 5;
static cpSpace *
init()
{
ChipmunkDemoMessageString = "Right click to make pentagons static/dynamic.";
cpSpace *space = cpSpaceNew();
cpSpaceSetIterations(space, 5);
cpSpaceSetGravity(space, cpv(0, -100));
cpBody *body_, staticBody = cpSpaceGetStaticBody(space);
cpShape *shape;
// Vertexes for a triangle shape.
cpVect tris[] = [
cpv(-15,-15),
cpv( 0, 10),
cpv( 15,-15),
];
// Create the static triangles.
for(int i=0; i<9; i++){
for(int j=0; j<6; j++){
cpFloat stagger = (j%2)*40;
cpVect offset = cpv(i*80 - 320 + stagger, j*70 - 240);
shape = cpSpaceAddShape(space, cpPolyShapeNew(staticBody, 3, tris.ptr, cpTransformTranslate(offset), 0.0));
cpShapeSetElasticity(shape, 1.0f);
cpShapeSetFriction(shape, 1.0f);
cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER);
}
}
// Create vertexes for a pentagon shape.
cpVect verts[NUM_VERTS];
for(int i=0; i<NUM_VERTS; i++){
cpFloat angle = -2.0f*CP_PI*i/(cast(cpFloat) NUM_VERTS);
verts[i] = cpv(10*cos(angle), 10*sin(angle));
}
pentagon_mass = 1.0;
pentagon_moment = cpMomentForPoly(1.0f, NUM_VERTS, verts.ptr, cpvzero, 0.0f);
// Add lots of pentagons.
for(int i=0; i<300; i++){
body_ = cpSpaceAddBody(space, cpBodyNew(pentagon_mass, pentagon_moment));
cpFloat x = uniform01()*640 - 320;
cpBodySetPosition(body_, cpv(x, 350));
shape = cpSpaceAddShape(space, cpPolyShapeNew(body_, NUM_VERTS, verts.ptr, cpTransformIdentity, 0.0));
cpShapeSetElasticity(shape, 0.0f);
cpShapeSetFriction(shape, 0.4f);
}
return space;
}
static void
destroy(cpSpace *space)
{
ChipmunkDemoFreeSpaceChildren(space);
cpSpaceFree(space);
}
ChipmunkDemo Plink = {
"Plink",
1.0/60.0,
&init,
&update,
&ChipmunkDemoDefaultDrawImpl,
&destroy,
};
|
D
|
module GameManager;
import IManagers;
import GlobalVariables;
import LocalPlayer;
static class GameManager : IManager {
bool init() {
GV.init();
players.length = 1;
players[0] = new LocalPlayer();
thread.addPosToBlockLoader([0,0,0]);
return true;
}
bool update(float delta) {
bool retVal = true;
retVal &= input.update(delta);
retVal &= thread.update(delta);
retVal &= chunk.update(delta);
foreach(player; players)
retVal &= player.update(delta);
retVal &= gui.update(delta);
retVal &= render.update(delta);
return retVal;
}
void cleanup() {
}
}
|
D
|
/Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/.build/debug/Core.build/Byte/BytesConvertible.swift.o : /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Array.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Bool+String.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Box.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Collection+Safe.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Dispatch.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/DispatchTime+Utilities.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Equatable.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Extractable.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/FileProtocol.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Lock.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/PercentEncoding.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Portal.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Result.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/RFC1123.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Semaphore.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Sequence.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/StaticDataBuffer.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Strand.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/String+CaseInsensitiveCompare.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/String.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/UnsignedInteger.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Byte/Byte+Random.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Byte/Byte.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Byte/ByteAliases.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Byte/Bytes+Base64.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Byte/Bytes.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Byte/BytesConvertible.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Byte/BytesSlice+PatternMatching.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/.build/debug/libc.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule
/Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/.build/debug/Core.build/BytesConvertible~partial.swiftmodule : /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Array.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Bool+String.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Box.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Collection+Safe.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Dispatch.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/DispatchTime+Utilities.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Equatable.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Extractable.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/FileProtocol.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Lock.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/PercentEncoding.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Portal.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Result.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/RFC1123.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Semaphore.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Sequence.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/StaticDataBuffer.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Strand.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/String+CaseInsensitiveCompare.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/String.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/UnsignedInteger.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Byte/Byte+Random.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Byte/Byte.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Byte/ByteAliases.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Byte/Bytes+Base64.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Byte/Bytes.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Byte/BytesConvertible.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Byte/BytesSlice+PatternMatching.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/.build/debug/libc.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule
/Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/.build/debug/Core.build/BytesConvertible~partial.swiftdoc : /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Array.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Bool+String.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Box.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Collection+Safe.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Dispatch.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/DispatchTime+Utilities.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Equatable.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Extractable.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/FileProtocol.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Lock.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/PercentEncoding.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Portal.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Result.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/RFC1123.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Semaphore.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Sequence.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/StaticDataBuffer.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Strand.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/String+CaseInsensitiveCompare.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/String.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/UnsignedInteger.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Byte/Byte+Random.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Byte/Byte.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Byte/ByteAliases.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Byte/Bytes+Base64.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Byte/Bytes.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Byte/BytesConvertible.swift /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/Packages/Core-1.0.0/Sources/Core/Byte/BytesSlice+PatternMatching.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/KyleBlazier/Documents/Development/Xcode/ServerSide/Postgres/postgresAPI/.build/debug/libc.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule
|
D
|
instance SFB_1000_Senyan(Npc_Default)
{
name[0] = "Senyan";
npcType = npctype_main;
guild = GIL_SFB;
level = 3;
voice = 1;
id = 1000;
attribute[ATR_STRENGTH] = 25;
attribute[ATR_DEXTERITY] = 20;
attribute[ATR_MANA_MAX] = 0;
attribute[ATR_MANA] = 0;
attribute[ATR_HITPOINTS_MAX] = 106;
attribute[ATR_HITPOINTS] = 106;
Mdl_SetVisual(self,"HUMANS.MDS");
Mdl_ApplyOverlayMds(self,"Humans_Tired.mds");
Mdl_SetVisualBody(self,"hum_body_Naked0",7,1,"Hum_Head_Psionic",42,1,sfb_armor_l);
B_Scale(self);
Mdl_SetModelFatness(self,0);
fight_tactic = FAI_HUMAN_COWARD;
Npc_SetTalentSkill(self,NPC_TALENT_1H,1);
CreateInvItems(self,ItFoRice,4);
CreateInvItems(self,ItMiNugget,7);
CreateInvItem(self,ItMi_Stuff_Plate_01);
EquipItem(self,ItMw_1H_Nailmace_01);
daily_routine = Rtn_start_1000;
};
func void Rtn_start_1000()
{
TA_StandAround(10,5,22,0,"NC_TAVERN_ROOM06");
TA_SitAround(22,0,8,0,"NC_TAVERN_SIT");
TA_WashSelf(8,0,8,30,"NC_WASH_02");
TA_StandAround(8,30,10,5,"NC_TAVERN_ROOM06");
};
|
D
|
// This file is part of Visual D
//
// Visual D integrates the D programming language into Visual Studio
// Copyright (c) 2010 by Rainer Schuetze, All Rights Reserved
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
module visuald.propertypage;
import visuald.windows;
import sdk.win32.objbase;
import sdk.vsi.vsshell;
import sdk.vsi.vsshell80;
import visuald.comutil;
import visuald.logutil;
import visuald.dpackage;
import visuald.dproject;
import visuald.dllmain;
import visuald.config;
import visuald.winctrl;
import visuald.hierarchy;
import visuald.hierutil;
import visuald.chiernode;
import stdext.array;
import std.string;
import std.conv;
/*debug*/ version = DParser;
class PropertyWindow : Window
{
this(Widget parent, uint style, string title, PropertyPage page)
{
mPropertyPage = page;
super(parent, style, title);
}
override int WindowProc(HWND hWnd, uint uMsg, WPARAM wParam, LPARAM lParam)
{
import sdk.win32.commctrl;
switch (uMsg) {
case WM_SIZE:
RECT r;
GetWindowRect(&r);
int w = LOWORD(lParam);
mPropertyPage.updateSizes(r.left, w);
break;
case TCN_SELCHANGING:
case TCN_SELCHANGE:
// Return FALSE to allow the selection to change.
auto tc = cast(TabControl) this;
return FALSE;
default:
break;
}
return super.WindowProc(hWnd, uMsg, wParam, lParam);
}
PropertyPage mPropertyPage;
}
abstract class PropertyPage : DisposingComObject, IPropertyPage, IVsPropertyPage, IVsPropertyPage2
{
/*const*/ int kPageWidth = 370;
/*const*/ int kPageHeight = 210;
/*const*/ int kMargin = 4;
/*const*/ int kLabelWidth = 120;
/*const*/ int kTextHeight = 20;
/*const*/ int kLineHeight = 23;
/*const*/ int kLineSpacing = 2;
/*const*/ int kNeededLines = 10;
override HRESULT QueryInterface(in IID* riid, void** pvObject)
{
if(queryInterface!(IPropertyPage) (this, riid, pvObject))
return S_OK;
if(queryInterface!(IVsPropertyPage) (this, riid, pvObject))
return S_OK;
if(queryInterface!(IVsPropertyPage2) (this, riid, pvObject))
return S_OK;
return super.QueryInterface(riid, pvObject);
}
override void Dispose()
{
mSite = release(mSite);
foreach(obj; mObjects)
release(obj);
mObjects.length = 0;
mResizableWidgets = mResizableWidgets.init;
mDlgFont = deleteDialogFont(mDlgFont);
}
override int SetPageSite(
/* [in] */ IPropertyPageSite pPageSite)
{
mixin(LogCallMix);
mSite = release(mSite);
mSite = addref(pPageSite);
return S_OK;
}
override int Activate(
/* [in] */ in HWND hWndParent,
/* [in] */ in RECT *pRect,
/* [in] */ in BOOL bModal)
{
mixin(LogCallMix);
if(mWindow)
return returnError(E_FAIL);
return _Activate(new Window(hWndParent), pRect, bModal);
}
int _Activate(
/* [in] */ Window win,
/* [in] */ in RECT *pRect,
/* [in] */ in BOOL bModal)
{
if(pRect)
logCall("_Activate(" ~ to!string(*pRect) ~ ")");
RECT pr;
win.GetWindowRect(&pr);
logCall(" parent.rect = " ~ to!string(pr) ~ "");
if(HWND phwnd = GetParent(win.hwnd))
{
GetWindowRect(phwnd, &pr);
logCall(" parent.parent.rect = " ~ to!string(pr) ~ "");
}
if(pRect)
kPageWidth = pRect.right - pRect.left;
updateEnvironmentFont();
if(!mDlgFont)
mDlgFont = newDialogFont();
mWindow = win;
mCanvas = new Window(mWindow);
DWORD color = GetSysColor(COLOR_BTNFACE);
mCanvas.setBackground(color);
mCanvas.setRect(kMargin, kMargin, kPageWidth - 2 * kMargin, kPageHeight - 2 * kMargin);
mResizableWidgets ~= mCanvas;
// avoid closing canvas (but not dialog) if pressing esc in MultiLineEdit controls
//mCanvas.cancelCloseDelegate ~= delegate bool(Widget c) { return true; };
class DelegateWrapper
{
void OnCommand(Widget w, int cmd)
{
UpdateDirty(true);
}
}
DelegateWrapper delegateWrapper = new DelegateWrapper;
mCanvas.commandDelegate = &delegateWrapper.OnCommand;
CreateControls();
UpdateControls();
mEnableUpdateDirty = true;
return S_OK;
}
override int Deactivate()
{
mixin(LogCallMix);
if(mWindow)
{
mWindow.Dispose();
mWindow = null;
mCanvas = null;
}
return S_OK;
//return returnError(E_NOTIMPL);
}
void updateSizes(int windowLeft, int width)
{
foreach(w; mResizableWidgets)
{
RECT r;
if(w && w.hwnd)
{
w.GetWindowRect(&r);
r.right = windowLeft + width - kMargin;
w.SetWindowPos(null, &r, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
}
}
}
void calcMetric()
{
updateEnvironmentFont();
kMargin = 4;
if(!mDlgFont)
mDlgFont = newDialogFont();
HWND hwnd = GetDesktopWindow();
HDC dc = GetDC(hwnd);
SelectObject(dc, mDlgFont);
TEXTMETRIC tm;
GetTextMetrics(dc, &tm);
ReleaseDC(hwnd, dc);
int fHeight = tm.tmHeight;
int fWidth = tm.tmAveCharWidth;
kPageWidth = fWidth * 75 + 2 * kMargin;
kLabelWidth = fWidth * 22;
mUnindentCheckBox = kLabelWidth;
kLineSpacing = 2;
kTextHeight = fHeight + 4;
kLineHeight = kTextHeight + kLineSpacing + 1;
kPageHeight = kLineHeight * kNeededLines + 2 * kMargin;
}
override int GetPageInfo(
/* [out] */ PROPPAGEINFO *pPageInfo)
{
mixin(LogCallMix);
if(pPageInfo.cb < PROPPAGEINFO.sizeof)
return E_INVALIDARG;
calcMetric();
pPageInfo.cb = PROPPAGEINFO.sizeof;
pPageInfo.pszTitle = string2OLESTR("Title");
pPageInfo.size = visuald.comutil.SIZE(kPageWidth, kPageHeight);
pPageInfo.pszHelpFile = string2OLESTR("HelpFile");
pPageInfo.pszDocString = string2OLESTR("DocString");
pPageInfo.dwHelpContext = 0;
return S_OK;
}
override int SetObjects(
/* [in] */ in ULONG cObjects,
/* [size_is][in] */ IUnknown *ppUnk)
{
mixin(LogCallMix2);
foreach(obj; mObjects)
release(obj);
mObjects.length = 0;
for(uint i = 0; i < cObjects; i++)
mObjects ~= addref(ppUnk[i]);
if(mWindow)
{
mEnableUpdateDirty = false;
UpdateControls();
mEnableUpdateDirty = true;
}
return S_OK;
}
override int Show(
/* [in] */ in UINT nCmdShow)
{
logCall("%s.Show(nCmdShow=%s)", this, _toLog(nCmdShow));
if(mWindow)
mWindow.setVisible(true);
return S_OK;
//return returnError(E_NOTIMPL);
}
override int Move(
/* [in] */ in RECT *pRect)
{
mixin(LogCallMix);
return returnError(E_NOTIMPL);
}
override int Help(
/* [in] */ in wchar* pszHelpDir)
{
logCall("%s.Help(pszHelpDir=%s)", this, _toLog(pszHelpDir));
return returnError(E_NOTIMPL);
}
override int TranslateAccelerator(
/* [in] */ in MSG *pMsg)
{
mixin(LogCallMix2);
if(mSite)
return mSite.TranslateAccelerator(pMsg);
return returnError(E_NOTIMPL);
}
// IVsPropertyPage
override int CategoryTitle(
/* [in] */ in UINT iLevel,
/* [retval][out] */ BSTR *pbstrCategory)
{
logCall("%s.get_CategoryTitle(iLevel=%s, pbstrCategory=%s)", this, _toLog(iLevel), _toLog(pbstrCategory));
switch(iLevel)
{
case 0:
if(GetCategoryName().length == 0)
return S_FALSE;
*pbstrCategory = allocBSTR(GetCategoryName());
break;
case 1:
return S_FALSE;
//*pbstrCategory = allocBSTR("CategoryTitle1");
default:
break;
}
return S_OK;
}
// IVsPropertyPage2
override int GetProperty(
/* [in] */ in VSPPPID propid,
/* [out] */ VARIANT *pvar)
{
mixin(LogCallMix);
switch(propid)
{
case VSPPPID_PAGENAME:
pvar.vt = VT_BSTR;
pvar.bstrVal = allocBSTR(GetPageName());
return S_OK;
default:
break;
}
return returnError(DISP_E_MEMBERNOTFOUND);
}
override int SetProperty(
/* [in] */ in VSPPPID propid,
/* [in] */ in VARIANT var)
{
mixin(LogCallMix);
return returnError(E_NOTIMPL);
}
///////////////////////////////////////
void UpdateDirty(bool bDirty)
{
if(mEnableUpdateDirty && mSite)
mSite.OnStatusChange(PROPPAGESTATUS_DIRTY | PROPPAGESTATUS_VALIDATE);
}
void AddControl(string label, Widget w)
{
int x = kLabelWidth;
auto cb = cast(CheckBox) w;
auto tc = cast(TabControl) w;
auto mt = cast(MultiLineText) w;
//if(cb)
// cb.cmd = 1; // enable actionDelegate
int lines = 1;
if(mt || tc)
lines = mLinesPerMultiLine;
int labelWidth = 0;
if(label.length)
{
Label lab = new Label(w ? w.parent : null, label);
int off = ((kLineHeight - kLineSpacing) - 16) / 2;
labelWidth = w ? kLabelWidth : kPageWidth - 2*kMargin;
lab.setRect(0, mLineY + off, labelWidth, kLineHeight - kLineSpacing);
}
else if (cb || tc)
{
x -= mUnindentCheckBox;
}
int h = lines * kLineHeight - kLineSpacing;
if(cast(Text) w && lines == 1)
{
h = kTextHeight;
}
else if(cb)
h -= 2;
//else if(cast(ComboBox) w)
// h -= 4;
int y = mLineY + (lines * kLineHeight - kLineSpacing - h) / 2;
if(w)
w.setRect(x, y, kPageWidth - 2*kMargin - labelWidth, h);
mLineY += lines * kLineHeight;
if(w)
mResizableWidgets ~= w;
}
void AddHorizontalLine()
{
auto w = new Label(mCanvas);
w.AddWindowStyle(SS_ETCHEDFRAME, SS_TYPEMASK);
w.setRect(0, mLineY + 2, kPageWidth - 2*kMargin, 2);
mResizableWidgets ~= w;
mLineY += 6;
}
int changeOption(V)(V val, ref V optval, ref V refval)
{
if(refval == val)
return 0;
optval = val;
return 1;
}
int changeOptionDg(V)(V val, void delegate (V optval) setdg, V refval)
{
if(refval == val)
return 0;
setdg(val);
return 1;
}
abstract void CreateControls();
abstract void UpdateControls();
abstract string GetCategoryName();
abstract string GetPageName();
Widget[] mResizableWidgets;
HFONT mDlgFont;
IUnknown[] mObjects;
IPropertyPageSite mSite;
Window mWindow;
Window mCanvas;
bool mEnableUpdateDirty;
int mLineY;
int mLinesPerMultiLine = 4;
int mUnindentCheckBox = 120; //16;
}
///////////////////////////////////////////////////////////////////////////////
class ProjectPropertyPage : PropertyPage, ConfigModifiedListener
{
abstract void SetControls(ProjectOptions options);
abstract int DoApply(ProjectOptions options, ProjectOptions refoptions);
override HRESULT QueryInterface(in IID* riid, void** pvObject)
{
//if(queryInterface!(ConfigModifiedListener) (this, riid, pvObject))
// return S_OK;
return super.QueryInterface(riid, pvObject);
}
override void UpdateControls()
{
if(ProjectOptions options = GetProjectOptions())
SetControls(options);
}
override void Dispose()
{
if(auto cfg = GetConfig())
cfg.RemoveModifiedListener(this);
super.Dispose();
}
override void OnConfigModified()
{
}
override int SetObjects(/* [in] */ in ULONG cObjects,
/* [size_is][in] */ IUnknown *ppUnk)
{
if(auto cfg = GetConfig())
cfg.RemoveModifiedListener(this);
int rc = super.SetObjects(cObjects, ppUnk);
if(auto cfg = GetConfig())
cfg.AddModifiedListener(this);
return rc;
}
Config GetConfig()
{
if(mObjects.length > 0)
{
auto config = ComPtr!(Config)(mObjects[0]);
return config;
}
return null;
}
ProjectOptions GetProjectOptions()
{
if(auto cfg = GetConfig())
return cfg.GetProjectOptions();
return null;
}
/*override*/ int IsPageDirty()
{
mixin(LogCallMix);
if(mWindow)
if(ProjectOptions options = GetProjectOptions())
{
scope ProjectOptions opt = new ProjectOptions(false, false);
return DoApply(opt, options) > 0 ? S_OK : S_FALSE;
}
return S_FALSE;
}
/*override*/ int Apply()
{
mixin(LogCallMix);
if(ProjectOptions refoptions = GetProjectOptions())
{
// make a copy, otherwise changes will no longer be detected after the first configuration
auto refopt = clone(refoptions);
for(int i = 0; i < mObjects.length; i++)
{
auto config = ComPtr!(Config)(mObjects[i]);
if(config)
{
DoApply(config.ptr.GetProjectOptions(), refopt);
config.SetDirty();
}
}
return S_OK;
}
return returnError(E_FAIL);
}
}
class NodePropertyPage : PropertyPage
{
abstract void SetControls(CFileNode node);
abstract int DoApply(CFileNode node, CFileNode refnode);
override void UpdateControls()
{
if(CFileNode node = GetNode())
SetControls(node);
}
CFileNode GetNode()
{
if(mObjects.length > 0)
{
auto node = ComPtr!(CFileNode)(mObjects[0]);
if(node)
return node;
}
return null;
}
/*override*/ int IsPageDirty()
{
mixin(LogCallMix);
if(mWindow)
if(CFileNode node = GetNode())
{
scope CFileNode n = newCom!CFileNode("");
return DoApply(n, node) > 0 ? S_OK : S_FALSE;
}
return S_FALSE;
}
/*override*/ int Apply()
{
mixin(LogCallMix);
if(CFileNode refnode = GetNode())
{
for(int i = 0; i < mObjects.length; i++)
{
auto node = ComPtr!(CFileNode)(mObjects[i]);
if(node)
{
DoApply(node, refnode);
if(CProjectNode pn = cast(CProjectNode) node.GetRootNode())
pn.SetProjectFileDirty(true);
}
}
return S_OK;
}
return returnError(E_FAIL);
}
}
class GlobalPropertyPage : PropertyPage
{
abstract void SetControls(GlobalOptions options);
abstract int DoApply(GlobalOptions options, GlobalOptions refoptions);
this(GlobalOptions options)
{
mOptions = options;
}
override void UpdateControls()
{
if(GlobalOptions options = GetGlobalOptions())
SetControls(options);
}
GlobalOptions GetGlobalOptions()
{
return mOptions;
}
void SetWindowSize(int x, int y, int w, int h)
{
mixin(LogCallMix);
if(mCanvas)
mCanvas.setRect(x, y, w, h);
}
/*override*/ int IsPageDirty()
{
mixin(LogCallMix);
if(mWindow)
if(GlobalOptions options = GetGlobalOptions())
{
scope GlobalOptions opt = new GlobalOptions;
return DoApply(opt, options) > 0 ? S_OK : S_FALSE;
}
return S_FALSE;
}
/*override*/ int Apply()
{
mixin(LogCallMix);
if(GlobalOptions options = GetGlobalOptions())
{
DoApply(options, options);
options.saveToRegistry();
return S_OK;
}
return returnError(E_FAIL);
}
GlobalOptions mOptions;
}
///////////////////////////////////////////////////////////////////////////////
class CommonPropertyPage : ProjectPropertyPage
{
override string GetCategoryName() { return ""; }
override string GetPageName() { return "General"; }
override void CreateControls()
{
AddControl("Build System", mCbBuildSystem = new ComboBox(mCanvas, [ "Visual D", "dsss", "rebuild" ], false));
mCbBuildSystem.setSelection(0);
mCbBuildSystem.setEnabled(false);
}
override void SetControls(ProjectOptions options)
{
}
override int DoApply(ProjectOptions options, ProjectOptions refoptions)
{
return 0;
}
ComboBox mCbBuildSystem;
}
class GeneralPropertyPage : ProjectPropertyPage
{
override string GetCategoryName() { return ""; }
override string GetPageName() { return "General"; }
__gshared const float[] selectableVersions = [ 1, 2 ];
override void CreateControls()
{
string[] versions;
foreach(ver; selectableVersions)
versions ~= "D" ~ to!(string)(ver);
//versions[$-1] ~= "+";
AddControl("Compiler", mCompiler = new ComboBox(mCanvas, [ "DMD", "GDC", "LDC" ], false));
AddControl("D-Version", mDVersion = new ComboBox(mCanvas, versions, false));
AddControl("Output Type", mCbOutputType = new ComboBox(mCanvas,
[ "Executable", "Library", "DLL" ], false));
AddControl("Subsystem", mCbSubsystem = new ComboBox(mCanvas,
[ "Not set", "Console", "Windows", "Native", "Posix" ], false));
AddControl("Output Path", mOutputPath = new Text(mCanvas));
AddControl("Intermediate Path", mIntermediatePath = new Text(mCanvas));
AddControl("Files to clean", mFilesToClean = new Text(mCanvas));
AddControl("Compilation", mSingleFileComp = new ComboBox(mCanvas,
[ "Combined compile and link", "Single file compilation",
"Separate compile and link", "Compile only (use Post-build command to link)" ], false));
}
override void SetControls(ProjectOptions options)
{
int ver = 0;
while(ver < selectableVersions.length - 1 && selectableVersions[ver+1] <= options.Dversion)
ver++;
mDVersion.setSelection(ver);
mCompiler.setSelection(options.compiler);
mSingleFileComp.setSelection(options.compilationModel);
mCbOutputType.setSelection(options.lib);
mCbSubsystem.setSelection(options.subsystem);
mOutputPath.setText(options.outdir);
mIntermediatePath.setText(options.objdir);
mFilesToClean.setText(options.filesToClean);
}
override int DoApply(ProjectOptions options, ProjectOptions refoptions)
{
float ver = selectableVersions[mDVersion.getSelection()];
int changes = 0;
changes += changeOption(cast(uint) mSingleFileComp.getSelection(), options.compilationModel, refoptions.compilationModel);
changes += changeOption(cast(ubyte) mCbOutputType.getSelection(), options.lib, refoptions.lib);
changes += changeOption(cast(ubyte) mCbSubsystem.getSelection(), options.subsystem, refoptions.subsystem);
changes += changeOption(cast(ubyte) mCompiler.getSelection(), options.compiler, refoptions.compiler);
changes += changeOption(ver, options.Dversion, refoptions.Dversion);
changes += changeOption(mOutputPath.getText(), options.outdir, refoptions.outdir);
changes += changeOption(mIntermediatePath.getText(), options.objdir, refoptions.objdir);
changes += changeOption(mFilesToClean.getText(), options.filesToClean, refoptions.filesToClean);
return changes;
}
ComboBox mCompiler;
ComboBox mSingleFileComp;
ComboBox mCbOutputType;
ComboBox mCbSubsystem;
ComboBox mDVersion;
Text mOutputPath;
Text mIntermediatePath;
Text mFilesToClean;
}
class DebuggingPropertyPage : ProjectPropertyPage
{
override string GetCategoryName() { return ""; }
override string GetPageName() { return "Debugging"; }
override void CreateControls()
{
Label lbl;
AddControl("Command", mCommand = new Text(mCanvas));
AddControl("Command Arguments", mArguments = new Text(mCanvas));
AddControl("Working Directory", mWorkingDir = new Text(mCanvas));
AddControl("", mAttach = new CheckBox(mCanvas, "Attach to running process"));
AddControl("Remote Machine", mRemote = new Text(mCanvas));
AddControl("Debugger", mDebugEngine = new ComboBox(mCanvas, [ "Visual Studio", "Mago", "Visual Studio (x86 Mixed Mode)" ], false));
AddControl("", mStdOutToOutputWindow = new CheckBox(mCanvas, "Redirect stdout to output window"));
AddControl("Run without debugging", lbl = new Label(mCanvas, ""));
AddControl("", mPauseAfterRunning = new CheckBox(mCanvas, "Pause when program finishes"));
lbl.AddWindowExStyle(WS_EX_STATICEDGE);
lbl.AddWindowStyle(SS_ETCHEDFRAME, SS_TYPEMASK);
int left, top, w, h;
if(lbl.getRect(left, top, w, h))
lbl.setRect(left, top + h / 2 - 1, w, 2);
}
override void UpdateDirty(bool bDirty)
{
super.UpdateDirty(bDirty);
EnableControls();
}
void EnableControls()
{
mStdOutToOutputWindow.setEnabled(mDebugEngine.getSelection() != 1);
}
override void SetControls(ProjectOptions options)
{
mCommand.setText(options.debugtarget);
mArguments.setText(options.debugarguments);
mWorkingDir.setText(options.debugworkingdir);
mAttach.setChecked(options.debugattach);
mRemote.setText(options.debugremote);
mDebugEngine.setSelection(options.debugEngine);
mStdOutToOutputWindow.setChecked(options.debugStdOutToOutputWindow);
mPauseAfterRunning.setChecked(options.pauseAfterRunning);
EnableControls();
}
override int DoApply(ProjectOptions options, ProjectOptions refoptions)
{
int changes = 0;
changes += changeOption(mCommand.getText(), options.debugtarget, refoptions.debugtarget);
changes += changeOption(mArguments.getText(), options.debugarguments, refoptions.debugarguments);
changes += changeOption(mWorkingDir.getText(), options.debugworkingdir, refoptions.debugworkingdir);
changes += changeOption(mAttach.isChecked(), options.debugattach, options.debugattach);
changes += changeOption(mRemote.getText(), options.debugremote, refoptions.debugremote);
changes += changeOption(cast(ubyte)mDebugEngine.getSelection(), options.debugEngine, refoptions.debugEngine);
changes += changeOption(mStdOutToOutputWindow.isChecked(), options.debugStdOutToOutputWindow, options.debugStdOutToOutputWindow);
changes += changeOption(mPauseAfterRunning.isChecked(), options.pauseAfterRunning, options.pauseAfterRunning);
return changes;
}
Text mCommand;
Text mArguments;
Text mWorkingDir;
Text mRemote;
CheckBox mAttach;
ComboBox mDebugEngine;
CheckBox mStdOutToOutputWindow;
CheckBox mPauseAfterRunning;
}
class DmdGeneralPropertyPage : ProjectPropertyPage
{
override string GetCategoryName() { return "Compiler"; }
override string GetPageName() { return "General"; }
override void CreateControls()
{
//AddControl("", mUseStandard = new CheckBox(mCanvas, "Use Standard Import Paths"));
AddControl("Additional Imports", mAddImports = new Text(mCanvas));
AddControl("String Imports", mStringImports = new Text(mCanvas));
AddControl("Version Identifiers", mVersionIdentifiers = new Text(mCanvas));
AddControl("Debug Identifiers", mDebugIdentifiers = new Text(mCanvas));
AddHorizontalLine();
AddControl("", mOtherDMD = new CheckBox(mCanvas, "Use other compiler"));
AddControl("Compiler Path", mCompilerPath = new Text(mCanvas));
AddHorizontalLine();
AddControl("C/C++ Compiler Cmd", mCCCmd = new Text(mCanvas));
AddControl("", mTransOpt = new CheckBox(mCanvas, "Translate D options (debug, optimizations)"));
}
override void UpdateDirty(bool bDirty)
{
super.UpdateDirty(bDirty);
EnableControls();
}
void EnableControls()
{
mCompilerPath.setEnabled(mOtherDMD.isChecked());
}
override void SetControls(ProjectOptions options)
{
//mUseStandard.setChecked(true);
//mUseStandard.setEnabled(false);
mAddImports.setText(options.imppath);
mStringImports.setText(options.fileImppath);
mVersionIdentifiers.setText(options.versionids);
mDebugIdentifiers.setText(options.debugids);
mOtherDMD.setChecked(options.otherDMD);
mCompilerPath.setText(options.program);
mCCCmd.setText(options.cccmd);
mTransOpt.setChecked(options.ccTransOpt);
EnableControls();
}
override int DoApply(ProjectOptions options, ProjectOptions refoptions)
{
int changes = 0;
changes += changeOption(mAddImports.getText(), options.imppath, refoptions.imppath);
changes += changeOption(mStringImports.getText(), options.fileImppath, refoptions.fileImppath);
changes += changeOption(mVersionIdentifiers.getText(), options.versionids, refoptions.versionids);
changes += changeOption(mDebugIdentifiers.getText(), options.debugids, refoptions.debugids);
changes += changeOption(mOtherDMD.isChecked(), options.otherDMD, refoptions.otherDMD);
changes += changeOption(mCompilerPath.getText(), options.program, refoptions.program);
changes += changeOption(mCCCmd.getText(), options.cccmd, refoptions.cccmd);
changes += changeOption(mTransOpt.isChecked(), options.ccTransOpt, refoptions.ccTransOpt);
return changes;
}
//CheckBox mUseStandard;
Text mAddImports;
Text mStringImports;
Text mVersionIdentifiers;
Text mDebugIdentifiers;
CheckBox mOtherDMD;
Text mCompilerPath;
Text mCCCmd;
CheckBox mTransOpt;
}
class DmdDebugPropertyPage : ProjectPropertyPage
{
override string GetCategoryName() { return "Compiler"; }
override string GetPageName() { return "Debug"; }
override void CreateControls()
{
AddControl("Debug Mode", mDebugMode = new ComboBox(mCanvas, [ "Off (release)", "On" ], false));
AddControl("Debug Info", mDebugInfo = new ComboBox(mCanvas, [ "None", "Symbolic (suitable for Mago)", "Symbolic (suitable for VS debug engine)" ], false));
AddHorizontalLine();
AddControl("", mRunCv2pdb = new CheckBox(mCanvas, "Run cv2pdb to Convert Debug Info"));
AddControl("Path to cv2pdb", mPathCv2pdb = new Text(mCanvas));
AddControl("", mCv2pdbPre2043 = new CheckBox(mCanvas, "Assume old associative array implementation (before dmd 2.043)"));
AddControl("", mCv2pdbNoDemangle = new CheckBox(mCanvas, "Do not demangle symbols"));
AddControl("", mCv2pdbEnumType = new CheckBox(mCanvas, "Use enumerator types"));
AddControl("More options", mCv2pdbOptions = new Text(mCanvas));
}
override void UpdateDirty(bool bDirty)
{
super.UpdateDirty(bDirty);
EnableControls();
}
void EnableControls()
{
mRunCv2pdb.setEnabled(mCanRunCv2PDB);
bool runcv2pdb = mCanRunCv2PDB && mRunCv2pdb.isChecked();
mPathCv2pdb.setEnabled(runcv2pdb);
mCv2pdbOptions.setEnabled(runcv2pdb);
mCv2pdbEnumType.setEnabled(runcv2pdb);
mCv2pdbPre2043.setEnabled(runcv2pdb);
mCv2pdbNoDemangle.setEnabled(runcv2pdb);
}
override void SetControls(ProjectOptions options)
{
mDebugMode.setSelection(options.release ? 0 : 1);
mDebugInfo.setSelection(options.symdebug);
mRunCv2pdb.setChecked(options.runCv2pdb);
mPathCv2pdb.setText(options.pathCv2pdb);
mCv2pdbOptions.setText(options.cv2pdbOptions);
mCv2pdbPre2043.setChecked(options.cv2pdbPre2043);
mCv2pdbNoDemangle.setChecked(options.cv2pdbNoDemangle);
mCv2pdbEnumType.setChecked(options.cv2pdbEnumType);
mCanRunCv2PDB = options.compiler != Compiler.DMD || (!options.isX86_64 && !options.mscoff);
EnableControls();
}
override int DoApply(ProjectOptions options, ProjectOptions refoptions)
{
int changes = 0;
changes += changeOption(mDebugMode.getSelection() == 0, options.release, refoptions.release);
changes += changeOption(cast(ubyte) mDebugInfo.getSelection(), options.symdebug, refoptions.symdebug);
changes += changeOption(mRunCv2pdb.isChecked(), options.runCv2pdb, refoptions.runCv2pdb);
changes += changeOption(mPathCv2pdb.getText(), options.pathCv2pdb, refoptions.pathCv2pdb);
changes += changeOption(mCv2pdbOptions.getText(), options.cv2pdbOptions, refoptions.cv2pdbOptions);
changes += changeOption(mCv2pdbPre2043.isChecked(), options.cv2pdbPre2043, refoptions.cv2pdbPre2043);
changes += changeOption(mCv2pdbNoDemangle.isChecked(), options.cv2pdbNoDemangle, refoptions.cv2pdbNoDemangle);
changes += changeOption(mCv2pdbEnumType.isChecked(), options.cv2pdbEnumType, refoptions.cv2pdbEnumType);
return changes;
}
bool mCanRunCv2PDB;
ComboBox mDebugMode;
ComboBox mDebugInfo;
CheckBox mRunCv2pdb;
Text mPathCv2pdb;
CheckBox mCv2pdbPre2043;
CheckBox mCv2pdbNoDemangle;
CheckBox mCv2pdbEnumType;
Text mCv2pdbOptions;
}
class DmdCodeGenPropertyPage : ProjectPropertyPage
{
this()
{
kNeededLines = 12;
}
override string GetCategoryName() { return "Compiler"; }
override string GetPageName() { return "Code Generation"; }
override void CreateControls()
{
mUnindentCheckBox = kLabelWidth;
AddControl("", mProfiling = new CheckBox(mCanvas, "Insert Profiling Hooks"));
AddControl("", mCodeCov = new CheckBox(mCanvas, "Generate Code Coverage"));
AddControl("", mUnitTests = new CheckBox(mCanvas, "Generate Unittest Code"));
AddHorizontalLine();
AddControl("", mOptimizer = new CheckBox(mCanvas, "Run Optimizer"));
AddControl("", mNoboundscheck = new CheckBox(mCanvas, "No Array Bounds Checking"));
AddControl("", mInline = new CheckBox(mCanvas, "Expand Inline Functions"));
AddHorizontalLine();
AddControl("", mNoFloat = new CheckBox(mCanvas, "No Floating Point Support"));
AddControl("", mGenStackFrame = new CheckBox(mCanvas, "Always generate stack frame (DMD 2.056+)"));
AddControl("", mStackStomp = new CheckBox(mCanvas, "Add stack stomp code (DMD 2.062+)"));
AddControl("", mAllInst = new CheckBox(mCanvas, "Generate code for all template instantiations (DMD 2.064+)"));
}
override void SetControls(ProjectOptions options)
{
mProfiling.setChecked(options.trace);
mCodeCov.setChecked(options.cov);
mOptimizer.setChecked(options.optimize);
mNoboundscheck.setChecked(options.noboundscheck);
mUnitTests.setChecked(options.useUnitTests);
mInline.setChecked(options.useInline);
mNoFloat.setChecked(options.nofloat);
mGenStackFrame.setChecked(options.genStackFrame);
mStackStomp.setChecked(options.stackStomp);
mAllInst.setChecked(options.allinst);
mNoboundscheck.setEnabled(options.Dversion > 1);
}
override int DoApply(ProjectOptions options, ProjectOptions refoptions)
{
int changes = 0;
changes += changeOption(mCodeCov.isChecked(), options.cov, refoptions.cov);
changes += changeOption(mProfiling.isChecked(), options.trace, refoptions.trace);
changes += changeOption(mOptimizer.isChecked(), options.optimize, refoptions.optimize);
changes += changeOption(mNoboundscheck.isChecked(), options.noboundscheck, refoptions.noboundscheck);
changes += changeOption(mUnitTests.isChecked(), options.useUnitTests, refoptions.useUnitTests);
changes += changeOption(mInline.isChecked(), options.useInline, refoptions.useInline);
changes += changeOption(mNoFloat.isChecked(), options.nofloat, refoptions.nofloat);
changes += changeOption(mGenStackFrame.isChecked(), options.genStackFrame, refoptions.genStackFrame);
changes += changeOption(mStackStomp.isChecked(), options.stackStomp, refoptions.stackStomp);
changes += changeOption(mAllInst.isChecked(), options.allinst, refoptions.allinst);
return changes;
}
CheckBox mCodeCov;
CheckBox mProfiling;
CheckBox mOptimizer;
CheckBox mNoboundscheck;
CheckBox mUnitTests;
CheckBox mInline;
CheckBox mNoFloat;
CheckBox mGenStackFrame;
CheckBox mStackStomp;
CheckBox mAllInst;
}
class DmdMessagesPropertyPage : ProjectPropertyPage
{
override string GetCategoryName() { return "Compiler"; }
override string GetPageName() { return "Messages"; }
override void CreateControls()
{
mUnindentCheckBox = kLabelWidth;
AddControl("", mWarnings = new CheckBox(mCanvas, "Enable Warnings"));
AddControl("", mInfoWarnings = new CheckBox(mCanvas, "Enable Informational Warnings (DMD 2.041+)"));
AddHorizontalLine();
AddControl("", mUseDeprecated = new CheckBox(mCanvas, "Silently Allow Deprecated Features"));
AddControl("", mErrDeprecated = new CheckBox(mCanvas, "Use of Deprecated Features causes Error (DMD 2.061+)"));
AddHorizontalLine();
AddControl("", mVerbose = new CheckBox(mCanvas, "Verbose Compile"));
AddControl("", mVtls = new CheckBox(mCanvas, "Show TLS Variables"));
AddControl("", mVgc = new CheckBox(mCanvas, "List all gc allocations including hidden ones (DMD 2.066+)"));
AddControl("", mIgnorePragmas = new CheckBox(mCanvas, "Ignore Unsupported Pragmas"));
AddControl("", mCheckProperty = new CheckBox(mCanvas, "Enforce Property Syntax (DMD 2.055+)"));
}
override void SetControls(ProjectOptions options)
{
mWarnings.setChecked(options.warnings);
mInfoWarnings.setChecked(options.infowarnings);
mVerbose.setChecked(options.verbose);
mVtls.setChecked(options.vtls);
mVgc.setChecked(options.vgc);
mUseDeprecated.setChecked(options.useDeprecated);
mErrDeprecated.setChecked(options.errDeprecated);
mIgnorePragmas.setChecked(options.ignoreUnsupportedPragmas);
mCheckProperty.setChecked(options.checkProperty);
mVtls.setEnabled(options.Dversion > 1);
mVgc.setEnabled(options.Dversion > 1);
}
override int DoApply(ProjectOptions options, ProjectOptions refoptions)
{
int changes = 0;
changes += changeOption(mWarnings.isChecked(), options.warnings, refoptions.warnings);
changes += changeOption(mInfoWarnings.isChecked(), options.infowarnings, refoptions.infowarnings);
changes += changeOption(mVerbose.isChecked(), options.verbose, refoptions.verbose);
changes += changeOption(mVtls.isChecked(), options.vtls, refoptions.vtls);
changes += changeOption(mVgc.isChecked(), options.vgc, refoptions.vgc);
changes += changeOption(mUseDeprecated.isChecked(), options.useDeprecated, refoptions.useDeprecated);
changes += changeOption(mErrDeprecated.isChecked(), options.errDeprecated, refoptions.errDeprecated);
changes += changeOption(mIgnorePragmas.isChecked(), options.ignoreUnsupportedPragmas, refoptions.ignoreUnsupportedPragmas);
changes += changeOption(mCheckProperty.isChecked(), options.checkProperty, refoptions.checkProperty);
return changes;
}
CheckBox mWarnings;
CheckBox mInfoWarnings;
CheckBox mVerbose;
CheckBox mVtls;
CheckBox mVgc;
CheckBox mUseDeprecated;
CheckBox mErrDeprecated;
CheckBox mIgnorePragmas;
CheckBox mCheckProperty;
}
class DmdDocPropertyPage : ProjectPropertyPage
{
override string GetCategoryName() { return "Compiler"; }
override string GetPageName() { return "Documentation"; }
override void CreateControls()
{
AddControl("", mGenDoc = new CheckBox(mCanvas, "Generate documentation"));
AddControl("Documentation file", mDocFile = new Text(mCanvas));
AddControl("Documentation dir", mDocDir = new Text(mCanvas));
AddControl("CanDyDOC module", mModulesDDoc = new Text(mCanvas));
AddControl("", mGenHdr = new CheckBox(mCanvas, "Generate interface headers"));
AddControl("Header file", mHdrFile = new Text(mCanvas));
AddControl("Header directory", mHdrDir = new Text(mCanvas));
AddControl("", mGenJSON = new CheckBox(mCanvas, "Generate JSON file"));
AddControl("JSON file", mJSONFile = new Text(mCanvas));
}
override void UpdateDirty(bool bDirty)
{
super.UpdateDirty(bDirty);
EnableControls();
}
void EnableControls()
{
mDocDir.setEnabled(mGenDoc.isChecked());
mDocFile.setEnabled(mGenDoc.isChecked());
mModulesDDoc.setEnabled(mGenDoc.isChecked());
mHdrDir.setEnabled(mGenHdr.isChecked());
mHdrFile.setEnabled(mGenHdr.isChecked());
mJSONFile.setEnabled(mGenJSON.isChecked());
}
override void SetControls(ProjectOptions options)
{
mGenDoc.setChecked(options.doDocComments);
mDocDir.setText(options.docdir);
mDocFile.setText(options.docname);
mModulesDDoc.setText(options.modules_ddoc);
mGenHdr.setChecked(options.doHdrGeneration);
mHdrDir.setText(options.hdrdir);
mHdrFile.setText(options.hdrname);
mGenJSON.setChecked(options.doXGeneration);
mJSONFile.setText(options.xfilename);
EnableControls();
}
override int DoApply(ProjectOptions options, ProjectOptions refoptions)
{
int changes = 0;
changes += changeOption(mGenDoc.isChecked(), options.doDocComments, refoptions.doDocComments);
changes += changeOption(mDocDir.getText(), options.docdir, refoptions.docdir);
changes += changeOption(mDocFile.getText(), options.docname, refoptions.docname);
changes += changeOption(mModulesDDoc.getText(), options.modules_ddoc, refoptions.modules_ddoc);
changes += changeOption(mGenHdr.isChecked(), options.doHdrGeneration, refoptions.doHdrGeneration);
changes += changeOption(mHdrDir.getText(), options.hdrdir, refoptions.hdrdir);
changes += changeOption(mHdrFile.getText(), options.hdrname, refoptions.hdrname);
changes += changeOption(mGenJSON.isChecked(), options.doXGeneration, refoptions.doXGeneration);
changes += changeOption(mJSONFile.getText(), options.xfilename, refoptions.xfilename);
return changes;
}
CheckBox mGenDoc;
Text mDocDir;
Text mDocFile;
Text mModulesDDoc;
CheckBox mGenHdr;
Text mHdrDir;
Text mHdrFile;
CheckBox mGenJSON;
Text mJSONFile;
}
class DmdOutputPropertyPage : ProjectPropertyPage
{
override string GetCategoryName() { return "Compiler"; }
override string GetPageName() { return "Output"; }
override void CreateControls()
{
mUnindentCheckBox = kLabelWidth;
AddControl("", mMultiObj = new CheckBox(mCanvas, "Multiple Object Files"));
AddControl("", mPreservePaths = new CheckBox(mCanvas, "Keep Path From Source File"));
AddControl("", mMsCoff32 = new CheckBox(mCanvas, "Use MS-COFF object file format for Win32 (DMD 2.067+)"));
}
override void SetControls(ProjectOptions options)
{
mMultiObj.setChecked(options.multiobj);
mPreservePaths.setChecked(options.preservePaths);
mMsCoff32.setChecked(options.mscoff);
}
override int DoApply(ProjectOptions options, ProjectOptions refoptions)
{
int changes = 0;
changes += changeOption(mMultiObj.isChecked(), options.multiobj, refoptions.multiobj);
changes += changeOption(mPreservePaths.isChecked(), options.preservePaths, refoptions.preservePaths);
changes += changeOption(mMsCoff32.isChecked(), options.mscoff, refoptions.mscoff);
return changes;
}
CheckBox mMultiObj;
CheckBox mPreservePaths;
CheckBox mMsCoff32;
}
class DmdLinkerPropertyPage : ProjectPropertyPage
{
override string GetCategoryName() { return "Linker"; }
override string GetPageName() { return "General"; }
override void UpdateDirty(bool bDirty)
{
super.UpdateDirty(bDirty);
EnableControls();
}
override void CreateControls()
{
AddControl("Output File", mExeFile = new Text(mCanvas));
AddControl("Object Files", mObjFiles = new Text(mCanvas));
AddControl("Library Files", mLibFiles = new Text(mCanvas));
AddControl("Library Search Path", mLibPaths = new Text(mCanvas));
//AddControl("Library search paths only work if you have modified sc.ini to include DMD_LIB!", null);
AddControl("Definition File", mDefFile = new Text(mCanvas));
AddControl("Resource File", mResFile = new Text(mCanvas));
AddControl("Generate Map File", mGenMap = new ComboBox(mCanvas,
[ "Minimum", "Symbols By Address", "Standard", "Full", "With cross references" ], false));
AddControl("", mImplib = new CheckBox(mCanvas, "Create import library"));
AddControl("", mUseStdLibPath = new CheckBox(mCanvas, "Use global and standard library search paths"));
AddControl("C Runtime", mCRuntime = new ComboBox(mCanvas, [ "None", "Static Release (LIBCMT)", "Static Debug (LIBCMTD)", "Dynamic Release (MSCVRT)", "Dynamic Debug (MSCVRTD)" ], false));
}
void EnableControls()
{
if(ProjectOptions options = GetProjectOptions())
mCRuntime.setEnabled(options.isX86_64);
}
override void SetControls(ProjectOptions options)
{
mExeFile.setText(options.exefile);
mObjFiles.setText(options.objfiles);
mLibFiles.setText(options.libfiles);
mLibPaths.setText(options.libpaths);
mDefFile.setText(options.deffile);
mResFile.setText(options.resfile);
mGenMap.setSelection(options.mapverbosity);
mImplib.setChecked(options.createImplib);
mUseStdLibPath.setChecked(options.useStdLibPath);
mCRuntime.setSelection(options.cRuntime);
EnableControls();
}
override int DoApply(ProjectOptions options, ProjectOptions refoptions)
{
int changes = 0;
changes += changeOption(mExeFile.getText(), options.exefile, refoptions.exefile);
changes += changeOption(mObjFiles.getText(), options.objfiles, refoptions.objfiles);
changes += changeOption(mLibFiles.getText(), options.libfiles, refoptions.libfiles);
changes += changeOption(mLibPaths.getText(), options.libpaths, refoptions.libpaths);
changes += changeOption(mDefFile.getText(), options.deffile, refoptions.deffile);
changes += changeOption(mResFile.getText(), options.resfile, refoptions.resfile);
changes += changeOption(cast(uint) mGenMap.getSelection(), options.mapverbosity, refoptions.mapverbosity);
changes += changeOption(mImplib.isChecked(), options.createImplib, refoptions.createImplib);
changes += changeOption(mUseStdLibPath.isChecked(), options.useStdLibPath, refoptions.useStdLibPath);
changes += changeOption(cast(uint) mCRuntime.getSelection(), options.cRuntime, refoptions.cRuntime);
return changes;
}
Text mExeFile;
Text mObjFiles;
Text mLibFiles;
Text mLibPaths;
Text mDefFile;
Text mResFile;
ComboBox mGenMap;
CheckBox mImplib;
CheckBox mUseStdLibPath;
ComboBox mCRuntime;
}
class DmdEventsPropertyPage : ProjectPropertyPage
{
override string GetCategoryName() { return ""; }
override string GetPageName() { return "Build Events"; }
override void CreateControls()
{
AddControl("Pre-Build Command", mPreCmd = new MultiLineText(mCanvas));
AddControl("Post-Build Command", mPostCmd = new MultiLineText(mCanvas));
Label lab = new Label(mCanvas, "Use \"if errorlevel 1 goto reportError\" to cancel on error");
lab.setRect(0, kPageHeight - kLineHeight, kPageWidth, kLineHeight);
}
override void SetControls(ProjectOptions options)
{
mPreCmd.setText(options.preBuildCommand);
mPostCmd.setText(options.postBuildCommand);
}
override int DoApply(ProjectOptions options, ProjectOptions refoptions)
{
int changes = 0;
changes += changeOption(mPreCmd.getText(), options.preBuildCommand, refoptions.preBuildCommand);
changes += changeOption(mPostCmd.getText(), options.postBuildCommand, refoptions.postBuildCommand);
return changes;
}
MultiLineText mPreCmd;
MultiLineText mPostCmd;
}
class DmdCmdLinePropertyPage : ProjectPropertyPage
{
override string GetCategoryName() { return ""; }
override string GetPageName() { return "Command line"; }
override void CreateControls()
{
AddControl("Command line", mCmdLine = new MultiLineText(mCanvas, "", 0, true));
AddControl("Additional options", mAddOpt = new MultiLineText(mCanvas));
}
override void OnConfigModified()
{
if(ProjectOptions options = GetProjectOptions())
if(mCmdLine && mCmdLine.hwnd)
mCmdLine.setText(options.buildCommandLine(true, true, true));
}
override void SetControls(ProjectOptions options)
{
mCmdLine.setText(options.buildCommandLine(true, true, true));
mAddOpt.setText(options.additionalOptions);
}
override int DoApply(ProjectOptions options, ProjectOptions refoptions)
{
int changes = 0;
changes += changeOption(mAddOpt.getText(), options.additionalOptions, refoptions.additionalOptions);
return changes;
}
MultiLineText mCmdLine;
MultiLineText mAddOpt;
}
class ConfigNodePropertyPage : ProjectPropertyPage
{
abstract void SetControls(CFileNode node);
abstract int DoApply(CFileNode node, CFileNode refnode, Config cfg);
override void SetControls(ProjectOptions options)
{
mNodes = GetSelectedNodes();
if(auto node = GetNode())
SetControls(node);
}
override int DoApply(ProjectOptions options, ProjectOptions refoptions)
{
return 0;
}
CHierNode[] GetSelectedNodes()
{
if(auto cfg = GetConfig()) // any config works
{
auto prj = cfg.GetProject();
CHierNode[] nodes;
prj.GetSelectedNodes(nodes);
return nodes;
}
return null;
}
CFileNode GetNode()
{
for(size_t i = 0; i < mNodes.length; i++)
if(auto node = cast(CFileNode)mNodes[i])
return node;
return null;
}
override int IsPageDirty()
{
mixin(LogCallMix);
if(mWindow)
if(CFileNode node = GetNode())
{
Config cfg = GetConfig();
scope CFileNode n = newCom!CFileNode("");
return DoApply(n, node, cfg) > 0 ? S_OK : S_FALSE;
}
return S_FALSE;
}
override int Apply()
{
mixin(LogCallMix);
if(CFileNode rnode = GetNode())
{
auto refnode = rnode.cloneDeep();
for(int i = 0; i < mObjects.length; i++)
{
auto config = ComPtr!(Config)(mObjects[i]);
if(config)
{
for(size_t n = 0; n < mNodes.length; n++)
if(auto node = cast(CFileNode)mNodes[n])
{
DoApply(node, refnode, config);
if(CProjectNode pn = cast(CProjectNode) node.GetRootNode())
pn.SetProjectFileDirty(true);
}
}
return S_OK;
}
}
return returnError(E_FAIL);
}
CHierNode[] mNodes;
}
class FilePropertyPage : ConfigNodePropertyPage
{
override string GetCategoryName() { return ""; }
override string GetPageName() { return "File"; }
override void CreateControls()
{
mLinesPerMultiLine = 3;
AddControl("", mPerConfig = new CheckBox(mCanvas, "per Configuration Options (apply and reopen dialog to update)"));
AddControl("Build Tool", mTool = new ComboBox(mCanvas, [ "Auto", "DMD", kToolCpp, kToolResourceCompiler, "Custom", "None" ], false));
AddControl("Additional Options", mAddOpt = new Text(mCanvas));
AddControl("Build Command", mCustomCmd = new MultiLineText(mCanvas));
AddControl("Other Dependencies", mDependencies = new Text(mCanvas));
AddControl("Output File", mOutFile = new Text(mCanvas));
AddControl("", mLinkOut = new CheckBox(mCanvas, "Add output to link"));
AddControl("", mUptodateWithSameTime = new CheckBox(mCanvas, "Assume output up to date with same time as input"));
}
override void UpdateDirty(bool bDirty)
{
super.UpdateDirty(bDirty);
enableControls(mTool.getText());
}
void enableControls(string tool)
{
bool perConfigChanged = mInitPerConfig != mPerConfig.isChecked();
bool isCustom = (tool == "Custom");
bool isRc = (tool == kToolResourceCompiler);
bool isCpp = (tool == kToolCpp);
mTool.setEnabled(!perConfigChanged);
mCustomCmd.setEnabled(!perConfigChanged && isCustom);
mAddOpt.setEnabled(!perConfigChanged && (isRc || isCpp));
mDependencies.setEnabled(!perConfigChanged && (isCustom || isRc));
mOutFile.setEnabled(!perConfigChanged && isCustom);
mLinkOut.setEnabled(!perConfigChanged && isCustom);
mUptodateWithSameTime.setEnabled(!perConfigChanged && isCustom);
}
string GetCfgName()
{
return GetConfig().getCfgName();
}
override void SetControls(CFileNode node)
{
string cfgname = GetCfgName();
string tool = node.GetTool(cfgname);
if(tool.length == 0)
mTool.setSelection(0);
else
mTool.setSelection(mTool.findString(tool));
mInitPerConfig = node.GetPerConfigOptions();
mPerConfig.setChecked(mInitPerConfig);
mCustomCmd.setText(node.GetCustomCmd(cfgname));
mAddOpt.setText(node.GetAdditionalOptions(cfgname));
mDependencies.setText(node.GetDependencies(cfgname));
mOutFile.setText(node.GetOutFile(cfgname));
mLinkOut.setChecked(node.GetLinkOutput(cfgname));
mUptodateWithSameTime.setChecked(node.GetUptodateWithSameTime(cfgname));
enableControls(tool);
}
override int DoApply(CFileNode node, CFileNode refnode, Config cfg)
{
string cfgname = GetCfgName();
int changes = 0;
string tool = mTool.getText();
if(tool == "Auto")
tool = "";
changes += changeOptionDg!bool(mPerConfig.isChecked(), &node.SetPerConfigOptions, refnode.GetPerConfigOptions());
changes += changeOptionDg!string(tool, (s) => node.SetTool(cfgname, s), refnode.GetTool(cfgname));
changes += changeOptionDg!string(mCustomCmd.getText(), (s) => node.SetCustomCmd(cfgname, s), refnode.GetCustomCmd(cfgname));
changes += changeOptionDg!string(mAddOpt.getText(), (s) => node.SetAdditionalOptions(cfgname, s), refnode.GetAdditionalOptions(cfgname));
changes += changeOptionDg!string(mDependencies.getText(), (s) => node.SetDependencies(cfgname, s), refnode.GetDependencies(cfgname));
changes += changeOptionDg!string(mOutFile.getText(), (s) => node.SetOutFile(cfgname, s), refnode.GetOutFile(cfgname));
changes += changeOptionDg!bool(mLinkOut.isChecked(), (b) => node.SetLinkOutput(cfgname, b), refnode.GetLinkOutput(cfgname));
changes += changeOptionDg!bool(mUptodateWithSameTime.isChecked(),
(b) => node.SetUptodateWithSameTime(cfgname, b), refnode.GetUptodateWithSameTime(cfgname));
enableControls(tool);
return changes;
}
bool mInitPerConfig;
CheckBox mPerConfig;
ComboBox mTool;
MultiLineText mCustomCmd;
Text mAddOpt;
Text mDependencies;
Text mOutFile;
CheckBox mLinkOut;
CheckBox mUptodateWithSameTime;
}
///////////////////////////////////////////////////////////////////////////////
class DirPropertyPage : GlobalPropertyPage
{
this(GlobalOptions options)
{
super(options);
kNeededLines = 13;
}
void dirCreateControls(string name, string overrideIni)
{
AddControl(name ~ " install path", mDmdPath = new Text(mCanvas));
mLinesPerMultiLine = 2;
AddControl("Import paths", mImpPath = new MultiLineText(mCanvas));
mLinesPerMultiLine = 10;
string[] archs = ["Win32", "x64"];
if(overrideIni)
archs ~= "Win32-COFF";
AddControl("", mTabArch = new TabControl(mCanvas, archs));
auto page32 = mTabArch.pages[0];
if(auto w = cast(Window)page32)
w.commandDelegate = mCanvas.commandDelegate;
mResizableWidgets ~= page32;
kPageWidth -= 6;
mLineY = 0;
mLinesPerMultiLine = 3;
AddControl("Executable paths", mExePath = new MultiLineText(page32));
mLinesPerMultiLine = 2;
AddControl("Library paths", mLibPath = new MultiLineText(page32));
auto page64 = mTabArch.pages[1];
if(auto w = cast(Window)page64)
w.commandDelegate = mCanvas.commandDelegate;
mResizableWidgets ~= page64;
mLineY = 0;
mLinesPerMultiLine = 3;
AddControl("Executable paths", mExePath64 = new MultiLineText(page64));
mLinesPerMultiLine = 2;
AddControl("Library paths", mLibPath64 = new MultiLineText(page64));
if(overrideIni.length)
{
AddControl("", mOverrideIni64 = new CheckBox(page64, overrideIni));
AddControl("Linker", mLinkerExecutable64 = new Text(page64));
AddControl("Additional options", mLinkerOptions64 = new Text(page64));
auto page32coff = mTabArch.pages[2];
if(auto w = cast(Window)page32coff)
w.commandDelegate = mCanvas.commandDelegate;
mResizableWidgets ~= page32coff;
mLineY = 0;
mLinesPerMultiLine = 3;
AddControl("Executable paths", mExePath32coff = new MultiLineText(page32coff));
mLinesPerMultiLine = 2;
AddControl("Library paths", mLibPath32coff = new MultiLineText(page32coff));
AddControl("", mOverrideIni32coff = new CheckBox(page32coff, overrideIni));
AddControl("Linker", mLinkerExecutable32coff = new Text(page32coff));
AddControl("Additional options", mLinkerOptions32coff = new Text(page32coff));
}
}
override void UpdateDirty(bool bDirty)
{
super.UpdateDirty(bDirty);
enableControls();
}
void enableControls()
{
if(mOverrideIni64)
{
mLinkerExecutable64.setEnabled(mOverrideIni64.isChecked());
mLinkerOptions64.setEnabled(mOverrideIni64.isChecked());
}
if(mOverrideIni32coff)
{
mLinkerExecutable32coff.setEnabled(mOverrideIni32coff.isChecked());
mLinkerOptions32coff.setEnabled(mOverrideIni32coff.isChecked());
}
}
abstract CompilerDirectories* getCompilerOptions(GlobalOptions opts);
override void SetControls(GlobalOptions opts)
{
CompilerDirectories* opt = getCompilerOptions(opts);
mDmdPath.setText(opt.InstallDir);
mExePath.setText(opt.ExeSearchPath);
mImpPath.setText(opt.ImpSearchPath);
mLibPath.setText(opt.LibSearchPath);
mExePath64.setText(opt.ExeSearchPath64);
mLibPath64.setText(opt.LibSearchPath64);
if(mOverrideIni64)
{
mOverrideIni64.setChecked(opt.overrideIni64);
mLinkerExecutable64.setText(opt.overrideLinker64);
mLinkerOptions64.setText(opt.overrideOptions64);
}
if(mOverrideIni32coff)
{
mExePath32coff.setText(opt.ExeSearchPath32coff);
mLibPath32coff.setText(opt.LibSearchPath32coff);
mOverrideIni32coff.setChecked(opt.overrideIni32coff);
mLinkerExecutable32coff.setText(opt.overrideLinker32coff);
mLinkerOptions32coff.setText(opt.overrideOptions32coff);
}
enableControls();
}
override int DoApply(GlobalOptions opts, GlobalOptions refopts)
{
CompilerDirectories* opt = getCompilerOptions(opts);
CompilerDirectories* refopt = getCompilerOptions(refopts);
int changes = 0;
changes += changeOption(mDmdPath.getText(), opt.InstallDir, refopt.InstallDir);
changes += changeOption(mExePath.getText(), opt.ExeSearchPath, refopt.ExeSearchPath);
changes += changeOption(mImpPath.getText(), opt.ImpSearchPath, refopt.ImpSearchPath);
changes += changeOption(mLibPath.getText(), opt.LibSearchPath, refopt.LibSearchPath);
changes += changeOption(mExePath64.getText(), opt.ExeSearchPath64, refopt.ExeSearchPath64);
changes += changeOption(mLibPath64.getText(), opt.LibSearchPath64, refopt.LibSearchPath64);
if(mOverrideIni64)
{
changes += changeOption(mOverrideIni64.isChecked(), opt.overrideIni64, refopt.overrideIni64);
changes += changeOption(mLinkerExecutable64.getText(), opt.overrideLinker64, refopt.overrideLinker64);
changes += changeOption(mLinkerOptions64.getText(), opt.overrideOptions64, refopt.overrideOptions64);
}
if(mOverrideIni32coff)
{
changes += changeOption(mExePath32coff.getText(), opt.ExeSearchPath32coff, refopt.ExeSearchPath32coff);
changes += changeOption(mLibPath32coff.getText(), opt.LibSearchPath32coff, refopt.LibSearchPath32coff);
changes += changeOption(mOverrideIni32coff.isChecked(), opt.overrideIni32coff, refopt.overrideIni32coff);
changes += changeOption(mLinkerExecutable32coff.getText(), opt.overrideLinker32coff, refopt.overrideLinker32coff);
changes += changeOption(mLinkerOptions32coff.getText(), opt.overrideOptions32coff, refopt.overrideOptions32coff);
}
return changes;
}
TabControl mTabArch;
Text mDmdPath;
MultiLineText mExePath;
MultiLineText mImpPath;
MultiLineText mLibPath;
MultiLineText mExePath64;
MultiLineText mLibPath64;
CheckBox mOverrideIni64;
Text mLinkerExecutable64;
Text mLinkerOptions64;
MultiLineText mExePath32coff;
MultiLineText mLibPath32coff;
CheckBox mOverrideIni32coff;
Text mLinkerExecutable32coff;
Text mLinkerOptions32coff;
}
///////////////////////////////////////////////////////////////////////////////
class DmdDirPropertyPage : DirPropertyPage
{
override string GetCategoryName() { return "D Options"; }
override string GetPageName() { return "DMD Directories"; }
this(GlobalOptions options)
{
super(options);
}
override void CreateControls()
{
dirCreateControls("DMD", "override linker settings from dmd configuration in sc.ini.");
}
override CompilerDirectories* getCompilerOptions(GlobalOptions opts)
{
return &opts.DMD;
}
}
///////////////////////////////////////////////////////////////////////////////
class GdcDirPropertyPage : DirPropertyPage
{
override string GetCategoryName() { return "D Options"; }
override string GetPageName() { return "GDC Directories"; }
this(GlobalOptions options)
{
super(options);
}
override void CreateControls()
{
dirCreateControls("GDC", "");
}
override CompilerDirectories* getCompilerOptions(GlobalOptions opts)
{
return &opts.GDC;
}
}
///////////////////////////////////////////////////////////////////////////////
class LdcDirPropertyPage : DirPropertyPage
{
override string GetCategoryName() { return "D Options"; }
override string GetPageName() { return "LDC Directories"; }
this(GlobalOptions options)
{
super(options);
}
override void CreateControls()
{
dirCreateControls("LDC", "");
}
override CompilerDirectories* getCompilerOptions(GlobalOptions opts)
{
return &opts.LDC;
}
}
///////////////////////////////////////////////////////////////////////////////
class ToolsProperty2Page : GlobalPropertyPage
{
override string GetCategoryName() { return "Projects"; }
override string GetPageName() { return "D Options"; }
this(GlobalOptions options)
{
super(options);
kNeededLines = 13;
}
override void CreateControls()
{
AddControl("", mSortProjects = new CheckBox(mCanvas, "Sort project items"));
AddControl("", mShowUptodate = new CheckBox(mCanvas, "Show why a target is rebuilt"));
AddControl("", mTimeBuilds = new CheckBox(mCanvas, "Show build time"));
AddControl("", mStopSlnBuild = new CheckBox(mCanvas, "Stop solution build on error"));
AddHorizontalLine();
AddControl("", mDemangleError = new CheckBox(mCanvas, "Demangle names in link errors"));
AddControl("", mOptlinkDeps = new CheckBox(mCanvas, "Monitor linker dependencies"));
AddHorizontalLine();
//AddControl("Remove project item", mDeleteFiles =
// new ComboBox(mCanvas, [ "Do not delete file on disk", "Ask", "Delete file on disk" ]));
mLinesPerMultiLine = 2;
AddControl("JSON paths", mJSNPath = new MultiLineText(mCanvas));
AddControl("Resource includes", mIncPath = new Text(mCanvas));
AddHorizontalLine();
AddControl("Compile+Run options", mCompileAndRunOpts = new Text(mCanvas));
AddControl("Compile+Debug options", mCompileAndDbgOpts = new Text(mCanvas));
AddControl(" Debugger", mCompileAndDbgEngine = new ComboBox(mCanvas, [ "Visual Studio", "Mago", "Visual Studio (x86 Mixed Mode)" ], false));
}
override void SetControls(GlobalOptions opts)
{
mTimeBuilds.setChecked(opts.timeBuilds);
mSortProjects.setChecked(opts.sortProjects);
mShowUptodate.setChecked(opts.showUptodateFailure);
mStopSlnBuild.setChecked(opts.stopSolutionBuild);
mDemangleError.setChecked(opts.demangleError);
mOptlinkDeps.setChecked(opts.optlinkDeps);
//mDeleteFiles.setSelection(opts.deleteFiles + 1);
mIncPath.setText(opts.IncSearchPath);
mJSNPath.setText(opts.JSNSearchPath);
mCompileAndRunOpts.setText(opts.compileAndRunOpts);
mCompileAndDbgOpts.setText(opts.compileAndDbgOpts);
mCompileAndDbgEngine.setSelection(opts.compileAndDbgEngine);
}
override int DoApply(GlobalOptions opts, GlobalOptions refopts)
{
int changes = 0;
changes += changeOption(mTimeBuilds.isChecked(), opts.timeBuilds, refopts.timeBuilds);
changes += changeOption(mSortProjects.isChecked(), opts.sortProjects, refopts.sortProjects);
changes += changeOption(mShowUptodate.isChecked(), opts.showUptodateFailure, refopts.showUptodateFailure);
changes += changeOption(mStopSlnBuild.isChecked(), opts.stopSolutionBuild, refopts.stopSolutionBuild);
changes += changeOption(mDemangleError.isChecked(), opts.demangleError, refopts.demangleError);
changes += changeOption(mOptlinkDeps.isChecked(), opts.optlinkDeps, refopts.optlinkDeps);
//changes += changeOption(cast(byte) (mDeleteFiles.getSelection() - 1), opts.deleteFiles, refopts.deleteFiles);
changes += changeOption(mIncPath.getText(), opts.IncSearchPath, refopts.IncSearchPath);
changes += changeOption(mJSNPath.getText(), opts.JSNSearchPath, refopts.JSNSearchPath);
changes += changeOption(mCompileAndRunOpts.getText(), opts.compileAndRunOpts, refopts.compileAndRunOpts);
changes += changeOption(mCompileAndDbgOpts.getText(), opts.compileAndDbgOpts, refopts.compileAndDbgOpts);
changes += changeOption(mCompileAndDbgEngine.getSelection(), opts.compileAndDbgEngine, refopts.compileAndDbgEngine);
return changes;
}
CheckBox mTimeBuilds;
CheckBox mSortProjects;
CheckBox mShowUptodate;
CheckBox mStopSlnBuild;
CheckBox mDemangleError;
CheckBox mOptlinkDeps;
//ComboBox mDeleteFiles;
Text mIncPath;
Text mCompileAndRunOpts;
Text mCompileAndDbgOpts;
ComboBox mCompileAndDbgEngine;
MultiLineText mJSNPath;
}
///////////////////////////////////////////////////////////////////////////////
class ColorizerPropertyPage : GlobalPropertyPage
{
override string GetCategoryName() { return "Language"; }
override string GetPageName() { return "Colorizer"; }
this(GlobalOptions options)
{
super(options);
kNeededLines = 11;
}
override void CreateControls()
{
AddControl("", mColorizeVersions = new CheckBox(mCanvas, "Colorize version and debug statements"));
AddControl("Colored types", mUserTypes = new MultiLineText(mCanvas));
AddHorizontalLine();
AddControl("", mColorizeCoverage = new CheckBox(mCanvas, "Colorize coverage from .LST file"));
AddControl("", mShowCoverageMargin = new CheckBox(mCanvas, "Show coverage margin"));
AddHorizontalLine();
AddControl("", mAutoOutlining = new CheckBox(mCanvas, "Add outlining regions when opening D files"));
AddControl("", mParseSource = new CheckBox(mCanvas, "Parse source for syntax errors"));
AddControl("", mPasteIndent = new CheckBox(mCanvas, "Reindent new lines after paste"));
}
override void SetControls(GlobalOptions opts)
{
mColorizeVersions.setChecked(opts.ColorizeVersions);
mColorizeCoverage.setChecked(opts.ColorizeCoverage);
mShowCoverageMargin.setChecked(opts.showCoverageMargin);
mAutoOutlining.setChecked(opts.autoOutlining);
mParseSource.setChecked(opts.parseSource);
mPasteIndent.setChecked(opts.pasteIndent);
mUserTypes.setText(opts.UserTypesSpec);
//mSemantics.setEnabled(false);
}
override int DoApply(GlobalOptions opts, GlobalOptions refopts)
{
int changes = 0;
changes += changeOption(mColorizeVersions.isChecked(), opts.ColorizeVersions, refopts.ColorizeVersions);
changes += changeOption(mColorizeCoverage.isChecked(), opts.ColorizeCoverage, refopts.ColorizeCoverage);
changes += changeOption(mShowCoverageMargin.isChecked(), opts.showCoverageMargin, refopts.showCoverageMargin);
changes += changeOption(mAutoOutlining.isChecked(), opts.autoOutlining, refopts.autoOutlining);
changes += changeOption(mParseSource.isChecked(), opts.parseSource, refopts.parseSource);
changes += changeOption(mPasteIndent.isChecked(), opts.pasteIndent, refopts.pasteIndent);
changes += changeOption(mUserTypes.getText(), opts.UserTypesSpec, refopts.UserTypesSpec);
return changes;
}
CheckBox mColorizeVersions;
CheckBox mColorizeCoverage;
CheckBox mShowCoverageMargin;
CheckBox mAutoOutlining;
CheckBox mParseSource;
CheckBox mPasteIndent;
MultiLineText mUserTypes;
}
///////////////////////////////////////////////////////////////////////////////
class IntellisensePropertyPage : GlobalPropertyPage
{
override string GetCategoryName() { return "Language"; }
override string GetPageName() { return "Intellisense"; }
this(GlobalOptions options)
{
super(options);
}
override void CreateControls()
{
AddControl("", mExpandSemantics = new CheckBox(mCanvas, "Expansions from semantic analysis"));
AddControl("", mExpandFromBuffer = new CheckBox(mCanvas, "Expansions from text buffer"));
AddControl("", mExpandFromJSON = new CheckBox(mCanvas, "Expansions from JSON browse information"));
AddControl("Show expansion when", mExpandTrigger = new ComboBox(mCanvas, [ "pressing Ctrl+Space", "writing '.'", "writing an identifier" ], false));
AddControl("", mShowTypeInTooltip = new CheckBox(mCanvas, "Show type of expressions in tool tip"));
AddControl("", mSemanticGotoDef = new CheckBox(mCanvas, "Use semantic analysis for \"Goto Definition\" (before trying JSON info)"));
version(DParser) AddControl("", mUseDParser = new CheckBox(mCanvas, "Use Alexander Bothe's D parsing engine for semantic analysis"));
AddControl("", mMixinAnalysis = new CheckBox(mCanvas, "Enable mixin analysis"));
AddControl("", mUFCSExpansions = new CheckBox(mCanvas, "Enable UFCS expansions"));
}
override void UpdateDirty(bool bDirty)
{
super.UpdateDirty(bDirty);
EnableControls();
}
void EnableControls()
{
version(DParser) bool useDParser = mUseDParser.isChecked();
else bool useDParser = false;
mMixinAnalysis.setEnabled(useDParser);
mUFCSExpansions.setEnabled(useDParser);
}
override void SetControls(GlobalOptions opts)
{
mExpandSemantics.setChecked(opts.expandFromSemantics);
mExpandFromBuffer.setChecked(opts.expandFromBuffer);
mExpandFromJSON.setChecked(opts.expandFromJSON);
mExpandTrigger.setSelection(opts.expandTrigger);
mShowTypeInTooltip.setChecked(opts.showTypeInTooltip);
mSemanticGotoDef.setChecked(opts.semanticGotoDef);
version(DParser) mUseDParser.setChecked(opts.useDParser);
mMixinAnalysis.setChecked(opts.mixinAnalysis);
mUFCSExpansions.setChecked(opts.UFCSExpansions);
//mExpandSemantics.setEnabled(false);
}
override int DoApply(GlobalOptions opts, GlobalOptions refopts)
{
int changes = 0;
changes += changeOption(mExpandSemantics.isChecked(), opts.expandFromSemantics, refopts.expandFromSemantics);
changes += changeOption(mExpandFromBuffer.isChecked(), opts.expandFromBuffer, refopts.expandFromBuffer);
changes += changeOption(mExpandFromJSON.isChecked(), opts.expandFromJSON, refopts.expandFromJSON);
changes += changeOption(cast(byte) mExpandTrigger.getSelection(), opts.expandTrigger, refopts.expandTrigger);
changes += changeOption(mShowTypeInTooltip.isChecked(), opts.showTypeInTooltip, refopts.showTypeInTooltip);
changes += changeOption(mSemanticGotoDef.isChecked(), opts.semanticGotoDef, refopts.semanticGotoDef);
version(DParser) changes += changeOption(mUseDParser.isChecked(), opts.useDParser, refopts.useDParser);
changes += changeOption(mMixinAnalysis.isChecked(), opts.mixinAnalysis, refopts.mixinAnalysis);
changes += changeOption(mUFCSExpansions.isChecked(), opts.UFCSExpansions, refopts.UFCSExpansions);
return changes;
}
CheckBox mExpandSemantics;
CheckBox mExpandFromBuffer;
CheckBox mExpandFromJSON;
ComboBox mExpandTrigger;
CheckBox mShowTypeInTooltip;
CheckBox mSemanticGotoDef;
version(DParser) CheckBox mUseDParser;
CheckBox mUFCSExpansions;
CheckBox mMixinAnalysis;
}
///////////////////////////////////////////////////////////////////////////////
// more guids in dpackage.d starting up to 980f
const GUID g_GeneralPropertyPage = uuid("002a2de9-8bb6-484d-9810-7e4ad4084715");
const GUID g_DmdGeneralPropertyPage = uuid("002a2de9-8bb6-484d-9811-7e4ad4084715");
const GUID g_DmdDebugPropertyPage = uuid("002a2de9-8bb6-484d-9812-7e4ad4084715");
const GUID g_DmdCodeGenPropertyPage = uuid("002a2de9-8bb6-484d-9813-7e4ad4084715");
const GUID g_DmdMessagesPropertyPage = uuid("002a2de9-8bb6-484d-9814-7e4ad4084715");
const GUID g_DmdOutputPropertyPage = uuid("002a2de9-8bb6-484d-9815-7e4ad4084715");
const GUID g_DmdLinkerPropertyPage = uuid("002a2de9-8bb6-484d-9816-7e4ad4084715");
const GUID g_DmdEventsPropertyPage = uuid("002a2de9-8bb6-484d-9817-7e4ad4084715");
const GUID g_CommonPropertyPage = uuid("002a2de9-8bb6-484d-9818-7e4ad4084715");
const GUID g_DebuggingPropertyPage = uuid("002a2de9-8bb6-484d-9819-7e4ad4084715");
const GUID g_FilePropertyPage = uuid("002a2de9-8bb6-484d-981a-7e4ad4084715");
const GUID g_DmdDocPropertyPage = uuid("002a2de9-8bb6-484d-981b-7e4ad4084715");
const GUID g_DmdCmdLinePropertyPage = uuid("002a2de9-8bb6-484d-981c-7e4ad4084715");
// does not need to be registered, created explicitely by package
const GUID g_DmdDirPropertyPage = uuid("002a2de9-8bb6-484d-9820-7e4ad4084715");
const GUID g_GdcDirPropertyPage = uuid("002a2de9-8bb6-484d-9824-7e4ad4084715");
const GUID g_LdcDirPropertyPage = uuid("002a2de9-8bb6-484d-9825-7e4ad4084715");
const GUID g_ToolsProperty2Page = uuid("002a2de9-8bb6-484d-9822-7e4ad4084715");
// registered under Languages\\Language Services\\D\\EditorToolsOptions\\Colorizer, created explicitely by package
const GUID g_ColorizerPropertyPage = uuid("002a2de9-8bb6-484d-9821-7e4ad4084715");
const GUID g_IntellisensePropertyPage = uuid("002a2de9-8bb6-484d-9823-7e4ad4084715");
const GUID*[] guids_propertyPages =
[
&g_GeneralPropertyPage,
&g_DmdGeneralPropertyPage,
&g_DmdDebugPropertyPage,
&g_DmdCodeGenPropertyPage,
&g_DmdMessagesPropertyPage,
&g_DmdOutputPropertyPage,
&g_DmdLinkerPropertyPage,
&g_DmdEventsPropertyPage,
&g_CommonPropertyPage,
&g_DebuggingPropertyPage,
&g_FilePropertyPage,
&g_DmdDocPropertyPage,
&g_DmdCmdLinePropertyPage,
];
class PropertyPageFactory : DComObject, IClassFactory
{
static PropertyPageFactory create(CLSID* rclsid)
{
foreach(id; guids_propertyPages)
if(*id == *rclsid)
return newCom!PropertyPageFactory(rclsid);
return null;
}
this(CLSID* rclsid)
{
mClsid = *rclsid;
}
override HRESULT QueryInterface(in IID* riid, void** pvObject)
{
if(queryInterface2!(IClassFactory) (this, IID_IClassFactory, riid, pvObject))
return S_OK;
return super.QueryInterface(riid, pvObject);
}
override HRESULT CreateInstance(IUnknown UnkOuter, in IID* riid, void** pvObject)
{
PropertyPage ppp;
assert(!UnkOuter);
if(mClsid == g_GeneralPropertyPage)
ppp = newCom!GeneralPropertyPage();
else if(mClsid == g_DebuggingPropertyPage)
ppp = newCom!DebuggingPropertyPage();
else if(mClsid == g_DmdGeneralPropertyPage)
ppp = newCom!DmdGeneralPropertyPage();
else if(mClsid == g_DmdDebugPropertyPage)
ppp = newCom!DmdDebugPropertyPage();
else if(mClsid == g_DmdCodeGenPropertyPage)
ppp = newCom!DmdCodeGenPropertyPage();
else if(mClsid == g_DmdMessagesPropertyPage)
ppp = newCom!DmdMessagesPropertyPage();
else if(mClsid == g_DmdDocPropertyPage)
ppp = newCom!DmdDocPropertyPage();
else if(mClsid == g_DmdOutputPropertyPage)
ppp = newCom!DmdOutputPropertyPage();
else if(mClsid == g_DmdLinkerPropertyPage)
ppp = newCom!DmdLinkerPropertyPage();
else if(mClsid == g_DmdEventsPropertyPage)
ppp = newCom!DmdEventsPropertyPage();
else if(mClsid == g_DmdCmdLinePropertyPage)
ppp = newCom!DmdCmdLinePropertyPage();
else if(mClsid == g_CommonPropertyPage)
ppp = newCom!CommonPropertyPage();
else if(mClsid == g_FilePropertyPage)
ppp = newCom!FilePropertyPage();
else
return E_INVALIDARG;
return ppp.QueryInterface(riid, pvObject);
}
override HRESULT LockServer(in BOOL fLock)
{
return S_OK;
}
static int GetProjectPages(CAUUID *pPages, bool addFile)
{
version(all) {
pPages.cElems = (addFile ? 12 : 11);
pPages.pElems = cast(GUID*)CoTaskMemAlloc(pPages.cElems*GUID.sizeof);
if (!pPages.pElems)
return E_OUTOFMEMORY;
int idx = 0;
if(addFile)
pPages.pElems[idx++] = g_FilePropertyPage;
pPages.pElems[idx++] = g_GeneralPropertyPage;
pPages.pElems[idx++] = g_DebuggingPropertyPage;
pPages.pElems[idx++] = g_DmdGeneralPropertyPage;
pPages.pElems[idx++] = g_DmdDebugPropertyPage;
pPages.pElems[idx++] = g_DmdCodeGenPropertyPage;
pPages.pElems[idx++] = g_DmdMessagesPropertyPage;
pPages.pElems[idx++] = g_DmdDocPropertyPage;
pPages.pElems[idx++] = g_DmdOutputPropertyPage;
pPages.pElems[idx++] = g_DmdLinkerPropertyPage;
pPages.pElems[idx++] = g_DmdCmdLinePropertyPage;
pPages.pElems[idx++] = g_DmdEventsPropertyPage;
return S_OK;
} else {
return returnError(E_NOTIMPL);
}
}
static int GetCommonPages(CAUUID *pPages)
{
pPages.cElems = 1;
pPages.pElems = cast(GUID*)CoTaskMemAlloc(pPages.cElems*GUID.sizeof);
if (!pPages.pElems)
return E_OUTOFMEMORY;
pPages.pElems[0] = g_CommonPropertyPage;
return S_OK;
}
static int GetFilePages(CAUUID *pPages)
{
pPages.cElems = 1;
pPages.pElems = cast(GUID*)CoTaskMemAlloc(pPages.cElems*GUID.sizeof);
if (!pPages.pElems)
return E_OUTOFMEMORY;
pPages.pElems[0] = g_FilePropertyPage;
return S_OK;
}
private:
GUID mClsid;
}
|
D
|
an elaborate party (often outdoors)
|
D
|
/Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIO.build/ByteBuffer-core.swift.o : /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/IO.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/NonBlockingFileIO.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/IOData.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Codec.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Thread.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Embedded.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Selectable.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/FileHandle.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelPipeline.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/AddressedEnvelope.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-core.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/EventLoopFuture.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/PriorityQueue.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Channel.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/DeadChannel.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/SocketChannel.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/BaseSocketChannel.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/MulticastChannel.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/BlockingIOThreadPool.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/System.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/FileRegion.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ContiguousCollection.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Heap.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Bootstrap.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/EventLoop.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/SocketOptionProvider.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/CircularBuffer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/MarkedCircularBuffer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/PendingWritesManager.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/PendingDatagramWritesManager.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelInvoker.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelHandler.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/TypeAssistedChannelHandler.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Resolver.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/GetaddrinfoResolver.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/CompositeError.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/RecvByteBufferAllocator.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Selector.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/FileDescriptor.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Interfaces.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Utilities.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/IntegerTypes.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/SocketAddresses.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/HappyEyeballs.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelHandlers.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-views.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/LinuxCPUSet.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Socket.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/BaseSocket.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ServerSocket.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-int.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-aux.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Linux.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/NIOAny.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes
/Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIO.build/ByteBuffer-core~partial.swiftmodule : /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/IO.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/NonBlockingFileIO.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/IOData.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Codec.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Thread.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Embedded.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Selectable.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/FileHandle.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelPipeline.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/AddressedEnvelope.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-core.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/EventLoopFuture.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/PriorityQueue.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Channel.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/DeadChannel.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/SocketChannel.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/BaseSocketChannel.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/MulticastChannel.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/BlockingIOThreadPool.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/System.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/FileRegion.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ContiguousCollection.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Heap.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Bootstrap.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/EventLoop.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/SocketOptionProvider.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/CircularBuffer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/MarkedCircularBuffer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/PendingWritesManager.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/PendingDatagramWritesManager.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelInvoker.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelHandler.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/TypeAssistedChannelHandler.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Resolver.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/GetaddrinfoResolver.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/CompositeError.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/RecvByteBufferAllocator.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Selector.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/FileDescriptor.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Interfaces.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Utilities.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/IntegerTypes.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/SocketAddresses.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/HappyEyeballs.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelHandlers.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-views.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/LinuxCPUSet.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Socket.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/BaseSocket.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ServerSocket.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-int.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-aux.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Linux.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/NIOAny.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes
/Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIO.build/ByteBuffer-core~partial.swiftdoc : /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/IO.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/NonBlockingFileIO.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/IOData.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Codec.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Thread.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Embedded.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Selectable.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/FileHandle.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelPipeline.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/AddressedEnvelope.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-core.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/EventLoopFuture.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/PriorityQueue.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Channel.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/DeadChannel.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/SocketChannel.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/BaseSocketChannel.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/MulticastChannel.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/BlockingIOThreadPool.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/System.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/FileRegion.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ContiguousCollection.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Heap.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Bootstrap.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/EventLoop.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/SocketOptionProvider.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/CircularBuffer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/MarkedCircularBuffer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/PendingWritesManager.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/PendingDatagramWritesManager.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelInvoker.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelHandler.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/TypeAssistedChannelHandler.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Resolver.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/GetaddrinfoResolver.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/CompositeError.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/RecvByteBufferAllocator.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Selector.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/FileDescriptor.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Interfaces.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Utilities.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/IntegerTypes.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/SocketAddresses.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/HappyEyeballs.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelHandlers.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-views.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/LinuxCPUSet.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Socket.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/BaseSocket.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ServerSocket.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-int.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-aux.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Linux.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/NIOAny.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes
|
D
|
module pgsql.protocol;
//https://www.postgresql.org/docs/10/static/protocol-message-formats.html
enum OutputMessageType : ubyte {
Bind = 'B',
Close = 'C',
CopyData = 'd',
CopyDone = 'c',
CopyFail = 'f',
Describe = 'D',
Execute = 'E',
Flush = 'H',
FunctionCall = 'F',
Parse = 'P',
PasswordMessage = 'p',
Query = 'Q',
Sync = 'S',
Terminate = 'T'
}
enum InputMessageType : ubyte {
Authentication = 'R',
BackendKeyData = 'K',
BindComplete = '2',
CloseComplete = '3',
CommandComplete = 'C',
CopyData = 'd',
CopyDone = 'c',
CopyInResponse = 'G',
CopyOutResponse = 'H',
CopyBothResponse = 'W',
DataRow = 'D',
EmptyQueryResponse = 'I',
ErrorResponse = 'E',
FunctionCallResponse= 'V',
NoData = 'n',
NoticeResponse = 'N',
NotificationResponse= 'A',
ParameterDescription= 't',
ParameterStatus = 'S',
ParseComplete = '1',
PortalSuspended = 's',
ReadyForQuery = 'Z',
RowDescription = 'T'
}
enum TransactionStatus : ubyte {
Idle = 'I',
Inside = 'T',
Error = 'E',
}
enum FormatCode : ubyte {
Text = 0,
Binary = 1,
}
enum NoticeMessageField : ubyte {
SeverityLocal = 'S',
Severity = 'V',
Code = 'C',
Message = 'M',
Detail = 'D',
Hint = 'H',
Position = 'P',
InternalPosition = 'p',
InternalQuery = 'q',
Where = 'W',
Schema = 's',
Table = 't',
Column = 'c',
DataType = 'd',
Constraint = 'n',
File = 'F',
Line = 'L',
Routine = 'R',
}
// https://github.com/postgres/postgres/blob/master/src/include/catalog/pg_type.dat
enum PgColumnTypes : uint {
NULL = 0,
BOOL = 16,
BYTEA = 17,
CHAR = 18,
NAME = 19,
INT8 = 20,
INT2 = 21,
// INTVEC2 = 22,
INT4 = 23,
//REGPROC = 24,
TEXT = 25,
// OID = 26,
// TID = 27,
// XID = 28,
// CID = 29,
// OIDARRAY = 30,
// PG_TYPE = 71,
// PG_ATTRIBUTE= 75,
// PG_PROC = 81,
// PG_CLASS = 83,
JSON = 114,
XML = 142,
POINT = 600,
LSEG = 601,
PATH = 602,
BOX = 603,
POLYGON = 604,
LINE = 628,
REAL = 700,
DOUBLE = 701,
// ABSTIME = 702,
// RELTIME = 703,
TINTERVAL = 704,
UNKNOWN = 705,
CIRCLE = 718,
MONEY = 790,
MACADDR = 829,
INET = 869,
CIDR = 650,
MACADDR8 = 774,
CHARA = 1042,
VARCHAR = 1043,
DATE = 1082,
TIME = 1083,
TIMESTAMP = 1114,
TIMESTAMPTZ = 1184,
INTERVAL = 1186,
TIMETZ = 1266,
BIT = 1560,
VARBIT = 1562,
NUMERIC = 1700,
// REFCURSOR = 1790,
// REGPROCEDURE= 2202,
// REGOPER = 2203,
// REGOPERATOR = 2204,
// REGCLASS = 2205,
// REGTYPE = 2206,
// REGROLE = 4096,
// REGNAMESPACE= 4089,
UUID = 2950,
JSONB = 3802
}
auto columnTypeName(PgColumnTypes type) {
final switch (type) with (PgColumnTypes) {
case NULL: return "null";
case BOOL: return "bool";
case BYTEA: return "bytea";
case CHAR: return "char";
case NAME: return "name";
case INT8: return "int8";
case INT2: return "int2";
case INT4: return "int4";
case TEXT: return "text";
case JSON: return "json";
case XML: return "xml";
case POINT: return "point";
case LSEG: return "lseg";
case PATH: return "path";
case BOX: return "box";
case POLYGON: return "polygon";
case LINE: return "line";
case REAL: return "real";
case DOUBLE: return "double precision";
case TINTERVAL: return "tinterval";
case UNKNOWN: return "unknown";
case CIRCLE: return "circle";
case MONEY: return "money";
case MACADDR: return "macaddr";
case INET: return "inet";
case CIDR: return "cidr";
case MACADDR8: return "macaddr8";
case CHARA: return "char(n)";
case VARCHAR: return "varchar";
case DATE: return "date";
case TIME: return "time";
case TIMESTAMP: return "timestamp";
case TIMESTAMPTZ: return "timestamptz";
case INTERVAL: return "interval";
case TIMETZ: return "timetz";
case BIT: return "bit";
case VARBIT: return "varbit";
case NUMERIC: return "numeric";
case UUID: return "uuid";
case JSONB: return "jsonb";
}
}
|
D
|
// Generated by gnome-h2d.rb <http://github.com/ddude/gnome.d>.
module gio.converteroutputstream;
/* GIO - GLib Input, Output and Streaming Library
*
* Copyright (C) 2009 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*
* Author: Alexander Larsson <alexl@redhat.com>
*/
/+
#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
#error "Only <gio/gio.h> can be included directly."
//#endif
+/
public import gio.filteroutputstream;
public import gio.converter;
extern(C):
//#define G_TYPE_CONVERTER_OUTPUT_STREAM (g_converter_output_stream_get_type ())
//#define G_CONVERTER_OUTPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_CONVERTER_OUTPUT_STREAM, GConverterOutputStream))
//#define G_CONVERTER_OUTPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_CONVERTER_OUTPUT_STREAM, GConverterOutputStreamClass))
//#define G_IS_CONVERTER_OUTPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_CONVERTER_OUTPUT_STREAM))
//#define G_IS_CONVERTER_OUTPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_CONVERTER_OUTPUT_STREAM))
//#define G_CONVERTER_OUTPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_CONVERTER_OUTPUT_STREAM, GConverterOutputStreamClass))
/**
* GConverterOutputStream:
*
* An implementation of #GFilterOutputStream that allows data
* conversion.
**/
//struct _GConverterOutputStreamClass GConverterOutputStreamClass;
struct _GConverterOutputStreamPrivate;
alias _GConverterOutputStreamPrivate* GConverterOutputStreamPrivate;
struct GConverterOutputStream {
GFilterOutputStream parent_instance;
/*< private >*/
GConverterOutputStreamPrivate *priv;
};
struct GConverterOutputStreamClass {
GFilterOutputStreamClass parent_class;
/*< private >*/
/* Padding for future expansion */
void function() _g_reserved1;
void function() _g_reserved2;
void function() _g_reserved3;
void function() _g_reserved4;
void function() _g_reserved5;
};
GType g_converter_output_stream_get_type () pure;
GOutputStream *g_converter_output_stream_new (GOutputStream *base_stream,
GConverter *converter);
GConverter *g_converter_output_stream_get_converter (GConverterOutputStream *converter_stream);
|
D
|
module hunt.framework.auth.guard.BasicGuard;
import hunt.framework.auth.guard.Guard;
import hunt.framework.auth.AuthOptions;
import hunt.framework.auth.BasicAuthRealm;
import hunt.framework.auth.JwtAuthRealm;
import hunt.framework.auth.SimpleUserService;
import hunt.framework.auth.UserService;
import hunt.framework.http.Request;
import hunt.http.AuthenticationScheme;
import hunt.shiro;
import hunt.logging;
import std.algorithm;
import std.base64;
import std.range;
import std.string;
class BasicGuard : Guard {
this() {
this(new SimpleUserService(), DEFAULT_GURAD_NAME);
}
this(UserService userService, string name) {
super(userService, name);
initialize();
}
override AuthenticationToken getToken(Request request) {
string tokenString = request.basicToken();
if (tokenString.empty)
tokenString = request.cookie(tokenCookieName);
if(tokenString.empty) {
return null;
}
ubyte[] decoded = Base64.decode(tokenString);
string[] values = split(cast(string)decoded, ":");
if(values.length != 2) {
warningf("Wrong token: %s", values);
return null;
}
string username = values[0];
string password = values[1];
return new UsernamePasswordToken(username, password);
}
protected void initialize() {
tokenCookieName = BASIC_COOKIE_NAME;
authScheme = AuthenticationScheme.Basic;
addRealms(new BasicAuthRealm(userService()));
// addRealms(new JwtAuthRealm(userService()));
}
}
|
D
|
/Users/markmoussa/HackathonProjects/Rhabit/DerivedData/Rhabit/Build/Intermediates/Pods.build/Debug-iphonesimulator/Charts.build/Objects-normal/x86_64/BubbleChartView.o : /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/BarChartData.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/BarChartDataEntry.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Interfaces/BarChartDataProvider.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/BarChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Highlight/BarChartHighlighter.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/BarChartRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/BarChartView.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/BarLineChartViewBase.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/BarLineScatterCandleBubbleChartData.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Interfaces/BarLineScatterCandleBubbleChartDataProvider.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/BarLineScatterCandleBubbleChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/BubbleChartData.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/BubbleChartDataEntry.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Interfaces/BubbleChartDataProvider.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/BubbleChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/BubbleChartRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/BubbleChartView.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/CandleChartData.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/CandleChartDataEntry.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Interfaces/CandleChartDataProvider.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/CandleChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/CandleStickChartRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/CandleStickChartView.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Animation/ChartAnimationEasing.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Animation/ChartAnimator.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Components/ChartAxisBase.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ChartAxisRendererBase.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/ChartBaseDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Utils/ChartColorTemplates.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Components/ChartComponentBase.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/ChartData.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Filters/ChartDataApproximatorFilter.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Filters/ChartDataBaseFilter.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/ChartDataEntry.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Interfaces/ChartDataProvider.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ChartDataRendererBase.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/ChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Formatters/ChartDefaultXAxisValueFormatter.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Utils/ChartFill.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Formatters/ChartFillFormatter.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Highlight/ChartHighlight.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Highlight/ChartHighlighter.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Components/ChartLegend.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ChartLegendRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Components/ChartLimitLine.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Components/ChartMarker.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Highlight/ChartRange.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ChartRendererBase.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Utils/ChartSelectionDetail.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Utils/ChartTransformer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Utils/ChartTransformerHorizontalBarChart.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Utils/ChartUtils.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/ChartViewBase.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Utils/ChartViewPortHandler.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Components/ChartXAxis.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ChartXAxisRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ChartXAxisRendererBarChart.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ChartXAxisRendererHorizontalBarChart.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ChartXAxisRendererRadarChart.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Formatters/ChartXAxisValueFormatter.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Components/ChartYAxis.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ChartYAxisRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ChartYAxisRendererHorizontalBarChart.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ChartYAxisRendererRadarChart.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/CombinedChartData.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/CombinedChartRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/CombinedChartView.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Highlight/CombinedHighlighter.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Highlight/HorizontalBarChartHighlighter.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/HorizontalBarChartRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/HorizontalBarChartView.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Interfaces/IBarChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Interfaces/IBarLineScatterCandleBubbleChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Interfaces/IBubbleChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Interfaces/ICandleChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Interfaces/IChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Interfaces/ILineChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Interfaces/ILineRadarChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Interfaces/ILineScatterCandleRadarChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Interfaces/IPieChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Interfaces/IRadarChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Interfaces/IScatterChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/LineChartData.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Interfaces/LineChartDataProvider.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/LineChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/LineChartRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/LineChartView.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/LineRadarChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/LineRadarChartRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/LineScatterCandleRadarChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/LineScatterCandleRadarChartRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/PieChartData.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/PieChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/PieChartRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/PieChartView.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/PieRadarChartViewBase.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/RadarChartData.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/RadarChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/RadarChartRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/RadarChartView.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/ScatterChartData.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Interfaces/ScatterChartDataProvider.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/ScatterChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ScatterChartRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/ScatterChartView.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/markmoussa/HackathonProjects/Rhabit/Pods/Target\ Support\ Files/Charts/Charts-umbrella.h /Users/markmoussa/HackathonProjects/Rhabit/DerivedData/Rhabit/Build/Intermediates/Pods.build/Debug-iphonesimulator/Charts.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule
/Users/markmoussa/HackathonProjects/Rhabit/DerivedData/Rhabit/Build/Intermediates/Pods.build/Debug-iphonesimulator/Charts.build/Objects-normal/x86_64/BubbleChartView~partial.swiftmodule : /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/BarChartData.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/BarChartDataEntry.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Interfaces/BarChartDataProvider.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/BarChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Highlight/BarChartHighlighter.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/BarChartRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/BarChartView.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/BarLineChartViewBase.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/BarLineScatterCandleBubbleChartData.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Interfaces/BarLineScatterCandleBubbleChartDataProvider.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/BarLineScatterCandleBubbleChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/BubbleChartData.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/BubbleChartDataEntry.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Interfaces/BubbleChartDataProvider.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/BubbleChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/BubbleChartRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/BubbleChartView.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/CandleChartData.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/CandleChartDataEntry.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Interfaces/CandleChartDataProvider.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/CandleChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/CandleStickChartRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/CandleStickChartView.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Animation/ChartAnimationEasing.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Animation/ChartAnimator.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Components/ChartAxisBase.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ChartAxisRendererBase.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/ChartBaseDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Utils/ChartColorTemplates.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Components/ChartComponentBase.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/ChartData.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Filters/ChartDataApproximatorFilter.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Filters/ChartDataBaseFilter.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/ChartDataEntry.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Interfaces/ChartDataProvider.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ChartDataRendererBase.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/ChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Formatters/ChartDefaultXAxisValueFormatter.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Utils/ChartFill.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Formatters/ChartFillFormatter.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Highlight/ChartHighlight.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Highlight/ChartHighlighter.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Components/ChartLegend.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ChartLegendRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Components/ChartLimitLine.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Components/ChartMarker.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Highlight/ChartRange.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ChartRendererBase.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Utils/ChartSelectionDetail.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Utils/ChartTransformer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Utils/ChartTransformerHorizontalBarChart.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Utils/ChartUtils.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/ChartViewBase.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Utils/ChartViewPortHandler.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Components/ChartXAxis.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ChartXAxisRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ChartXAxisRendererBarChart.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ChartXAxisRendererHorizontalBarChart.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ChartXAxisRendererRadarChart.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Formatters/ChartXAxisValueFormatter.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Components/ChartYAxis.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ChartYAxisRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ChartYAxisRendererHorizontalBarChart.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ChartYAxisRendererRadarChart.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/CombinedChartData.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/CombinedChartRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/CombinedChartView.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Highlight/CombinedHighlighter.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Highlight/HorizontalBarChartHighlighter.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/HorizontalBarChartRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/HorizontalBarChartView.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Interfaces/IBarChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Interfaces/IBarLineScatterCandleBubbleChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Interfaces/IBubbleChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Interfaces/ICandleChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Interfaces/IChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Interfaces/ILineChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Interfaces/ILineRadarChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Interfaces/ILineScatterCandleRadarChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Interfaces/IPieChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Interfaces/IRadarChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Interfaces/IScatterChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/LineChartData.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Interfaces/LineChartDataProvider.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/LineChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/LineChartRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/LineChartView.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/LineRadarChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/LineRadarChartRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/LineScatterCandleRadarChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/LineScatterCandleRadarChartRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/PieChartData.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/PieChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/PieChartRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/PieChartView.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/PieRadarChartViewBase.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/RadarChartData.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/RadarChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/RadarChartRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/RadarChartView.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/ScatterChartData.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Interfaces/ScatterChartDataProvider.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/ScatterChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ScatterChartRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/ScatterChartView.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/markmoussa/HackathonProjects/Rhabit/Pods/Target\ Support\ Files/Charts/Charts-umbrella.h /Users/markmoussa/HackathonProjects/Rhabit/DerivedData/Rhabit/Build/Intermediates/Pods.build/Debug-iphonesimulator/Charts.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule
/Users/markmoussa/HackathonProjects/Rhabit/DerivedData/Rhabit/Build/Intermediates/Pods.build/Debug-iphonesimulator/Charts.build/Objects-normal/x86_64/BubbleChartView~partial.swiftdoc : /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/BarChartData.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/BarChartDataEntry.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Interfaces/BarChartDataProvider.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/BarChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Highlight/BarChartHighlighter.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/BarChartRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/BarChartView.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/BarLineChartViewBase.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/BarLineScatterCandleBubbleChartData.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Interfaces/BarLineScatterCandleBubbleChartDataProvider.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/BarLineScatterCandleBubbleChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/BubbleChartData.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/BubbleChartDataEntry.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Interfaces/BubbleChartDataProvider.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/BubbleChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/BubbleChartRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/BubbleChartView.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/CandleChartData.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/CandleChartDataEntry.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Interfaces/CandleChartDataProvider.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/CandleChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/CandleStickChartRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/CandleStickChartView.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Animation/ChartAnimationEasing.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Animation/ChartAnimator.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Components/ChartAxisBase.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ChartAxisRendererBase.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/ChartBaseDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Utils/ChartColorTemplates.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Components/ChartComponentBase.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/ChartData.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Filters/ChartDataApproximatorFilter.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Filters/ChartDataBaseFilter.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/ChartDataEntry.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Interfaces/ChartDataProvider.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ChartDataRendererBase.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/ChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Formatters/ChartDefaultXAxisValueFormatter.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Utils/ChartFill.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Formatters/ChartFillFormatter.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Highlight/ChartHighlight.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Highlight/ChartHighlighter.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Components/ChartLegend.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ChartLegendRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Components/ChartLimitLine.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Components/ChartMarker.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Highlight/ChartRange.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ChartRendererBase.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Utils/ChartSelectionDetail.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Utils/ChartTransformer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Utils/ChartTransformerHorizontalBarChart.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Utils/ChartUtils.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/ChartViewBase.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Utils/ChartViewPortHandler.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Components/ChartXAxis.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ChartXAxisRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ChartXAxisRendererBarChart.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ChartXAxisRendererHorizontalBarChart.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ChartXAxisRendererRadarChart.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Formatters/ChartXAxisValueFormatter.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Components/ChartYAxis.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ChartYAxisRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ChartYAxisRendererHorizontalBarChart.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ChartYAxisRendererRadarChart.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/CombinedChartData.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/CombinedChartRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/CombinedChartView.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Highlight/CombinedHighlighter.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Highlight/HorizontalBarChartHighlighter.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/HorizontalBarChartRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/HorizontalBarChartView.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Interfaces/IBarChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Interfaces/IBarLineScatterCandleBubbleChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Interfaces/IBubbleChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Interfaces/ICandleChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Interfaces/IChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Interfaces/ILineChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Interfaces/ILineRadarChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Interfaces/ILineScatterCandleRadarChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Interfaces/IPieChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Interfaces/IRadarChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Interfaces/IScatterChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/LineChartData.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Interfaces/LineChartDataProvider.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/LineChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/LineChartRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/LineChartView.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/LineRadarChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/LineRadarChartRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/LineScatterCandleRadarChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/LineScatterCandleRadarChartRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/PieChartData.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/PieChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/PieChartRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/PieChartView.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/PieRadarChartViewBase.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/RadarChartData.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/RadarChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/RadarChartRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/RadarChartView.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/ScatterChartData.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Interfaces/ScatterChartDataProvider.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Data/Implementations/Standard/ScatterChartDataSet.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Renderers/ScatterChartRenderer.swift /Users/markmoussa/HackathonProjects/Rhabit/Pods/Charts/Charts/Classes/Charts/ScatterChartView.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/markmoussa/HackathonProjects/Rhabit/Pods/Target\ Support\ Files/Charts/Charts-umbrella.h /Users/markmoussa/HackathonProjects/Rhabit/DerivedData/Rhabit/Build/Intermediates/Pods.build/Debug-iphonesimulator/Charts.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule
|
D
|
module derelict.guile.hooks;
/* corresponds to hooks.h in libguile */
alias scm_t_c_hook_function = extern(C) nothrow @nogc void* function(void* hook_data, void* fn_data, void* data);
alias scm_t_c_hook_type = int;
enum : scm_t_c_hook_type {
SCM_C_HOOK_NORMAL,
SCM_C_HOOK_OR,
SCM_C_HOOK_AND
}
struct scm_t_c_hook_entry {
scm_t_c_hook_entry* next;
scm_t_c_hook_function func;
void* data;
}
struct scm_t_c_hook {
scm_t_c_hook_entry* first;
scm_t_c_hook_type type;
void* data;
}
|
D
|
/**
* D header file for POSIX.
*
* Copyright: Copyright (c) 2013 Lars Tandle Kyllingstad.
* License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
* Authors: Lars Tandle Kyllingstad
* Standards: The Open Group Base Specifications Issue 7, IEEE Std 1003.1-2008
*/
module core.sys.posix.sys.resource;
version (Posix):
public import core.sys.posix.sys.time;
public import core.sys.posix.sys.types: id_t;
import core.sys.posix.config;
version (OSX)
version = Darwin;
else version (iOS)
version = Darwin;
else version (TVOS)
version = Darwin;
else version (WatchOS)
version = Darwin;
nothrow @nogc extern(C):
//
// XOpen (XSI)
//
// http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_resource.h.html
/*
enum
{
PRIO_PROCESS,
PRIO_PGRP,
PRIO_USER,
}
alias ulong rlim_t;
enum
{
RLIM_INFINITY,
RLIM_SAVED_MAX,
RLIM_SAVED_CUR,
}
enum
{
RUSAGE_SELF,
RUSAGE_CHILDREN,
}
struct rlimit
{
rlim_t rlim_cur;
rlim_t rlim_max;
}
struct rusage
{
timeval ru_utime;
timeval ru_stime;
}
enum
{
RLIMIT_CORE,
RLIMIT_CPU,
RLIMIT_DATA,
RLIMIT_FSIZE,
RLIMIT_NOFILE,
RLIMIT_STACK,
RLIMIT_AS,
}
int getpriority(int, id_t);
int getrlimit(int, rlimit*);
int getrusage(int, rusage*);
int setpriority(int, id_t, int);
int setrlimit(int, const rlimit*);
*/
version (CRuntime_Glibc)
{
// rusage and some other constants in the Bionic section below really
// come from the linux kernel headers, but they're all mixed right now.
enum
{
PRIO_PROCESS = 0,
PRIO_PGRP = 1,
PRIO_USER = 2,
}
static if (__USE_FILE_OFFSET64)
alias ulong rlim_t;
else
alias c_ulong rlim_t;
static if (__USE_FILE_OFFSET64)
enum RLIM_INFINITY = 0xffffffffffffffffUL;
else
enum RLIM_INFINITY = cast(c_ulong)(~0UL);
enum RLIM_SAVED_MAX = RLIM_INFINITY;
enum RLIM_SAVED_CUR = RLIM_INFINITY;
enum
{
RUSAGE_SELF = 0,
RUSAGE_CHILDREN = -1,
}
struct rusage
{
timeval ru_utime;
timeval ru_stime;
c_long ru_maxrss;
c_long ru_ixrss;
c_long ru_idrss;
c_long ru_isrss;
c_long ru_minflt;
c_long ru_majflt;
c_long ru_nswap;
c_long ru_inblock;
c_long ru_oublock;
c_long ru_msgsnd;
c_long ru_msgrcv;
c_long ru_nsignals;
c_long ru_nvcsw;
c_long ru_nivcsw;
}
enum
{
RLIMIT_CORE = 4,
RLIMIT_CPU = 0,
RLIMIT_DATA = 2,
RLIMIT_FSIZE = 1,
RLIMIT_NOFILE = 7,
RLIMIT_STACK = 3,
RLIMIT_AS = 9,
}
}
else version (Darwin)
{
enum
{
PRIO_PROCESS = 0,
PRIO_PGRP = 1,
PRIO_USER = 2,
}
alias ulong rlim_t;
enum
{
RLIM_INFINITY = ((cast(ulong) 1 << 63) - 1),
RLIM_SAVED_MAX = RLIM_INFINITY,
RLIM_SAVED_CUR = RLIM_INFINITY,
}
enum
{
RUSAGE_SELF = 0,
RUSAGE_CHILDREN = -1,
}
struct rusage
{
timeval ru_utime;
timeval ru_stime;
c_long[14] ru_opaque;
}
enum
{
RLIMIT_CORE = 4,
RLIMIT_CPU = 0,
RLIMIT_DATA = 2,
RLIMIT_FSIZE = 1,
RLIMIT_NOFILE = 8,
RLIMIT_STACK = 3,
RLIMIT_AS = 5,
}
}
else version (FreeBSD)
{
enum
{
PRIO_PROCESS = 0,
PRIO_PGRP = 1,
PRIO_USER = 2,
}
alias long rlim_t;
enum
{
RLIM_INFINITY = (cast(rlim_t)((cast(ulong) 1 << 63) - 1)),
// FreeBSD explicitly does not define the following:
//RLIM_SAVED_MAX,
//RLIM_SAVED_CUR,
}
enum
{
RUSAGE_SELF = 0,
RUSAGE_CHILDREN = -1,
}
struct rusage
{
timeval ru_utime;
timeval ru_stime;
c_long ru_maxrss;
alias ru_ixrss ru_first;
c_long ru_ixrss;
c_long ru_idrss;
c_long ru_isrss;
c_long ru_minflt;
c_long ru_majflt;
c_long ru_nswap;
c_long ru_inblock;
c_long ru_oublock;
c_long ru_msgsnd;
c_long ru_msgrcv;
c_long ru_nsignals;
c_long ru_nvcsw;
c_long ru_nivcsw;
alias ru_nivcsw ru_last;
}
enum
{
RLIMIT_CORE = 4,
RLIMIT_CPU = 0,
RLIMIT_DATA = 2,
RLIMIT_FSIZE = 1,
RLIMIT_NOFILE = 8,
RLIMIT_STACK = 3,
RLIMIT_AS = 10,
}
}
else version (NetBSD)
{
enum
{
PRIO_PROCESS = 0,
PRIO_PGRP = 1,
PRIO_USER = 2,
}
alias long rlim_t;
enum
{
RLIM_INFINITY = (cast(rlim_t)((cast(ulong) 1 << 63) - 1)),
// FreeBSD explicitly does not define the following:
//RLIM_SAVED_MAX,
//RLIM_SAVED_CUR,
}
enum
{
RUSAGE_SELF = 0,
RUSAGE_CHILDREN = -1,
}
struct rusage
{
timeval ru_utime;
timeval ru_stime;
c_long ru_maxrss;
alias ru_ixrss ru_first;
c_long ru_ixrss;
c_long ru_idrss;
c_long ru_isrss;
c_long ru_minflt;
c_long ru_majflt;
c_long ru_nswap;
c_long ru_inblock;
c_long ru_oublock;
c_long ru_msgsnd;
c_long ru_msgrcv;
c_long ru_nsignals;
c_long ru_nvcsw;
c_long ru_nivcsw;
alias ru_nivcsw ru_last;
}
enum
{
RLIMIT_CORE = 4,
RLIMIT_CPU = 0,
RLIMIT_DATA = 2,
RLIMIT_FSIZE = 1,
RLIMIT_NOFILE = 8,
RLIMIT_STACK = 3,
RLIMIT_AS = 10,
}
}
else version (OpenBSD)
{
enum
{
PRIO_PROCESS = 0,
PRIO_PGRP = 1,
PRIO_USER = 2,
}
alias ulong rlim_t;
enum
{
RLIM_INFINITY = (cast(rlim_t)((cast(ulong) 1 << 63) - 1)),
RLIM_SAVED_MAX = RLIM_INFINITY,
RLIM_SAVED_CUR = RLIM_INFINITY,
}
enum
{
RUSAGE_SELF = 0,
RUSAGE_CHILDREN = -1,
RUSAGE_THREAD = 1,
}
struct rusage
{
timeval ru_utime;
timeval ru_stime;
c_long ru_maxrss;
alias ru_ixrss ru_first;
c_long ru_ixrss;
c_long ru_idrss;
c_long ru_isrss;
c_long ru_minflt;
c_long ru_majflt;
c_long ru_nswap;
c_long ru_inblock;
c_long ru_oublock;
c_long ru_msgsnd;
c_long ru_msgrcv;
c_long ru_nsignals;
c_long ru_nvcsw;
c_long ru_nivcsw;
alias ru_nivcsw ru_last;
}
enum
{
RLIMIT_CORE = 4,
RLIMIT_CPU = 0,
RLIMIT_DATA = 2,
RLIMIT_FSIZE = 1,
RLIMIT_NOFILE = 8,
RLIMIT_STACK = 3,
// OpenBSD does not define the following:
//RLIMIT_AS,
}
}
else version (DragonFlyBSD)
{
enum
{
PRIO_PROCESS = 0,
PRIO_PGRP = 1,
PRIO_USER = 2,
}
alias long rlim_t;
enum
{
RLIM_INFINITY = (cast(rlim_t)((cast(ulong) 1 << 63) - 1)),
// DragonFlyBSD explicitly does not define the following:
//RLIM_SAVED_MAX,
//RLIM_SAVED_CUR,
}
enum
{
RUSAGE_SELF = 0,
RUSAGE_CHILDREN = -1,
}
struct rusage
{
timeval ru_utime;
timeval ru_stime;
c_long ru_maxrss;
alias ru_ixrss ru_first;
c_long ru_ixrss;
c_long ru_idrss;
c_long ru_isrss;
c_long ru_minflt;
c_long ru_majflt;
c_long ru_nswap;
c_long ru_inblock;
c_long ru_oublock;
c_long ru_msgsnd;
c_long ru_msgrcv;
c_long ru_nsignals;
c_long ru_nvcsw;
c_long ru_nivcsw;
alias ru_nivcsw ru_last;
}
enum
{
RLIMIT_CORE = 4,
RLIMIT_CPU = 0,
RLIMIT_DATA = 2,
RLIMIT_FSIZE = 1,
RLIMIT_NOFILE = 8,
RLIMIT_STACK = 3,
RLIMIT_AS = 10,
}
}
else version (Solaris)
{
enum
{
PRIO_PROCESS = 0,
PRIO_PGRP = 1,
PRIO_USER = 2,
}
alias c_ulong rlim_t;
enum : c_long
{
RLIM_INFINITY = -3,
RLIM_SAVED_MAX = -2,
RLIM_SAVED_CUR = -1,
}
enum
{
RUSAGE_SELF = 0,
RUSAGE_CHILDREN = -1,
}
struct rusage
{
timeval ru_utime;
timeval ru_stime;
c_long ru_maxrss;
c_long ru_ixrss;
c_long ru_idrss;
c_long ru_isrss;
c_long ru_minflt;
c_long ru_majflt;
c_long ru_nswap;
c_long ru_inblock;
c_long ru_oublock;
c_long ru_msgsnd;
c_long ru_msgrcv;
c_long ru_nsignals;
c_long ru_nvcsw;
c_long ru_nivcsw;
}
enum
{
RLIMIT_CORE = 4,
RLIMIT_CPU = 0,
RLIMIT_DATA = 2,
RLIMIT_FSIZE = 1,
RLIMIT_NOFILE = 5,
RLIMIT_STACK = 3,
RLIMIT_AS = 6,
}
}
else version (CRuntime_Bionic)
{
enum
{
PRIO_PROCESS = 0,
PRIO_PGRP = 1,
PRIO_USER = 2,
}
alias c_ulong rlim_t;
enum RLIM_INFINITY = cast(c_ulong)(~0UL);
enum
{
RUSAGE_SELF = 0,
RUSAGE_CHILDREN = -1,
}
struct rusage
{
timeval ru_utime;
timeval ru_stime;
c_long ru_maxrss;
c_long ru_ixrss;
c_long ru_idrss;
c_long ru_isrss;
c_long ru_minflt;
c_long ru_majflt;
c_long ru_nswap;
c_long ru_inblock;
c_long ru_oublock;
c_long ru_msgsnd;
c_long ru_msgrcv;
c_long ru_nsignals;
c_long ru_nvcsw;
c_long ru_nivcsw;
}
enum
{
RLIMIT_CORE = 4,
RLIMIT_CPU = 0,
RLIMIT_DATA = 2,
RLIMIT_FSIZE = 1,
RLIMIT_NOFILE = 7,
RLIMIT_STACK = 3,
RLIMIT_AS = 9,
}
}
else version (CRuntime_Musl)
{
alias ulong rlim_t;
int getrlimit(int, rlimit*);
int setrlimit(int, const scope rlimit*);
alias getrlimit getrlimit64;
alias setrlimit setrlimit64;
enum
{
RUSAGE_SELF = 0,
RUSAGE_CHILDREN = -1,
RUSAGE_THREAD = 1
}
struct rusage
{
timeval ru_utime;
timeval ru_stime;
c_long ru_maxrss;
c_long ru_ixrss;
c_long ru_idrss;
c_long ru_isrss;
c_long ru_minflt;
c_long ru_majflt;
c_long ru_nswap;
c_long ru_inblock;
c_long ru_oublock;
c_long ru_msgsnd;
c_long ru_msgrcv;
c_long ru_nsignals;
c_long ru_nvcsw;
c_long ru_nivcsw;
c_long[16] __reserved;
}
enum
{
RLIMIT_CPU = 0,
RLIMIT_FSIZE = 1,
RLIMIT_DATA = 2,
RLIMIT_STACK = 3,
RLIMIT_CORE = 4,
RLIMIT_NOFILE = 7,
RLIMIT_AS = 9,
}
}
else version (CRuntime_UClibc)
{
enum
{
PRIO_PROCESS = 0,
PRIO_PGRP = 1,
PRIO_USER = 2,
}
static if (__USE_FILE_OFFSET64)
alias ulong rlim_t;
else
alias c_ulong rlim_t;
static if (__USE_FILE_OFFSET64)
enum RLIM_INFINITY = 0xffffffffffffffffUL;
else
enum RLIM_INFINITY = cast(c_ulong)(~0UL);
enum RLIM_SAVED_MAX = RLIM_INFINITY;
enum RLIM_SAVED_CUR = RLIM_INFINITY;
enum
{
RUSAGE_SELF = 0,
RUSAGE_CHILDREN = -1,
}
struct rusage
{
timeval ru_utime;
timeval ru_stime;
c_long ru_maxrss;
c_long ru_ixrss;
c_long ru_idrss;
c_long ru_isrss;
c_long ru_minflt;
c_long ru_majflt;
c_long ru_nswap;
c_long ru_inblock;
c_long ru_oublock;
c_long ru_msgsnd;
c_long ru_msgrcv;
c_long ru_nsignals;
c_long ru_nvcsw;
c_long ru_nivcsw;
}
enum
{
RLIMIT_CORE = 4,
RLIMIT_CPU = 0,
RLIMIT_DATA = 2,
RLIMIT_FSIZE = 1,
RLIMIT_NOFILE = 7,
RLIMIT_STACK = 3,
RLIMIT_AS = 9,
}
}
else static assert (false, "Unsupported platform");
struct rlimit
{
rlim_t rlim_cur;
rlim_t rlim_max;
}
version (CRuntime_Glibc)
{
int getpriority(int, id_t);
int setpriority(int, id_t, int);
}
else version (FreeBSD)
{
int getpriority(int, int);
int setpriority(int, int, int);
}
else version (DragonFlyBSD)
{
int getpriority(int, int);
int setpriority(int, int, int);
}
else version (CRuntime_Bionic)
{
int getpriority(int, int);
int setpriority(int, int, int);
}
else version (Solaris)
{
int getpriority(int, id_t);
int setpriority(int, id_t, int);
}
else version (Darwin)
{
int getpriority(int, id_t);
int setpriority(int, id_t, int);
}
else version (CRuntime_UClibc)
{
int getpriority(int, id_t);
int setpriority(int, id_t, int);
}
version (CRuntime_Glibc)
{
static if (__USE_FILE_OFFSET64)
{
int getrlimit64(int, rlimit*);
int setrlimit64(int, const scope rlimit*);
alias getrlimit = getrlimit64;
alias setrlimit = setrlimit64;
}
else
{
int getrlimit(int, rlimit*);
int setrlimit(int, const scope rlimit*);
}
int getrusage(int, rusage*);
}
else version (CRuntime_Bionic)
{
int getrlimit(int, rlimit*);
int getrusage(int, rusage*);
int setrlimit(int, const scope rlimit*);
}
else version (Darwin)
{
int getrlimit(int, rlimit*);
int getrusage(int, rusage*);
int setrlimit(int, const scope rlimit*);
}
else version (FreeBSD)
{
int getrlimit(int, rlimit*);
int getrusage(int, rusage*);
int setrlimit(int, const scope rlimit*);
}
else version (NetBSD)
{
int getrlimit(int, rlimit*);
int getrusage(int, rusage*);
int setrlimit(int, const scope rlimit*);
}
else version (OpenBSD)
{
int getrlimit(int, rlimit*);
int getrusage(int, rusage*);
int setrlimit(int, const scope rlimit*);
}
else version (DragonFlyBSD)
{
int getrlimit(int, rlimit*);
int getrusage(int, rusage*);
int setrlimit(int, const scope rlimit*);
}
else version (Solaris)
{
int getrlimit(int, rlimit*);
int getrusage(int, rusage*);
int setrlimit(int, const scope rlimit*);
}
else version (CRuntime_UClibc)
{
static if (__USE_FILE_OFFSET64)
{
int getrlimit64(int, rlimit*);
int setrlimit64(int, const scope rlimit*);
alias getrlimit = getrlimit64;
alias setrlimit = setrlimit64;
}
else
{
int getrlimit(int, rlimit*);
int setrlimit(int, const scope rlimit*);
}
int getrusage(int, rusage*);
}
|
D
|
/Users/raunak/Downloads/steve-jobs/target/rls/debug/build/proc-macro2-6076c5b3ff4ebd43/build_script_build-6076c5b3ff4ebd43: /Users/raunak/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.24/build.rs
/Users/raunak/Downloads/steve-jobs/target/rls/debug/build/proc-macro2-6076c5b3ff4ebd43/build_script_build-6076c5b3ff4ebd43.d: /Users/raunak/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.24/build.rs
/Users/raunak/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.24/build.rs:
|
D
|
/mnt/sda5/sabasit/Documents/IOT/Practice/menu_card/menu_generator/target/debug/deps/ppv_lite86-4314e74b6b1c9f1f.rmeta: /home/sabasit/.cargo/registry/src/github.com-1ecc6299db9ec823/ppv-lite86-0.2.5/src/lib.rs /home/sabasit/.cargo/registry/src/github.com-1ecc6299db9ec823/ppv-lite86-0.2.5/src/soft.rs /home/sabasit/.cargo/registry/src/github.com-1ecc6299db9ec823/ppv-lite86-0.2.5/src/types.rs /home/sabasit/.cargo/registry/src/github.com-1ecc6299db9ec823/ppv-lite86-0.2.5/src/x86_64/mod.rs /home/sabasit/.cargo/registry/src/github.com-1ecc6299db9ec823/ppv-lite86-0.2.5/src/x86_64/sse2.rs
/mnt/sda5/sabasit/Documents/IOT/Practice/menu_card/menu_generator/target/debug/deps/libppv_lite86-4314e74b6b1c9f1f.rlib: /home/sabasit/.cargo/registry/src/github.com-1ecc6299db9ec823/ppv-lite86-0.2.5/src/lib.rs /home/sabasit/.cargo/registry/src/github.com-1ecc6299db9ec823/ppv-lite86-0.2.5/src/soft.rs /home/sabasit/.cargo/registry/src/github.com-1ecc6299db9ec823/ppv-lite86-0.2.5/src/types.rs /home/sabasit/.cargo/registry/src/github.com-1ecc6299db9ec823/ppv-lite86-0.2.5/src/x86_64/mod.rs /home/sabasit/.cargo/registry/src/github.com-1ecc6299db9ec823/ppv-lite86-0.2.5/src/x86_64/sse2.rs
/mnt/sda5/sabasit/Documents/IOT/Practice/menu_card/menu_generator/target/debug/deps/ppv_lite86-4314e74b6b1c9f1f.d: /home/sabasit/.cargo/registry/src/github.com-1ecc6299db9ec823/ppv-lite86-0.2.5/src/lib.rs /home/sabasit/.cargo/registry/src/github.com-1ecc6299db9ec823/ppv-lite86-0.2.5/src/soft.rs /home/sabasit/.cargo/registry/src/github.com-1ecc6299db9ec823/ppv-lite86-0.2.5/src/types.rs /home/sabasit/.cargo/registry/src/github.com-1ecc6299db9ec823/ppv-lite86-0.2.5/src/x86_64/mod.rs /home/sabasit/.cargo/registry/src/github.com-1ecc6299db9ec823/ppv-lite86-0.2.5/src/x86_64/sse2.rs
/home/sabasit/.cargo/registry/src/github.com-1ecc6299db9ec823/ppv-lite86-0.2.5/src/lib.rs:
/home/sabasit/.cargo/registry/src/github.com-1ecc6299db9ec823/ppv-lite86-0.2.5/src/soft.rs:
/home/sabasit/.cargo/registry/src/github.com-1ecc6299db9ec823/ppv-lite86-0.2.5/src/types.rs:
/home/sabasit/.cargo/registry/src/github.com-1ecc6299db9ec823/ppv-lite86-0.2.5/src/x86_64/mod.rs:
/home/sabasit/.cargo/registry/src/github.com-1ecc6299db9ec823/ppv-lite86-0.2.5/src/x86_64/sse2.rs:
|
D
|
a form of socialism featuring racism and expansionism and obedience to a strong leader
|
D
|
/*******************************************************************************
* Copyright (c) 2000, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Port to the D Programming Language:
* John Reimer <terminal.node@gmail.com>
*******************************************************************************/
module org.eclipse.swt.internal.opengl.win32.WGL;
import org.eclipse.swt.internal.Library;
import org.eclipse.swt.internal.Platform;
private import org.eclipse.swt.internal.win32.WINAPI;
static import org.eclipse.swt.internal.opengl.win32.native;
alias org.eclipse.swt.internal.opengl.win32.native OPENGL_NATIVE;
public class WGL : Platform {
public:
enum : int {
WGL_FONT_LINES = 0,
WGL_FONT_POLYGONS = 1,
/* LAYERPLANEDESCRIPTOR flags */
LPD_DOUBLEBUFFER = 0x00000001,
LPD_STEREO = 0x00000002,
LPD_SUPPORT_GDI = 0x00000010,
LPD_SUPPORT_OPENGL = 0x00000020,
LPD_SHARE_DEPTH = 0x00000040,
LPD_SHARE_STENCIL = 0x00000080,
LPD_SHARE_ACCUM = 0x00000100,
LPD_SWAP_EXCHANGE = 0x00000200,
LPD_SWAP_COPY = 0x00000400,
LPD_TRANSPARENT = 0x00001000,
LPD_TYPE_RGBA = 0,
LPD_TYPE_COLORINDEX = 1,
/* wglSwapLayerBuffers flags */
WGL_SWAP_MAIN_PLANE = 0x00000001,
WGL_SWAP_OVERLAY1 = 0x00000002,
WGL_SWAP_OVERLAY2 = 0x00000004,
WGL_SWAP_OVERLAY3 = 0x00000008,
WGL_SWAP_OVERLAY4 = 0x00000010,
WGL_SWAP_OVERLAY5 = 0x00000020,
WGL_SWAP_OVERLAY6 = 0x00000040,
WGL_SWAP_OVERLAY7 = 0x00000080,
WGL_SWAP_OVERLAY8 = 0x00000100,
WGL_SWAP_OVERLAY9 = 0x00000200,
WGL_SWAP_OVERLAY10 = 0x00000400,
WGL_SWAP_OVERLAY11 = 0x00000800,
WGL_SWAP_OVERLAY12 = 0x00001000,
WGL_SWAP_OVERLAY13 = 0x00002000,
WGL_SWAP_OVERLAY14 = 0x00004000,
WGL_SWAP_OVERLAY15 = 0x00008000,
WGL_SWAP_UNDERLAY1 = 0x00010000,
WGL_SWAP_UNDERLAY2 = 0x00020000,
WGL_SWAP_UNDERLAY3 = 0x00040000,
WGL_SWAP_UNDERLAY4 = 0x00080000,
WGL_SWAP_UNDERLAY5 = 0x00100000,
WGL_SWAP_UNDERLAY6 = 0x00200000,
WGL_SWAP_UNDERLAY7 = 0x00400000,
WGL_SWAP_UNDERLAY8 = 0x00800000,
WGL_SWAP_UNDERLAY9 = 0x01000000,
WGL_SWAP_UNDERLAY10 = 0x02000000,
WGL_SWAP_UNDERLAY11 = 0x04000000,
WGL_SWAP_UNDERLAY12 = 0x08000000,
WGL_SWAP_UNDERLAY13 = 0x10000000,
WGL_SWAP_UNDERLAY14 = 0x20000000,
WGL_SWAP_UNDERLAY15 = 0x40000000,
/* pixel types */
PFD_TYPE_RGBA = 0,
PFD_TYPE_COLORINDEX = 1,
/* layer types */
PFD_MAIN_PLANE = 0,
PFD_OVERLAY_PLANE = 1,
PFD_UNDERLAY_PLANE = -1,
/* PIXELFORMATDESCRIPTOR flags */
PFD_DOUBLEBUFFER = 0x00000001,
PFD_STEREO = 0x00000002,
PFD_DRAW_TO_WINDOW = 0x00000004,
PFD_DRAW_TO_BITMAP = 0x00000008,
PFD_SUPPORT_GDI = 0x00000010,
PFD_SUPPORT_OPENGL = 0x00000020,
PFD_GENERIC_FORMAT = 0x00000040,
PFD_NEED_PALETTE = 0x00000080,
PFD_NEED_SYSTEM_PALETTE = 0x00000100,
PFD_SWAP_EXCHANGE = 0x00000200,
PFD_SWAP_COPY = 0x00000400,
PFD_SWAP_LAYER_BUFFERS = 0x00000800,
PFD_GENERIC_ACCELERATED = 0x00001000,
PFD_SUPPORT_DIRECTDRAW = 0x00002000,
/* PIXELFORMATDESCRIPTOR flags for use in ChoosePixelFormat only */
PFD_DEPTH_DONTCARE = 0x20000000,
PFD_DOUBLEBUFFER_DONTCARE = 0x40000000,
PFD_STEREO_DONTCARE = 0x80000000
}
alias OPENGL_NATIVE.ChoosePixelFormat ChoosePixelFormat;
alias OPENGL_NATIVE.DescribePixelFormat DescribePixelFormat;
alias OPENGL_NATIVE.GetPixelFormat GetPixelFormat;
alias OPENGL_NATIVE.SetPixelFormat SetPixelFormat;
alias OPENGL_NATIVE.SwapBuffers SwapBuffers;
alias OPENGL_NATIVE.wglCopyContext wglCopyContext;
alias OPENGL_NATIVE.wglCreateContext wglCreateContext;
alias OPENGL_NATIVE.wglCreateLayerContext wglCreateLayerContext;
alias OPENGL_NATIVE.wglDeleteContext wglDeleteContext;
alias OPENGL_NATIVE.wglGetCurrentContext wglGetCurrentContext;
alias OPENGL_NATIVE.wglGetCurrentDC wglGetCurrentDC;
alias OPENGL_NATIVE.wglGetProcAddress wglGetProcAddress;
alias OPENGL_NATIVE.wglMakeCurrent wglMakeCurrent;
alias OPENGL_NATIVE.wglShareLists wglShareLists;
alias OPENGL_NATIVE.wglDescribeLayerPlane wglDescribeLayerPlane;
alias OPENGL_NATIVE.wglSetLayerPaletteEntries wglSetLayerPaletteEntries;
alias OPENGL_NATIVE.wglGetLayerPaletteEntries wglGetLayerPaletteEntries;
alias OPENGL_NATIVE.wglRealizeLayerPalette wglRealizeLayerPalette;
alias OPENGL_NATIVE.wglSwapLayerBuffers wglSwapLayerBuffers;
}
|
D
|
module hunt.security.acl.permission.Permission;
import hunt.security.acl.permission.Item;
import std.algorithm;
import kiss.logger;
class Permission
{
PermissionItem[] permissions;
public Permission addPermission(PermissionItem permission)
{
this.permissions ~= permission;
return this;
}
public Permission addPermissions(PermissionItem[] permissions)
{
this.permissions ~= permissions;
return this;
}
public bool hasPermission(string key)
{
logInfo(permissions , " key " , key);
return find!(" a.key == b")(permissions , key).length > 0;
}
public Permission addPermission( string key , string name)
{
addPermission( PermissionItem( key , name));
return this;
}
}
|
D
|
/*
* This file is part of gtkD.
*
* gtkD is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* gtkD is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with gtkD; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// generated automatically - do not change
// find conversion definition on APILookup.txt
// implement new conversion functionalities on the wrap.utils pakage
/*
* Conversion parameters:
* inFile = GVolumeMonitor.html
* outPack = gio
* outFile = VolumeMonitor
* strct = GVolumeMonitor
* realStrct=
* ctorStrct=
* clss = VolumeMonitor
* interf =
* class Code: Yes
* interface Code: No
* template for:
* extend =
* implements:
* prefixes:
* - g_volume_monitor_
* omit structs:
* omit prefixes:
* omit code:
* - g_volume_monitor_get
* omit signals:
* imports:
* - gtkD.glib.Str
* - gtkD.glib.ListG
* - gtkD.gio.Drive
* - gtkD.gio.DriveIF
* - gtkD.gio.Mount
* - gtkD.gio.MountIF
* - gtkD.gio.Volume
* - gtkD.gio.VolumeIF
* structWrap:
* - GDrive* -> DriveIF
* - GList* -> ListG
* - GMount* -> MountIF
* - GVolume* -> VolumeIF
* - GVolumeMonitor* ->
* module aliases:
* local aliases:
* overrides:
*/
module gtkD.gio.VolumeMonitor;
public import gtkD.gtkc.giotypes;
private import gtkD.gtkc.gio;
private import gtkD.glib.ConstructionException;
private import gtkD.gobject.Signals;
public import gtkD.gtkc.gdktypes;
private import gtkD.glib.Str;
private import gtkD.glib.ListG;
private import gtkD.gio.Drive;
private import gtkD.gio.DriveIF;
private import gtkD.gio.Mount;
private import gtkD.gio.MountIF;
private import gtkD.gio.Volume;
private import gtkD.gio.VolumeIF;
private import gtkD.gobject.ObjectG;
/**
* Description
* GVolumeMonitor is for listing the user interesting devices and volumes
* on the computer. In other words, what a file selector or file manager
* would show in a sidebar.
* GVolumeMonitor is not thread-default-context
* aware, and so should not be used other than from the main
* thread, with no thread-default-context active.
*/
public class VolumeMonitor : ObjectG
{
/** the main Gtk struct */
protected GVolumeMonitor* gVolumeMonitor;
public GVolumeMonitor* getVolumeMonitorStruct()
{
return gVolumeMonitor;
}
/** the main Gtk struct as a void* */
protected override void* getStruct()
{
return cast(void*)gVolumeMonitor;
}
/**
* Sets our main struct and passes it to the parent class
*/
public this (GVolumeMonitor* gVolumeMonitor)
{
if(gVolumeMonitor is null)
{
this = null;
return;
}
//Check if there already is a D object for this gtk struct
void* ptr = getDObject(cast(GObject*)gVolumeMonitor);
if( ptr !is null )
{
this = cast(VolumeMonitor)ptr;
return;
}
super(cast(GObject*)gVolumeMonitor);
this.gVolumeMonitor = gVolumeMonitor;
}
/**
* Gets the volume monitor used by gtkD.gio.
* Throws: ConstructionException GTK+ fails to create the object.
*/
public this()
{
// GVolumeMonitor* g_volume_monitor_get (void);
auto p = g_volume_monitor_get();
if(p is null)
{
throw new ConstructionException("g_volume_monitor_get()");
}
this(cast(GVolumeMonitor*) p);
}
/**
*/
int[char[]] connectedSignals;
void delegate(DriveIF, VolumeMonitor)[] onDriveChangedListeners;
/**
* Emitted when a drive changes.
*/
void addOnDriveChanged(void delegate(DriveIF, VolumeMonitor) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
if ( !("drive-changed" in connectedSignals) )
{
Signals.connectData(
getStruct(),
"drive-changed",
cast(GCallback)&callBackDriveChanged,
cast(void*)this,
null,
connectFlags);
connectedSignals["drive-changed"] = 1;
}
onDriveChangedListeners ~= dlg;
}
extern(C) static void callBackDriveChanged(GVolumeMonitor* volumeMonitorStruct, GDrive* drive, VolumeMonitor volumeMonitor)
{
foreach ( void delegate(DriveIF, VolumeMonitor) dlg ; volumeMonitor.onDriveChangedListeners )
{
dlg(new Drive(drive), volumeMonitor);
}
}
void delegate(DriveIF, VolumeMonitor)[] onDriveConnectedListeners;
/**
* Emitted when a drive is connected to the system.
*/
void addOnDriveConnected(void delegate(DriveIF, VolumeMonitor) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
if ( !("drive-connected" in connectedSignals) )
{
Signals.connectData(
getStruct(),
"drive-connected",
cast(GCallback)&callBackDriveConnected,
cast(void*)this,
null,
connectFlags);
connectedSignals["drive-connected"] = 1;
}
onDriveConnectedListeners ~= dlg;
}
extern(C) static void callBackDriveConnected(GVolumeMonitor* volumeMonitorStruct, GDrive* drive, VolumeMonitor volumeMonitor)
{
foreach ( void delegate(DriveIF, VolumeMonitor) dlg ; volumeMonitor.onDriveConnectedListeners )
{
dlg(new Drive(drive), volumeMonitor);
}
}
void delegate(DriveIF, VolumeMonitor)[] onDriveDisconnectedListeners;
/**
* Emitted when a drive is disconnected from the system.
*/
void addOnDriveDisconnected(void delegate(DriveIF, VolumeMonitor) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
if ( !("drive-disconnected" in connectedSignals) )
{
Signals.connectData(
getStruct(),
"drive-disconnected",
cast(GCallback)&callBackDriveDisconnected,
cast(void*)this,
null,
connectFlags);
connectedSignals["drive-disconnected"] = 1;
}
onDriveDisconnectedListeners ~= dlg;
}
extern(C) static void callBackDriveDisconnected(GVolumeMonitor* volumeMonitorStruct, GDrive* drive, VolumeMonitor volumeMonitor)
{
foreach ( void delegate(DriveIF, VolumeMonitor) dlg ; volumeMonitor.onDriveDisconnectedListeners )
{
dlg(new Drive(drive), volumeMonitor);
}
}
void delegate(DriveIF, VolumeMonitor)[] onDriveEjectButtonListeners;
/**
* Emitted when the eject button is pressed on drive.
* Since 2.18
*/
void addOnDriveEjectButton(void delegate(DriveIF, VolumeMonitor) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
if ( !("drive-eject-button" in connectedSignals) )
{
Signals.connectData(
getStruct(),
"drive-eject-button",
cast(GCallback)&callBackDriveEjectButton,
cast(void*)this,
null,
connectFlags);
connectedSignals["drive-eject-button"] = 1;
}
onDriveEjectButtonListeners ~= dlg;
}
extern(C) static void callBackDriveEjectButton(GVolumeMonitor* volumeMonitorStruct, GDrive* drive, VolumeMonitor volumeMonitor)
{
foreach ( void delegate(DriveIF, VolumeMonitor) dlg ; volumeMonitor.onDriveEjectButtonListeners )
{
dlg(new Drive(drive), volumeMonitor);
}
}
void delegate(DriveIF, VolumeMonitor)[] onDriveStopButtonListeners;
/**
* Emitted when the stop button is pressed on drive.
* Since 2.22
*/
void addOnDriveStopButton(void delegate(DriveIF, VolumeMonitor) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
if ( !("drive-stop-button" in connectedSignals) )
{
Signals.connectData(
getStruct(),
"drive-stop-button",
cast(GCallback)&callBackDriveStopButton,
cast(void*)this,
null,
connectFlags);
connectedSignals["drive-stop-button"] = 1;
}
onDriveStopButtonListeners ~= dlg;
}
extern(C) static void callBackDriveStopButton(GVolumeMonitor* volumeMonitorStruct, GDrive* drive, VolumeMonitor volumeMonitor)
{
foreach ( void delegate(DriveIF, VolumeMonitor) dlg ; volumeMonitor.onDriveStopButtonListeners )
{
dlg(new Drive(drive), volumeMonitor);
}
}
void delegate(MountIF, VolumeMonitor)[] onMountAddedListeners;
/**
* Emitted when a mount is added.
*/
void addOnMountAdded(void delegate(MountIF, VolumeMonitor) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
if ( !("mount-added" in connectedSignals) )
{
Signals.connectData(
getStruct(),
"mount-added",
cast(GCallback)&callBackMountAdded,
cast(void*)this,
null,
connectFlags);
connectedSignals["mount-added"] = 1;
}
onMountAddedListeners ~= dlg;
}
extern(C) static void callBackMountAdded(GVolumeMonitor* volumeMonitorStruct, GMount* mount, VolumeMonitor volumeMonitor)
{
foreach ( void delegate(MountIF, VolumeMonitor) dlg ; volumeMonitor.onMountAddedListeners )
{
dlg(new Mount(mount), volumeMonitor);
}
}
void delegate(MountIF, VolumeMonitor)[] onMountChangedListeners;
/**
* Emitted when a mount changes.
*/
void addOnMountChanged(void delegate(MountIF, VolumeMonitor) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
if ( !("mount-changed" in connectedSignals) )
{
Signals.connectData(
getStruct(),
"mount-changed",
cast(GCallback)&callBackMountChanged,
cast(void*)this,
null,
connectFlags);
connectedSignals["mount-changed"] = 1;
}
onMountChangedListeners ~= dlg;
}
extern(C) static void callBackMountChanged(GVolumeMonitor* volumeMonitorStruct, GMount* mount, VolumeMonitor volumeMonitor)
{
foreach ( void delegate(MountIF, VolumeMonitor) dlg ; volumeMonitor.onMountChangedListeners )
{
dlg(new Mount(mount), volumeMonitor);
}
}
void delegate(MountIF, VolumeMonitor)[] onMountPreUnmountListeners;
/**
* Emitted when a mount is about to be removed.
*/
void addOnMountPreUnmount(void delegate(MountIF, VolumeMonitor) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
if ( !("mount-pre-unmount" in connectedSignals) )
{
Signals.connectData(
getStruct(),
"mount-pre-unmount",
cast(GCallback)&callBackMountPreUnmount,
cast(void*)this,
null,
connectFlags);
connectedSignals["mount-pre-unmount"] = 1;
}
onMountPreUnmountListeners ~= dlg;
}
extern(C) static void callBackMountPreUnmount(GVolumeMonitor* volumeMonitorStruct, GMount* mount, VolumeMonitor volumeMonitor)
{
foreach ( void delegate(MountIF, VolumeMonitor) dlg ; volumeMonitor.onMountPreUnmountListeners )
{
dlg(new Mount(mount), volumeMonitor);
}
}
void delegate(MountIF, VolumeMonitor)[] onMountRemovedListeners;
/**
* Emitted when a mount is removed.
*/
void addOnMountRemoved(void delegate(MountIF, VolumeMonitor) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
if ( !("mount-removed" in connectedSignals) )
{
Signals.connectData(
getStruct(),
"mount-removed",
cast(GCallback)&callBackMountRemoved,
cast(void*)this,
null,
connectFlags);
connectedSignals["mount-removed"] = 1;
}
onMountRemovedListeners ~= dlg;
}
extern(C) static void callBackMountRemoved(GVolumeMonitor* volumeMonitorStruct, GMount* mount, VolumeMonitor volumeMonitor)
{
foreach ( void delegate(MountIF, VolumeMonitor) dlg ; volumeMonitor.onMountRemovedListeners )
{
dlg(new Mount(mount), volumeMonitor);
}
}
void delegate(VolumeIF, VolumeMonitor)[] onVolumeAddedListeners;
/**
* Emitted when a mountable volume is added to the system.
*/
void addOnVolumeAdded(void delegate(VolumeIF, VolumeMonitor) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
if ( !("volume-added" in connectedSignals) )
{
Signals.connectData(
getStruct(),
"volume-added",
cast(GCallback)&callBackVolumeAdded,
cast(void*)this,
null,
connectFlags);
connectedSignals["volume-added"] = 1;
}
onVolumeAddedListeners ~= dlg;
}
extern(C) static void callBackVolumeAdded(GVolumeMonitor* volumeMonitorStruct, GVolume* volume, VolumeMonitor volumeMonitor)
{
foreach ( void delegate(VolumeIF, VolumeMonitor) dlg ; volumeMonitor.onVolumeAddedListeners )
{
dlg(new Volume(volume), volumeMonitor);
}
}
void delegate(VolumeIF, VolumeMonitor)[] onVolumeChangedListeners;
/**
* Emitted when mountable volume is changed.
*/
void addOnVolumeChanged(void delegate(VolumeIF, VolumeMonitor) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
if ( !("volume-changed" in connectedSignals) )
{
Signals.connectData(
getStruct(),
"volume-changed",
cast(GCallback)&callBackVolumeChanged,
cast(void*)this,
null,
connectFlags);
connectedSignals["volume-changed"] = 1;
}
onVolumeChangedListeners ~= dlg;
}
extern(C) static void callBackVolumeChanged(GVolumeMonitor* volumeMonitorStruct, GVolume* volume, VolumeMonitor volumeMonitor)
{
foreach ( void delegate(VolumeIF, VolumeMonitor) dlg ; volumeMonitor.onVolumeChangedListeners )
{
dlg(new Volume(volume), volumeMonitor);
}
}
void delegate(VolumeIF, VolumeMonitor)[] onVolumeRemovedListeners;
/**
* Emitted when a mountable volume is removed from the system.
* See Also
* #GFileMonitor
*/
void addOnVolumeRemoved(void delegate(VolumeIF, VolumeMonitor) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
if ( !("volume-removed" in connectedSignals) )
{
Signals.connectData(
getStruct(),
"volume-removed",
cast(GCallback)&callBackVolumeRemoved,
cast(void*)this,
null,
connectFlags);
connectedSignals["volume-removed"] = 1;
}
onVolumeRemovedListeners ~= dlg;
}
extern(C) static void callBackVolumeRemoved(GVolumeMonitor* volumeMonitorStruct, GVolume* volume, VolumeMonitor volumeMonitor)
{
foreach ( void delegate(VolumeIF, VolumeMonitor) dlg ; volumeMonitor.onVolumeRemovedListeners )
{
dlg(new Volume(volume), volumeMonitor);
}
}
/**
* Gets a list of drives connected to the system.
* The returned list should be freed with g_list_free(), after
* its elements have been unreffed with g_object_unref().
* Returns: a GList of connected GDrive objects.
*/
public ListG getConnectedDrives()
{
// GList * g_volume_monitor_get_connected_drives (GVolumeMonitor *volume_monitor);
auto p = g_volume_monitor_get_connected_drives(gVolumeMonitor);
if(p is null)
{
return null;
}
return new ListG(cast(GList*) p);
}
/**
* Gets a list of the volumes on the system.
* The returned list should be freed with g_list_free(), after
* its elements have been unreffed with g_object_unref().
* Returns: a GList of GVolume objects.
*/
public ListG getVolumes()
{
// GList * g_volume_monitor_get_volumes (GVolumeMonitor *volume_monitor);
auto p = g_volume_monitor_get_volumes(gVolumeMonitor);
if(p is null)
{
return null;
}
return new ListG(cast(GList*) p);
}
/**
* Gets a list of the mounts on the system.
* The returned list should be freed with g_list_free(), after
* its elements have been unreffed with g_object_unref().
* Returns: a GList of GMount objects.
*/
public ListG getMounts()
{
// GList * g_volume_monitor_get_mounts (GVolumeMonitor *volume_monitor);
auto p = g_volume_monitor_get_mounts(gVolumeMonitor);
if(p is null)
{
return null;
}
return new ListG(cast(GList*) p);
}
/**
* Warning
* g_volume_monitor_adopt_orphan_mount has been deprecated since version 2.20 and should not be used in newly-written code. Instead of using this function, GVolumeMonitor
* implementations should instead create shadow mounts with the URI of
* the mount they intend to adopt. See the proxy volume monitor in
* gvfs for an example of this. Also see g_mount_is_shadowed(),
* g_mount_shadow() and g_mount_unshadow() functions.
* This function should be called by any GVolumeMonitor
* implementation when a new GMount object is created that is not
* associated with a GVolume object. It must be called just before
* emitting the mount_added signal.
* If the return value is not NULL, the caller must associate the
* returned GVolume object with the GMount. This involves returning
* it in its g_mount_get_volume() implementation. The caller must
* also listen for the "removed" signal on the returned object
* and give up its reference when handling that signal
* Similary, if implementing g_volume_monitor_adopt_orphan_mount(),
* the implementor must take a reference to mount and return it in
* its g_volume_get_mount() implemented. Also, the implementor must
* listen for the "unmounted" signal on mount and give up its
* reference upon handling that signal.
* There are two main use cases for this function.
* One is when implementing a user space file system driver that reads
* blocks of a block device that is already represented by the native
* volume monitor (for example a CD Audio file system driver). Such
* a driver will generate its own GMount object that needs to be
* assoicated with the GVolume object that represents the volume.
* The other is for implementing a GVolumeMonitor whose sole purpose
* is to return GVolume objects representing entries in the users
* "favorite servers" list or similar.
* Params:
* mount = a GMount object to find a parent for
* Returns: the GVolume object that is the parent for mount or NULLif no wants to adopt the GMount.
*/
public static VolumeIF adoptOrphanMount(MountIF mount)
{
// GVolume * g_volume_monitor_adopt_orphan_mount (GMount *mount);
auto p = g_volume_monitor_adopt_orphan_mount((mount is null) ? null : mount.getMountTStruct());
if(p is null)
{
return null;
}
return new Volume(cast(GVolume*) p);
}
/**
* Finds a GMount object by its UUID (see g_mount_get_uuid())
* Params:
* uuid = the UUID to look for
* Returns: a GMount or NULL if no such mount is available. Free the returned object with g_object_unref().
*/
public MountIF getMountForUuid(string uuid)
{
// GMount * g_volume_monitor_get_mount_for_uuid (GVolumeMonitor *volume_monitor, const char *uuid);
auto p = g_volume_monitor_get_mount_for_uuid(gVolumeMonitor, Str.toStringz(uuid));
if(p is null)
{
return null;
}
return new Mount(cast(GMount*) p);
}
/**
* Finds a GVolume object by its UUID (see g_volume_get_uuid())
* Params:
* uuid = the UUID to look for
* Returns: a GVolume or NULL if no such volume is available. Free the returned object with g_object_unref().Signal DetailsThe "drive-changed" signalvoid user_function (GVolumeMonitor *volume_monitor, GDrive *drive, gpointer user_data) : Run LastEmitted when a drive changes.
*/
public VolumeIF getVolumeForUuid(string uuid)
{
// GVolume * g_volume_monitor_get_volume_for_uuid (GVolumeMonitor *volume_monitor, const char *uuid);
auto p = g_volume_monitor_get_volume_for_uuid(gVolumeMonitor, Str.toStringz(uuid));
if(p is null)
{
return null;
}
return new Volume(cast(GVolume*) p);
}
}
|
D
|
module android.java.java.util.concurrent.RunnableFuture_d_interface;
import arsd.jni : IJavaObjectImplementation, JavaPackageId, JavaName, IJavaObject, ImportExportImpl, JavaInterfaceMembers;
static import arsd.jni;
import import0 = android.java.java.lang.Class_d_interface;
import import1 = android.java.java.util.concurrent.TimeUnit_d_interface;
final class RunnableFuture : IJavaObject {
static immutable string[] _d_canCastTo = [
"java/lang/Runnable",
"java/util/concurrent/Future",
];
@Import void run();
@Import import0.Class getClass();
@Import int hashCode();
@Import bool equals(IJavaObject);
@Import @JavaName("toString") string toString_();
override string toString() { return arsd.jni.javaObjectToString(this); }
@Import void notify();
@Import void notifyAll();
@Import void wait(long);
@Import void wait(long, int);
@Import void wait();
@Import bool cancel(bool);
@Import bool isCancelled();
@Import bool isDone();
@Import IJavaObject get();
@Import IJavaObject get(long, import1.TimeUnit);
mixin IJavaObjectImplementation!(false);
public static immutable string _javaParameterString = "Ljava/util/concurrent/RunnableFuture;";
}
|
D
|
module android.java.android.view.KeyEvent_DispatcherState;
public import android.java.android.view.KeyEvent_DispatcherState_d_interface;
import arsd.jni : ImportExportImpl;
mixin ImportExportImpl!KeyEvent_DispatcherState;
import import1 = android.java.java.lang.Class;
|
D
|
//
// Would be nice: way to take output of the canvas to an image file (raster and/or svg)
//
//
// Copyright (c) 2013 Mikko Mononen memon@inside.org
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
// Fork developement, feature integration and new bugs:
// Ketmar // Invisible Vector <ketmar@ketmar.no-ip.org>
// Contains code from various contributors.
/**
The NanoVega API is modeled loosely on HTML5 canvas API.
If you know canvas, you're up to speed with NanoVega in no time.
$(SIDE_BY_SIDE
$(COLUMN
D code with nanovega:
---
import arsd.simpledisplay;
import arsd.nanovega;
void main () {
NVGContext nvg; // our NanoVega context
// we need at least OpenGL3 with GLSL to use NanoVega,
// so let's tell simpledisplay about that
setOpenGLContextVersion(3, 0);
// now create OpenGL window
auto sdmain = new SimpleWindow(800, 600, "NanoVega Simple Sample", OpenGlOptions.yes, Resizability.allowResizing);
// we need to destroy NanoVega context on window close
// stricly speaking, it is not necessary, as nothing fatal
// will happen if you'll forget it, but let's be polite.
// note that we cannot do that *after* our window was closed,
// as we need alive OpenGL context to do proper cleanup.
sdmain.onClosing = delegate () {
nvg.kill();
};
// this is called just before our window will be shown for the first time.
// we must create NanoVega context here, as it needs to initialize
// internal OpenGL subsystem with valid OpenGL context.
sdmain.visibleForTheFirstTime = delegate () {
// yes, that's all
nvg = nvgCreateContext();
if (nvg is null) assert(0, "cannot initialize NanoVega");
};
// this callback will be called when we will need to repaint our window
sdmain.redrawOpenGlScene = delegate () {
// fix viewport (we can do this in resize event, or here, it doesn't matter)
glViewport(0, 0, sdmain.width, sdmain.height);
// clear window
glClearColor(0, 0, 0, 0);
glClear(glNVGClearFlags); // use NanoVega API to get flags for OpenGL call
{
nvg.beginFrame(sdmain.width, sdmain.height); // begin rendering
scope(exit) nvg.endFrame(); // and flush render queue on exit
nvg.beginPath(); // start new path
nvg.roundedRect(20.5, 30.5, sdmain.width-40, sdmain.height-60, 8); // .5 to draw at pixel center (see NanoVega documentation)
// now set filling mode for our rectangle
// you can create colors using HTML syntax, or with convenient constants
nvg.fillPaint = nvg.linearGradient(20.5, 30.5, sdmain.width-40, sdmain.height-60, NVGColor("#f70"), NVGColor.green);
// now fill our rect
nvg.fill();
// and draw a nice outline
nvg.strokeColor = NVGColor.white;
nvg.strokeWidth = 2;
nvg.stroke();
// that's all, folks!
}
};
sdmain.eventLoop(0, // no pulse timer required
delegate (KeyEvent event) {
if (event == "*-Q" || event == "Escape") { sdmain.close(); return; } // quit on Q, Ctrl+Q, and so on
},
);
flushGui(); // let OS do it's cleanup
}
---
)
$(COLUMN
Javascript code with HTML5 Canvas
```html
<!DOCTYPE html>
<html>
<head>
<title>NanoVega Simple Sample (HTML5 Translation)</title>
<style>
body { background-color: black; }
</style>
</head>
<body>
<canvas id="my-canvas" width="800" height="600"></canvas>
<script>
var canvas = document.getElementById("my-canvas");
var context = canvas.getContext("2d");
context.beginPath();
context.rect(20.5, 30.5, canvas.width - 40, canvas.height - 60);
var gradient = context.createLinearGradient(20.5, 30.5, canvas.width - 40, canvas.height - 60);
gradient.addColorStop(0, "#f70");
gradient.addColorStop(1, "green");
context.fillStyle = gradient;
context.fill();
context.closePath();
context.strokeStyle = "white";
context.lineWidth = 2;
context.stroke();
</script>
</body>
</html>
```
)
)
Creating drawing context
========================
The drawing context is created using platform specific constructor function.
---
NVGContext vg = nvgCreateContext();
---
$(WARNING You must use created context ONLY in that thread where you created it.
There is no way to "transfer" context between threads. Trying to do so
will lead to UB.)
$(WARNING Never issue any commands outside of [beginFrame]/[endFrame]. Trying to
do so will lead to UB.)
Drawing shapes with NanoVega
============================
Drawing a simple shape using NanoVega consists of four steps:
$(LIST
* begin a new shape,
* define the path to draw,
* set fill or stroke,
* and finally fill or stroke the path.
)
---
vg.beginPath();
vg.rect(100, 100, 120, 30);
vg.fillColor(nvgRGBA(255, 192, 0, 255));
vg.fill();
---
Calling [beginPath] will clear any existing paths and start drawing from blank slate.
There are number of number of functions to define the path to draw, such as rectangle,
rounded rectangle and ellipse, or you can use the common moveTo, lineTo, bezierTo and
arcTo API to compose the paths step by step.
Understanding Composite Paths
=============================
Because of the way the rendering backend is built in NanoVega, drawing a composite path,
that is path consisting from multiple paths defining holes and fills, is a bit more
involved. NanoVega uses non-zero filling rule and by default, and paths are wound in counter
clockwise order. Keep that in mind when drawing using the low level draw API. In order to
wind one of the predefined shapes as a hole, you should call `pathWinding(NVGSolidity.Hole)`,
or `pathWinding(NVGSolidity.Solid)` $(B after) defining the path.
---
vg.beginPath();
vg.rect(100, 100, 120, 30);
vg.circle(120, 120, 5);
vg.pathWinding(NVGSolidity.Hole); // mark circle as a hole
vg.fillColor(nvgRGBA(255, 192, 0, 255));
vg.fill();
---
Rendering is wrong, what to do?
===============================
$(LIST
* make sure you have created NanoVega context using [nvgCreateContext] call
* make sure you have initialised OpenGL with $(B stencil buffer)
* make sure you have cleared stencil buffer
* make sure all rendering calls happen between [beginFrame] and [endFrame]
* to enable more checks for OpenGL errors, add `NVGContextFlag.Debug` flag to [nvgCreateContext]
)
OpenGL state touched by the backend
===================================
The OpenGL back-end touches following states:
When textures are uploaded or updated, the following pixel store is set to defaults:
`GL_UNPACK_ALIGNMENT`, `GL_UNPACK_ROW_LENGTH`, `GL_UNPACK_SKIP_PIXELS`, `GL_UNPACK_SKIP_ROWS`.
Texture binding is also affected. Texture updates can happen when the user loads images,
or when new font glyphs are added. Glyphs are added as needed between calls to [beginFrame]
and [endFrame].
The data for the whole frame is buffered and flushed in [endFrame].
The following code illustrates the OpenGL state touched by the rendering code:
---
glUseProgram(prog);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
glFrontFace(GL_CCW);
glEnable(GL_BLEND);
glDisable(GL_DEPTH_TEST);
glDisable(GL_SCISSOR_TEST);
glDisable(GL_COLOR_LOGIC_OP);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glStencilMask(0xffffffff);
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
glStencilFunc(GL_ALWAYS, 0, 0xffffffff);
glActiveTexture(GL_TEXTURE1);
glActiveTexture(GL_TEXTURE0);
glBindBuffer(GL_UNIFORM_BUFFER, buf);
glBindVertexArray(arr);
glBindBuffer(GL_ARRAY_BUFFER, buf);
glBindTexture(GL_TEXTURE_2D, tex);
glUniformBlockBinding(... , GLNVG_FRAG_BINDING);
---
Symbol_groups:
context_management =
## Context Management
Functions to create and destory NanoVega context.
frame_management =
## Frame Management
To start drawing with NanoVega context, you have to "begin frame", and then
"end frame" to flush your rendering commands to GPU.
composite_operation =
## Composite Operation
The composite operations in NanoVega are modeled after HTML Canvas API, and
the blend func is based on OpenGL (see corresponding manuals for more info).
The colors in the blending state have premultiplied alpha.
color_utils =
## Color Utils
Colors in NanoVega are stored as ARGB. Zero alpha means "transparent color".
matrices =
## Matrices and Transformations
The paths, gradients, patterns and scissor region are transformed by an transformation
matrix at the time when they are passed to the API.
The current transformation matrix is an affine matrix:
----------------------
[sx kx tx]
[ky sy ty]
[ 0 0 1]
----------------------
Where: (sx, sy) define scaling, (kx, ky) skewing, and (tx, ty) translation.
The last row is assumed to be (0, 0, 1) and is not stored.
Apart from [resetTransform], each transformation function first creates
specific transformation matrix and pre-multiplies the current transformation by it.
Current coordinate system (transformation) can be saved and restored using [save] and [restore].
The following functions can be used to make calculations on 2x3 transformation matrices.
A 2x3 matrix is represented as float[6].
state_handling =
## State Handling
NanoVega contains state which represents how paths will be rendered.
The state contains transform, fill and stroke styles, text and font styles,
and scissor clipping.
render_styles =
## Render Styles
Fill and stroke render style can be either a solid color or a paint which is a gradient or a pattern.
Solid color is simply defined as a color value, different kinds of paints can be created
using [linearGradient], [boxGradient], [radialGradient] and [imagePattern].
Current render style can be saved and restored using [save] and [restore].
Note that if you want "almost perfect" pixel rendering, you should set aspect ratio to 1,
and use `integerCoord+0.5f` as pixel coordinates.
render_transformations =
## Render Transformations
Transformation matrix management for the current rendering style. Transformations are applied in
backwards order. I.e. if you first translate, and then rotate, your path will be rotated around
it's origin, and then translated to the destination point.
scissoring =
## Scissoring
Scissoring allows you to clip the rendering into a rectangle. This is useful for various
user interface cases like rendering a text edit or a timeline.
images =
## Images
NanoVega allows you to load image files in various formats (if arsd loaders are in place) to be used for rendering.
In addition you can upload your own image.
The parameter imageFlagsList is a list of flags defined in [NVGImageFlag].
If you will use your image as fill pattern, it will be scaled by default. To make it repeat, pass
[NVGImageFlag.RepeatX] and [NVGImageFlag.RepeatY] flags to image creation function respectively.
paints =
## Paints
NanoVega supports four types of paints: linear gradient, box gradient, radial gradient and image pattern.
These can be used as paints for strokes and fills.
gpu_affine =
## Render-Time Affine Transformations
It is possible to set affine transformation matrix for GPU. That matrix will
be applied by the shader code. This can be used to quickly translate and rotate
saved paths. Call this $(B only) between [beginFrame] and [endFrame].
Note that [beginFrame] resets this matrix to identity one.
$(WARNING Don't use this for scaling or skewing, or your image will be heavily distorted!)
paths =
## Paths
Drawing a new shape starts with [beginPath], it clears all the currently defined paths.
Then you define one or more paths and sub-paths which describe the shape. The are functions
to draw common shapes like rectangles and circles, and lower level step-by-step functions,
which allow to define a path curve by curve.
NanoVega uses even-odd fill rule to draw the shapes. Solid shapes should have counter clockwise
winding and holes should have counter clockwise order. To specify winding of a path you can
call [pathWinding]. This is useful especially for the common shapes, which are drawn CCW.
Finally you can fill the path using current fill style by calling [fill], and stroke it
with current stroke style by calling [stroke].
The curve segments and sub-paths are transformed by the current transform.
picking_api =
## Picking API
This is picking API that works directly on paths, without rasterizing them first.
[beginFrame] resets picking state. Then you can create paths as usual, but
there is a possibility to perform hit checks $(B before) rasterizing a path.
Call either id assigning functions ([currFillHitId]/[currStrokeHitId]), or
immediate hit test functions ([hitTestCurrFill]/[hitTestCurrStroke])
before rasterizing (i.e. calling [fill] or [stroke]) to perform hover
effects, for example.
Also note that picking API is ignoring GPU affine transformation matrix.
You can "untransform" picking coordinates before checking with [gpuUntransformPoint].
$(WARNING Picking API completely ignores clipping. If you want to check for
clip regions, you have to manually register them as fill/stroke paths,
and perform the necessary logic. See [hitTestForId] function.)
clipping =
## Clipping with paths
If scissoring is not enough for you, you can clip rendering with arbitrary path,
or with combination of paths. Clip region is saved by [save] and restored by
[restore] NanoVega functions. You can combine clip paths with various logic
operations, see [NVGClipMode].
Note that both [clip] and [clipStroke] are ignoring scissoring (i.e. clip mask
is created as if there was no scissor set). Actual rendering is affected by
scissors, though.
text_api =
## Text
NanoVega allows you to load .ttf files and use the font to render text.
You have to load some font, and set proper font size before doing anything
with text, as there is no "default" font provided by NanoVega. Also, don't
forget to check return value of `createFont()`, 'cause NanoVega won't fail
if it cannot load font, it will silently try to render nothing.
The appearance of the text can be defined by setting the current text style
and by specifying the fill color. Common text and font settings such as
font size, letter spacing and text align are supported. Font blur allows you
to create simple text effects such as drop shadows.
At render time the font face can be set based on the font handles or name.
Font measure functions return values in local space, the calculations are
carried in the same resolution as the final rendering. This is done because
the text glyph positions are snapped to the nearest pixels sharp rendering.
The local space means that values are not rotated or scale as per the current
transformation. For example if you set font size to 12, which would mean that
line height is 16, then regardless of the current scaling and rotation, the
returned line height is always 16. Some measures may vary because of the scaling
since aforementioned pixel snapping.
While this may sound a little odd, the setup allows you to always render the
same way regardless of scaling. I.e. following works regardless of scaling:
----------------------
string txt = "Text me up.";
vg.textBounds(x, y, txt, bounds);
vg.beginPath();
vg.roundedRect(bounds[0], bounds[1], bounds[2]-bounds[0], bounds[3]-bounds[1], 6);
vg.fill();
----------------------
Note: currently only solid color fill is supported for text.
font_stash =
## Low-Level Font Engine (FontStash)
FontStash is used to load fonts, to manage font atlases, and to get various text metrics.
You don't need any graphics context to use FontStash, so you can do things like text
layouting outside of your rendering code. Loaded fonts are refcounted, so it is cheap
to create new FontStash, copy fonts from NanoVega context into it, and use that new
FontStash to do some UI layouting, for example. Also note that you can get text metrics
without creating glyph bitmaps (by using [FONSTextBoundsIterator], for example); this way
you don't need to waste CPU and memory resources to render unneeded images into font atlas,
and you can layout alot of text very fast.
Note that "FontStash" is abbrevated as "FONS". So when you see some API that contains
word "fons" in it, this is not a typo, and it should not read "font" intead.
TODO for Ketmar: write some nice example code here, and finish documenting FontStash API.
*/
module arsd.nanovega;
private:
version(aliced) {
import iv.meta;
import iv.vfs;
} else {
private alias usize = size_t;
// i fear phobos!
private template Unqual(T) {
static if (is(T U == immutable U)) alias Unqual = U;
else static if (is(T U == shared inout const U)) alias Unqual = U;
else static if (is(T U == shared inout U)) alias Unqual = U;
else static if (is(T U == shared const U)) alias Unqual = U;
else static if (is(T U == shared U)) alias Unqual = U;
else static if (is(T U == inout const U)) alias Unqual = U;
else static if (is(T U == inout U)) alias Unqual = U;
else static if (is(T U == const U)) alias Unqual = U;
else alias Unqual = T;
}
private template isAnyCharType(T, bool unqual=false) {
static if (unqual) private alias UT = Unqual!T; else private alias UT = T;
enum isAnyCharType = is(UT == char) || is(UT == wchar) || is(UT == dchar);
}
private template isWideCharType(T, bool unqual=false) {
static if (unqual) private alias UT = Unqual!T; else private alias UT = T;
enum isWideCharType = is(UT == wchar) || is(UT == dchar);
}
}
version(nanovg_disable_vfs) {
enum NanoVegaHasIVVFS = false;
} else {
static if (is(typeof((){import iv.vfs;}))) {
enum NanoVegaHasIVVFS = true;
import iv.vfs;
} else {
enum NanoVegaHasIVVFS = false;
}
}
// ////////////////////////////////////////////////////////////////////////// //
// engine
// ////////////////////////////////////////////////////////////////////////// //
import core.stdc.stdlib : malloc, realloc, free;
import core.stdc.string : memset, memcpy, strlen;
import std.math : PI;
//version = nanovg_force_stb_ttf;
version(Posix) {
version = nanovg_use_freetype;
} else {
version = nanovg_disable_fontconfig;
}
version(aliced) {
version = nanovg_default_no_font_aa;
version = nanovg_builtin_fontconfig_bindings;
version = nanovg_builtin_freetype_bindings;
version = nanovg_builtin_opengl_bindings; // use `arsd.simpledisplay` to get basic bindings
} else {
version = nanovg_builtin_fontconfig_bindings;
version = nanovg_builtin_freetype_bindings;
version = nanovg_builtin_opengl_bindings; // use `arsd.simpledisplay` to get basic bindings
}
version(nanovg_disable_fontconfig) {
public enum NanoVegaHasFontConfig = false;
} else {
public enum NanoVegaHasFontConfig = true;
version(nanovg_builtin_fontconfig_bindings) {} else import iv.fontconfig;
}
//version = nanovg_bench_flatten;
/++
Annotation to indicate the marked function is compatible with [arsd.script].
Any function that takes a [Color] argument will be passed a string instead.
Scriptable Functions
====================
$(UDA_USES)
$(ALWAYS_DOCUMENT)
+/
private enum scriptable = "arsd_jsvar_compatible";
public:
alias NVG_PI = PI;
enum NanoVegaHasArsdColor = (is(typeof((){ import arsd.color; })));
enum NanoVegaHasArsdImage = (is(typeof((){ import arsd.color; import arsd.image; })));
static if (NanoVegaHasArsdColor) private import arsd.color;
static if (NanoVegaHasArsdImage) {
private import arsd.image;
} else {
void stbi_set_unpremultiply_on_load (int flag_true_if_should_unpremultiply) {}
void stbi_convert_iphone_png_to_rgb (int flag_true_if_should_convert) {}
ubyte* stbi_load (const(char)* filename, int* x, int* y, int* comp, int req_comp) { return null; }
ubyte* stbi_load_from_memory (const(void)* buffer, int len, int* x, int* y, int* comp, int req_comp) { return null; }
void stbi_image_free (void* retval_from_stbi_load) {}
}
version(nanovg_default_no_font_aa) {
__gshared bool NVG_INVERT_FONT_AA = false;
} else {
__gshared bool NVG_INVERT_FONT_AA = true;
}
/// this is branchless for ints on x86, and even for longs on x86_64
public ubyte nvgClampToByte(T) (T n) pure nothrow @safe @nogc if (__traits(isIntegral, T)) {
static if (__VERSION__ > 2067) pragma(inline, true);
static if (T.sizeof == 2 || T.sizeof == 4) {
static if (__traits(isUnsigned, T)) {
return cast(ubyte)(n&0xff|(255-((-cast(int)(n < 256))>>24)));
} else {
n &= -cast(int)(n >= 0);
return cast(ubyte)(n|((255-cast(int)n)>>31));
}
} else static if (T.sizeof == 1) {
static assert(__traits(isUnsigned, T), "clampToByte: signed byte? no, really?");
return cast(ubyte)n;
} else static if (T.sizeof == 8) {
static if (__traits(isUnsigned, T)) {
return cast(ubyte)(n&0xff|(255-((-cast(long)(n < 256))>>56)));
} else {
n &= -cast(long)(n >= 0);
return cast(ubyte)(n|((255-cast(long)n)>>63));
}
} else {
static assert(false, "clampToByte: integer too big");
}
}
/// NanoVega RGBA color
/// Group: color_utils
public align(1) struct NVGColor {
align(1):
public:
float[4] rgba = 0; /// default color is transparent (a=1 is opaque)
public:
@property string toString () const @safe { import std.string : format; return "NVGColor(%s,%s,%s,%s)".format(r, g, b, a); }
public:
enum transparent = NVGColor(0.0f, 0.0f, 0.0f, 0.0f);
enum k8orange = NVGColor(1.0f, 0.5f, 0.0f, 1.0f);
enum aliceblue = NVGColor(240, 248, 255);
enum antiquewhite = NVGColor(250, 235, 215);
enum aqua = NVGColor(0, 255, 255);
enum aquamarine = NVGColor(127, 255, 212);
enum azure = NVGColor(240, 255, 255);
enum beige = NVGColor(245, 245, 220);
enum bisque = NVGColor(255, 228, 196);
enum black = NVGColor(0, 0, 0); // basic color
enum blanchedalmond = NVGColor(255, 235, 205);
enum blue = NVGColor(0, 0, 255); // basic color
enum blueviolet = NVGColor(138, 43, 226);
enum brown = NVGColor(165, 42, 42);
enum burlywood = NVGColor(222, 184, 135);
enum cadetblue = NVGColor(95, 158, 160);
enum chartreuse = NVGColor(127, 255, 0);
enum chocolate = NVGColor(210, 105, 30);
enum coral = NVGColor(255, 127, 80);
enum cornflowerblue = NVGColor(100, 149, 237);
enum cornsilk = NVGColor(255, 248, 220);
enum crimson = NVGColor(220, 20, 60);
enum cyan = NVGColor(0, 255, 255); // basic color
enum darkblue = NVGColor(0, 0, 139);
enum darkcyan = NVGColor(0, 139, 139);
enum darkgoldenrod = NVGColor(184, 134, 11);
enum darkgray = NVGColor(169, 169, 169);
enum darkgreen = NVGColor(0, 100, 0);
enum darkgrey = NVGColor(169, 169, 169);
enum darkkhaki = NVGColor(189, 183, 107);
enum darkmagenta = NVGColor(139, 0, 139);
enum darkolivegreen = NVGColor(85, 107, 47);
enum darkorange = NVGColor(255, 140, 0);
enum darkorchid = NVGColor(153, 50, 204);
enum darkred = NVGColor(139, 0, 0);
enum darksalmon = NVGColor(233, 150, 122);
enum darkseagreen = NVGColor(143, 188, 143);
enum darkslateblue = NVGColor(72, 61, 139);
enum darkslategray = NVGColor(47, 79, 79);
enum darkslategrey = NVGColor(47, 79, 79);
enum darkturquoise = NVGColor(0, 206, 209);
enum darkviolet = NVGColor(148, 0, 211);
enum deeppink = NVGColor(255, 20, 147);
enum deepskyblue = NVGColor(0, 191, 255);
enum dimgray = NVGColor(105, 105, 105);
enum dimgrey = NVGColor(105, 105, 105);
enum dodgerblue = NVGColor(30, 144, 255);
enum firebrick = NVGColor(178, 34, 34);
enum floralwhite = NVGColor(255, 250, 240);
enum forestgreen = NVGColor(34, 139, 34);
enum fuchsia = NVGColor(255, 0, 255);
enum gainsboro = NVGColor(220, 220, 220);
enum ghostwhite = NVGColor(248, 248, 255);
enum gold = NVGColor(255, 215, 0);
enum goldenrod = NVGColor(218, 165, 32);
enum gray = NVGColor(128, 128, 128); // basic color
enum green = NVGColor(0, 128, 0); // basic color
enum greenyellow = NVGColor(173, 255, 47);
enum grey = NVGColor(128, 128, 128); // basic color
enum honeydew = NVGColor(240, 255, 240);
enum hotpink = NVGColor(255, 105, 180);
enum indianred = NVGColor(205, 92, 92);
enum indigo = NVGColor(75, 0, 130);
enum ivory = NVGColor(255, 255, 240);
enum khaki = NVGColor(240, 230, 140);
enum lavender = NVGColor(230, 230, 250);
enum lavenderblush = NVGColor(255, 240, 245);
enum lawngreen = NVGColor(124, 252, 0);
enum lemonchiffon = NVGColor(255, 250, 205);
enum lightblue = NVGColor(173, 216, 230);
enum lightcoral = NVGColor(240, 128, 128);
enum lightcyan = NVGColor(224, 255, 255);
enum lightgoldenrodyellow = NVGColor(250, 250, 210);
enum lightgray = NVGColor(211, 211, 211);
enum lightgreen = NVGColor(144, 238, 144);
enum lightgrey = NVGColor(211, 211, 211);
enum lightpink = NVGColor(255, 182, 193);
enum lightsalmon = NVGColor(255, 160, 122);
enum lightseagreen = NVGColor(32, 178, 170);
enum lightskyblue = NVGColor(135, 206, 250);
enum lightslategray = NVGColor(119, 136, 153);
enum lightslategrey = NVGColor(119, 136, 153);
enum lightsteelblue = NVGColor(176, 196, 222);
enum lightyellow = NVGColor(255, 255, 224);
enum lime = NVGColor(0, 255, 0);
enum limegreen = NVGColor(50, 205, 50);
enum linen = NVGColor(250, 240, 230);
enum magenta = NVGColor(255, 0, 255); // basic color
enum maroon = NVGColor(128, 0, 0);
enum mediumaquamarine = NVGColor(102, 205, 170);
enum mediumblue = NVGColor(0, 0, 205);
enum mediumorchid = NVGColor(186, 85, 211);
enum mediumpurple = NVGColor(147, 112, 219);
enum mediumseagreen = NVGColor(60, 179, 113);
enum mediumslateblue = NVGColor(123, 104, 238);
enum mediumspringgreen = NVGColor(0, 250, 154);
enum mediumturquoise = NVGColor(72, 209, 204);
enum mediumvioletred = NVGColor(199, 21, 133);
enum midnightblue = NVGColor(25, 25, 112);
enum mintcream = NVGColor(245, 255, 250);
enum mistyrose = NVGColor(255, 228, 225);
enum moccasin = NVGColor(255, 228, 181);
enum navajowhite = NVGColor(255, 222, 173);
enum navy = NVGColor(0, 0, 128);
enum oldlace = NVGColor(253, 245, 230);
enum olive = NVGColor(128, 128, 0);
enum olivedrab = NVGColor(107, 142, 35);
enum orange = NVGColor(255, 165, 0);
enum orangered = NVGColor(255, 69, 0);
enum orchid = NVGColor(218, 112, 214);
enum palegoldenrod = NVGColor(238, 232, 170);
enum palegreen = NVGColor(152, 251, 152);
enum paleturquoise = NVGColor(175, 238, 238);
enum palevioletred = NVGColor(219, 112, 147);
enum papayawhip = NVGColor(255, 239, 213);
enum peachpuff = NVGColor(255, 218, 185);
enum peru = NVGColor(205, 133, 63);
enum pink = NVGColor(255, 192, 203);
enum plum = NVGColor(221, 160, 221);
enum powderblue = NVGColor(176, 224, 230);
enum purple = NVGColor(128, 0, 128);
enum red = NVGColor(255, 0, 0); // basic color
enum rosybrown = NVGColor(188, 143, 143);
enum royalblue = NVGColor(65, 105, 225);
enum saddlebrown = NVGColor(139, 69, 19);
enum salmon = NVGColor(250, 128, 114);
enum sandybrown = NVGColor(244, 164, 96);
enum seagreen = NVGColor(46, 139, 87);
enum seashell = NVGColor(255, 245, 238);
enum sienna = NVGColor(160, 82, 45);
enum silver = NVGColor(192, 192, 192);
enum skyblue = NVGColor(135, 206, 235);
enum slateblue = NVGColor(106, 90, 205);
enum slategray = NVGColor(112, 128, 144);
enum slategrey = NVGColor(112, 128, 144);
enum snow = NVGColor(255, 250, 250);
enum springgreen = NVGColor(0, 255, 127);
enum steelblue = NVGColor(70, 130, 180);
enum tan = NVGColor(210, 180, 140);
enum teal = NVGColor(0, 128, 128);
enum thistle = NVGColor(216, 191, 216);
enum tomato = NVGColor(255, 99, 71);
enum turquoise = NVGColor(64, 224, 208);
enum violet = NVGColor(238, 130, 238);
enum wheat = NVGColor(245, 222, 179);
enum white = NVGColor(255, 255, 255); // basic color
enum whitesmoke = NVGColor(245, 245, 245);
enum yellow = NVGColor(255, 255, 0); // basic color
enum yellowgreen = NVGColor(154, 205, 50);
nothrow @safe @nogc:
public:
///
this (ubyte ar, ubyte ag, ubyte ab, ubyte aa=255) pure {
pragma(inline, true);
r = ar/255.0f;
g = ag/255.0f;
b = ab/255.0f;
a = aa/255.0f;
}
///
this (float ar, float ag, float ab, float aa=1.0f) pure {
pragma(inline, true);
r = ar;
g = ag;
b = ab;
a = aa;
}
/// AABBGGRR (same format as little-endian RGBA image, coincidentally, the same as arsd.color)
this (uint c) pure {
pragma(inline, true);
r = (c&0xff)/255.0f;
g = ((c>>8)&0xff)/255.0f;
b = ((c>>16)&0xff)/255.0f;
a = ((c>>24)&0xff)/255.0f;
}
/// Supports: "#rgb", "#rrggbb", "#argb", "#aarrggbb"
this (const(char)[] srgb) {
static int c2d (char ch) pure nothrow @safe @nogc {
pragma(inline, true);
return
ch >= '0' && ch <= '9' ? ch-'0' :
ch >= 'A' && ch <= 'F' ? ch-'A'+10 :
ch >= 'a' && ch <= 'f' ? ch-'a'+10 :
-1;
}
int[8] digs;
int dc = -1;
foreach (immutable char ch; srgb) {
if (ch <= ' ') continue;
if (ch == '#') {
if (dc != -1) { dc = -1; break; }
dc = 0;
} else {
if (dc >= digs.length) { dc = -1; break; }
if ((digs[dc++] = c2d(ch)) < 0) { dc = -1; break; }
}
}
switch (dc) {
case 3: // rgb
a = 1.0f;
r = digs[0]/15.0f;
g = digs[1]/15.0f;
b = digs[2]/15.0f;
break;
case 4: // argb
a = digs[0]/15.0f;
r = digs[1]/15.0f;
g = digs[2]/15.0f;
b = digs[3]/15.0f;
break;
case 6: // rrggbb
a = 1.0f;
r = (digs[0]*16+digs[1])/255.0f;
g = (digs[2]*16+digs[3])/255.0f;
b = (digs[4]*16+digs[5])/255.0f;
break;
case 8: // aarrggbb
a = (digs[0]*16+digs[1])/255.0f;
r = (digs[2]*16+digs[3])/255.0f;
g = (digs[4]*16+digs[5])/255.0f;
b = (digs[6]*16+digs[7])/255.0f;
break;
default:
break;
}
}
/// Is this color completely opaque?
@property bool isOpaque () const pure nothrow @trusted @nogc { pragma(inline, true); return (rgba.ptr[3] >= 1.0f); }
/// Is this color completely transparent?
@property bool isTransparent () const pure nothrow @trusted @nogc { pragma(inline, true); return (rgba.ptr[3] <= 0.0f); }
/// AABBGGRR (same format as little-endian RGBA image, coincidentally, the same as arsd.color)
@property uint asUint () const pure {
pragma(inline, true);
return
cast(uint)(r*255)|
(cast(uint)(g*255)<<8)|
(cast(uint)(b*255)<<16)|
(cast(uint)(a*255)<<24);
}
alias asUintABGR = asUint; /// Ditto.
/// AABBGGRR (same format as little-endian RGBA image, coincidentally, the same as arsd.color)
static NVGColor fromUint (uint c) pure { pragma(inline, true); return NVGColor(c); }
alias fromUintABGR = fromUint; /// Ditto.
/// AARRGGBB
@property uint asUintARGB () const pure {
pragma(inline, true);
return
cast(uint)(b*255)|
(cast(uint)(g*255)<<8)|
(cast(uint)(r*255)<<16)|
(cast(uint)(a*255)<<24);
}
/// AARRGGBB
static NVGColor fromUintARGB (uint c) pure { pragma(inline, true); return NVGColor((c>>16)&0xff, (c>>8)&0xff, c&0xff, (c>>24)&0xff); }
@property ref inout(float) r () inout pure @trusted { pragma(inline, true); return rgba.ptr[0]; } ///
@property ref inout(float) g () inout pure @trusted { pragma(inline, true); return rgba.ptr[1]; } ///
@property ref inout(float) b () inout pure @trusted { pragma(inline, true); return rgba.ptr[2]; } ///
@property ref inout(float) a () inout pure @trusted { pragma(inline, true); return rgba.ptr[3]; } ///
ref NVGColor applyTint() (in auto ref NVGColor tint) nothrow @trusted @nogc {
if (tint.a == 0) return this;
foreach (immutable idx, ref float v; rgba[0..4]) {
v = nvg__clamp(v*tint.rgba.ptr[idx], 0.0f, 1.0f);
}
return this;
}
NVGHSL asHSL() (bool useWeightedLightness=false) const { pragma(inline, true); return NVGHSL.fromColor(this, useWeightedLightness); } ///
static fromHSL() (in auto ref NVGHSL hsl) { pragma(inline, true); return hsl.asColor; } ///
static if (NanoVegaHasArsdColor) {
Color toArsd () const { pragma(inline, true); return Color(cast(int)(r*255), cast(int)(g*255), cast(int)(b*255), cast(int)(a*255)); } ///
static NVGColor fromArsd (in Color c) { pragma(inline, true); return NVGColor(c.r, c.g, c.b, c.a); } ///
///
this (in Color c) {
version(aliced) pragma(inline, true);
r = c.r/255.0f;
g = c.g/255.0f;
b = c.b/255.0f;
a = c.a/255.0f;
}
}
}
/// NanoVega A-HSL color
/// Group: color_utils
public align(1) struct NVGHSL {
align(1):
float h=0, s=0, l=1, a=1; ///
string toString () const { import std.format : format; return (a != 1 ? "HSL(%s,%s,%s,%d)".format(h, s, l, a) : "HSL(%s,%s,%s)".format(h, s, l)); }
nothrow @safe @nogc:
public:
///
this (float ah, float as, float al, float aa=1) pure { pragma(inline, true); h = ah; s = as; l = al; a = aa; }
NVGColor asColor () const { pragma(inline, true); return nvgHSLA(h, s, l, a); } ///
// taken from Adam's arsd.color
/** Converts an RGB color into an HSL triplet.
* [useWeightedLightness] will try to get a better value for luminosity for the human eye,
* which is more sensitive to green than red and more to red than blue.
* If it is false, it just does average of the rgb. */
static NVGHSL fromColor() (in auto ref NVGColor c, bool useWeightedLightness=false) pure {
NVGHSL res;
res.a = c.a;
float r1 = c.r;
float g1 = c.g;
float b1 = c.b;
float maxColor = r1;
if (g1 > maxColor) maxColor = g1;
if (b1 > maxColor) maxColor = b1;
float minColor = r1;
if (g1 < minColor) minColor = g1;
if (b1 < minColor) minColor = b1;
res.l = (maxColor+minColor)/2;
if (useWeightedLightness) {
// the colors don't affect the eye equally
// this is a little more accurate than plain HSL numbers
res.l = 0.2126*r1+0.7152*g1+0.0722*b1;
}
if (maxColor != minColor) {
if (res.l < 0.5) {
res.s = (maxColor-minColor)/(maxColor+minColor);
} else {
res.s = (maxColor-minColor)/(2.0-maxColor-minColor);
}
if (r1 == maxColor) {
res.h = (g1-b1)/(maxColor-minColor);
} else if(g1 == maxColor) {
res.h = 2.0+(b1-r1)/(maxColor-minColor);
} else {
res.h = 4.0+(r1-g1)/(maxColor-minColor);
}
}
res.h = res.h*60;
if (res.h < 0) res.h += 360;
res.h /= 360;
return res;
}
}
//version = nanovega_debug_image_manager;
//version = nanovega_debug_image_manager_rc;
/** NanoVega image handle.
*
* This is refcounted struct, so you don't need to do anything special to free it once it is allocated.
*
* Group: images
*/
struct NVGImage {
enum isOpaqueStruct = true;
private:
NVGContext ctx;
int id; // backend image id
public:
///
this() (in auto ref NVGImage src) nothrow @trusted @nogc {
version(nanovega_debug_image_manager_rc) { import core.stdc.stdio; if (src.id != 0) printf("NVGImage %p created from %p (imgid=%d)\n", &this, src, src.id); }
if (src.id > 0 && src.ctx !is null) {
ctx = cast(NVGContext)src.ctx;
id = src.id;
ctx.nvg__imageIncRef(id);
}
}
///
~this () nothrow @trusted @nogc { version(aliced) pragma(inline, true); clear(); }
///
this (this) nothrow @trusted @nogc {
version(aliced) pragma(inline, true);
if (id > 0 && ctx !is null) {
version(nanovega_debug_image_manager_rc) { import core.stdc.stdio; printf("NVGImage %p postblit (imgid=%d)\n", &this, id); }
ctx.nvg__imageIncRef(id);
}
}
///
void opAssign() (in auto ref NVGImage src) nothrow @trusted @nogc {
if (src.id <= 0 || src.ctx is null) {
clear();
} else {
version(nanovega_debug_image_manager_rc) { import core.stdc.stdio; printf("NVGImage %p (imgid=%d) assigned from %p (imgid=%d)\n", &this, id, &src, src.id); }
if (src.id > 0 && src.ctx !is null) (cast(NVGContext)src.ctx).nvg__imageIncRef(src.id);
if (id > 0 && ctx !is null) ctx.nvg__imageDecRef(id);
ctx = cast(NVGContext)src.ctx;
id = src.id;
}
}
/// Free this image.
void clear () nothrow @trusted @nogc {
if (id > 0 && ctx !is null) {
version(nanovega_debug_image_manager_rc) { import core.stdc.stdio; printf("NVGImage %p cleared (imgid=%d)\n", &this, id); }
ctx.nvg__imageDecRef(id);
}
id = 0;
ctx = null;
}
/// Is this image valid?
@property bool valid () const pure nothrow @safe @nogc { pragma(inline, true); return (id > 0 && ctx.valid); }
/// Is the given image valid and comes from the same context?
@property bool isSameContext (const(NVGContext) actx) const pure nothrow @safe @nogc { pragma(inline, true); return (actx !is null && ctx is actx); }
/// Returns image width, or zero for invalid image.
int width () const nothrow @trusted @nogc {
int w = 0;
if (valid) {
int h = void;
ctx.params.renderGetTextureSize(cast(void*)ctx.params.userPtr, id, &w, &h);
}
return w;
}
/// Returns image height, or zero for invalid image.
int height () const nothrow @trusted @nogc {
int h = 0;
if (valid) {
int w = void;
ctx.params.renderGetTextureSize(cast(void*)ctx.params.userPtr, id, &w, &h);
}
return h;
}
}
/// Paint parameters for various fills. Don't change anything here!
/// Group: render_styles
public struct NVGPaint {
enum isOpaqueStruct = true;
NVGMatrix xform;
float[2] extent = 0.0f;
float radius = 0.0f;
float feather = 0.0f;
NVGColor innerColor; /// this can be used to modulate images (fill/font)
NVGColor middleColor;
NVGColor outerColor;
float midp = -1; // middle stop for 3-color gradient
NVGImage image;
bool simpleColor; /// if `true`, only innerColor is used, and this is solid-color paint
this() (in auto ref NVGPaint p) nothrow @trusted @nogc {
xform = p.xform;
extent[] = p.extent[];
radius = p.radius;
feather = p.feather;
innerColor = p.innerColor;
middleColor = p.middleColor;
midp = p.midp;
outerColor = p.outerColor;
image = p.image;
simpleColor = p.simpleColor;
}
void opAssign() (in auto ref NVGPaint p) nothrow @trusted @nogc {
xform = p.xform;
extent[] = p.extent[];
radius = p.radius;
feather = p.feather;
innerColor = p.innerColor;
middleColor = p.middleColor;
midp = p.midp;
outerColor = p.outerColor;
image = p.image;
simpleColor = p.simpleColor;
}
void clear () nothrow @trusted @nogc {
version(aliced) pragma(inline, true);
import core.stdc.string : memset;
image.clear();
memset(&this, 0, this.sizeof);
simpleColor = true;
}
}
/// Path winding.
/// Group: paths
public enum NVGWinding {
CCW = 1, /// Winding for solid shapes
CW = 2, /// Winding for holes
}
/// Path solidity.
/// Group: paths
public enum NVGSolidity {
Solid = 1, /// Solid shape (CCW winding).
Hole = 2, /// Hole (CW winding).
}
/// Line cap style.
/// Group: render_styles
public enum NVGLineCap {
Butt, ///
Round, ///
Square, ///
Bevel, ///
Miter, ///
}
/// Text align.
/// Group: text_api
public align(1) struct NVGTextAlign {
align(1):
/// Horizontal align.
enum H : ubyte {
Left = 0, /// Default, align text horizontally to left.
Center = 1, /// Align text horizontally to center.
Right = 2, /// Align text horizontally to right.
}
/// Vertical align.
enum V : ubyte {
Baseline = 0, /// Default, align text vertically to baseline.
Top = 1, /// Align text vertically to top.
Middle = 2, /// Align text vertically to middle.
Bottom = 3, /// Align text vertically to bottom.
}
pure nothrow @safe @nogc:
public:
this (H h) { pragma(inline, true); value = h; } ///
this (V v) { pragma(inline, true); value = cast(ubyte)(v<<4); } ///
this (H h, V v) { pragma(inline, true); value = cast(ubyte)(h|(v<<4)); } ///
this (V v, H h) { pragma(inline, true); value = cast(ubyte)(h|(v<<4)); } ///
void reset () { pragma(inline, true); value = 0; } ///
void reset (H h, V v) { pragma(inline, true); value = cast(ubyte)(h|(v<<4)); } ///
void reset (V v, H h) { pragma(inline, true); value = cast(ubyte)(h|(v<<4)); } ///
@property:
bool left () const { pragma(inline, true); return ((value&0x0f) == H.Left); } ///
void left (bool v) { pragma(inline, true); value = cast(ubyte)((value&0xf0)|(v ? H.Left : 0)); } ///
bool center () const { pragma(inline, true); return ((value&0x0f) == H.Center); } ///
void center (bool v) { pragma(inline, true); value = cast(ubyte)((value&0xf0)|(v ? H.Center : 0)); } ///
bool right () const { pragma(inline, true); return ((value&0x0f) == H.Right); } ///
void right (bool v) { pragma(inline, true); value = cast(ubyte)((value&0xf0)|(v ? H.Right : 0)); } ///
//
bool baseline () const { pragma(inline, true); return (((value>>4)&0x0f) == V.Baseline); } ///
void baseline (bool v) { pragma(inline, true); value = cast(ubyte)((value&0x0f)|(v ? V.Baseline<<4 : 0)); } ///
bool top () const { pragma(inline, true); return (((value>>4)&0x0f) == V.Top); } ///
void top (bool v) { pragma(inline, true); value = cast(ubyte)((value&0x0f)|(v ? V.Top<<4 : 0)); } ///
bool middle () const { pragma(inline, true); return (((value>>4)&0x0f) == V.Middle); } ///
void middle (bool v) { pragma(inline, true); value = cast(ubyte)((value&0x0f)|(v ? V.Middle<<4 : 0)); } ///
bool bottom () const { pragma(inline, true); return (((value>>4)&0x0f) == V.Bottom); } ///
void bottom (bool v) { pragma(inline, true); value = cast(ubyte)((value&0x0f)|(v ? V.Bottom<<4 : 0)); } ///
//
H horizontal () const { pragma(inline, true); return cast(H)(value&0x0f); } ///
void horizontal (H v) { pragma(inline, true); value = (value&0xf0)|v; } ///
//
V vertical () const { pragma(inline, true); return cast(V)((value>>4)&0x0f); } ///
void vertical (V v) { pragma(inline, true); value = (value&0x0f)|cast(ubyte)(v<<4); } ///
//
private:
ubyte value = 0; // low nibble: horizontal; high nibble: vertical
}
/// Blending type.
/// Group: composite_operation
public enum NVGBlendFactor {
Zero = 1<<0, ///
One = 1<<1, ///
SrcColor = 1<<2, ///
OneMinusSrcColor = 1<<3, ///
DstColor = 1<<4, ///
OneMinusDstColor = 1<<5, ///
SrcAlpha = 1<<6, ///
OneMinusSrcAlpha = 1<<7, ///
DstAlpha = 1<<8, ///
OneMinusDstAlpha = 1<<9, ///
SrcAlphaSaturate = 1<<10, ///
}
/// Composite operation (HTML5-alike).
/// Group: composite_operation
public enum NVGCompositeOperation {
SourceOver, ///
SourceIn, ///
SourceOut, ///
SourceAtop, ///
DestinationOver, ///
DestinationIn, ///
DestinationOut, ///
DestinationAtop, ///
Lighter, ///
Copy, ///
Xor, ///
}
/// Composite operation state.
/// Group: composite_operation
public struct NVGCompositeOperationState {
bool simple; /// `true`: use `glBlendFunc()` instead of `glBlendFuncSeparate()`
NVGBlendFactor srcRGB; ///
NVGBlendFactor dstRGB; ///
NVGBlendFactor srcAlpha; ///
NVGBlendFactor dstAlpha; ///
}
/// Mask combining more
/// Group: clipping
public enum NVGClipMode {
None, /// normal rendering (i.e. render path instead of modifying clip region)
Union, /// old mask will be masked with the current one; this is the default mode for [clip]
Or, /// new mask will be added to the current one (logical `OR` operation);
Xor, /// new mask will be logically `XOR`ed with the current one
Sub, /// "subtract" current path from mask
Replace, /// replace current mask
Add = Or, /// Synonym
}
/// Glyph position info.
/// Group: text_api
public struct NVGGlyphPosition {
usize strpos; /// Position of the glyph in the input string.
float x; /// The x-coordinate of the logical glyph position.
float minx, maxx; /// The bounds of the glyph shape.
}
/// Text row storage.
/// Group: text_api
public struct NVGTextRow(CT) if (isAnyCharType!CT) {
alias CharType = CT;
const(CT)[] s;
int start; /// Index in the input text where the row starts.
int end; /// Index in the input text where the row ends (one past the last character).
float width; /// Logical width of the row.
float minx, maxx; /// Actual bounds of the row. Logical with and bounds can differ because of kerning and some parts over extending.
/// Get rest of the string.
@property const(CT)[] rest () const pure nothrow @trusted @nogc { pragma(inline, true); return (end <= s.length ? s[end..$] : null); }
/// Get current row.
@property const(CT)[] row () const pure nothrow @trusted @nogc { pragma(inline, true); return s[start..end]; }
@property const(CT)[] string () const pure nothrow @trusted @nogc { pragma(inline, true); return s; }
@property void string(CT) (const(CT)[] v) pure nothrow @trusted @nogc { pragma(inline, true); s = v; }
}
/// Image creation flags.
/// Group: images
public enum NVGImageFlag : uint {
None = 0, /// Nothing special.
GenerateMipmaps = 1<<0, /// Generate mipmaps during creation of the image.
RepeatX = 1<<1, /// Repeat image in X direction.
RepeatY = 1<<2, /// Repeat image in Y direction.
FlipY = 1<<3, /// Flips (inverses) image in Y direction when rendered.
Premultiplied = 1<<4, /// Image data has premultiplied alpha.
ClampToBorderX = 1<<5, /// Clamp image to border (instead of clamping to edge by default)
ClampToBorderY = 1<<6, /// Clamp image to border (instead of clamping to edge by default)
NoFiltering = 1<<8, /// use GL_NEAREST instead of GL_LINEAR
Nearest = NoFiltering, /// compatibility with original NanoVG
NoDelete = 1<<16,/// Do not delete GL texture handle.
}
alias NVGImageFlags = NVGImageFlag; /// Backwards compatibility for [NVGImageFlag].
// ////////////////////////////////////////////////////////////////////////// //
private:
static T* xdup(T) (const(T)* ptr, int count) nothrow @trusted @nogc {
import core.stdc.stdlib : malloc;
import core.stdc.string : memcpy;
if (count == 0) return null;
T* res = cast(T*)malloc(T.sizeof*count);
if (res is null) assert(0, "NanoVega: out of memory");
memcpy(res, ptr, T.sizeof*count);
return res;
}
// Internal Render API
enum NVGtexture {
Alpha = 0x01,
RGBA = 0x02,
}
struct NVGscissor {
NVGMatrix xform;
float[2] extent = -1.0f;
}
/// General NanoVega vertex struct. Contains geometry coordinates, and (sometimes unused) texture coordinates.
public struct NVGVertex {
float x, y, u, v;
}
struct NVGpath {
int first;
int count;
bool closed;
int nbevel;
NVGVertex* fill;
int nfill;
NVGVertex* stroke;
int nstroke;
NVGWinding mWinding;
bool convex;
bool cloned;
@disable this (this); // no copies
void opAssign() (in auto ref NVGpath a) { static assert(0, "no copies!"); }
void clear () nothrow @trusted @nogc {
import core.stdc.stdlib : free;
import core.stdc.string : memset;
if (cloned) {
if (stroke !is null && stroke !is fill) free(stroke);
if (fill !is null) free(fill);
}
memset(&this, 0, this.sizeof);
}
// won't clear current path
void copyFrom (const NVGpath* src) nothrow @trusted @nogc {
import core.stdc.string : memcpy;
assert(src !is null);
memcpy(&this, src, NVGpath.sizeof);
this.fill = xdup(src.fill, src.nfill);
if (src.stroke is src.fill) {
this.stroke = this.fill;
} else {
this.stroke = xdup(src.stroke, src.nstroke);
}
this.cloned = true;
}
public @property const(NVGVertex)[] fillVertices () const pure nothrow @trusted @nogc {
pragma(inline, true);
return (nfill > 0 ? fill[0..nfill] : null);
}
public @property const(NVGVertex)[] strokeVertices () const pure nothrow @trusted @nogc {
pragma(inline, true);
return (nstroke > 0 ? stroke[0..nstroke] : null);
}
public @property NVGWinding winding () const pure nothrow @trusted @nogc { pragma(inline, true); return mWinding; }
public @property bool complex () const pure nothrow @trusted @nogc { pragma(inline, true); return !convex; }
}
struct NVGparams {
void* userPtr;
bool edgeAntiAlias;
bool fontAA;
bool function (void* uptr) nothrow @trusted @nogc renderCreate;
int function (void* uptr, NVGtexture type, int w, int h, int imageFlags, const(ubyte)* data) nothrow @trusted @nogc renderCreateTexture;
bool function (void* uptr, int image) nothrow @trusted @nogc renderTextureIncRef;
bool function (void* uptr, int image) nothrow @trusted @nogc renderDeleteTexture; // this basically does decref; also, it should be thread-safe, and postpone real deletion to next `renderViewport()` call
bool function (void* uptr, int image, int x, int y, int w, int h, const(ubyte)* data) nothrow @trusted @nogc renderUpdateTexture;
bool function (void* uptr, int image, int* w, int* h) nothrow @trusted @nogc renderGetTextureSize;
void function (void* uptr, int width, int height) nothrow @trusted @nogc renderViewport; // called in [beginFrame]
void function (void* uptr) nothrow @trusted @nogc renderCancel;
void function (void* uptr) nothrow @trusted @nogc renderFlush;
void function (void* uptr) nothrow @trusted @nogc renderPushClip; // backend should support stack of at least [NVG_MAX_STATES] elements
void function (void* uptr) nothrow @trusted @nogc renderPopClip; // backend should support stack of at least [NVG_MAX_STATES] elements
void function (void* uptr) nothrow @trusted @nogc renderResetClip; // reset current clip region to `non-clipped`
void function (void* uptr, NVGCompositeOperationState compositeOperation, NVGClipMode clipmode, NVGPaint* paint, NVGscissor* scissor, float fringe, const(float)* bounds, const(NVGpath)* paths, int npaths, bool evenOdd) nothrow @trusted @nogc renderFill;
void function (void* uptr, NVGCompositeOperationState compositeOperation, NVGClipMode clipmode, NVGPaint* paint, NVGscissor* scissor, float fringe, float strokeWidth, const(NVGpath)* paths, int npaths) nothrow @trusted @nogc renderStroke;
void function (void* uptr, NVGCompositeOperationState compositeOperation, NVGClipMode clipmode, NVGPaint* paint, NVGscissor* scissor, const(NVGVertex)* verts, int nverts) nothrow @trusted @nogc renderTriangles;
void function (void* uptr, in ref NVGMatrix mat) nothrow @trusted @nogc renderSetAffine;
void function (void* uptr) nothrow @trusted @nogc renderDelete;
}
// ////////////////////////////////////////////////////////////////////////// //
private:
enum NVG_INIT_FONTIMAGE_SIZE = 512;
enum NVG_MAX_FONTIMAGE_SIZE = 2048;
enum NVG_MAX_FONTIMAGES = 4;
enum NVG_INIT_COMMANDS_SIZE = 256;
enum NVG_INIT_POINTS_SIZE = 128;
enum NVG_INIT_PATHS_SIZE = 16;
enum NVG_INIT_VERTS_SIZE = 256;
enum NVG_MAX_STATES = 32;
public enum NVG_KAPPA90 = 0.5522847493f; /// Length proportional to radius of a cubic bezier handle for 90deg arcs.
enum NVG_MIN_FEATHER = 0.001f; // it should be greater than zero, 'cause it is used in shader for divisions
enum Command {
MoveTo = 0,
LineTo = 1,
BezierTo = 2,
Close = 3,
Winding = 4,
}
enum PointFlag : int {
Corner = 0x01,
Left = 0x02,
Bevel = 0x04,
InnerBevelPR = 0x08,
}
struct NVGstate {
NVGCompositeOperationState compositeOperation;
bool shapeAntiAlias = true;
NVGPaint fill;
NVGPaint stroke;
float strokeWidth = 1.0f;
float miterLimit = 10.0f;
NVGLineCap lineJoin = NVGLineCap.Miter;
NVGLineCap lineCap = NVGLineCap.Butt;
float alpha = 1.0f;
NVGMatrix xform;
NVGscissor scissor;
float fontSize = 16.0f;
float letterSpacing = 0.0f;
float lineHeight = 1.0f;
float fontBlur = 0.0f;
NVGTextAlign textAlign;
int fontId = 0;
bool evenOddMode = false; // use even-odd filling rule (required for some svgs); otherwise use non-zero fill
// dashing
enum MaxDashes = 32; // max 16 dashes
float[MaxDashes] dashes;
uint dashCount = 0;
uint lastFlattenDashCount = 0;
float dashStart = 0;
float totalDashLen;
bool firstDashIsGap = false;
// dasher state for flattener
bool dasherActive = false;
void clearPaint () nothrow @trusted @nogc {
fill.clear();
stroke.clear();
}
}
struct NVGpoint {
float x, y;
float dx, dy;
float len;
float dmx, dmy;
ubyte flags;
}
struct NVGpathCache {
NVGpoint* points;
int npoints;
int cpoints;
NVGpath* paths;
int npaths;
int cpaths;
NVGVertex* verts;
int nverts;
int cverts;
float[4] bounds;
// this is required for saved paths
bool strokeReady;
bool fillReady;
float strokeAlphaMul;
float strokeWidth;
float fringeWidth;
bool evenOddMode;
NVGClipMode clipmode;
// non-saved path will not have this
float* commands;
int ncommands;
@disable this (this); // no copies
void opAssign() (in auto ref NVGpathCache a) { static assert(0, "no copies!"); }
// won't clear current path
void copyFrom (const NVGpathCache* src) nothrow @trusted @nogc {
import core.stdc.stdlib : malloc;
import core.stdc.string : memcpy, memset;
assert(src !is null);
memcpy(&this, src, NVGpathCache.sizeof);
this.points = xdup(src.points, src.npoints);
this.cpoints = src.npoints;
this.verts = xdup(src.verts, src.nverts);
this.cverts = src.nverts;
this.commands = xdup(src.commands, src.ncommands);
if (src.npaths > 0) {
this.paths = cast(NVGpath*)malloc(src.npaths*NVGpath.sizeof);
memset(this.paths, 0, npaths*NVGpath.sizeof);
foreach (immutable pidx; 0..npaths) this.paths[pidx].copyFrom(&src.paths[pidx]);
this.cpaths = src.npaths;
} else {
this.npaths = this.cpaths = 0;
}
}
void clear () nothrow @trusted @nogc {
import core.stdc.stdlib : free;
import core.stdc.string : memset;
if (paths !is null) {
foreach (ref p; paths[0..npaths]) p.clear();
free(paths);
}
if (points !is null) free(points);
if (verts !is null) free(verts);
if (commands !is null) free(commands);
memset(&this, 0, this.sizeof);
}
}
/// Pointer to opaque NanoVega context structure.
/// Group: context_management
public alias NVGContext = NVGcontextinternal*;
/// FontStash context
/// Group: font_stash
public alias FONSContext = FONScontextInternal*;
/// Returns FontStash context of the given NanoVega context.
/// Group: font_stash
public FONSContext fonsContext (NVGContext ctx) pure nothrow @trusted @nogc { pragma(inline, true); return (ctx !is null && ctx.contextAlive ? ctx.fs : null); }
/// Returns scale that should be applied to FontStash parameters due to matrix transformations on the context (or 1)
/// Group: font_stash
public float fonsScale (NVGContext ctx) /*pure*/ nothrow @trusted @nogc {
pragma(inline, true);
return (ctx !is null && ctx.contextAlive && ctx.nstates > 0 ? nvg__getFontScale(&ctx.states.ptr[ctx.nstates-1])*ctx.devicePxRatio : 1);
}
/// Setup FontStash from the given NanoVega context font parameters. Note that this will apply transformation scale too.
/// Returns `false` if FontStash or NanoVega context is not active.
/// Group: font_stash
public bool setupFonsFrom (FONSContext stash, NVGContext ctx) nothrow @trusted @nogc {
if (stash is null || ctx is null || !ctx.contextAlive || ctx.nstates == 0) return false;
NVGstate* state = nvg__getState(ctx);
immutable float scale = nvg__getFontScale(state)*ctx.devicePxRatio;
stash.size = state.fontSize*scale;
stash.spacing = state.letterSpacing*scale;
stash.blur = state.fontBlur*scale;
stash.textAlign = state.textAlign;
stash.fontId = state.fontId;
return true;
}
/// Setup NanoVega context font parameters from the given FontStash. Note that NanoVega can apply transformation scale later.
/// Returns `false` if FontStash or NanoVega context is not active.
/// Group: font_stash
public bool setupCtxFrom (NVGContext ctx, FONSContext stash) nothrow @trusted @nogc {
if (stash is null || ctx is null || !ctx.contextAlive || ctx.nstates == 0) return false;
NVGstate* state = nvg__getState(ctx);
immutable float scale = nvg__getFontScale(state)*ctx.devicePxRatio;
state.fontSize = stash.size;
state.letterSpacing = stash.spacing;
state.fontBlur = stash.blur;
state.textAlign = stash.textAlign;
state.fontId = stash.fontId;
return true;
}
/** Bezier curve rasterizer.
*
* De Casteljau Bezier rasterizer is faster, but currently rasterizing curves with cusps sligtly wrong.
* It doesn't really matter in practice.
*
* AFD tesselator is somewhat slower, but does cusps better.
*
* McSeem rasterizer should have the best quality, bit it is the slowest method. Basically, you will
* never notice any visial difference (and this code is not really debugged), so you probably should
* not use it. It is there for further experiments.
*/
public enum NVGTesselation {
DeCasteljau, /// default: standard well-known tesselation algorithm
AFD, /// adaptive forward differencing
DeCasteljauMcSeem, /// standard well-known tesselation algorithm, with improvements from Maxim Shemanarev; slowest one, but should give best results
}
/// Default tesselator for Bezier curves.
public __gshared NVGTesselation NVG_DEFAULT_TESSELATOR = NVGTesselation.DeCasteljau;
// some public info
/// valid only inside [beginFrame]/[endFrame]
/// Group: context_management
public int width (NVGContext ctx) pure nothrow @trusted @nogc { pragma(inline, true); return (ctx !is null ? ctx.mWidth : 0); }
/// valid only inside [beginFrame]/[endFrame]
/// Group: context_management
public int height (NVGContext ctx) pure nothrow @trusted @nogc { pragma(inline, true); return (ctx !is null ? ctx.mHeight : 0); }
/// valid only inside [beginFrame]/[endFrame]
/// Group: context_management
public float devicePixelRatio (NVGContext ctx) pure nothrow @trusted @nogc { pragma(inline, true); return (ctx !is null ? ctx.devicePxRatio : float.nan); }
/// Returns `true` if [beginFrame] was called, and neither [endFrame], nor [cancelFrame] were.
/// Group: context_management
public bool inFrame (NVGContext ctx) pure nothrow @trusted @nogc { pragma(inline, true); return (ctx !is null && ctx.contextAlive ? ctx.nstates > 0 : false); }
// path autoregistration
/// [pickid] to stop autoregistration.
/// Group: context_management
public enum NVGNoPick = -1;
/// >=0: this pickid will be assigned to all filled/stroked paths
/// Group: context_management
public int pickid (NVGContext ctx) pure nothrow @trusted @nogc { pragma(inline, true); return (ctx !is null ? ctx.pathPickId : NVGNoPick); }
/// >=0: this pickid will be assigned to all filled/stroked paths
/// Group: context_management
public void pickid (NVGContext ctx, int v) nothrow @trusted @nogc { pragma(inline, true); if (ctx !is null) ctx.pathPickId = v; }
/// pick autoregistration mode; see [NVGPickKind]
/// Group: context_management
public uint pickmode (NVGContext ctx) pure nothrow @trusted @nogc { pragma(inline, true); return (ctx !is null ? ctx.pathPickRegistered&NVGPickKind.All : 0); }
/// pick autoregistration mode; see [NVGPickKind]
/// Group: context_management
public void pickmode (NVGContext ctx, uint v) nothrow @trusted @nogc { pragma(inline, true); if (ctx !is null) ctx.pathPickRegistered = (ctx.pathPickRegistered&0xffff_0000u)|(v&NVGPickKind.All); }
// tesselator options
/// Get current Bezier tesselation mode. See [NVGTesselation].
/// Group: context_management
public NVGTesselation tesselation (NVGContext ctx) pure nothrow @trusted @nogc { pragma(inline, true); return (ctx !is null ? ctx.tesselatortype : NVGTesselation.DeCasteljau); }
/// Set current Bezier tesselation mode. See [NVGTesselation].
/// Group: context_management
public void tesselation (NVGContext ctx, NVGTesselation v) nothrow @trusted @nogc { pragma(inline, true); if (ctx !is null) ctx.tesselatortype = v; }
private struct NVGcontextinternal {
private:
NVGparams params;
float* commands;
int ccommands;
int ncommands;
float commandx, commandy;
NVGstate[NVG_MAX_STATES] states;
int nstates;
NVGpathCache* cache;
public float tessTol;
public float angleTol; // 0.0f -- angle tolerance for McSeem Bezier rasterizer
public float cuspLimit; // 0 -- cusp limit for McSeem Bezier rasterizer (0: real cusps)
float distTol;
public float fringeWidth;
float devicePxRatio;
FONSContext fs;
NVGImage[NVG_MAX_FONTIMAGES] fontImages;
int fontImageIdx;
int drawCallCount;
int fillTriCount;
int strokeTriCount;
int textTriCount;
NVGTesselation tesselatortype;
// picking API
NVGpickScene* pickScene;
int pathPickId; // >=0: register all paths for picking using this id
uint pathPickRegistered; // if [pathPickId] >= 0, this is used to avoid double-registration (see [NVGPickKind]); hi 16 bit is check flags, lo 16 bit is mode
// path recording
NVGPathSet recset;
int recstart; // used to cancel recording
bool recblockdraw;
// internals
NVGMatrix gpuAffine;
int mWidth, mHeight;
// image manager
shared int imageCount; // number of alive images in this context
bool contextAlive; // context can be dead, but still contain some images
@disable this (this); // no copies
void opAssign() (in auto ref NVGcontextinternal a) { static assert(0, "no copies!"); }
// debug feature
public @property int getImageCount () nothrow @trusted @nogc {
import core.atomic;
return atomicLoad(imageCount);
}
}
/** Returns number of tesselated pathes in context.
*
* Tesselated pathes are either triangle strips (for strokes), or
* triangle fans (for fills). Note that NanoVega can generate some
* surprising pathes (like fringe stroke for antialiasing, for example).
*
* One render path can contain vertices both for fill, and for stroke triangles.
*/
public int renderPathCount (NVGContext ctx) pure nothrow @trusted @nogc {
pragma(inline, true);
return (ctx !is null && ctx.contextAlive ? ctx.cache.npaths : 0);
}
/** Get vertices of "fill" triangle fan for the given render path. Can return empty slice.
*
* $(WARNING Returned slice can be invalidated by any other NanoVega API call
* (except the calls to render path accessors), and using it in such
* case is UB. So copy vertices to freshly allocated array if you want
* to keep them for further processing.)
*/
public const(NVGVertex)[] renderPathFillVertices (NVGContext ctx, int pathidx) pure nothrow @trusted @nogc {
pragma(inline, true);
return (ctx !is null && ctx.contextAlive && pathidx >= 0 && pathidx < ctx.cache.npaths ? ctx.cache.paths[pathidx].fillVertices : null);
}
/** Get vertices of "stroke" triangle strip for the given render path. Can return empty slice.
*
* $(WARNING Returned slice can be invalidated by any other NanoVega API call
* (except the calls to render path accessors), and using it in such
* case is UB. So copy vertices to freshly allocated array if you want
* to keep them for further processing.)
*/
public const(NVGVertex)[] renderPathStrokeVertices (NVGContext ctx, int pathidx) pure nothrow @trusted @nogc {
pragma(inline, true);
return (ctx !is null && ctx.contextAlive && pathidx >= 0 && pathidx < ctx.cache.npaths ? ctx.cache.paths[pathidx].strokeVertices : null);
}
/// Returns winding for the given render path.
public NVGWinding renderPathWinding (NVGContext ctx, int pathidx) pure nothrow @trusted @nogc {
pragma(inline, true);
return (ctx !is null && ctx.contextAlive && pathidx >= 0 && pathidx < ctx.cache.npaths ? ctx.cache.paths[pathidx].winding : NVGWinding.CCW);
}
/// Returns "complex path" flag for the given render path.
public bool renderPathComplex (NVGContext ctx, int pathidx) pure nothrow @trusted @nogc {
pragma(inline, true);
return (ctx !is null && ctx.contextAlive && pathidx >= 0 && pathidx < ctx.cache.npaths ? ctx.cache.paths[pathidx].complex : false);
}
void nvg__imageIncRef (NVGContext ctx, int imgid, bool increfInGL=true) nothrow @trusted @nogc {
if (ctx !is null && imgid > 0) {
import core.atomic : atomicOp;
atomicOp!"+="(ctx.imageCount, 1);
version(nanovega_debug_image_manager_rc) { import core.stdc.stdio; printf("image[++]ref: context %p: %d image refs (%d)\n", ctx, ctx.imageCount, imgid); }
if (ctx.contextAlive && increfInGL) ctx.params.renderTextureIncRef(ctx.params.userPtr, imgid);
}
}
void nvg__imageDecRef (NVGContext ctx, int imgid) nothrow @trusted @nogc {
if (ctx !is null && imgid > 0) {
import core.atomic : atomicOp;
int icnt = atomicOp!"-="(ctx.imageCount, 1);
if (icnt < 0) assert(0, "NanoVega: internal image refcounting error");
version(nanovega_debug_image_manager_rc) { import core.stdc.stdio; printf("image[--]ref: context %p: %d image refs (%d)\n", ctx, ctx.imageCount, imgid); }
if (ctx.contextAlive) ctx.params.renderDeleteTexture(ctx.params.userPtr, imgid);
version(nanovega_debug_image_manager) if (!ctx.contextAlive) { import core.stdc.stdio; printf("image[--]ref: zombie context %p: %d image refs (%d)\n", ctx, ctx.imageCount, imgid); }
if (!ctx.contextAlive && icnt == 0) {
// it is finally safe to free context memory
import core.stdc.stdlib : free;
version(nanovega_debug_image_manager) { import core.stdc.stdio; printf("killed zombie context %p\n", ctx); }
free(ctx);
}
}
}
public import core.stdc.math :
nvg__sqrtf = sqrtf,
nvg__modf = fmodf,
nvg__sinf = sinf,
nvg__cosf = cosf,
nvg__tanf = tanf,
nvg__atan2f = atan2f,
nvg__acosf = acosf,
nvg__ceilf = ceilf;
version(Windows) {
public int nvg__lrintf (float f) nothrow @trusted @nogc { pragma(inline, true); return cast(int)(f+0.5); }
} else {
public import core.stdc.math : nvg__lrintf = lrintf;
}
public auto nvg__min(T) (T a, T b) { pragma(inline, true); return (a < b ? a : b); }
public auto nvg__max(T) (T a, T b) { pragma(inline, true); return (a > b ? a : b); }
public auto nvg__clamp(T) (T a, T mn, T mx) { pragma(inline, true); return (a < mn ? mn : (a > mx ? mx : a)); }
//float nvg__absf() (float a) { pragma(inline, true); return (a >= 0.0f ? a : -a); }
public auto nvg__sign(T) (T a) { pragma(inline, true); return (a >= cast(T)0 ? cast(T)1 : cast(T)(-1)); }
public float nvg__cross() (float dx0, float dy0, float dx1, float dy1) { pragma(inline, true); return (dx1*dy0-dx0*dy1); }
//public import core.stdc.math : nvg__absf = fabsf;
public import core.math : nvg__absf = fabs;
float nvg__normalize (float* x, float* y) nothrow @safe @nogc {
float d = nvg__sqrtf((*x)*(*x)+(*y)*(*y));
if (d > 1e-6f) {
immutable float id = 1.0f/d;
*x *= id;
*y *= id;
}
return d;
}
void nvg__deletePathCache (ref NVGpathCache* c) nothrow @trusted @nogc {
if (c !is null) {
c.clear();
free(c);
}
}
NVGpathCache* nvg__allocPathCache () nothrow @trusted @nogc {
NVGpathCache* c = cast(NVGpathCache*)malloc(NVGpathCache.sizeof);
if (c is null) goto error;
memset(c, 0, NVGpathCache.sizeof);
c.points = cast(NVGpoint*)malloc(NVGpoint.sizeof*NVG_INIT_POINTS_SIZE);
if (c.points is null) goto error;
assert(c.npoints == 0);
c.cpoints = NVG_INIT_POINTS_SIZE;
c.paths = cast(NVGpath*)malloc(NVGpath.sizeof*NVG_INIT_PATHS_SIZE);
if (c.paths is null) goto error;
assert(c.npaths == 0);
c.cpaths = NVG_INIT_PATHS_SIZE;
c.verts = cast(NVGVertex*)malloc(NVGVertex.sizeof*NVG_INIT_VERTS_SIZE);
if (c.verts is null) goto error;
assert(c.nverts == 0);
c.cverts = NVG_INIT_VERTS_SIZE;
return c;
error:
nvg__deletePathCache(c);
return null;
}
void nvg__setDevicePixelRatio (NVGContext ctx, float ratio) pure nothrow @safe @nogc {
ctx.tessTol = 0.25f/ratio;
ctx.distTol = 0.01f/ratio;
ctx.fringeWidth = 1.0f/ratio;
ctx.devicePxRatio = ratio;
}
NVGCompositeOperationState nvg__compositeOperationState (NVGCompositeOperation op) pure nothrow @safe @nogc {
NVGCompositeOperationState state;
NVGBlendFactor sfactor, dfactor;
if (op == NVGCompositeOperation.SourceOver) { sfactor = NVGBlendFactor.One; dfactor = NVGBlendFactor.OneMinusSrcAlpha;}
else if (op == NVGCompositeOperation.SourceIn) { sfactor = NVGBlendFactor.DstAlpha; dfactor = NVGBlendFactor.Zero; }
else if (op == NVGCompositeOperation.SourceOut) { sfactor = NVGBlendFactor.OneMinusDstAlpha; dfactor = NVGBlendFactor.Zero; }
else if (op == NVGCompositeOperation.SourceAtop) { sfactor = NVGBlendFactor.DstAlpha; dfactor = NVGBlendFactor.OneMinusSrcAlpha; }
else if (op == NVGCompositeOperation.DestinationOver) { sfactor = NVGBlendFactor.OneMinusDstAlpha; dfactor = NVGBlendFactor.One; }
else if (op == NVGCompositeOperation.DestinationIn) { sfactor = NVGBlendFactor.Zero; dfactor = NVGBlendFactor.SrcAlpha; }
else if (op == NVGCompositeOperation.DestinationOut) { sfactor = NVGBlendFactor.Zero; dfactor = NVGBlendFactor.OneMinusSrcAlpha; }
else if (op == NVGCompositeOperation.DestinationAtop) { sfactor = NVGBlendFactor.OneMinusDstAlpha; dfactor = NVGBlendFactor.SrcAlpha; }
else if (op == NVGCompositeOperation.Lighter) { sfactor = NVGBlendFactor.One; dfactor = NVGBlendFactor.One; }
else if (op == NVGCompositeOperation.Copy) { sfactor = NVGBlendFactor.One; dfactor = NVGBlendFactor.Zero; }
else if (op == NVGCompositeOperation.Xor) {
state.simple = false;
state.srcRGB = NVGBlendFactor.OneMinusDstColor;
state.srcAlpha = NVGBlendFactor.OneMinusDstAlpha;
state.dstRGB = NVGBlendFactor.OneMinusSrcColor;
state.dstAlpha = NVGBlendFactor.OneMinusSrcAlpha;
return state;
}
else { sfactor = NVGBlendFactor.One; dfactor = NVGBlendFactor.OneMinusSrcAlpha; } // default value for invalid op: SourceOver
state.simple = true;
state.srcAlpha = sfactor;
state.dstAlpha = dfactor;
return state;
}
NVGstate* nvg__getState (NVGContext ctx) pure nothrow @trusted @nogc {
pragma(inline, true);
if (ctx is null || !ctx.contextAlive || ctx.nstates == 0) assert(0, "NanoVega: cannot perform commands on inactive context");
return &ctx.states.ptr[ctx.nstates-1];
}
// Constructor called by the render back-end.
NVGContext createInternal (NVGparams* params) nothrow @trusted @nogc {
FONSParams fontParams;
NVGContext ctx = cast(NVGContext)malloc(NVGcontextinternal.sizeof);
if (ctx is null) goto error;
memset(ctx, 0, NVGcontextinternal.sizeof);
ctx.angleTol = 0; // angle tolerance for McSeem Bezier rasterizer
ctx.cuspLimit = 0; // cusp limit for McSeem Bezier rasterizer (0: real cusps)
ctx.contextAlive = true;
ctx.params = *params;
//ctx.fontImages[0..NVG_MAX_FONTIMAGES] = 0;
ctx.commands = cast(float*)malloc(float.sizeof*NVG_INIT_COMMANDS_SIZE);
if (ctx.commands is null) goto error;
ctx.ncommands = 0;
ctx.ccommands = NVG_INIT_COMMANDS_SIZE;
ctx.cache = nvg__allocPathCache();
if (ctx.cache is null) goto error;
ctx.save();
ctx.reset();
nvg__setDevicePixelRatio(ctx, 1.0f);
ctx.mWidth = ctx.mHeight = 0;
if (!ctx.params.renderCreate(ctx.params.userPtr)) goto error;
// init font rendering
memset(&fontParams, 0, fontParams.sizeof);
fontParams.width = NVG_INIT_FONTIMAGE_SIZE;
fontParams.height = NVG_INIT_FONTIMAGE_SIZE;
fontParams.flags = FONSParams.Flag.ZeroTopLeft;
fontParams.renderCreate = null;
fontParams.renderUpdate = null;
fontParams.renderDelete = null;
fontParams.userPtr = null;
ctx.fs = FONSContext.create(fontParams);
if (ctx.fs is null) goto error;
// create font texture
ctx.fontImages[0].id = ctx.params.renderCreateTexture(ctx.params.userPtr, NVGtexture.Alpha, fontParams.width, fontParams.height, (ctx.params.fontAA ? 0 : NVGImageFlag.NoFiltering), null);
if (ctx.fontImages[0].id == 0) goto error;
ctx.fontImages[0].ctx = ctx;
ctx.nvg__imageIncRef(ctx.fontImages[0].id, false); // don't increment driver refcount
ctx.fontImageIdx = 0;
ctx.pathPickId = -1;
ctx.tesselatortype = NVG_DEFAULT_TESSELATOR;
return ctx;
error:
ctx.deleteInternal();
return null;
}
// Called by render backend.
NVGparams* internalParams (NVGContext ctx) nothrow @trusted @nogc {
return &ctx.params;
}
// Destructor called by the render back-end.
void deleteInternal (ref NVGContext ctx) nothrow @trusted @nogc {
if (ctx is null) return;
if (ctx.contextAlive) {
if (ctx.commands !is null) free(ctx.commands);
nvg__deletePathCache(ctx.cache);
if (ctx.fs) ctx.fs.kill();
foreach (uint i; 0..NVG_MAX_FONTIMAGES) ctx.fontImages[i].clear();
if (ctx.params.renderDelete !is null) ctx.params.renderDelete(ctx.params.userPtr);
if (ctx.pickScene !is null) nvg__deletePickScene(ctx.pickScene);
ctx.contextAlive = false;
import core.atomic : atomicLoad;
if (atomicLoad(ctx.imageCount) == 0) {
version(nanovega_debug_image_manager) { import core.stdc.stdio; printf("destroyed context %p\n", ctx); }
free(ctx);
} else {
version(nanovega_debug_image_manager) { import core.stdc.stdio; printf("context %p is zombie now (%d image refs)\n", ctx, ctx.imageCount); }
}
}
}
/// Delete NanoVega context.
/// Group: context_management
public void kill (ref NVGContext ctx) nothrow @trusted @nogc {
if (ctx !is null) {
ctx.deleteInternal();
ctx = null;
}
}
/// Returns `true` if the given context is not `null` and can be used for painting.
/// Group: context_management
public bool valid (in NVGContext ctx) pure nothrow @trusted @nogc { pragma(inline, true); return (ctx !is null && ctx.contextAlive); }
// ////////////////////////////////////////////////////////////////////////// //
// Frame Management
/** Begin drawing a new frame.
*
* Calls to NanoVega drawing API should be wrapped in [beginFrame] and [endFrame]
*
* [beginFrame] defines the size of the window to render to in relation currently
* set viewport (i.e. glViewport on GL backends). Device pixel ration allows to
* control the rendering on Hi-DPI devices.
*
* For example, GLFW returns two dimension for an opened window: window size and
* frame buffer size. In that case you would set windowWidth/windowHeight to the window size,
* devicePixelRatio to: `windowWidth/windowHeight`.
*
* Default ratio is `1`.
*
* Note that fractional ratio can (and will) distort your fonts and images.
*
* This call also resets pick marks (see picking API for non-rasterized paths),
* path recording, and GPU affine transformatin matrix.
*
* see also [glNVGClearFlags], which returns necessary flags for [glClear].
*
* Group: frame_management
*/
public void beginFrame (NVGContext ctx, int windowWidth, int windowHeight, float devicePixelRatio=1.0f) nothrow @trusted @nogc {
import std.math : isNaN;
/*
printf("Tris: draws:%d fill:%d stroke:%d text:%d TOT:%d\n",
ctx.drawCallCount, ctx.fillTriCount, ctx.strokeTriCount, ctx.textTriCount,
ctx.fillTriCount+ctx.strokeTriCount+ctx.textTriCount);
*/
if (ctx.nstates > 0) ctx.cancelFrame();
if (windowWidth < 1) windowWidth = 1;
if (windowHeight < 1) windowHeight = 1;
if (isNaN(devicePixelRatio)) devicePixelRatio = (windowHeight > 0 ? cast(float)windowWidth/cast(float)windowHeight : 1024.0/768.0);
foreach (ref NVGstate st; ctx.states[0..ctx.nstates]) st.clearPaint();
ctx.nstates = 0;
ctx.save();
ctx.reset();
nvg__setDevicePixelRatio(ctx, devicePixelRatio);
ctx.params.renderViewport(ctx.params.userPtr, windowWidth, windowHeight);
ctx.mWidth = windowWidth;
ctx.mHeight = windowHeight;
ctx.recset = null;
ctx.recstart = -1;
ctx.pathPickId = NVGNoPick;
ctx.pathPickRegistered = 0;
ctx.drawCallCount = 0;
ctx.fillTriCount = 0;
ctx.strokeTriCount = 0;
ctx.textTriCount = 0;
ctx.ncommands = 0;
ctx.pathPickRegistered = 0;
nvg__clearPathCache(ctx);
ctx.gpuAffine = NVGMatrix.Identity;
nvg__pickBeginFrame(ctx, windowWidth, windowHeight);
}
/// Cancels drawing the current frame. Cancels path recording.
/// Group: frame_management
public void cancelFrame (NVGContext ctx) nothrow @trusted @nogc {
ctx.cancelRecording();
//ctx.mWidth = 0;
//ctx.mHeight = 0;
// cancel render queue
ctx.params.renderCancel(ctx.params.userPtr);
// clear saved states (this may free some textures)
foreach (ref NVGstate st; ctx.states[0..ctx.nstates]) st.clearPaint();
ctx.nstates = 0;
}
/// Ends drawing the current frame (flushing remaining render state). Commits recorded paths.
/// Group: frame_management
public void endFrame (NVGContext ctx) nothrow @trusted @nogc {
if (ctx.recset !is null) ctx.recset.takeCurrentPickScene(ctx);
ctx.stopRecording();
//ctx.mWidth = 0;
//ctx.mHeight = 0;
// flush render queue
NVGstate* state = nvg__getState(ctx);
ctx.params.renderFlush(ctx.params.userPtr);
if (ctx.fontImageIdx != 0) {
auto fontImage = ctx.fontImages[ctx.fontImageIdx];
int j = 0, iw, ih;
// delete images that smaller than current one
if (!fontImage.valid) return;
ctx.imageSize(fontImage, iw, ih);
foreach (int i; 0..ctx.fontImageIdx) {
if (ctx.fontImages[i].valid) {
int nw, nh;
ctx.imageSize(ctx.fontImages[i], nw, nh);
if (nw < iw || nh < ih) {
ctx.deleteImage(ctx.fontImages[i]);
} else {
ctx.fontImages[j++] = ctx.fontImages[i];
}
}
}
// make current font image to first
ctx.fontImages[j++] = ctx.fontImages[0];
ctx.fontImages[0] = fontImage;
ctx.fontImageIdx = 0;
// clear all images after j
ctx.fontImages[j..NVG_MAX_FONTIMAGES] = NVGImage.init;
}
// clear saved states (this may free some textures)
foreach (ref NVGstate st; ctx.states[0..ctx.nstates]) st.clearPaint();
ctx.nstates = 0;
}
// ////////////////////////////////////////////////////////////////////////// //
// Recording and Replaying Pathes
// Saved path set.
// Group: path_recording
public alias NVGPathSet = NVGPathSetS*;
//TODO: save scissor info?
struct NVGPathSetS {
private:
// either path cache, or text item
static struct Node {
NVGPaint paint;
NVGpathCache* path;
}
private:
Node* nodes;
int nnodes, cnodes;
NVGpickScene* pickscene;
//int npickscenes, cpickscenes;
NVGContext svctx; // used to do some sanity checks, and to free resources
private:
Node* allocNode () nothrow @trusted @nogc {
import core.stdc.string : memset;
// grow buffer if necessary
if (nnodes+1 > cnodes) {
import core.stdc.stdlib : realloc;
int newsz = (cnodes == 0 ? 8 : cnodes <= 1024 ? cnodes*2 : cnodes+1024);
nodes = cast(Node*)realloc(nodes, newsz*Node.sizeof);
if (nodes is null) assert(0, "NanoVega: out of memory");
//memset(svp.caches+svp.ccaches, 0, (newsz-svp.ccaches)*NVGpathCache.sizeof);
cnodes = newsz;
}
assert(nnodes < cnodes);
memset(nodes+nnodes, 0, Node.sizeof);
return &nodes[nnodes++];
}
Node* allocPathNode () nothrow @trusted @nogc {
import core.stdc.stdlib : malloc;
import core.stdc.string : memset;
auto node = allocNode();
// allocate path cache
auto pc = cast(NVGpathCache*)malloc(NVGpathCache.sizeof);
if (pc is null) assert(0, "NanoVega: out of memory");
node.path = pc;
return node;
}
void clearNode (int idx) nothrow @trusted @nogc {
if (idx < 0 || idx >= nnodes) return;
Node* node = &nodes[idx];
if (svctx !is null && node.paint.image.valid) node.paint.image.clear();
if (node.path !is null) node.path.clear();
}
private:
void takeCurrentPickScene (NVGContext ctx) nothrow @trusted @nogc {
NVGpickScene* ps = ctx.pickScene;
if (ps is null) return; // nothing to do
if (ps.npaths == 0) return; // pick scene is empty
ctx.pickScene = null;
pickscene = ps;
}
void replay (NVGContext ctx, in ref NVGColor fillTint, in ref NVGColor strokeTint) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
foreach (ref node; nodes[0..nnodes]) {
if (auto cc = node.path) {
if (cc.npaths <= 0) continue;
if (cc.fillReady) {
NVGPaint fillPaint = node.paint;
// apply global alpha
fillPaint.innerColor.a *= state.alpha;
fillPaint.middleColor.a *= state.alpha;
fillPaint.outerColor.a *= state.alpha;
fillPaint.innerColor.applyTint(fillTint);
fillPaint.middleColor.applyTint(fillTint);
fillPaint.outerColor.applyTint(fillTint);
ctx.params.renderFill(ctx.params.userPtr, state.compositeOperation, cc.clipmode, &fillPaint, &state.scissor, cc.fringeWidth, cc.bounds.ptr, cc.paths, cc.npaths, cc.evenOddMode);
// count triangles
foreach (int i; 0..cc.npaths) {
NVGpath* path = &cc.paths[i];
ctx.fillTriCount += path.nfill-2;
ctx.fillTriCount += path.nstroke-2;
ctx.drawCallCount += 2;
}
}
if (cc.strokeReady) {
NVGPaint strokePaint = node.paint;
strokePaint.innerColor.a *= cc.strokeAlphaMul;
strokePaint.middleColor.a *= cc.strokeAlphaMul;
strokePaint.outerColor.a *= cc.strokeAlphaMul;
// apply global alpha
strokePaint.innerColor.a *= state.alpha;
strokePaint.middleColor.a *= state.alpha;
strokePaint.outerColor.a *= state.alpha;
strokePaint.innerColor.applyTint(strokeTint);
strokePaint.middleColor.applyTint(strokeTint);
strokePaint.outerColor.applyTint(strokeTint);
ctx.params.renderStroke(ctx.params.userPtr, state.compositeOperation, cc.clipmode, &strokePaint, &state.scissor, cc.fringeWidth, cc.strokeWidth, cc.paths, cc.npaths);
// count triangles
foreach (int i; 0..cc.npaths) {
NVGpath* path = &cc.paths[i];
ctx.strokeTriCount += path.nstroke-2;
++ctx.drawCallCount;
}
}
}
}
}
public:
@disable this (this); // no copies
void opAssign() (in auto ref NVGPathSetS a) { static assert(0, "no copies!"); }
// pick test
// Call delegate [dg] for each path under the specified position (in no particular order).
// Returns the id of the path for which delegate [dg] returned true or -1.
// dg is: `bool delegate (int id, int order)` -- [order] is path ordering (ascending).
int hitTestDG(bool bestOrder=false, DG) (in float x, in float y, NVGPickKind kind, scope DG dg) if (IsGoodHitTestDG!DG || IsGoodHitTestInternalDG!DG) {
if (pickscene is null) return -1;
NVGpickScene* ps = pickscene;
int levelwidth = 1<<(ps.nlevels-1);
int cellx = nvg__clamp(cast(int)(x/ps.xdim), 0, levelwidth);
int celly = nvg__clamp(cast(int)(y/ps.ydim), 0, levelwidth);
int npicked = 0;
for (int lvl = ps.nlevels-1; lvl >= 0; --lvl) {
NVGpickPath* pp = ps.levels[lvl][celly*levelwidth+cellx];
while (pp !is null) {
if (nvg__pickPathTestBounds(svctx, ps, pp, x, y)) {
int hit = 0;
if ((kind&NVGPickKind.Stroke) && (pp.flags&NVGPathFlags.Stroke)) hit = nvg__pickPathStroke(ps, pp, x, y);
if (!hit && (kind&NVGPickKind.Fill) && (pp.flags&NVGPathFlags.Fill)) hit = nvg__pickPath(ps, pp, x, y);
if (hit) {
static if (IsGoodHitTestDG!DG) {
static if (__traits(compiles, (){ DG dg; bool res = dg(cast(int)42, cast(int)666); })) {
if (dg(pp.id, cast(int)pp.order)) return pp.id;
} else {
dg(pp.id, cast(int)pp.order);
}
} else {
static if (__traits(compiles, (){ DG dg; NVGpickPath* pp; bool res = dg(pp); })) {
if (dg(pp)) return pp.id;
} else {
dg(pp);
}
}
}
}
pp = pp.next;
}
cellx >>= 1;
celly >>= 1;
levelwidth >>= 1;
}
return -1;
}
// Fills ids with a list of the top most hit ids under the specified position.
// Returns the slice of [ids].
int[] hitTestAll (in float x, in float y, NVGPickKind kind, int[] ids) nothrow @trusted @nogc {
if (pickscene is null || ids.length == 0) return ids[0..0];
int npicked = 0;
NVGpickScene* ps = pickscene;
hitTestDG!false(x, y, kind, delegate (NVGpickPath* pp) nothrow @trusted @nogc {
if (npicked == ps.cpicked) {
int cpicked = ps.cpicked+ps.cpicked;
NVGpickPath** picked = cast(NVGpickPath**)realloc(ps.picked, (NVGpickPath*).sizeof*ps.cpicked);
if (picked is null) return true; // abort
ps.cpicked = cpicked;
ps.picked = picked;
}
ps.picked[npicked] = pp;
++npicked;
return false; // go on
});
qsort(ps.picked, npicked, (NVGpickPath*).sizeof, &nvg__comparePaths);
assert(npicked >= 0);
if (npicked > ids.length) npicked = cast(int)ids.length;
foreach (immutable nidx, ref int did; ids[0..npicked]) did = ps.picked[nidx].id;
return ids[0..npicked];
}
// Returns the id of the pickable shape containing x,y or -1 if no shape was found.
int hitTest (in float x, in float y, NVGPickKind kind) nothrow @trusted @nogc {
if (pickscene is null) return -1;
int bestOrder = -1;
int bestID = -1;
hitTestDG!true(x, y, kind, delegate (NVGpickPath* pp) nothrow @trusted @nogc {
if (pp.order > bestOrder) {
bestOrder = pp.order;
bestID = pp.id;
}
});
return bestID;
}
}
// Append current path to existing path set. Is is safe to call this with `null` [svp].
void appendCurrentPathToCache (NVGContext ctx, NVGPathSet svp, in ref NVGPaint paint) nothrow @trusted @nogc {
if (ctx is null || svp is null) return;
if (ctx !is svp.svctx) assert(0, "NanoVega: cannot save paths from different contexts");
if (ctx.ncommands == 0) {
assert(ctx.cache.npaths == 0);
return;
}
if (!ctx.cache.fillReady && !ctx.cache.strokeReady) return;
// tesselate current path
//if (!ctx.cache.fillReady) nvg__prepareFill(ctx);
//if (!ctx.cache.strokeReady) nvg__prepareStroke(ctx);
auto node = svp.allocPathNode();
NVGpathCache* cc = node.path;
cc.copyFrom(ctx.cache);
node.paint = paint;
// copy path commands (we may need 'em for picking)
version(all) {
cc.ncommands = ctx.ncommands;
if (cc.ncommands) {
import core.stdc.stdlib : malloc;
import core.stdc.string : memcpy;
cc.commands = cast(float*)malloc(ctx.ncommands*float.sizeof);
if (cc.commands is null) assert(0, "NanoVega: out of memory");
memcpy(cc.commands, ctx.commands, ctx.ncommands*float.sizeof);
} else {
cc.commands = null;
}
}
}
// Create new empty path set.
// Group: path_recording
public NVGPathSet newPathSet (NVGContext ctx) nothrow @trusted @nogc {
import core.stdc.stdlib : malloc;
import core.stdc.string : memset;
if (ctx is null) return null;
NVGPathSet res = cast(NVGPathSet)malloc(NVGPathSetS.sizeof);
if (res is null) assert(0, "NanoVega: out of memory");
memset(res, 0, NVGPathSetS.sizeof);
res.svctx = ctx;
return res;
}
// Is the given path set empty? Empty path set can be `null`.
// Group: path_recording
public bool empty (NVGPathSet svp) pure nothrow @safe @nogc { pragma(inline, true); return (svp is null || svp.nnodes == 0); }
// Clear path set contents. Will release $(B some) allocated memory (this function is meant to clear something that will be reused).
// Group: path_recording
public void clear (NVGPathSet svp) nothrow @trusted @nogc {
if (svp !is null) {
import core.stdc.stdlib : free;
foreach (immutable idx; 0.. svp.nnodes) svp.clearNode(idx);
svp.nnodes = 0;
}
}
// Destroy path set (frees all allocated memory).
// Group: path_recording
public void kill (ref NVGPathSet svp) nothrow @trusted @nogc {
if (svp !is null) {
import core.stdc.stdlib : free;
svp.clear();
if (svp.nodes !is null) free(svp.nodes);
free(svp);
if (svp.pickscene !is null) nvg__deletePickScene(svp.pickscene);
svp = null;
}
}
// Start path recording. [svp] should be alive until recording is cancelled or stopped.
// Group: path_recording
public void startRecording (NVGContext ctx, NVGPathSet svp) nothrow @trusted @nogc {
if (svp !is null && svp.svctx !is ctx) assert(0, "NanoVega: cannot share path set between contexts");
ctx.stopRecording();
ctx.recset = svp;
ctx.recstart = (svp !is null ? svp.nnodes : -1);
ctx.recblockdraw = false;
}
/* Start path recording. [svp] should be alive until recording is cancelled or stopped.
*
* This will block all rendering, so you can call your rendering functions to record paths without actual drawing.
* Commiting or cancelling will re-enable rendering.
* You can call this with `null` svp to block rendering without recording any paths.
*
* Group: path_recording
*/
public void startBlockingRecording (NVGContext ctx, NVGPathSet svp) nothrow @trusted @nogc {
if (svp !is null && svp.svctx !is ctx) assert(0, "NanoVega: cannot share path set between contexts");
ctx.stopRecording();
ctx.recset = svp;
ctx.recstart = (svp !is null ? svp.nnodes : -1);
ctx.recblockdraw = true;
}
// Commit recorded paths. It is safe to call this when recording is not started.
// Group: path_recording
public void stopRecording (NVGContext ctx) nothrow @trusted @nogc {
if (ctx.recset !is null && ctx.recset.svctx !is ctx) assert(0, "NanoVega: cannot share path set between contexts");
if (ctx.recset !is null) ctx.recset.takeCurrentPickScene(ctx);
ctx.recset = null;
ctx.recstart = -1;
ctx.recblockdraw = false;
}
// Cancel path recording.
// Group: path_recording
public void cancelRecording (NVGContext ctx) nothrow @trusted @nogc {
if (ctx.recset !is null) {
if (ctx.recset.svctx !is ctx) assert(0, "NanoVega: cannot share path set between contexts");
assert(ctx.recstart >= 0 && ctx.recstart <= ctx.recset.nnodes);
foreach (immutable idx; ctx.recstart..ctx.recset.nnodes) ctx.recset.clearNode(idx);
ctx.recset.nnodes = ctx.recstart;
ctx.recset = null;
ctx.recstart = -1;
}
ctx.recblockdraw = false;
}
/* Replay saved path set.
*
* Replaying record while you're recording another one is undefined behavior.
*
* Group: path_recording
*/
public void replayRecording() (NVGContext ctx, NVGPathSet svp, in auto ref NVGColor fillTint, in auto ref NVGColor strokeTint) nothrow @trusted @nogc {
if (svp !is null && svp.svctx !is ctx) assert(0, "NanoVega: cannot share path set between contexts");
svp.replay(ctx, fillTint, strokeTint);
}
/// Ditto.
public void replayRecording() (NVGContext ctx, NVGPathSet svp, in auto ref NVGColor fillTint) nothrow @trusted @nogc { ctx.replayRecording(svp, fillTint, NVGColor.transparent); }
/// Ditto.
public void replayRecording (NVGContext ctx, NVGPathSet svp) nothrow @trusted @nogc { ctx.replayRecording(svp, NVGColor.transparent, NVGColor.transparent); }
// ////////////////////////////////////////////////////////////////////////// //
// Composite operation
/// Sets the composite operation.
/// Group: composite_operation
public void globalCompositeOperation (NVGContext ctx, NVGCompositeOperation op) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
state.compositeOperation = nvg__compositeOperationState(op);
}
/// Sets the composite operation with custom pixel arithmetic.
/// Group: composite_operation
public void globalCompositeBlendFunc (NVGContext ctx, NVGBlendFactor sfactor, NVGBlendFactor dfactor) nothrow @trusted @nogc {
ctx.globalCompositeBlendFuncSeparate(sfactor, dfactor, sfactor, dfactor);
}
/// Sets the composite operation with custom pixel arithmetic for RGB and alpha components separately.
/// Group: composite_operation
public void globalCompositeBlendFuncSeparate (NVGContext ctx, NVGBlendFactor srcRGB, NVGBlendFactor dstRGB, NVGBlendFactor srcAlpha, NVGBlendFactor dstAlpha) nothrow @trusted @nogc {
NVGCompositeOperationState op;
op.simple = false;
op.srcRGB = srcRGB;
op.dstRGB = dstRGB;
op.srcAlpha = srcAlpha;
op.dstAlpha = dstAlpha;
NVGstate* state = nvg__getState(ctx);
state.compositeOperation = op;
}
// ////////////////////////////////////////////////////////////////////////// //
// Color utils
/// Returns a color value from string form.
/// Supports: "#rgb", "#rrggbb", "#argb", "#aarrggbb"
/// Group: color_utils
public NVGColor nvgRGB (const(char)[] srgb) nothrow @trusted @nogc { pragma(inline, true); return NVGColor(srgb); }
/// Ditto.
public NVGColor nvgRGBA (const(char)[] srgb) nothrow @trusted @nogc { pragma(inline, true); return NVGColor(srgb); }
/// Returns a color value from red, green, blue values. Alpha will be set to 255 (1.0f).
/// Group: color_utils
public NVGColor nvgRGB (int r, int g, int b) nothrow @trusted @nogc { pragma(inline, true); return NVGColor(nvgClampToByte(r), nvgClampToByte(g), nvgClampToByte(b), 255); }
/// Returns a color value from red, green, blue values. Alpha will be set to 1.0f.
/// Group: color_utils
public NVGColor nvgRGBf (float r, float g, float b) nothrow @trusted @nogc { pragma(inline, true); return NVGColor(r, g, b, 1.0f); }
/// Returns a color value from red, green, blue and alpha values.
/// Group: color_utils
public NVGColor nvgRGBA (int r, int g, int b, int a=255) nothrow @trusted @nogc { pragma(inline, true); return NVGColor(nvgClampToByte(r), nvgClampToByte(g), nvgClampToByte(b), nvgClampToByte(a)); }
/// Returns a color value from red, green, blue and alpha values.
/// Group: color_utils
public NVGColor nvgRGBAf (float r, float g, float b, float a=1.0f) nothrow @trusted @nogc { pragma(inline, true); return NVGColor(r, g, b, a); }
/// Returns new color with transparency (alpha) set to [a].
/// Group: color_utils
public NVGColor nvgTransRGBA (NVGColor c, ubyte a) nothrow @trusted @nogc {
pragma(inline, true);
c.a = a/255.0f;
return c;
}
/// Ditto.
public NVGColor nvgTransRGBAf (NVGColor c, float a) nothrow @trusted @nogc {
pragma(inline, true);
c.a = a;
return c;
}
/// Linearly interpolates from color c0 to c1, and returns resulting color value.
/// Group: color_utils
public NVGColor nvgLerpRGBA() (in auto ref NVGColor c0, in auto ref NVGColor c1, float u) nothrow @trusted @nogc {
NVGColor cint = void;
u = nvg__clamp(u, 0.0f, 1.0f);
float oneminu = 1.0f-u;
foreach (uint i; 0..4) cint.rgba.ptr[i] = c0.rgba.ptr[i]*oneminu+c1.rgba.ptr[i]*u;
return cint;
}
/* see below
public NVGColor nvgHSL() (float h, float s, float l) {
//pragma(inline, true); // alas
return nvgHSLA(h, s, l, 255);
}
*/
float nvg__hue (float h, float m1, float m2) pure nothrow @safe @nogc {
if (h < 0) h += 1;
if (h > 1) h -= 1;
if (h < 1.0f/6.0f) return m1+(m2-m1)*h*6.0f;
if (h < 3.0f/6.0f) return m2;
if (h < 4.0f/6.0f) return m1+(m2-m1)*(2.0f/3.0f-h)*6.0f;
return m1;
}
/// Returns color value specified by hue, saturation and lightness.
/// HSL values are all in range [0..1], alpha will be set to 255.
/// Group: color_utils
public alias nvgHSL = nvgHSLA; // trick to allow inlining
/// Returns color value specified by hue, saturation and lightness and alpha.
/// HSL values are all in range [0..1], alpha in range [0..255].
/// Group: color_utils
public NVGColor nvgHSLA (float h, float s, float l, ubyte a=255) nothrow @trusted @nogc {
pragma(inline, true);
NVGColor col = void;
h = nvg__modf(h, 1.0f);
if (h < 0.0f) h += 1.0f;
s = nvg__clamp(s, 0.0f, 1.0f);
l = nvg__clamp(l, 0.0f, 1.0f);
immutable float m2 = (l <= 0.5f ? l*(1+s) : l+s-l*s);
immutable float m1 = 2*l-m2;
col.r = nvg__clamp(nvg__hue(h+1.0f/3.0f, m1, m2), 0.0f, 1.0f);
col.g = nvg__clamp(nvg__hue(h, m1, m2), 0.0f, 1.0f);
col.b = nvg__clamp(nvg__hue(h-1.0f/3.0f, m1, m2), 0.0f, 1.0f);
col.a = a/255.0f;
return col;
}
/// Returns color value specified by hue, saturation and lightness and alpha.
/// HSL values and alpha are all in range [0..1].
/// Group: color_utils
public NVGColor nvgHSLA (float h, float s, float l, float a) nothrow @trusted @nogc {
// sorry for copypasta, it is for inliner
static if (__VERSION__ >= 2072) pragma(inline, true);
NVGColor col = void;
h = nvg__modf(h, 1.0f);
if (h < 0.0f) h += 1.0f;
s = nvg__clamp(s, 0.0f, 1.0f);
l = nvg__clamp(l, 0.0f, 1.0f);
immutable m2 = (l <= 0.5f ? l*(1+s) : l+s-l*s);
immutable m1 = 2*l-m2;
col.r = nvg__clamp(nvg__hue(h+1.0f/3.0f, m1, m2), 0.0f, 1.0f);
col.g = nvg__clamp(nvg__hue(h, m1, m2), 0.0f, 1.0f);
col.b = nvg__clamp(nvg__hue(h-1.0f/3.0f, m1, m2), 0.0f, 1.0f);
col.a = a;
return col;
}
// ////////////////////////////////////////////////////////////////////////// //
// Matrices and Transformations
/** Matrix class.
*
* Group: matrices
*/
public align(1) struct NVGMatrix {
align(1):
private:
static immutable float[6] IdentityMat = [
1.0f, 0.0f,
0.0f, 1.0f,
0.0f, 0.0f,
];
public:
/// Matrix values. Initial value is identity matrix.
float[6] mat = [
1.0f, 0.0f,
0.0f, 1.0f,
0.0f, 0.0f,
];
public nothrow @trusted @nogc:
/// Create Matrix with the given values.
this (const(float)[] amat...) {
pragma(inline, true);
if (amat.length >= 6) {
mat.ptr[0..6] = amat.ptr[0..6];
} else {
mat.ptr[0..6] = 0;
mat.ptr[0..amat.length] = amat[];
}
}
/// Can be used to check validity of [inverted] result
@property bool valid () const { import core.stdc.math : isfinite; return (isfinite(mat.ptr[0]) != 0); }
/// Returns `true` if this matrix is identity matrix.
@property bool isIdentity () const { version(aliced) pragma(inline, true); return (mat[] == IdentityMat[]); }
/// Returns new inverse matrix.
/// If inverted matrix cannot be calculated, `res.valid` fill be `false`.
NVGMatrix inverted () const {
NVGMatrix res = this;
res.invert;
return res;
}
/// Inverts this matrix.
/// If inverted matrix cannot be calculated, `this.valid` fill be `false`.
ref NVGMatrix invert () {
float[6] inv = void;
immutable double det = cast(double)mat.ptr[0]*mat.ptr[3]-cast(double)mat.ptr[2]*mat.ptr[1];
if (det > -1e-6 && det < 1e-6) {
inv[] = float.nan;
} else {
immutable double invdet = 1.0/det;
inv.ptr[0] = cast(float)(mat.ptr[3]*invdet);
inv.ptr[2] = cast(float)(-mat.ptr[2]*invdet);
inv.ptr[4] = cast(float)((cast(double)mat.ptr[2]*mat.ptr[5]-cast(double)mat.ptr[3]*mat.ptr[4])*invdet);
inv.ptr[1] = cast(float)(-mat.ptr[1]*invdet);
inv.ptr[3] = cast(float)(mat.ptr[0]*invdet);
inv.ptr[5] = cast(float)((cast(double)mat.ptr[1]*mat.ptr[4]-cast(double)mat.ptr[0]*mat.ptr[5])*invdet);
}
mat.ptr[0..6] = inv.ptr[0..6];
return this;
}
/// Sets this matrix to identity matrix.
ref NVGMatrix identity () { version(aliced) pragma(inline, true); mat[] = IdentityMat[]; return this; }
/// Translate this matrix.
ref NVGMatrix translate (in float tx, in float ty) {
version(aliced) pragma(inline, true);
return this.mul(Translated(tx, ty));
}
/// Scale this matrix.
ref NVGMatrix scale (in float sx, in float sy) {
version(aliced) pragma(inline, true);
return this.mul(Scaled(sx, sy));
}
/// Rotate this matrix.
ref NVGMatrix rotate (in float a) {
version(aliced) pragma(inline, true);
return this.mul(Rotated(a));
}
/// Skew this matrix by X axis.
ref NVGMatrix skewX (in float a) {
version(aliced) pragma(inline, true);
return this.mul(SkewedX(a));
}
/// Skew this matrix by Y axis.
ref NVGMatrix skewY (in float a) {
version(aliced) pragma(inline, true);
return this.mul(SkewedY(a));
}
/// Skew this matrix by both axes.
ref NVGMatrix skewY (in float ax, in float ay) {
version(aliced) pragma(inline, true);
return this.mul(SkewedXY(ax, ay));
}
/// Transform point with this matrix. `null` destinations are allowed.
/// [sx] and [sy] is the source point. [dx] and [dy] may point to the same variables.
void point (float* dx, float* dy, float sx, float sy) nothrow @trusted @nogc {
version(aliced) pragma(inline, true);
if (dx !is null) *dx = sx*mat.ptr[0]+sy*mat.ptr[2]+mat.ptr[4];
if (dy !is null) *dy = sx*mat.ptr[1]+sy*mat.ptr[3]+mat.ptr[5];
}
/// Transform point with this matrix.
void point (ref float x, ref float y) nothrow @trusted @nogc {
version(aliced) pragma(inline, true);
immutable float nx = x*mat.ptr[0]+y*mat.ptr[2]+mat.ptr[4];
immutable float ny = x*mat.ptr[1]+y*mat.ptr[3]+mat.ptr[5];
x = nx;
y = ny;
}
/// Sets this matrix to the result of multiplication of `this` and [s] (this * S).
ref NVGMatrix mul() (in auto ref NVGMatrix s) {
immutable float t0 = mat.ptr[0]*s.mat.ptr[0]+mat.ptr[1]*s.mat.ptr[2];
immutable float t2 = mat.ptr[2]*s.mat.ptr[0]+mat.ptr[3]*s.mat.ptr[2];
immutable float t4 = mat.ptr[4]*s.mat.ptr[0]+mat.ptr[5]*s.mat.ptr[2]+s.mat.ptr[4];
mat.ptr[1] = mat.ptr[0]*s.mat.ptr[1]+mat.ptr[1]*s.mat.ptr[3];
mat.ptr[3] = mat.ptr[2]*s.mat.ptr[1]+mat.ptr[3]*s.mat.ptr[3];
mat.ptr[5] = mat.ptr[4]*s.mat.ptr[1]+mat.ptr[5]*s.mat.ptr[3]+s.mat.ptr[5];
mat.ptr[0] = t0;
mat.ptr[2] = t2;
mat.ptr[4] = t4;
return this;
}
/// Sets this matrix to the result of multiplication of [s] and `this` (S * this).
/// Sets the transform to the result of multiplication of two transforms, of A = B*A.
/// Group: matrices
ref NVGMatrix premul() (in auto ref NVGMatrix s) {
NVGMatrix s2 = s;
s2.mul(this);
mat[] = s2.mat[];
return this;
}
/// Multiply this matrix by [s], return result as new matrix.
/// Performs operations in this left-to-right order.
NVGMatrix opBinary(string op="*") (in auto ref NVGMatrix s) const {
version(aliced) pragma(inline, true);
NVGMatrix res = this;
res.mul(s);
return res;
}
/// Multiply this matrix by [s].
/// Performs operations in this left-to-right order.
ref NVGMatrix opOpAssign(string op="*") (in auto ref NVGMatrix s) {
version(aliced) pragma(inline, true);
return this.mul(s);
}
float scaleX () const { pragma(inline, true); return nvg__sqrtf(mat.ptr[0]*mat.ptr[0]+mat.ptr[2]*mat.ptr[2]); } /// Returns x scaling of this matrix.
float scaleY () const { pragma(inline, true); return nvg__sqrtf(mat.ptr[1]*mat.ptr[1]+mat.ptr[3]*mat.ptr[3]); } /// Returns y scaling of this matrix.
float rotation () const { pragma(inline, true); return nvg__atan2f(mat.ptr[1], mat.ptr[0]); } /// Returns rotation of this matrix.
float tx () const { pragma(inline, true); return mat.ptr[4]; } /// Returns x translation of this matrix.
float ty () const { pragma(inline, true); return mat.ptr[5]; } /// Returns y translation of this matrix.
ref NVGMatrix scaleX (in float v) { pragma(inline, true); return scaleRotateTransform(v, scaleY, rotation, tx, ty); } /// Sets x scaling of this matrix.
ref NVGMatrix scaleY (in float v) { pragma(inline, true); return scaleRotateTransform(scaleX, v, rotation, tx, ty); } /// Sets y scaling of this matrix.
ref NVGMatrix rotation (in float v) { pragma(inline, true); return scaleRotateTransform(scaleX, scaleY, v, tx, ty); } /// Sets rotation of this matrix.
ref NVGMatrix tx (in float v) { pragma(inline, true); mat.ptr[4] = v; return this; } /// Sets x translation of this matrix.
ref NVGMatrix ty (in float v) { pragma(inline, true); mat.ptr[5] = v; return this; } /// Sets y translation of this matrix.
/// Utility function to be used in `setXXX()`.
/// This is the same as doing: `mat.identity.rotate(a).scale(xs, ys).translate(tx, ty)`, only faster
ref NVGMatrix scaleRotateTransform (in float xscale, in float yscale, in float a, in float tx, in float ty) {
immutable float cs = nvg__cosf(a), sn = nvg__sinf(a);
mat.ptr[0] = xscale*cs; mat.ptr[1] = yscale*sn;
mat.ptr[2] = xscale*-sn; mat.ptr[3] = yscale*cs;
mat.ptr[4] = tx; mat.ptr[5] = ty;
return this;
}
/// This is the same as doing: `mat.identity.rotate(a).translate(tx, ty)`, only faster
ref NVGMatrix rotateTransform (in float a, in float tx, in float ty) {
immutable float cs = nvg__cosf(a), sn = nvg__sinf(a);
mat.ptr[0] = cs; mat.ptr[1] = sn;
mat.ptr[2] = -sn; mat.ptr[3] = cs;
mat.ptr[4] = tx; mat.ptr[5] = ty;
return this;
}
/// Returns new identity matrix.
static NVGMatrix Identity () { pragma(inline, true); return NVGMatrix.init; }
/// Returns new translation matrix.
static NVGMatrix Translated (in float tx, in float ty) {
version(aliced) pragma(inline, true);
NVGMatrix res = void;
res.mat.ptr[0] = 1.0f; res.mat.ptr[1] = 0.0f;
res.mat.ptr[2] = 0.0f; res.mat.ptr[3] = 1.0f;
res.mat.ptr[4] = tx; res.mat.ptr[5] = ty;
return res;
}
/// Returns new scaling matrix.
static NVGMatrix Scaled (in float sx, in float sy) {
version(aliced) pragma(inline, true);
NVGMatrix res = void;
res.mat.ptr[0] = sx; res.mat.ptr[1] = 0.0f;
res.mat.ptr[2] = 0.0f; res.mat.ptr[3] = sy;
res.mat.ptr[4] = 0.0f; res.mat.ptr[5] = 0.0f;
return res;
}
/// Returns new rotation matrix. Angle is specified in radians.
static NVGMatrix Rotated (in float a) {
version(aliced) pragma(inline, true);
immutable float cs = nvg__cosf(a), sn = nvg__sinf(a);
NVGMatrix res = void;
res.mat.ptr[0] = cs; res.mat.ptr[1] = sn;
res.mat.ptr[2] = -sn; res.mat.ptr[3] = cs;
res.mat.ptr[4] = 0.0f; res.mat.ptr[5] = 0.0f;
return res;
}
/// Returns new x-skewing matrix. Angle is specified in radians.
static NVGMatrix SkewedX (in float a) {
version(aliced) pragma(inline, true);
NVGMatrix res = void;
res.mat.ptr[0] = 1.0f; res.mat.ptr[1] = 0.0f;
res.mat.ptr[2] = nvg__tanf(a); res.mat.ptr[3] = 1.0f;
res.mat.ptr[4] = 0.0f; res.mat.ptr[5] = 0.0f;
return res;
}
/// Returns new y-skewing matrix. Angle is specified in radians.
static NVGMatrix SkewedY (in float a) {
version(aliced) pragma(inline, true);
NVGMatrix res = void;
res.mat.ptr[0] = 1.0f; res.mat.ptr[1] = nvg__tanf(a);
res.mat.ptr[2] = 0.0f; res.mat.ptr[3] = 1.0f;
res.mat.ptr[4] = 0.0f; res.mat.ptr[5] = 0.0f;
return res;
}
/// Returns new xy-skewing matrix. Angles are specified in radians.
static NVGMatrix SkewedXY (in float ax, in float ay) {
version(aliced) pragma(inline, true);
NVGMatrix res = void;
res.mat.ptr[0] = 1.0f; res.mat.ptr[1] = nvg__tanf(ay);
res.mat.ptr[2] = nvg__tanf(ax); res.mat.ptr[3] = 1.0f;
res.mat.ptr[4] = 0.0f; res.mat.ptr[5] = 0.0f;
return res;
}
/// Utility function to be used in `setXXX()`.
/// This is the same as doing: `NVGMatrix.Identity.rotate(a).scale(xs, ys).translate(tx, ty)`, only faster
static NVGMatrix ScaledRotatedTransformed (in float xscale, in float yscale, in float a, in float tx, in float ty) {
NVGMatrix res = void;
res.scaleRotateTransform(xscale, yscale, a, tx, ty);
return res;
}
/// This is the same as doing: `NVGMatrix.Identity.rotate(a).translate(tx, ty)`, only faster
static NVGMatrix RotatedTransformed (in float a, in float tx, in float ty) {
NVGMatrix res = void;
res.rotateTransform(a, tx, ty);
return res;
}
}
/// Converts degrees to radians.
/// Group: matrices
public float nvgDegToRad() (in float deg) pure nothrow @safe @nogc { pragma(inline, true); return deg/180.0f*NVG_PI; }
/// Converts radians to degrees.
/// Group: matrices
public float nvgRadToDeg() (in float rad) pure nothrow @safe @nogc { pragma(inline, true); return rad/NVG_PI*180.0f; }
public alias nvgDegrees = nvgDegToRad; /// Use this like `42.nvgDegrees`
public float nvgRadians() (in float rad) pure nothrow @safe @nogc { pragma(inline, true); return rad; } /// Use this like `0.1.nvgRadians`
// ////////////////////////////////////////////////////////////////////////// //
void nvg__setPaintColor() (ref NVGPaint p, in auto ref NVGColor color) nothrow @trusted @nogc {
p.clear();
p.xform.identity;
p.radius = 0.0f;
p.feather = 1.0f;
p.innerColor = p.middleColor = p.outerColor = color;
p.midp = -1;
p.simpleColor = true;
}
// ////////////////////////////////////////////////////////////////////////// //
// State handling
version(nanovega_debug_clipping) {
public void nvgClipDumpOn (NVGContext ctx) { glnvg__clipDebugDump(ctx.params.userPtr, true); }
public void nvgClipDumpOff (NVGContext ctx) { glnvg__clipDebugDump(ctx.params.userPtr, false); }
}
/** Pushes and saves the current render state into a state stack.
* A matching [restore] must be used to restore the state.
* Returns `false` if state stack overflowed.
*
* Group: state_handling
*/
public bool save (NVGContext ctx) nothrow @trusted @nogc {
if (ctx.nstates >= NVG_MAX_STATES) return false;
if (ctx.nstates > 0) {
//memcpy(&ctx.states[ctx.nstates], &ctx.states[ctx.nstates-1], NVGstate.sizeof);
ctx.states[ctx.nstates] = ctx.states[ctx.nstates-1];
ctx.params.renderPushClip(ctx.params.userPtr);
}
++ctx.nstates;
return true;
}
/// Pops and restores current render state.
/// Group: state_handling
public bool restore (NVGContext ctx) nothrow @trusted @nogc {
if (ctx.nstates <= 1) return false;
ctx.states[ctx.nstates-1].clearPaint();
ctx.params.renderPopClip(ctx.params.userPtr);
--ctx.nstates;
return true;
}
/// Resets current render state to default values. Does not affect the render state stack.
/// Group: state_handling
public void reset (NVGContext ctx) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
state.clearPaint();
nvg__setPaintColor(state.fill, nvgRGBA(255, 255, 255, 255));
nvg__setPaintColor(state.stroke, nvgRGBA(0, 0, 0, 255));
state.compositeOperation = nvg__compositeOperationState(NVGCompositeOperation.SourceOver);
state.shapeAntiAlias = true;
state.strokeWidth = 1.0f;
state.miterLimit = 10.0f;
state.lineCap = NVGLineCap.Butt;
state.lineJoin = NVGLineCap.Miter;
state.alpha = 1.0f;
state.xform.identity;
state.scissor.extent[] = -1.0f;
state.fontSize = 16.0f;
state.letterSpacing = 0.0f;
state.lineHeight = 1.0f;
state.fontBlur = 0.0f;
state.textAlign.reset;
state.fontId = 0;
state.evenOddMode = false;
state.dashCount = 0;
state.lastFlattenDashCount = 0;
state.dashStart = 0;
state.firstDashIsGap = false;
state.dasherActive = false;
ctx.params.renderResetClip(ctx.params.userPtr);
}
/** Returns `true` if we have any room in state stack.
* It is guaranteed to have at least 32 stack slots.
*
* Group: state_handling
*/
public bool canSave (NVGContext ctx) pure nothrow @trusted @nogc { pragma(inline, true); return (ctx.nstates < NVG_MAX_STATES); }
/** Returns `true` if we have any saved state.
*
* Group: state_handling
*/
public bool canRestore (NVGContext ctx) pure nothrow @trusted @nogc { pragma(inline, true); return (ctx.nstates > 1); }
/// Returns `true` if rendering is currently blocked.
/// Group: state_handling
public bool renderBlocked (NVGContext ctx) pure nothrow @trusted @nogc { pragma(inline, true); return (ctx !is null && ctx.contextAlive ? ctx.recblockdraw : false); }
/// Blocks/unblocks rendering
/// Group: state_handling
public void renderBlocked (NVGContext ctx, bool v) pure nothrow @trusted @nogc { pragma(inline, true); if (ctx !is null && ctx.contextAlive) ctx.recblockdraw = v; }
/// Blocks/unblocks rendering; returns previous state.
/// Group: state_handling
public bool setRenderBlocked (NVGContext ctx, bool v) pure nothrow @trusted @nogc { pragma(inline, true); if (ctx !is null && ctx.contextAlive) { bool res = ctx.recblockdraw; ctx.recblockdraw = v; return res; } else return false; }
// ////////////////////////////////////////////////////////////////////////// //
// Render styles
/// Sets filling mode to "even-odd".
/// Group: render_styles
public void evenOddFill (NVGContext ctx) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
state.evenOddMode = true;
}
/// Sets filling mode to "non-zero" (this is default mode).
/// Group: render_styles
public void nonZeroFill (NVGContext ctx) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
state.evenOddMode = false;
}
/// Sets whether to draw antialias for [stroke] and [fill]. It's enabled by default.
/// Group: render_styles
public void shapeAntiAlias (NVGContext ctx, bool enabled) {
NVGstate* state = nvg__getState(ctx);
state.shapeAntiAlias = enabled;
}
/// Sets the stroke width of the stroke style.
/// Group: render_styles
@scriptable
public void strokeWidth (NVGContext ctx, float width) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
state.strokeWidth = width;
}
/// Sets the miter limit of the stroke style. Miter limit controls when a sharp corner is beveled.
/// Group: render_styles
public void miterLimit (NVGContext ctx, float limit) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
state.miterLimit = limit;
}
/// Sets how the end of the line (cap) is drawn,
/// Can be one of: NVGLineCap.Butt (default), NVGLineCap.Round, NVGLineCap.Square.
/// Group: render_styles
public void lineCap (NVGContext ctx, NVGLineCap cap) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
state.lineCap = cap;
}
/// Sets how sharp path corners are drawn.
/// Can be one of NVGLineCap.Miter (default), NVGLineCap.Round, NVGLineCap.Bevel.
/// Group: render_styles
public void lineJoin (NVGContext ctx, NVGLineCap join) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
state.lineJoin = join;
}
/// Sets stroke dashing, using (dash_length, gap_length) pairs.
/// Current limit is 16 pairs.
/// Resets dash start to zero.
/// Group: render_styles
public void setLineDash (NVGContext ctx, const(float)[] dashdata) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
state.dashCount = 0;
state.dashStart = 0;
state.firstDashIsGap = false;
if (dashdata.length >= 2) {
bool curFIsGap = true; // trick
foreach (immutable idx, float f; dashdata) {
curFIsGap = !curFIsGap;
if (f < 0.01f) continue; // skip it
if (idx == 0) {
// register first dash
state.firstDashIsGap = curFIsGap;
state.dashes.ptr[state.dashCount++] = f;
} else {
if ((idx&1) != ((state.dashCount&1)^cast(uint)state.firstDashIsGap)) {
// oops, continuation
state.dashes[state.dashCount-1] += f;
} else {
if (state.dashCount == state.dashes.length) break;
state.dashes[state.dashCount++] = f;
}
}
}
if (state.dashCount&1) {
if (state.dashCount == 1) {
state.dashCount = 0;
} else {
assert(state.dashCount < state.dashes.length);
state.dashes[state.dashCount++] = 0;
}
}
// calculate total dash path length
state.totalDashLen = 0;
foreach (float f; state.dashes.ptr[0..state.dashCount]) state.totalDashLen += f;
if (state.totalDashLen < 0.01f) {
state.dashCount = 0; // nothing to do
} else {
if (state.lastFlattenDashCount != 0) state.lastFlattenDashCount = uint.max; // force re-flattening
}
}
}
public alias lineDash = setLineDash; /// Ditto.
/// Sets stroke dashing, using (dash_length, gap_length) pairs.
/// Current limit is 16 pairs.
/// Group: render_styles
public void setLineDashStart (NVGContext ctx, in float dashStart) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
if (state.lastFlattenDashCount != 0 && state.dashStart != dashStart) {
state.lastFlattenDashCount = uint.max; // force re-flattening
}
state.dashStart = dashStart;
}
public alias lineDashStart = setLineDashStart; /// Ditto.
/// Sets the transparency applied to all rendered shapes.
/// Already transparent paths will get proportionally more transparent as well.
/// Group: render_styles
public void globalAlpha (NVGContext ctx, float alpha) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
state.alpha = alpha;
}
private void strokeColor() {}
static if (NanoVegaHasArsdColor) {
/// Sets current stroke style to a solid color.
/// Group: render_styles
@scriptable
public void strokeColor (NVGContext ctx, Color color) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
nvg__setPaintColor(state.stroke, NVGColor(color));
}
}
/// Sets current stroke style to a solid color.
/// Group: render_styles
public void strokeColor() (NVGContext ctx, in auto ref NVGColor color) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
nvg__setPaintColor(state.stroke, color);
}
@scriptable
public void strokePaint(NVGContext ctx, in NVGPaint* paint) nothrow @trusted @nogc {
strokePaint(ctx, *paint);
}
/// Sets current stroke style to a paint, which can be a one of the gradients or a pattern.
/// Group: render_styles
@scriptable
public void strokePaint() (NVGContext ctx, in auto ref NVGPaint paint) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
state.stroke = paint;
//nvgTransformMultiply(state.stroke.xform[], state.xform[]);
state.stroke.xform.mul(state.xform);
}
// this is a hack to work around https://issues.dlang.org/show_bug.cgi?id=16206
// for scriptable reflection. it just needs to be declared first among the overloads
private void fillColor (NVGContext ctx) nothrow @trusted @nogc { }
static if (NanoVegaHasArsdColor) {
/// Sets current fill style to a solid color.
/// Group: render_styles
@scriptable
public void fillColor (NVGContext ctx, Color color) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
nvg__setPaintColor(state.fill, NVGColor(color));
}
}
/// Sets current fill style to a solid color.
/// Group: render_styles
public void fillColor() (NVGContext ctx, in auto ref NVGColor color) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
nvg__setPaintColor(state.fill, color);
}
@scriptable // kinda a hack for bug 16206 but also because jsvar deals in opaque NVGPaint* instead of auto refs (which it doesn't know how to reflect on)
public void fillPaint (NVGContext ctx, in NVGPaint* paint) nothrow @trusted @nogc {
fillPaint(ctx, *paint);
}
/// Sets current fill style to a paint, which can be a one of the gradients or a pattern.
/// Group: render_styles
@scriptable
public void fillPaint() (NVGContext ctx, in auto ref NVGPaint paint) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
state.fill = paint;
//nvgTransformMultiply(state.fill.xform[], state.xform[]);
state.fill.xform.mul(state.xform);
}
/// Sets current fill style to a multistop linear gradient.
/// Group: render_styles
public void fillPaint() (NVGContext ctx, in auto ref NVGLGS lgs) nothrow @trusted @nogc {
if (!lgs.valid) {
NVGPaint p = void;
memset(&p, 0, p.sizeof);
nvg__setPaintColor(p, NVGColor.red);
ctx.fillPaint = p;
} else if (lgs.midp >= -1) {
//{ import core.stdc.stdio; printf("SIMPLE! midp=%f\n", cast(double)lgs.midp); }
ctx.fillPaint = ctx.linearGradient(lgs.cx, lgs.cy, lgs.dimx, lgs.dimy, lgs.ic, lgs.midp, lgs.mc, lgs.oc);
} else {
ctx.fillPaint = ctx.imagePattern(lgs.cx, lgs.cy, lgs.dimx, lgs.dimy, lgs.angle, lgs.imgid);
}
}
/// Returns current transformation matrix.
/// Group: render_transformations
public NVGMatrix currTransform (NVGContext ctx) pure nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
return state.xform;
}
/// Sets current transformation matrix.
/// Group: render_transformations
public void currTransform() (NVGContext ctx, in auto ref NVGMatrix m) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
state.xform = m;
}
/// Resets current transform to an identity matrix.
/// Group: render_transformations
@scriptable
public void resetTransform (NVGContext ctx) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
state.xform.identity;
}
/// Premultiplies current coordinate system by specified matrix.
/// Group: render_transformations
public void transform() (NVGContext ctx, in auto ref NVGMatrix mt) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
//nvgTransformPremultiply(state.xform[], t[]);
state.xform *= mt;
}
/// Translates current coordinate system.
/// Group: render_transformations
@scriptable
public void translate (NVGContext ctx, in float x, in float y) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
//NVGMatrix t = void;
//nvgTransformTranslate(t[], x, y);
//nvgTransformPremultiply(state.xform[], t[]);
state.xform.premul(NVGMatrix.Translated(x, y));
}
/// Rotates current coordinate system. Angle is specified in radians.
/// Group: render_transformations
@scriptable
public void rotate (NVGContext ctx, in float angle) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
//NVGMatrix t = void;
//nvgTransformRotate(t[], angle);
//nvgTransformPremultiply(state.xform[], t[]);
state.xform.premul(NVGMatrix.Rotated(angle));
}
/// Skews the current coordinate system along X axis. Angle is specified in radians.
/// Group: render_transformations
@scriptable
public void skewX (NVGContext ctx, in float angle) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
//NVGMatrix t = void;
//nvgTransformSkewX(t[], angle);
//nvgTransformPremultiply(state.xform[], t[]);
state.xform.premul(NVGMatrix.SkewedX(angle));
}
/// Skews the current coordinate system along Y axis. Angle is specified in radians.
/// Group: render_transformations
@scriptable
public void skewY (NVGContext ctx, in float angle) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
//NVGMatrix t = void;
//nvgTransformSkewY(t[], angle);
//nvgTransformPremultiply(state.xform[], t[]);
state.xform.premul(NVGMatrix.SkewedY(angle));
}
/// Scales the current coordinate system.
/// Group: render_transformations
@scriptable
public void scale (NVGContext ctx, in float x, in float y) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
//NVGMatrix t = void;
//nvgTransformScale(t[], x, y);
//nvgTransformPremultiply(state.xform[], t[]);
state.xform.premul(NVGMatrix.Scaled(x, y));
}
// ////////////////////////////////////////////////////////////////////////// //
// Images
/// Creates image by loading it from the disk from specified file name.
/// Returns handle to the image or 0 on error.
/// Group: images
public NVGImage createImage() (NVGContext ctx, const(char)[] filename, const(NVGImageFlag)[] imageFlagsList...) {
static if (NanoVegaHasArsdImage) {
import arsd.image;
// do we have new arsd API to load images?
static if (!is(typeof(MemoryImage.fromImageFile)) || !is(typeof(MemoryImage.clearInternal))) {
static assert(0, "Sorry, your ARSD is too old. Please, update it.");
}
try {
auto oimg = MemoryImage.fromImageFile(filename);
if (auto img = cast(TrueColorImage)oimg) {
scope(exit) oimg.clearInternal();
return ctx.createImageRGBA(img.width, img.height, img.imageData.bytes[], imageFlagsList);
} else {
TrueColorImage img = oimg.getAsTrueColorImage;
scope(exit) img.clearInternal();
oimg.clearInternal(); // drop original image, as `getAsTrueColorImage()` MUST create a new one here
oimg = null;
return ctx.createImageRGBA(img.width, img.height, img.imageData.bytes[], imageFlagsList);
}
} catch (Exception) {}
return NVGImage.init;
} else {
import std.internal.cstring;
ubyte* img;
int w, h, n;
stbi_set_unpremultiply_on_load(1);
stbi_convert_iphone_png_to_rgb(1);
img = stbi_load(filename.tempCString, &w, &h, &n, 4);
if (img is null) {
//printf("Failed to load %s - %s\n", filename, stbi_failure_reason());
return NVGImage.init;
}
auto image = ctx.createImageRGBA(w, h, img[0..w*h*4], imageFlagsList);
stbi_image_free(img);
return image;
}
}
static if (NanoVegaHasArsdImage) {
/// Creates image by loading it from the specified memory image.
/// Returns handle to the image or 0 on error.
/// Group: images
public NVGImage createImageFromMemoryImage() (NVGContext ctx, MemoryImage img, const(NVGImageFlag)[] imageFlagsList...) {
if (img is null) return NVGImage.init;
if (auto tc = cast(TrueColorImage)img) {
return ctx.createImageRGBA(tc.width, tc.height, tc.imageData.bytes[], imageFlagsList);
} else {
auto tc = img.getAsTrueColorImage;
scope(exit) tc.clearInternal(); // here, it is guaranteed that `tc` is newly allocated image, so it is safe to kill it
return ctx.createImageRGBA(tc.width, tc.height, tc.imageData.bytes[], imageFlagsList);
}
}
} else {
/// Creates image by loading it from the specified chunk of memory.
/// Returns handle to the image or 0 on error.
/// Group: images
public NVGImage createImageMem() (NVGContext ctx, const(ubyte)* data, int ndata, const(NVGImageFlag)[] imageFlagsList...) {
int w, h, n, image;
ubyte* img = stbi_load_from_memory(data, ndata, &w, &h, &n, 4);
if (img is null) {
//printf("Failed to load %s - %s\n", filename, stbi_failure_reason());
return NVGImage.init;
}
image = ctx.createImageRGBA(w, h, img[0..w*h*4], imageFlagsList);
stbi_image_free(img);
return image;
}
}
/// Creates image from specified image data.
/// Returns handle to the image or 0 on error.
/// Group: images
public NVGImage createImageRGBA (NVGContext ctx, int w, int h, const(void)[] data, const(NVGImageFlag)[] imageFlagsList...) nothrow @trusted @nogc {
if (w < 1 || h < 1 || data.length < w*h*4) return NVGImage.init;
uint imageFlags = 0;
foreach (immutable uint flag; imageFlagsList) imageFlags |= flag;
NVGImage res;
res.id = ctx.params.renderCreateTexture(ctx.params.userPtr, NVGtexture.RGBA, w, h, imageFlags, cast(const(ubyte)*)data.ptr);
if (res.id > 0) {
version(nanovega_debug_image_manager_rc) { import core.stdc.stdio; printf("createImageRGBA: img=%p; imgid=%d\n", &res, res.id); }
res.ctx = ctx;
ctx.nvg__imageIncRef(res.id, false); // don't increment driver refcount
}
return res;
}
/// Updates image data specified by image handle.
/// Group: images
public void updateImage() (NVGContext ctx, auto ref NVGImage image, const(void)[] data) nothrow @trusted @nogc {
if (image.valid) {
int w, h;
if (image.ctx !is ctx) assert(0, "NanoVega: you cannot use image from one context in another context");
ctx.params.renderGetTextureSize(ctx.params.userPtr, image.id, &w, &h);
ctx.params.renderUpdateTexture(ctx.params.userPtr, image.id, 0, 0, w, h, cast(const(ubyte)*)data.ptr);
}
}
/// Returns the dimensions of a created image.
/// Group: images
public void imageSize() (NVGContext ctx, in auto ref NVGImage image, out int w, out int h) nothrow @trusted @nogc {
if (image.valid) {
if (image.ctx !is ctx) assert(0, "NanoVega: you cannot use image from one context in another context");
ctx.params.renderGetTextureSize(cast(void*)ctx.params.userPtr, image.id, &w, &h);
}
}
/// Deletes created image.
/// Group: images
public void deleteImage() (NVGContext ctx, ref NVGImage image) nothrow @trusted @nogc {
if (ctx is null || !image.valid) return;
if (image.ctx !is ctx) assert(0, "NanoVega: you cannot use image from one context in another context");
image.clear();
}
// ////////////////////////////////////////////////////////////////////////// //
// Paints
private void linearGradient() {} // hack for dmd bug
static if (NanoVegaHasArsdColor) {
/** Creates and returns a linear gradient. Parameters `(sx, sy) (ex, ey)` specify the start and end coordinates
* of the linear gradient, icol specifies the start color and ocol the end color.
* The gradient is transformed by the current transform when it is passed to [fillPaint] or [strokePaint].
*
* Group: paints
*/
@scriptable
public NVGPaint linearGradient (NVGContext ctx, in float sx, in float sy, in float ex, in float ey, in Color icol, in Color ocol) nothrow @trusted @nogc {
return ctx.linearGradient(sx, sy, ex, ey, NVGColor(icol), NVGColor(ocol));
}
/** Creates and returns a linear gradient with middle stop. Parameters `(sx, sy) (ex, ey)` specify the start
* and end coordinates of the linear gradient, icol specifies the start color, midp specifies stop point in
* range `(0..1)`, and ocol the end color.
* The gradient is transformed by the current transform when it is passed to [fillPaint] or [strokePaint].
*
* Group: paints
*/
public NVGPaint linearGradient (NVGContext ctx, in float sx, in float sy, in float ex, in float ey, in Color icol, in float midp, in Color mcol, in Color ocol) nothrow @trusted @nogc {
return ctx.linearGradient(sx, sy, ex, ey, NVGColor(icol), midp, NVGColor(mcol), NVGColor(ocol));
}
}
/** Creates and returns a linear gradient. Parameters `(sx, sy) (ex, ey)` specify the start and end coordinates
* of the linear gradient, icol specifies the start color and ocol the end color.
* The gradient is transformed by the current transform when it is passed to [fillPaint] or [strokePaint].
*
* Group: paints
*/
public NVGPaint linearGradient() (NVGContext ctx, float sx, float sy, float ex, float ey, in auto ref NVGColor icol, in auto ref NVGColor ocol) nothrow @trusted @nogc {
enum large = 1e5f;
NVGPaint p = void;
memset(&p, 0, p.sizeof);
p.simpleColor = false;
// Calculate transform aligned to the line
float dx = ex-sx;
float dy = ey-sy;
immutable float d = nvg__sqrtf(dx*dx+dy*dy);
if (d > 0.0001f) {
dx /= d;
dy /= d;
} else {
dx = 0;
dy = 1;
}
p.xform.mat.ptr[0] = dy; p.xform.mat.ptr[1] = -dx;
p.xform.mat.ptr[2] = dx; p.xform.mat.ptr[3] = dy;
p.xform.mat.ptr[4] = sx-dx*large; p.xform.mat.ptr[5] = sy-dy*large;
p.extent.ptr[0] = large;
p.extent.ptr[1] = large+d*0.5f;
p.radius = 0.0f;
p.feather = nvg__max(NVG_MIN_FEATHER, d);
p.innerColor = p.middleColor = icol;
p.outerColor = ocol;
p.midp = -1;
return p;
}
/** Creates and returns a linear gradient with middle stop. Parameters `(sx, sy) (ex, ey)` specify the start
* and end coordinates of the linear gradient, icol specifies the start color, midp specifies stop point in
* range `(0..1)`, and ocol the end color.
* The gradient is transformed by the current transform when it is passed to [fillPaint] or [strokePaint].
*
* Group: paints
*/
public NVGPaint linearGradient() (NVGContext ctx, float sx, float sy, float ex, float ey, in auto ref NVGColor icol, in float midp, in auto ref NVGColor mcol, in auto ref NVGColor ocol) nothrow @trusted @nogc {
enum large = 1e5f;
NVGPaint p = void;
memset(&p, 0, p.sizeof);
p.simpleColor = false;
// Calculate transform aligned to the line
float dx = ex-sx;
float dy = ey-sy;
immutable float d = nvg__sqrtf(dx*dx+dy*dy);
if (d > 0.0001f) {
dx /= d;
dy /= d;
} else {
dx = 0;
dy = 1;
}
p.xform.mat.ptr[0] = dy; p.xform.mat.ptr[1] = -dx;
p.xform.mat.ptr[2] = dx; p.xform.mat.ptr[3] = dy;
p.xform.mat.ptr[4] = sx-dx*large; p.xform.mat.ptr[5] = sy-dy*large;
p.extent.ptr[0] = large;
p.extent.ptr[1] = large+d*0.5f;
p.radius = 0.0f;
p.feather = nvg__max(NVG_MIN_FEATHER, d);
if (midp <= 0) {
p.innerColor = p.middleColor = mcol;
p.midp = -1;
} else if (midp > 1) {
p.innerColor = p.middleColor = icol;
p.midp = -1;
} else {
p.innerColor = icol;
p.middleColor = mcol;
p.midp = midp;
}
p.outerColor = ocol;
return p;
}
static if (NanoVegaHasArsdColor) {
/** Creates and returns a radial gradient. Parameters (cx, cy) specify the center, inr and outr specify
* the inner and outer radius of the gradient, icol specifies the start color and ocol the end color.
* The gradient is transformed by the current transform when it is passed to [fillPaint] or [strokePaint].
*
* Group: paints
*/
public NVGPaint radialGradient (NVGContext ctx, in float cx, in float cy, in float inr, in float outr, in Color icol, in Color ocol) nothrow @trusted @nogc {
return ctx.radialGradient(cx, cy, inr, outr, NVGColor(icol), NVGColor(ocol));
}
}
/** Creates and returns a radial gradient. Parameters (cx, cy) specify the center, inr and outr specify
* the inner and outer radius of the gradient, icol specifies the start color and ocol the end color.
* The gradient is transformed by the current transform when it is passed to [fillPaint] or [strokePaint].
*
* Group: paints
*/
public NVGPaint radialGradient() (NVGContext ctx, float cx, float cy, float inr, float outr, in auto ref NVGColor icol, in auto ref NVGColor ocol) nothrow @trusted @nogc {
immutable float r = (inr+outr)*0.5f;
immutable float f = (outr-inr);
NVGPaint p = void;
memset(&p, 0, p.sizeof);
p.simpleColor = false;
p.xform.identity;
p.xform.mat.ptr[4] = cx;
p.xform.mat.ptr[5] = cy;
p.extent.ptr[0] = r;
p.extent.ptr[1] = r;
p.radius = r;
p.feather = nvg__max(NVG_MIN_FEATHER, f);
p.innerColor = p.middleColor = icol;
p.outerColor = ocol;
p.midp = -1;
return p;
}
static if (NanoVegaHasArsdColor) {
/** Creates and returns a box gradient. Box gradient is a feathered rounded rectangle, it is useful for rendering
* drop shadows or highlights for boxes. Parameters (x, y) define the top-left corner of the rectangle,
* (w, h) define the size of the rectangle, r defines the corner radius, and f feather. Feather defines how blurry
* the border of the rectangle is. Parameter icol specifies the inner color and ocol the outer color of the gradient.
* The gradient is transformed by the current transform when it is passed to [fillPaint] or [strokePaint].
*
* Group: paints
*/
public NVGPaint boxGradient (NVGContext ctx, in float x, in float y, in float w, in float h, in float r, in float f, in Color icol, in Color ocol) nothrow @trusted @nogc {
return ctx.boxGradient(x, y, w, h, r, f, NVGColor(icol), NVGColor(ocol));
}
}
/** Creates and returns a box gradient. Box gradient is a feathered rounded rectangle, it is useful for rendering
* drop shadows or highlights for boxes. Parameters (x, y) define the top-left corner of the rectangle,
* (w, h) define the size of the rectangle, r defines the corner radius, and f feather. Feather defines how blurry
* the border of the rectangle is. Parameter icol specifies the inner color and ocol the outer color of the gradient.
* The gradient is transformed by the current transform when it is passed to [fillPaint] or [strokePaint].
*
* Group: paints
*/
public NVGPaint boxGradient() (NVGContext ctx, float x, float y, float w, float h, float r, float f, in auto ref NVGColor icol, in auto ref NVGColor ocol) nothrow @trusted @nogc {
NVGPaint p = void;
memset(&p, 0, p.sizeof);
p.simpleColor = false;
p.xform.identity;
p.xform.mat.ptr[4] = x+w*0.5f;
p.xform.mat.ptr[5] = y+h*0.5f;
p.extent.ptr[0] = w*0.5f;
p.extent.ptr[1] = h*0.5f;
p.radius = r;
p.feather = nvg__max(NVG_MIN_FEATHER, f);
p.innerColor = p.middleColor = icol;
p.outerColor = ocol;
p.midp = -1;
return p;
}
/** Creates and returns an image pattern. Parameters `(cx, cy)` specify the left-top location of the image pattern,
* `(w, h)` the size of one image, [angle] rotation around the top-left corner, [image] is handle to the image to render.
* The gradient is transformed by the current transform when it is passed to [fillPaint] or [strokePaint].
*
* Group: paints
*/
public NVGPaint imagePattern() (NVGContext ctx, float cx, float cy, float w, float h, float angle, in auto ref NVGImage image, float alpha=1) nothrow @trusted @nogc {
NVGPaint p = void;
memset(&p, 0, p.sizeof);
p.simpleColor = false;
p.xform.identity.rotate(angle);
p.xform.mat.ptr[4] = cx;
p.xform.mat.ptr[5] = cy;
p.extent.ptr[0] = w;
p.extent.ptr[1] = h;
p.image = image;
p.innerColor = p.middleColor = p.outerColor = nvgRGBAf(1, 1, 1, alpha);
p.midp = -1;
return p;
}
/// Linear gradient with multiple stops.
/// $(WARNING THIS IS EXPERIMENTAL API AND MAY BE CHANGED/BROKEN IN NEXT RELEASES!)
/// Group: paints
public struct NVGLGS {
private:
NVGColor ic, mc, oc; // inner, middle, out
float midp;
NVGImage imgid;
// [imagePattern] arguments
float cx, cy, dimx, dimy; // dimx and dimy are ex and ey for simple gradients
public float angle; ///
public:
@property bool valid () const pure nothrow @safe @nogc { pragma(inline, true); return (imgid.valid || midp >= -1); } ///
void clear () nothrow @safe @nogc { pragma(inline, true); imgid.clear(); midp = float.nan; } ///
}
/** Returns [NVGPaint] for linear gradient with stops, created with [createLinearGradientWithStops].
* The gradient is transformed by the current transform when it is passed to [fillPaint] or [strokePaint].
*
* $(WARNING THIS IS EXPERIMENTAL API AND MAY BE CHANGED/BROKEN IN NEXT RELEASES!)
* Group: paints
*/
public NVGPaint asPaint() (NVGContext ctx, in auto ref NVGLGS lgs) nothrow @trusted @nogc {
if (!lgs.valid) {
NVGPaint p = void;
memset(&p, 0, p.sizeof);
nvg__setPaintColor(p, NVGColor.red);
return p;
} else if (lgs.midp >= -1) {
return ctx.linearGradient(lgs.cx, lgs.cy, lgs.dimx, lgs.dimy, lgs.ic, lgs.midp, lgs.mc, lgs.oc);
} else {
return ctx.imagePattern(lgs.cx, lgs.cy, lgs.dimx, lgs.dimy, lgs.angle, lgs.imgid);
}
}
/// Gradient Stop Point.
/// $(WARNING THIS IS EXPERIMENTAL API AND MAY BE CHANGED/BROKEN IN NEXT RELEASES!)
/// Group: paints
public struct NVGGradientStop {
float offset = 0; /// [0..1]
NVGColor color; ///
this() (in float aofs, in auto ref NVGColor aclr) nothrow @trusted @nogc { pragma(inline, true); offset = aofs; color = aclr; } ///
static if (NanoVegaHasArsdColor) {
this() (in float aofs, in Color aclr) nothrow @trusted @nogc { pragma(inline, true); offset = aofs; color = NVGColor(aclr); } ///
}
}
/// Create linear gradient data suitable to use with `linearGradient(res)`.
/// Don't forget to destroy the result when you don't need it anymore with `ctx.kill(res);`.
/// $(WARNING THIS IS EXPERIMENTAL API AND MAY BE CHANGED/BROKEN IN NEXT RELEASES!)
/// Group: paints
public NVGLGS createLinearGradientWithStops (NVGContext ctx, in float sx, in float sy, in float ex, in float ey, const(NVGGradientStop)[] stops...) nothrow @trusted @nogc {
// based on the code by Jorge Acereda <jacereda@gmail.com>
enum NVG_GRADIENT_SAMPLES = 1024;
static void gradientSpan (uint* dst, const(NVGGradientStop)* s0, const(NVGGradientStop)* s1) nothrow @trusted @nogc {
immutable float s0o = nvg__clamp(s0.offset, 0.0f, 1.0f);
immutable float s1o = nvg__clamp(s1.offset, 0.0f, 1.0f);
uint s = cast(uint)(s0o*NVG_GRADIENT_SAMPLES);
uint e = cast(uint)(s1o*NVG_GRADIENT_SAMPLES);
uint sc = 0xffffffffU;
uint sh = 24;
uint r = cast(uint)(s0.color.rgba[0]*sc);
uint g = cast(uint)(s0.color.rgba[1]*sc);
uint b = cast(uint)(s0.color.rgba[2]*sc);
uint a = cast(uint)(s0.color.rgba[3]*sc);
uint dr = cast(uint)((s1.color.rgba[0]*sc-r)/(e-s));
uint dg = cast(uint)((s1.color.rgba[1]*sc-g)/(e-s));
uint db = cast(uint)((s1.color.rgba[2]*sc-b)/(e-s));
uint da = cast(uint)((s1.color.rgba[3]*sc-a)/(e-s));
dst += s;
foreach (immutable _; s..e) {
version(BigEndian) {
*dst++ = ((r>>sh)<<24)+((g>>sh)<<16)+((b>>sh)<<8)+((a>>sh)<<0);
} else {
*dst++ = ((a>>sh)<<24)+((b>>sh)<<16)+((g>>sh)<<8)+((r>>sh)<<0);
}
r += dr;
g += dg;
b += db;
a += da;
}
}
NVGLGS res;
res.cx = sx;
res.cy = sy;
if (stops.length == 2 && stops.ptr[0].offset <= 0 && stops.ptr[1].offset >= 1) {
// create simple linear gradient
res.ic = res.mc = stops.ptr[0].color;
res.oc = stops.ptr[1].color;
res.midp = -1;
res.dimx = ex;
res.dimy = ey;
} else if (stops.length == 3 && stops.ptr[0].offset <= 0 && stops.ptr[2].offset >= 1) {
// create simple linear gradient with middle stop
res.ic = stops.ptr[0].color;
res.mc = stops.ptr[1].color;
res.oc = stops.ptr[2].color;
res.midp = stops.ptr[1].offset;
res.dimx = ex;
res.dimy = ey;
} else {
// create image gradient
uint[NVG_GRADIENT_SAMPLES] data = void;
immutable float w = ex-sx;
immutable float h = ey-sy;
res.dimx = nvg__sqrtf(w*w+h*h);
res.dimy = 1; //???
res.angle =
(/*nvg__absf(h) < 0.0001 ? 0 :
nvg__absf(w) < 0.0001 ? 90.nvgDegrees :*/
nvg__atan2f(h/*ey-sy*/, w/*ex-sx*/));
if (stops.length > 0) {
auto s0 = NVGGradientStop(0, nvgRGBAf(0, 0, 0, 1));
auto s1 = NVGGradientStop(1, nvgRGBAf(1, 1, 1, 1));
if (stops.length > 64) stops = stops[0..64];
if (stops.length) {
s0.color = stops[0].color;
s1.color = stops[$-1].color;
}
gradientSpan(data.ptr, &s0, (stops.length ? stops.ptr : &s1));
foreach (immutable i; 0..stops.length-1) gradientSpan(data.ptr, stops.ptr+i, stops.ptr+i+1);
gradientSpan(data.ptr, (stops.length ? stops.ptr+stops.length-1 : &s0), &s1);
res.imgid = ctx.createImageRGBA(NVG_GRADIENT_SAMPLES, 1, data[]/*, NVGImageFlag.RepeatX, NVGImageFlag.RepeatY*/);
}
}
return res;
}
// ////////////////////////////////////////////////////////////////////////// //
// Scissoring
/// Sets the current scissor rectangle. The scissor rectangle is transformed by the current transform.
/// Group: scissoring
public void scissor (NVGContext ctx, in float x, in float y, float w, float h) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
w = nvg__max(0.0f, w);
h = nvg__max(0.0f, h);
state.scissor.xform.identity;
state.scissor.xform.mat.ptr[4] = x+w*0.5f;
state.scissor.xform.mat.ptr[5] = y+h*0.5f;
//nvgTransformMultiply(state.scissor.xform[], state.xform[]);
state.scissor.xform.mul(state.xform);
state.scissor.extent.ptr[0] = w*0.5f;
state.scissor.extent.ptr[1] = h*0.5f;
}
/// Sets the current scissor rectangle. The scissor rectangle is transformed by the current transform.
/// Arguments: [x, y, w, h]*
/// Group: scissoring
public void scissor (NVGContext ctx, in float[] args) nothrow @trusted @nogc {
enum ArgC = 4;
if (args.length%ArgC != 0) assert(0, "NanoVega: invalid [scissor] call");
if (args.length < ArgC) return;
NVGstate* state = nvg__getState(ctx);
const(float)* aptr = args.ptr;
foreach (immutable idx; 0..args.length/ArgC) {
immutable x = *aptr++;
immutable y = *aptr++;
immutable w = nvg__max(0.0f, *aptr++);
immutable h = nvg__max(0.0f, *aptr++);
state.scissor.xform.identity;
state.scissor.xform.mat.ptr[4] = x+w*0.5f;
state.scissor.xform.mat.ptr[5] = y+h*0.5f;
//nvgTransformMultiply(state.scissor.xform[], state.xform[]);
state.scissor.xform.mul(state.xform);
state.scissor.extent.ptr[0] = w*0.5f;
state.scissor.extent.ptr[1] = h*0.5f;
}
}
void nvg__isectRects (float* dst, float ax, float ay, float aw, float ah, float bx, float by, float bw, float bh) nothrow @trusted @nogc {
immutable float minx = nvg__max(ax, bx);
immutable float miny = nvg__max(ay, by);
immutable float maxx = nvg__min(ax+aw, bx+bw);
immutable float maxy = nvg__min(ay+ah, by+bh);
dst[0] = minx;
dst[1] = miny;
dst[2] = nvg__max(0.0f, maxx-minx);
dst[3] = nvg__max(0.0f, maxy-miny);
}
/** Intersects current scissor rectangle with the specified rectangle.
* The scissor rectangle is transformed by the current transform.
* Note: in case the rotation of previous scissor rect differs from
* the current one, the intersection will be done between the specified
* rectangle and the previous scissor rectangle transformed in the current
* transform space. The resulting shape is always rectangle.
*
* Group: scissoring
*/
public void intersectScissor (NVGContext ctx, in float x, in float y, in float w, in float h) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
// If no previous scissor has been set, set the scissor as current scissor.
if (state.scissor.extent.ptr[0] < 0) {
ctx.scissor(x, y, w, h);
return;
}
NVGMatrix pxform = void;
NVGMatrix invxorm = void;
float[4] rect = void;
// Transform the current scissor rect into current transform space.
// If there is difference in rotation, this will be approximation.
//memcpy(pxform.mat.ptr, state.scissor.xform.ptr, float.sizeof*6);
pxform = state.scissor.xform;
immutable float ex = state.scissor.extent.ptr[0];
immutable float ey = state.scissor.extent.ptr[1];
//nvgTransformInverse(invxorm[], state.xform[]);
invxorm = state.xform.inverted;
//nvgTransformMultiply(pxform[], invxorm[]);
pxform.mul(invxorm);
immutable float tex = ex*nvg__absf(pxform.mat.ptr[0])+ey*nvg__absf(pxform.mat.ptr[2]);
immutable float tey = ex*nvg__absf(pxform.mat.ptr[1])+ey*nvg__absf(pxform.mat.ptr[3]);
// Intersect rects.
nvg__isectRects(rect.ptr, pxform.mat.ptr[4]-tex, pxform.mat.ptr[5]-tey, tex*2, tey*2, x, y, w, h);
//ctx.scissor(rect.ptr[0], rect.ptr[1], rect.ptr[2], rect.ptr[3]);
ctx.scissor(rect.ptr[0..4]);
}
/** Intersects current scissor rectangle with the specified rectangle.
* The scissor rectangle is transformed by the current transform.
* Note: in case the rotation of previous scissor rect differs from
* the current one, the intersection will be done between the specified
* rectangle and the previous scissor rectangle transformed in the current
* transform space. The resulting shape is always rectangle.
*
* Arguments: [x, y, w, h]*
*
* Group: scissoring
*/
public void intersectScissor (NVGContext ctx, in float[] args) nothrow @trusted @nogc {
enum ArgC = 4;
if (args.length%ArgC != 0) assert(0, "NanoVega: invalid [intersectScissor] call");
if (args.length < ArgC) return;
const(float)* aptr = args.ptr;
foreach (immutable idx; 0..args.length/ArgC) {
immutable x = *aptr++;
immutable y = *aptr++;
immutable w = *aptr++;
immutable h = *aptr++;
ctx.intersectScissor(x, y, w, h);
}
}
/// Reset and disables scissoring.
/// Group: scissoring
public void resetScissor (NVGContext ctx) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
state.scissor.xform.mat[] = 0.0f;
state.scissor.extent[] = -1.0f;
}
// ////////////////////////////////////////////////////////////////////////// //
// Render-Time Affine Transformations
/// Sets GPU affine transformatin matrix. Don't do scaling or skewing here.
/// This matrix won't be saved/restored with context state save/restore operations, as it is not a part of that state.
/// Group: gpu_affine
public void affineGPU() (NVGContext ctx, in auto ref NVGMatrix mat) nothrow @trusted @nogc {
ctx.gpuAffine = mat;
ctx.params.renderSetAffine(ctx.params.userPtr, ctx.gpuAffine);
}
/// Get current GPU affine transformatin matrix.
/// Group: gpu_affine
public NVGMatrix affineGPU (NVGContext ctx) nothrow @safe @nogc {
pragma(inline, true);
return ctx.gpuAffine;
}
/// "Untransform" point using current GPU affine matrix.
/// Group: gpu_affine
public void gpuUntransformPoint (NVGContext ctx, float *dx, float *dy, in float x, in float y) nothrow @safe @nogc {
if (ctx.gpuAffine.isIdentity) {
if (dx !is null) *dx = x;
if (dy !is null) *dy = y;
} else {
// inverse GPU transformation
NVGMatrix igpu = ctx.gpuAffine.inverted;
igpu.point(dx, dy, x, y);
}
}
// ////////////////////////////////////////////////////////////////////////// //
// rasterization (tesselation) code
int nvg__ptEquals (float x1, float y1, float x2, float y2, float tol) pure nothrow @safe @nogc {
//pragma(inline, true);
immutable float dx = x2-x1;
immutable float dy = y2-y1;
return dx*dx+dy*dy < tol*tol;
}
float nvg__distPtSeg (float x, float y, float px, float py, float qx, float qy) pure nothrow @safe @nogc {
immutable float pqx = qx-px;
immutable float pqy = qy-py;
float dx = x-px;
float dy = y-py;
immutable float d = pqx*pqx+pqy*pqy;
float t = pqx*dx+pqy*dy;
if (d > 0) t /= d;
if (t < 0) t = 0; else if (t > 1) t = 1;
dx = px+t*pqx-x;
dy = py+t*pqy-y;
return dx*dx+dy*dy;
}
void nvg__appendCommands(bool useCommand=true) (NVGContext ctx, Command acmd, const(float)[] vals...) nothrow @trusted @nogc {
int nvals = cast(int)vals.length;
static if (useCommand) {
enum addon = 1;
} else {
enum addon = 0;
if (nvals == 0) return; // nothing to do
}
NVGstate* state = nvg__getState(ctx);
if (ctx.ncommands+nvals+addon > ctx.ccommands) {
//int ccommands = ctx.ncommands+nvals+ctx.ccommands/2;
int ccommands = ((ctx.ncommands+(nvals+addon))|0xfff)+1;
float* commands = cast(float*)realloc(ctx.commands, float.sizeof*ccommands);
if (commands is null) assert(0, "NanoVega: out of memory");
ctx.commands = commands;
ctx.ccommands = ccommands;
assert(ctx.ncommands+(nvals+addon) <= ctx.ccommands);
}
static if (!useCommand) acmd = cast(Command)vals.ptr[0];
if (acmd != Command.Close && acmd != Command.Winding) {
//assert(nvals+addon >= 3);
ctx.commandx = vals.ptr[nvals-2];
ctx.commandy = vals.ptr[nvals-1];
}
// copy commands
float* vp = ctx.commands+ctx.ncommands;
static if (useCommand) {
vp[0] = cast(float)acmd;
if (nvals > 0) memcpy(vp+1, vals.ptr, nvals*float.sizeof);
} else {
memcpy(vp, vals.ptr, nvals*float.sizeof);
}
ctx.ncommands += nvals+addon;
// transform commands
int i = nvals+addon;
while (i > 0) {
int nlen = 1;
final switch (cast(Command)(*vp)) {
case Command.MoveTo:
case Command.LineTo:
assert(i >= 3);
state.xform.point(vp+1, vp+2, vp[1], vp[2]);
nlen = 3;
break;
case Command.BezierTo:
assert(i >= 7);
state.xform.point(vp+1, vp+2, vp[1], vp[2]);
state.xform.point(vp+3, vp+4, vp[3], vp[4]);
state.xform.point(vp+5, vp+6, vp[5], vp[6]);
nlen = 7;
break;
case Command.Close:
nlen = 1;
break;
case Command.Winding:
nlen = 2;
break;
}
assert(nlen > 0 && nlen <= i);
i -= nlen;
vp += nlen;
}
}
void nvg__clearPathCache (NVGContext ctx) nothrow @trusted @nogc {
// no need to clear paths, as data is not copied there
//foreach (ref p; ctx.cache.paths[0..ctx.cache.npaths]) p.clear();
ctx.cache.npoints = 0;
ctx.cache.npaths = 0;
ctx.cache.fillReady = ctx.cache.strokeReady = false;
ctx.cache.clipmode = NVGClipMode.None;
}
NVGpath* nvg__lastPath (NVGContext ctx) nothrow @trusted @nogc {
return (ctx.cache.npaths > 0 ? &ctx.cache.paths[ctx.cache.npaths-1] : null);
}
void nvg__addPath (NVGContext ctx) nothrow @trusted @nogc {
import core.stdc.stdlib : realloc;
import core.stdc.string : memset;
if (ctx.cache.npaths+1 > ctx.cache.cpaths) {
int cpaths = ctx.cache.npaths+1+ctx.cache.cpaths/2;
NVGpath* paths = cast(NVGpath*)realloc(ctx.cache.paths, NVGpath.sizeof*cpaths);
if (paths is null) assert(0, "NanoVega: out of memory");
ctx.cache.paths = paths;
ctx.cache.cpaths = cpaths;
}
NVGpath* path = &ctx.cache.paths[ctx.cache.npaths++];
memset(path, 0, NVGpath.sizeof);
path.first = ctx.cache.npoints;
path.mWinding = NVGWinding.CCW;
}
NVGpoint* nvg__lastPoint (NVGContext ctx) nothrow @trusted @nogc {
return (ctx.cache.npoints > 0 ? &ctx.cache.points[ctx.cache.npoints-1] : null);
}
void nvg__addPoint (NVGContext ctx, float x, float y, int flags) nothrow @trusted @nogc {
NVGpath* path = nvg__lastPath(ctx);
if (path is null) return;
if (path.count > 0 && ctx.cache.npoints > 0) {
NVGpoint* pt = nvg__lastPoint(ctx);
if (nvg__ptEquals(pt.x, pt.y, x, y, ctx.distTol)) {
pt.flags |= flags;
return;
}
}
if (ctx.cache.npoints+1 > ctx.cache.cpoints) {
int cpoints = ctx.cache.npoints+1+ctx.cache.cpoints/2;
NVGpoint* points = cast(NVGpoint*)realloc(ctx.cache.points, NVGpoint.sizeof*cpoints);
if (points is null) return;
ctx.cache.points = points;
ctx.cache.cpoints = cpoints;
}
NVGpoint* pt = &ctx.cache.points[ctx.cache.npoints];
memset(pt, 0, (*pt).sizeof);
pt.x = x;
pt.y = y;
pt.flags = cast(ubyte)flags;
++ctx.cache.npoints;
++path.count;
}
void nvg__closePath (NVGContext ctx) nothrow @trusted @nogc {
NVGpath* path = nvg__lastPath(ctx);
if (path is null) return;
path.closed = true;
}
void nvg__pathWinding (NVGContext ctx, NVGWinding winding) nothrow @trusted @nogc {
NVGpath* path = nvg__lastPath(ctx);
if (path is null) return;
path.mWinding = winding;
}
float nvg__getAverageScale() (in auto ref NVGMatrix t) /*pure*/ nothrow @trusted @nogc {
immutable float sx = nvg__sqrtf(t.mat.ptr[0]*t.mat.ptr[0]+t.mat.ptr[2]*t.mat.ptr[2]);
immutable float sy = nvg__sqrtf(t.mat.ptr[1]*t.mat.ptr[1]+t.mat.ptr[3]*t.mat.ptr[3]);
return (sx+sy)*0.5f;
}
NVGVertex* nvg__allocTempVerts (NVGContext ctx, int nverts) nothrow @trusted @nogc {
if (nverts > ctx.cache.cverts) {
int cverts = (nverts+0xff)&~0xff; // Round up to prevent allocations when things change just slightly.
NVGVertex* verts = cast(NVGVertex*)realloc(ctx.cache.verts, NVGVertex.sizeof*cverts);
if (verts is null) return null;
ctx.cache.verts = verts;
ctx.cache.cverts = cverts;
}
return ctx.cache.verts;
}
float nvg__triarea2 (float ax, float ay, float bx, float by, float cx, float cy) pure nothrow @safe @nogc {
immutable float abx = bx-ax;
immutable float aby = by-ay;
immutable float acx = cx-ax;
immutable float acy = cy-ay;
return acx*aby-abx*acy;
}
float nvg__polyArea (NVGpoint* pts, int npts) nothrow @trusted @nogc {
float area = 0;
foreach (int i; 2..npts) {
NVGpoint* a = &pts[0];
NVGpoint* b = &pts[i-1];
NVGpoint* c = &pts[i];
area += nvg__triarea2(a.x, a.y, b.x, b.y, c.x, c.y);
}
return area*0.5f;
}
void nvg__polyReverse (NVGpoint* pts, int npts) nothrow @trusted @nogc {
NVGpoint tmp = void;
int i = 0, j = npts-1;
while (i < j) {
tmp = pts[i];
pts[i] = pts[j];
pts[j] = tmp;
++i;
--j;
}
}
void nvg__vset (NVGVertex* vtx, float x, float y, float u, float v) nothrow @trusted @nogc {
vtx.x = x;
vtx.y = y;
vtx.u = u;
vtx.v = v;
}
void nvg__tesselateBezier (NVGContext ctx, in float x1, in float y1, in float x2, in float y2, in float x3, in float y3, in float x4, in float y4, in int level, in int type) nothrow @trusted @nogc {
if (level > 10) return;
// check for collinear points, and use AFD tesselator on such curves (it is WAY faster for this case)
/*
if (level == 0 && ctx.tesselatortype == NVGTesselation.Combined) {
static bool collinear (in float v0x, in float v0y, in float v1x, in float v1y, in float v2x, in float v2y) nothrow @trusted @nogc {
immutable float cz = (v1x-v0x)*(v2y-v0y)-(v2x-v0x)*(v1y-v0y);
return (nvg__absf(cz*cz) <= 0.01f); // arbitrary number, seems to work ok with NanoSVG output
}
if (collinear(x1, y1, x2, y2, x3, y3) && collinear(x2, y2, x3, y3, x3, y4)) {
//{ import core.stdc.stdio; printf("AFD fallback!\n"); }
ctx.nvg__tesselateBezierAFD(x1, y1, x2, y2, x3, y3, x4, y4, type);
return;
}
}
*/
immutable float x12 = (x1+x2)*0.5f;
immutable float y12 = (y1+y2)*0.5f;
immutable float x23 = (x2+x3)*0.5f;
immutable float y23 = (y2+y3)*0.5f;
immutable float x34 = (x3+x4)*0.5f;
immutable float y34 = (y3+y4)*0.5f;
immutable float x123 = (x12+x23)*0.5f;
immutable float y123 = (y12+y23)*0.5f;
immutable float dx = x4-x1;
immutable float dy = y4-y1;
immutable float d2 = nvg__absf(((x2-x4)*dy-(y2-y4)*dx));
immutable float d3 = nvg__absf(((x3-x4)*dy-(y3-y4)*dx));
if ((d2+d3)*(d2+d3) < ctx.tessTol*(dx*dx+dy*dy)) {
nvg__addPoint(ctx, x4, y4, type);
return;
}
immutable float x234 = (x23+x34)*0.5f;
immutable float y234 = (y23+y34)*0.5f;
immutable float x1234 = (x123+x234)*0.5f;
immutable float y1234 = (y123+y234)*0.5f;
// "taxicab" / "manhattan" check for flat curves
if (nvg__absf(x1+x3-x2-x2)+nvg__absf(y1+y3-y2-y2)+nvg__absf(x2+x4-x3-x3)+nvg__absf(y2+y4-y3-y3) < ctx.tessTol/4) {
nvg__addPoint(ctx, x1234, y1234, type);
return;
}
nvg__tesselateBezier(ctx, x1, y1, x12, y12, x123, y123, x1234, y1234, level+1, 0);
nvg__tesselateBezier(ctx, x1234, y1234, x234, y234, x34, y34, x4, y4, level+1, type);
}
// based on the ideas and code of Maxim Shemanarev. Rest in Peace, bro!
// see http://www.antigrain.com/research/adaptive_bezier/index.html
void nvg__tesselateBezierMcSeem (NVGContext ctx, in float x1, in float y1, in float x2, in float y2, in float x3, in float y3, in float x4, in float y4, in int level, in int type) nothrow @trusted @nogc {
enum CollinearEPS = 0.00000001f; // 0.00001f;
enum AngleTolEPS = 0.01f;
static float distSquared (in float x1, in float y1, in float x2, in float y2) pure nothrow @safe @nogc {
pragma(inline, true);
immutable float dx = x2-x1;
immutable float dy = y2-y1;
return dx*dx+dy*dy;
}
if (level == 0) {
nvg__addPoint(ctx, x1, y1, 0);
nvg__tesselateBezierMcSeem(ctx, x1, y1, x2, y2, x3, y3, x4, y4, 1, type);
nvg__addPoint(ctx, x4, y4, type);
return;
}
if (level >= 32) return; // recurse limit; practically, it should be never reached, but...
// calculate all the mid-points of the line segments
immutable float x12 = (x1+x2)*0.5f;
immutable float y12 = (y1+y2)*0.5f;
immutable float x23 = (x2+x3)*0.5f;
immutable float y23 = (y2+y3)*0.5f;
immutable float x34 = (x3+x4)*0.5f;
immutable float y34 = (y3+y4)*0.5f;
immutable float x123 = (x12+x23)*0.5f;
immutable float y123 = (y12+y23)*0.5f;
immutable float x234 = (x23+x34)*0.5f;
immutable float y234 = (y23+y34)*0.5f;
immutable float x1234 = (x123+x234)*0.5f;
immutable float y1234 = (y123+y234)*0.5f;
// try to approximate the full cubic curve by a single straight line
immutable float dx = x4-x1;
immutable float dy = y4-y1;
float d2 = nvg__absf(((x2-x4)*dy-(y2-y4)*dx));
float d3 = nvg__absf(((x3-x4)*dy-(y3-y4)*dx));
//immutable float da1, da2, k;
final switch ((cast(int)(d2 > CollinearEPS)<<1)+cast(int)(d3 > CollinearEPS)) {
case 0:
// all collinear or p1 == p4
float k = dx*dx+dy*dy;
if (k == 0) {
d2 = distSquared(x1, y1, x2, y2);
d3 = distSquared(x4, y4, x3, y3);
} else {
k = 1.0f/k;
float da1 = x2-x1;
float da2 = y2-y1;
d2 = k*(da1*dx+da2*dy);
da1 = x3-x1;
da2 = y3-y1;
d3 = k*(da1*dx+da2*dy);
if (d2 > 0 && d2 < 1 && d3 > 0 && d3 < 1) {
// Simple collinear case, 1---2---3---4
// We can leave just two endpoints
return;
}
if (d2 <= 0) d2 = distSquared(x2, y2, x1, y1);
else if (d2 >= 1) d2 = distSquared(x2, y2, x4, y4);
else d2 = distSquared(x2, y2, x1+d2*dx, y1+d2*dy);
if (d3 <= 0) d3 = distSquared(x3, y3, x1, y1);
else if (d3 >= 1) d3 = distSquared(x3, y3, x4, y4);
else d3 = distSquared(x3, y3, x1+d3*dx, y1+d3*dy);
}
if (d2 > d3) {
if (d2 < ctx.tessTol) {
nvg__addPoint(ctx, x2, y2, type);
return;
}
} if (d3 < ctx.tessTol) {
nvg__addPoint(ctx, x3, y3, type);
return;
}
break;
case 1:
// p1,p2,p4 are collinear, p3 is significant
if (d3*d3 <= ctx.tessTol*(dx*dx+dy*dy)) {
if (ctx.angleTol < AngleTolEPS) {
nvg__addPoint(ctx, x23, y23, type);
return;
} else {
// angle condition
float da1 = nvg__absf(nvg__atan2f(y4-y3, x4-x3)-nvg__atan2f(y3-y2, x3-x2));
if (da1 >= NVG_PI) da1 = 2*NVG_PI-da1;
if (da1 < ctx.angleTol) {
nvg__addPoint(ctx, x2, y2, type);
nvg__addPoint(ctx, x3, y3, type);
return;
}
if (ctx.cuspLimit != 0.0) {
if (da1 > ctx.cuspLimit) {
nvg__addPoint(ctx, x3, y3, type);
return;
}
}
}
}
break;
case 2:
// p1,p3,p4 are collinear, p2 is significant
if (d2*d2 <= ctx.tessTol*(dx*dx+dy*dy)) {
if (ctx.angleTol < AngleTolEPS) {
nvg__addPoint(ctx, x23, y23, type);
return;
} else {
// angle condition
float da1 = nvg__absf(nvg__atan2f(y3-y2, x3-x2)-nvg__atan2f(y2-y1, x2-x1));
if (da1 >= NVG_PI) da1 = 2*NVG_PI-da1;
if (da1 < ctx.angleTol) {
nvg__addPoint(ctx, x2, y2, type);
nvg__addPoint(ctx, x3, y3, type);
return;
}
if (ctx.cuspLimit != 0.0) {
if (da1 > ctx.cuspLimit) {
nvg__addPoint(ctx, x2, y2, type);
return;
}
}
}
}
break;
case 3:
// regular case
if ((d2+d3)*(d2+d3) <= ctx.tessTol*(dx*dx+dy*dy)) {
// if the curvature doesn't exceed the distance tolerance value, we tend to finish subdivisions
if (ctx.angleTol < AngleTolEPS) {
nvg__addPoint(ctx, x23, y23, type);
return;
} else {
// angle and cusp condition
immutable float k = nvg__atan2f(y3-y2, x3-x2);
float da1 = nvg__absf(k-nvg__atan2f(y2-y1, x2-x1));
float da2 = nvg__absf(nvg__atan2f(y4-y3, x4-x3)-k);
if (da1 >= NVG_PI) da1 = 2*NVG_PI-da1;
if (da2 >= NVG_PI) da2 = 2*NVG_PI-da2;
if (da1+da2 < ctx.angleTol) {
// finally we can stop the recursion
nvg__addPoint(ctx, x23, y23, type);
return;
}
if (ctx.cuspLimit != 0.0) {
if (da1 > ctx.cuspLimit) {
nvg__addPoint(ctx, x2, y2, type);
return;
}
if (da2 > ctx.cuspLimit) {
nvg__addPoint(ctx, x3, y3, type);
return;
}
}
}
}
break;
}
// continue subdivision
nvg__tesselateBezierMcSeem(ctx, x1, y1, x12, y12, x123, y123, x1234, y1234, level+1, 0);
nvg__tesselateBezierMcSeem(ctx, x1234, y1234, x234, y234, x34, y34, x4, y4, level+1, type);
}
// Adaptive forward differencing for bezier tesselation.
// See Lien, Sheue-Ling, Michael Shantz, and Vaughan Pratt.
// "Adaptive forward differencing for rendering curves and surfaces."
// ACM SIGGRAPH Computer Graphics. Vol. 21. No. 4. ACM, 1987.
// original code by Taylor Holliday <taylor@audulus.com>
void nvg__tesselateBezierAFD (NVGContext ctx, in float x1, in float y1, in float x2, in float y2, in float x3, in float y3, in float x4, in float y4, in int type) nothrow @trusted @nogc {
enum AFD_ONE = (1<<10);
// power basis
immutable float ax = -x1+3*x2-3*x3+x4;
immutable float ay = -y1+3*y2-3*y3+y4;
immutable float bx = 3*x1-6*x2+3*x3;
immutable float by = 3*y1-6*y2+3*y3;
immutable float cx = -3*x1+3*x2;
immutable float cy = -3*y1+3*y2;
// Transform to forward difference basis (stepsize 1)
float px = x1;
float py = y1;
float dx = ax+bx+cx;
float dy = ay+by+cy;
float ddx = 6*ax+2*bx;
float ddy = 6*ay+2*by;
float dddx = 6*ax;
float dddy = 6*ay;
//printf("dx: %f, dy: %f\n", dx, dy);
//printf("ddx: %f, ddy: %f\n", ddx, ddy);
//printf("dddx: %f, dddy: %f\n", dddx, dddy);
int t = 0;
int dt = AFD_ONE;
immutable float tol = ctx.tessTol*4;
while (t < AFD_ONE) {
// Flatness measure.
float d = ddx*ddx+ddy*ddy+dddx*dddx+dddy*dddy;
// printf("d: %f, th: %f\n", d, th);
// Go to higher resolution if we're moving a lot or overshooting the end.
while ((d > tol && dt > 1) || (t+dt > AFD_ONE)) {
// printf("up\n");
// Apply L to the curve. Increase curve resolution.
dx = 0.5f*dx-(1.0f/8.0f)*ddx+(1.0f/16.0f)*dddx;
dy = 0.5f*dy-(1.0f/8.0f)*ddy+(1.0f/16.0f)*dddy;
ddx = (1.0f/4.0f)*ddx-(1.0f/8.0f)*dddx;
ddy = (1.0f/4.0f)*ddy-(1.0f/8.0f)*dddy;
dddx = (1.0f/8.0f)*dddx;
dddy = (1.0f/8.0f)*dddy;
// Half the stepsize.
dt >>= 1;
// Recompute d
d = ddx*ddx+ddy*ddy+dddx*dddx+dddy*dddy;
}
// Go to lower resolution if we're really flat
// and we aren't going to overshoot the end.
// XXX: tol/32 is just a guess for when we are too flat.
while ((d > 0 && d < tol/32.0f && dt < AFD_ONE) && (t+2*dt <= AFD_ONE)) {
// printf("down\n");
// Apply L^(-1) to the curve. Decrease curve resolution.
dx = 2*dx+ddx;
dy = 2*dy+ddy;
ddx = 4*ddx+4*dddx;
ddy = 4*ddy+4*dddy;
dddx = 8*dddx;
dddy = 8*dddy;
// Double the stepsize.
dt <<= 1;
// Recompute d
d = ddx*ddx+ddy*ddy+dddx*dddx+dddy*dddy;
}
// Forward differencing.
px += dx;
py += dy;
dx += ddx;
dy += ddy;
ddx += dddx;
ddy += dddy;
// Output a point.
nvg__addPoint(ctx, px, py, (t > 0 ? type : 0));
// Advance along the curve.
t += dt;
// Ensure we don't overshoot.
assert(t <= AFD_ONE);
}
}
void nvg__dashLastPath (NVGContext ctx) nothrow @trusted @nogc {
import core.stdc.stdlib : realloc;
import core.stdc.string : memcpy;
NVGpathCache* cache = ctx.cache;
if (cache.npaths == 0) return;
NVGpath* path = nvg__lastPath(ctx);
if (path is null) return;
NVGstate* state = nvg__getState(ctx);
if (!state.dasherActive) return;
static NVGpoint* pts = null;
static uint ptsCount = 0;
static uint ptsSize = 0;
if (path.count < 2) return; // just in case
// copy path points (reserve one point for closed pathes)
if (ptsSize < path.count+1) {
ptsSize = cast(uint)(path.count+1);
pts = cast(NVGpoint*)realloc(pts, ptsSize*NVGpoint.sizeof);
if (pts is null) assert(0, "NanoVega: out of memory");
}
ptsCount = cast(uint)path.count;
memcpy(pts, &cache.points[path.first], ptsCount*NVGpoint.sizeof);
// add closing point for closed pathes
if (path.closed && !nvg__ptEquals(pts[0].x, pts[0].y, pts[ptsCount-1].x, pts[ptsCount-1].y, ctx.distTol)) {
pts[ptsCount++] = pts[0];
}
// remove last path (with its points)
--cache.npaths;
cache.npoints -= path.count;
// add stroked pathes
const(float)* dashes = state.dashes.ptr;
immutable uint dashCount = state.dashCount;
float currDashStart = 0;
uint currDashIdx = 0;
immutable bool firstIsGap = state.firstDashIsGap;
// calculate lengthes
{
NVGpoint* v1 = &pts[0];
NVGpoint* v2 = &pts[1];
foreach (immutable _; 0..ptsCount) {
float dx = v2.x-v1.x;
float dy = v2.y-v1.y;
v1.len = nvg__normalize(&dx, &dy);
v1 = v2++;
}
}
void calcDashStart (float ds) {
if (ds < 0) {
ds = ds%state.totalDashLen;
while (ds < 0) ds += state.totalDashLen;
}
currDashIdx = 0;
currDashStart = 0;
while (ds > 0) {
if (ds > dashes[currDashIdx]) {
ds -= dashes[currDashIdx];
++currDashIdx;
currDashStart = 0;
if (currDashIdx >= dashCount) currDashIdx = 0;
} else {
currDashStart = ds;
ds = 0;
}
}
}
calcDashStart(state.dashStart);
uint srcPointIdx = 1;
const(NVGpoint)* v1 = &pts[0];
const(NVGpoint)* v2 = &pts[1];
float currRest = v1.len;
nvg__addPath(ctx);
nvg__addPoint(ctx, v1.x, v1.y, PointFlag.Corner);
void fixLastPoint () {
auto lpt = nvg__lastPath(ctx);
if (lpt !is null && lpt.count > 0) {
// fix last point
if (auto lps = nvg__lastPoint(ctx)) lps.flags = PointFlag.Corner;
// fix first point
NVGpathCache* cache = ctx.cache;
cache.points[lpt.first].flags = PointFlag.Corner;
}
}
for (;;) {
immutable float dlen = dashes[currDashIdx];
if (dlen == 0) {
++currDashIdx;
if (currDashIdx >= dashCount) currDashIdx = 0;
continue;
}
immutable float dashRest = dlen-currDashStart;
if ((currDashIdx&1) != firstIsGap) {
// this is "moveto" command, so create new path
fixLastPoint();
nvg__addPath(ctx);
}
if (currRest > dashRest) {
currRest -= dashRest;
++currDashIdx;
if (currDashIdx >= dashCount) currDashIdx = 0;
currDashStart = 0;
nvg__addPoint(ctx,
v2.x-(v2.x-v1.x)*currRest/v1.len,
v2.y-(v2.y-v1.y)*currRest/v1.len,
PointFlag.Corner
);
} else {
currDashStart += currRest;
nvg__addPoint(ctx, v2.x, v2.y, v1.flags); //k8:fix flags here?
++srcPointIdx;
v1 = v2;
currRest = v1.len;
if (srcPointIdx >= ptsCount) break;
v2 = &pts[srcPointIdx];
}
}
fixLastPoint();
}
version(nanovg_bench_flatten) import iv.timer : Timer;
void nvg__flattenPaths(bool asStroke) (NVGContext ctx) nothrow @trusted @nogc {
version(nanovg_bench_flatten) {
Timer timer;
char[128] tmbuf;
int bzcount;
}
NVGpathCache* cache = ctx.cache;
NVGstate* state = nvg__getState(ctx);
// check if we already did flattening
static if (asStroke) {
if (state.dashCount >= 2) {
if (cache.npaths > 0 && state.lastFlattenDashCount == state.dashCount) return; // already flattened
state.dasherActive = true;
state.lastFlattenDashCount = state.dashCount;
} else {
if (cache.npaths > 0 && state.lastFlattenDashCount == 0) return; // already flattened
state.dasherActive = false;
state.lastFlattenDashCount = 0;
}
} else {
if (cache.npaths > 0 && state.lastFlattenDashCount == 0) return; // already flattened
state.lastFlattenDashCount = 0; // so next stroke flattening will redo it
state.dasherActive = false;
}
// clear path cache
cache.npaths = 0;
cache.npoints = 0;
// flatten
version(nanovg_bench_flatten) timer.restart();
int i = 0;
while (i < ctx.ncommands) {
final switch (cast(Command)ctx.commands[i]) {
case Command.MoveTo:
//assert(i+3 <= ctx.ncommands);
static if (asStroke) {
if (cache.npaths > 0 && state.dasherActive) nvg__dashLastPath(ctx);
}
nvg__addPath(ctx);
const p = &ctx.commands[i+1];
nvg__addPoint(ctx, p[0], p[1], PointFlag.Corner);
i += 3;
break;
case Command.LineTo:
//assert(i+3 <= ctx.ncommands);
const p = &ctx.commands[i+1];
nvg__addPoint(ctx, p[0], p[1], PointFlag.Corner);
i += 3;
break;
case Command.BezierTo:
//assert(i+7 <= ctx.ncommands);
const last = nvg__lastPoint(ctx);
if (last !is null) {
const cp1 = &ctx.commands[i+1];
const cp2 = &ctx.commands[i+3];
const p = &ctx.commands[i+5];
if (ctx.tesselatortype == NVGTesselation.DeCasteljau) {
nvg__tesselateBezier(ctx, last.x, last.y, cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1], 0, PointFlag.Corner);
} else if (ctx.tesselatortype == NVGTesselation.DeCasteljauMcSeem) {
nvg__tesselateBezierMcSeem(ctx, last.x, last.y, cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1], 0, PointFlag.Corner);
} else {
nvg__tesselateBezierAFD(ctx, last.x, last.y, cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1], PointFlag.Corner);
}
version(nanovg_bench_flatten) ++bzcount;
}
i += 7;
break;
case Command.Close:
//assert(i+1 <= ctx.ncommands);
nvg__closePath(ctx);
i += 1;
break;
case Command.Winding:
//assert(i+2 <= ctx.ncommands);
nvg__pathWinding(ctx, cast(NVGWinding)ctx.commands[i+1]);
i += 2;
break;
}
}
static if (asStroke) {
if (cache.npaths > 0 && state.dasherActive) nvg__dashLastPath(ctx);
}
version(nanovg_bench_flatten) {{
timer.stop();
auto xb = timer.toBuffer(tmbuf[]);
import core.stdc.stdio : printf;
printf("flattening time: [%.*s] (%d beziers)\n", cast(uint)xb.length, xb.ptr, bzcount);
}}
cache.bounds.ptr[0] = cache.bounds.ptr[1] = float.max;
cache.bounds.ptr[2] = cache.bounds.ptr[3] = -float.max;
// calculate the direction and length of line segments
version(nanovg_bench_flatten) timer.restart();
foreach (int j; 0..cache.npaths) {
NVGpath* path = &cache.paths[j];
NVGpoint* pts = &cache.points[path.first];
// if the first and last points are the same, remove the last, mark as closed path
NVGpoint* p0 = &pts[path.count-1];
NVGpoint* p1 = &pts[0];
if (nvg__ptEquals(p0.x, p0.y, p1.x, p1.y, ctx.distTol)) {
--path.count;
p0 = &pts[path.count-1];
path.closed = true;
}
// enforce winding
if (path.count > 2) {
immutable float area = nvg__polyArea(pts, path.count);
if (path.mWinding == NVGWinding.CCW && area < 0.0f) nvg__polyReverse(pts, path.count);
if (path.mWinding == NVGWinding.CW && area > 0.0f) nvg__polyReverse(pts, path.count);
}
foreach (immutable _; 0..path.count) {
// calculate segment direction and length
p0.dx = p1.x-p0.x;
p0.dy = p1.y-p0.y;
p0.len = nvg__normalize(&p0.dx, &p0.dy);
// update bounds
cache.bounds.ptr[0] = nvg__min(cache.bounds.ptr[0], p0.x);
cache.bounds.ptr[1] = nvg__min(cache.bounds.ptr[1], p0.y);
cache.bounds.ptr[2] = nvg__max(cache.bounds.ptr[2], p0.x);
cache.bounds.ptr[3] = nvg__max(cache.bounds.ptr[3], p0.y);
// advance
p0 = p1++;
}
}
version(nanovg_bench_flatten) {{
timer.stop();
auto xb = timer.toBuffer(tmbuf[]);
import core.stdc.stdio : printf;
printf("segment calculation time: [%.*s]\n", cast(uint)xb.length, xb.ptr);
}}
}
int nvg__curveDivs (float r, float arc, float tol) nothrow @trusted @nogc {
immutable float da = nvg__acosf(r/(r+tol))*2.0f;
return nvg__max(2, cast(int)nvg__ceilf(arc/da));
}
void nvg__chooseBevel (int bevel, NVGpoint* p0, NVGpoint* p1, float w, float* x0, float* y0, float* x1, float* y1) nothrow @trusted @nogc {
if (bevel) {
*x0 = p1.x+p0.dy*w;
*y0 = p1.y-p0.dx*w;
*x1 = p1.x+p1.dy*w;
*y1 = p1.y-p1.dx*w;
} else {
*x0 = p1.x+p1.dmx*w;
*y0 = p1.y+p1.dmy*w;
*x1 = p1.x+p1.dmx*w;
*y1 = p1.y+p1.dmy*w;
}
}
NVGVertex* nvg__roundJoin (NVGVertex* dst, NVGpoint* p0, NVGpoint* p1, float lw, float rw, float lu, float ru, int ncap, float fringe) nothrow @trusted @nogc {
float dlx0 = p0.dy;
float dly0 = -p0.dx;
float dlx1 = p1.dy;
float dly1 = -p1.dx;
//NVG_NOTUSED(fringe);
if (p1.flags&PointFlag.Left) {
float lx0 = void, ly0 = void, lx1 = void, ly1 = void;
nvg__chooseBevel(p1.flags&PointFlag.InnerBevelPR, p0, p1, lw, &lx0, &ly0, &lx1, &ly1);
immutable float a0 = nvg__atan2f(-dly0, -dlx0);
float a1 = nvg__atan2f(-dly1, -dlx1);
if (a1 > a0) a1 -= NVG_PI*2;
nvg__vset(dst, lx0, ly0, lu, 1); ++dst;
nvg__vset(dst, p1.x-dlx0*rw, p1.y-dly0*rw, ru, 1); ++dst;
int n = nvg__clamp(cast(int)nvg__ceilf(((a0-a1)/NVG_PI)*ncap), 2, ncap);
for (int i = 0; i < n; ++i) {
float u = i/cast(float)(n-1);
float a = a0+u*(a1-a0);
float rx = p1.x+nvg__cosf(a)*rw;
float ry = p1.y+nvg__sinf(a)*rw;
nvg__vset(dst, p1.x, p1.y, 0.5f, 1); ++dst;
nvg__vset(dst, rx, ry, ru, 1); ++dst;
}
nvg__vset(dst, lx1, ly1, lu, 1); ++dst;
nvg__vset(dst, p1.x-dlx1*rw, p1.y-dly1*rw, ru, 1); ++dst;
} else {
float rx0 = void, ry0 = void, rx1 = void, ry1 = void;
nvg__chooseBevel(p1.flags&PointFlag.InnerBevelPR, p0, p1, -rw, &rx0, &ry0, &rx1, &ry1);
immutable float a0 = nvg__atan2f(dly0, dlx0);
float a1 = nvg__atan2f(dly1, dlx1);
if (a1 < a0) a1 += NVG_PI*2;
nvg__vset(dst, p1.x+dlx0*rw, p1.y+dly0*rw, lu, 1); ++dst;
nvg__vset(dst, rx0, ry0, ru, 1); ++dst;
int n = nvg__clamp(cast(int)nvg__ceilf(((a1-a0)/NVG_PI)*ncap), 2, ncap);
for (int i = 0; i < n; i++) {
float u = i/cast(float)(n-1);
float a = a0+u*(a1-a0);
float lx = p1.x+nvg__cosf(a)*lw;
float ly = p1.y+nvg__sinf(a)*lw;
nvg__vset(dst, lx, ly, lu, 1); ++dst;
nvg__vset(dst, p1.x, p1.y, 0.5f, 1); ++dst;
}
nvg__vset(dst, p1.x+dlx1*rw, p1.y+dly1*rw, lu, 1); ++dst;
nvg__vset(dst, rx1, ry1, ru, 1); ++dst;
}
return dst;
}
NVGVertex* nvg__bevelJoin (NVGVertex* dst, NVGpoint* p0, NVGpoint* p1, float lw, float rw, float lu, float ru, float fringe) nothrow @trusted @nogc {
float rx0, ry0, rx1, ry1;
float lx0, ly0, lx1, ly1;
float dlx0 = p0.dy;
float dly0 = -p0.dx;
float dlx1 = p1.dy;
float dly1 = -p1.dx;
//NVG_NOTUSED(fringe);
if (p1.flags&PointFlag.Left) {
nvg__chooseBevel(p1.flags&PointFlag.InnerBevelPR, p0, p1, lw, &lx0, &ly0, &lx1, &ly1);
nvg__vset(dst, lx0, ly0, lu, 1); ++dst;
nvg__vset(dst, p1.x-dlx0*rw, p1.y-dly0*rw, ru, 1); ++dst;
if (p1.flags&PointFlag.Bevel) {
nvg__vset(dst, lx0, ly0, lu, 1); ++dst;
nvg__vset(dst, p1.x-dlx0*rw, p1.y-dly0*rw, ru, 1); ++dst;
nvg__vset(dst, lx1, ly1, lu, 1); ++dst;
nvg__vset(dst, p1.x-dlx1*rw, p1.y-dly1*rw, ru, 1); ++dst;
} else {
rx0 = p1.x-p1.dmx*rw;
ry0 = p1.y-p1.dmy*rw;
nvg__vset(dst, p1.x, p1.y, 0.5f, 1); ++dst;
nvg__vset(dst, p1.x-dlx0*rw, p1.y-dly0*rw, ru, 1); ++dst;
nvg__vset(dst, rx0, ry0, ru, 1); ++dst;
nvg__vset(dst, rx0, ry0, ru, 1); ++dst;
nvg__vset(dst, p1.x, p1.y, 0.5f, 1); ++dst;
nvg__vset(dst, p1.x-dlx1*rw, p1.y-dly1*rw, ru, 1); ++dst;
}
nvg__vset(dst, lx1, ly1, lu, 1); ++dst;
nvg__vset(dst, p1.x-dlx1*rw, p1.y-dly1*rw, ru, 1); ++dst;
} else {
nvg__chooseBevel(p1.flags&PointFlag.InnerBevelPR, p0, p1, -rw, &rx0, &ry0, &rx1, &ry1);
nvg__vset(dst, p1.x+dlx0*lw, p1.y+dly0*lw, lu, 1); ++dst;
nvg__vset(dst, rx0, ry0, ru, 1); ++dst;
if (p1.flags&PointFlag.Bevel) {
nvg__vset(dst, p1.x+dlx0*lw, p1.y+dly0*lw, lu, 1); ++dst;
nvg__vset(dst, rx0, ry0, ru, 1); ++dst;
nvg__vset(dst, p1.x+dlx1*lw, p1.y+dly1*lw, lu, 1); ++dst;
nvg__vset(dst, rx1, ry1, ru, 1); ++dst;
} else {
lx0 = p1.x+p1.dmx*lw;
ly0 = p1.y+p1.dmy*lw;
nvg__vset(dst, p1.x+dlx0*lw, p1.y+dly0*lw, lu, 1); ++dst;
nvg__vset(dst, p1.x, p1.y, 0.5f, 1); ++dst;
nvg__vset(dst, lx0, ly0, lu, 1); ++dst;
nvg__vset(dst, lx0, ly0, lu, 1); ++dst;
nvg__vset(dst, p1.x+dlx1*lw, p1.y+dly1*lw, lu, 1); ++dst;
nvg__vset(dst, p1.x, p1.y, 0.5f, 1); ++dst;
}
nvg__vset(dst, p1.x+dlx1*lw, p1.y+dly1*lw, lu, 1); ++dst;
nvg__vset(dst, rx1, ry1, ru, 1); ++dst;
}
return dst;
}
NVGVertex* nvg__buttCapStart (NVGVertex* dst, NVGpoint* p, float dx, float dy, float w, float d, float aa) nothrow @trusted @nogc {
immutable float px = p.x-dx*d;
immutable float py = p.y-dy*d;
immutable float dlx = dy;
immutable float dly = -dx;
nvg__vset(dst, px+dlx*w-dx*aa, py+dly*w-dy*aa, 0, 0); ++dst;
nvg__vset(dst, px-dlx*w-dx*aa, py-dly*w-dy*aa, 1, 0); ++dst;
nvg__vset(dst, px+dlx*w, py+dly*w, 0, 1); ++dst;
nvg__vset(dst, px-dlx*w, py-dly*w, 1, 1); ++dst;
return dst;
}
NVGVertex* nvg__buttCapEnd (NVGVertex* dst, NVGpoint* p, float dx, float dy, float w, float d, float aa) nothrow @trusted @nogc {
immutable float px = p.x+dx*d;
immutable float py = p.y+dy*d;
immutable float dlx = dy;
immutable float dly = -dx;
nvg__vset(dst, px+dlx*w, py+dly*w, 0, 1); ++dst;
nvg__vset(dst, px-dlx*w, py-dly*w, 1, 1); ++dst;
nvg__vset(dst, px+dlx*w+dx*aa, py+dly*w+dy*aa, 0, 0); ++dst;
nvg__vset(dst, px-dlx*w+dx*aa, py-dly*w+dy*aa, 1, 0); ++dst;
return dst;
}
NVGVertex* nvg__roundCapStart (NVGVertex* dst, NVGpoint* p, float dx, float dy, float w, int ncap, float aa) nothrow @trusted @nogc {
immutable float px = p.x;
immutable float py = p.y;
immutable float dlx = dy;
immutable float dly = -dx;
//NVG_NOTUSED(aa);
immutable float ncpf = cast(float)(ncap-1);
foreach (int i; 0..ncap) {
float a = i/*/cast(float)(ncap-1)*//ncpf*NVG_PI;
float ax = nvg__cosf(a)*w, ay = nvg__sinf(a)*w;
nvg__vset(dst, px-dlx*ax-dx*ay, py-dly*ax-dy*ay, 0, 1); ++dst;
nvg__vset(dst, px, py, 0.5f, 1); ++dst;
}
nvg__vset(dst, px+dlx*w, py+dly*w, 0, 1); ++dst;
nvg__vset(dst, px-dlx*w, py-dly*w, 1, 1); ++dst;
return dst;
}
NVGVertex* nvg__roundCapEnd (NVGVertex* dst, NVGpoint* p, float dx, float dy, float w, int ncap, float aa) nothrow @trusted @nogc {
immutable float px = p.x;
immutable float py = p.y;
immutable float dlx = dy;
immutable float dly = -dx;
//NVG_NOTUSED(aa);
nvg__vset(dst, px+dlx*w, py+dly*w, 0, 1); ++dst;
nvg__vset(dst, px-dlx*w, py-dly*w, 1, 1); ++dst;
immutable float ncpf = cast(float)(ncap-1);
foreach (int i; 0..ncap) {
float a = i/*cast(float)(ncap-1)*//ncpf*NVG_PI;
float ax = nvg__cosf(a)*w, ay = nvg__sinf(a)*w;
nvg__vset(dst, px, py, 0.5f, 1); ++dst;
nvg__vset(dst, px-dlx*ax+dx*ay, py-dly*ax+dy*ay, 0, 1); ++dst;
}
return dst;
}
void nvg__calculateJoins (NVGContext ctx, float w, int lineJoin, float miterLimit) nothrow @trusted @nogc {
NVGpathCache* cache = ctx.cache;
float iw = 0.0f;
if (w > 0.0f) iw = 1.0f/w;
// Calculate which joins needs extra vertices to append, and gather vertex count.
foreach (int i; 0..cache.npaths) {
NVGpath* path = &cache.paths[i];
NVGpoint* pts = &cache.points[path.first];
NVGpoint* p0 = &pts[path.count-1];
NVGpoint* p1 = &pts[0];
int nleft = 0;
path.nbevel = 0;
foreach (int j; 0..path.count) {
//float dlx0, dly0, dlx1, dly1, dmr2, cross, limit;
immutable float dlx0 = p0.dy;
immutable float dly0 = -p0.dx;
immutable float dlx1 = p1.dy;
immutable float dly1 = -p1.dx;
// Calculate extrusions
p1.dmx = (dlx0+dlx1)*0.5f;
p1.dmy = (dly0+dly1)*0.5f;
immutable float dmr2 = p1.dmx*p1.dmx+p1.dmy*p1.dmy;
if (dmr2 > 0.000001f) {
float scale = 1.0f/dmr2;
if (scale > 600.0f) scale = 600.0f;
p1.dmx *= scale;
p1.dmy *= scale;
}
// Clear flags, but keep the corner.
p1.flags = (p1.flags&PointFlag.Corner) ? PointFlag.Corner : 0;
// Keep track of left turns.
immutable float cross = p1.dx*p0.dy-p0.dx*p1.dy;
if (cross > 0.0f) {
nleft++;
p1.flags |= PointFlag.Left;
}
// Calculate if we should use bevel or miter for inner join.
immutable float limit = nvg__max(1.01f, nvg__min(p0.len, p1.len)*iw);
if ((dmr2*limit*limit) < 1.0f) p1.flags |= PointFlag.InnerBevelPR;
// Check to see if the corner needs to be beveled.
if (p1.flags&PointFlag.Corner) {
if ((dmr2*miterLimit*miterLimit) < 1.0f || lineJoin == NVGLineCap.Bevel || lineJoin == NVGLineCap.Round) {
p1.flags |= PointFlag.Bevel;
}
}
if ((p1.flags&(PointFlag.Bevel|PointFlag.InnerBevelPR)) != 0) path.nbevel++;
p0 = p1++;
}
path.convex = (nleft == path.count);
}
}
void nvg__expandStroke (NVGContext ctx, float w, int lineCap, int lineJoin, float miterLimit) nothrow @trusted @nogc {
NVGpathCache* cache = ctx.cache;
immutable float aa = ctx.fringeWidth;
int ncap = nvg__curveDivs(w, NVG_PI, ctx.tessTol); // Calculate divisions per half circle.
nvg__calculateJoins(ctx, w, lineJoin, miterLimit);
// Calculate max vertex usage.
int cverts = 0;
foreach (int i; 0..cache.npaths) {
NVGpath* path = &cache.paths[i];
immutable bool loop = path.closed;
if (lineJoin == NVGLineCap.Round) {
cverts += (path.count+path.nbevel*(ncap+2)+1)*2; // plus one for loop
} else {
cverts += (path.count+path.nbevel*5+1)*2; // plus one for loop
}
if (!loop) {
// space for caps
if (lineCap == NVGLineCap.Round) {
cverts += (ncap*2+2)*2;
} else {
cverts += (3+3)*2;
}
}
}
NVGVertex* verts = nvg__allocTempVerts(ctx, cverts);
if (verts is null) return;
foreach (int i; 0..cache.npaths) {
NVGpath* path = &cache.paths[i];
NVGpoint* pts = &cache.points[path.first];
NVGpoint* p0;
NVGpoint* p1;
int s, e;
path.fill = null;
path.nfill = 0;
// Calculate fringe or stroke
immutable bool loop = path.closed;
NVGVertex* dst = verts;
path.stroke = dst;
if (loop) {
// Looping
p0 = &pts[path.count-1];
p1 = &pts[0];
s = 0;
e = path.count;
} else {
// Add cap
p0 = &pts[0];
p1 = &pts[1];
s = 1;
e = path.count-1;
}
if (!loop) {
// Add cap
float dx = p1.x-p0.x;
float dy = p1.y-p0.y;
nvg__normalize(&dx, &dy);
if (lineCap == NVGLineCap.Butt) dst = nvg__buttCapStart(dst, p0, dx, dy, w, -aa*0.5f, aa);
else if (lineCap == NVGLineCap.Butt || lineCap == NVGLineCap.Square) dst = nvg__buttCapStart(dst, p0, dx, dy, w, w-aa, aa);
else if (lineCap == NVGLineCap.Round) dst = nvg__roundCapStart(dst, p0, dx, dy, w, ncap, aa);
}
foreach (int j; s..e) {
if ((p1.flags&(PointFlag.Bevel|PointFlag.InnerBevelPR)) != 0) {
if (lineJoin == NVGLineCap.Round) {
dst = nvg__roundJoin(dst, p0, p1, w, w, 0, 1, ncap, aa);
} else {
dst = nvg__bevelJoin(dst, p0, p1, w, w, 0, 1, aa);
}
} else {
nvg__vset(dst, p1.x+(p1.dmx*w), p1.y+(p1.dmy*w), 0, 1); ++dst;
nvg__vset(dst, p1.x-(p1.dmx*w), p1.y-(p1.dmy*w), 1, 1); ++dst;
}
p0 = p1++;
}
if (loop) {
// Loop it
nvg__vset(dst, verts[0].x, verts[0].y, 0, 1); ++dst;
nvg__vset(dst, verts[1].x, verts[1].y, 1, 1); ++dst;
} else {
// Add cap
float dx = p1.x-p0.x;
float dy = p1.y-p0.y;
nvg__normalize(&dx, &dy);
if (lineCap == NVGLineCap.Butt) dst = nvg__buttCapEnd(dst, p1, dx, dy, w, -aa*0.5f, aa);
else if (lineCap == NVGLineCap.Butt || lineCap == NVGLineCap.Square) dst = nvg__buttCapEnd(dst, p1, dx, dy, w, w-aa, aa);
else if (lineCap == NVGLineCap.Round) dst = nvg__roundCapEnd(dst, p1, dx, dy, w, ncap, aa);
}
path.nstroke = cast(int)(dst-verts);
verts = dst;
}
}
void nvg__expandFill (NVGContext ctx, float w, int lineJoin, float miterLimit) nothrow @trusted @nogc {
NVGpathCache* cache = ctx.cache;
immutable float aa = ctx.fringeWidth;
bool fringe = (w > 0.0f);
nvg__calculateJoins(ctx, w, lineJoin, miterLimit);
// Calculate max vertex usage.
int cverts = 0;
foreach (int i; 0..cache.npaths) {
NVGpath* path = &cache.paths[i];
cverts += path.count+path.nbevel+1;
if (fringe) cverts += (path.count+path.nbevel*5+1)*2; // plus one for loop
}
NVGVertex* verts = nvg__allocTempVerts(ctx, cverts);
if (verts is null) return;
bool convex = (cache.npaths == 1 && cache.paths[0].convex);
foreach (int i; 0..cache.npaths) {
NVGpath* path = &cache.paths[i];
NVGpoint* pts = &cache.points[path.first];
// Calculate shape vertices.
immutable float woff = 0.5f*aa;
NVGVertex* dst = verts;
path.fill = dst;
if (fringe) {
// Looping
NVGpoint* p0 = &pts[path.count-1];
NVGpoint* p1 = &pts[0];
foreach (int j; 0..path.count) {
if (p1.flags&PointFlag.Bevel) {
immutable float dlx0 = p0.dy;
immutable float dly0 = -p0.dx;
immutable float dlx1 = p1.dy;
immutable float dly1 = -p1.dx;
if (p1.flags&PointFlag.Left) {
immutable float lx = p1.x+p1.dmx*woff;
immutable float ly = p1.y+p1.dmy*woff;
nvg__vset(dst, lx, ly, 0.5f, 1); ++dst;
} else {
immutable float lx0 = p1.x+dlx0*woff;
immutable float ly0 = p1.y+dly0*woff;
immutable float lx1 = p1.x+dlx1*woff;
immutable float ly1 = p1.y+dly1*woff;
nvg__vset(dst, lx0, ly0, 0.5f, 1); ++dst;
nvg__vset(dst, lx1, ly1, 0.5f, 1); ++dst;
}
} else {
nvg__vset(dst, p1.x+(p1.dmx*woff), p1.y+(p1.dmy*woff), 0.5f, 1); ++dst;
}
p0 = p1++;
}
} else {
foreach (int j; 0..path.count) {
nvg__vset(dst, pts[j].x, pts[j].y, 0.5f, 1);
++dst;
}
}
path.nfill = cast(int)(dst-verts);
verts = dst;
// Calculate fringe
if (fringe) {
float lw = w+woff;
immutable float rw = w-woff;
float lu = 0;
immutable float ru = 1;
dst = verts;
path.stroke = dst;
// Create only half a fringe for convex shapes so that
// the shape can be rendered without stenciling.
if (convex) {
lw = woff; // This should generate the same vertex as fill inset above.
lu = 0.5f; // Set outline fade at middle.
}
// Looping
NVGpoint* p0 = &pts[path.count-1];
NVGpoint* p1 = &pts[0];
foreach (int j; 0..path.count) {
if ((p1.flags&(PointFlag.Bevel|PointFlag.InnerBevelPR)) != 0) {
dst = nvg__bevelJoin(dst, p0, p1, lw, rw, lu, ru, ctx.fringeWidth);
} else {
nvg__vset(dst, p1.x+(p1.dmx*lw), p1.y+(p1.dmy*lw), lu, 1); ++dst;
nvg__vset(dst, p1.x-(p1.dmx*rw), p1.y-(p1.dmy*rw), ru, 1); ++dst;
}
p0 = p1++;
}
// Loop it
nvg__vset(dst, verts[0].x, verts[0].y, lu, 1); ++dst;
nvg__vset(dst, verts[1].x, verts[1].y, ru, 1); ++dst;
path.nstroke = cast(int)(dst-verts);
verts = dst;
} else {
path.stroke = null;
path.nstroke = 0;
}
}
}
// ////////////////////////////////////////////////////////////////////////// //
// Paths
/// Clears the current path and sub-paths.
/// Group: paths
@scriptable
public void beginPath (NVGContext ctx) nothrow @trusted @nogc {
ctx.ncommands = 0;
ctx.pathPickRegistered &= NVGPickKind.All; // reset "registered" flags
nvg__clearPathCache(ctx);
}
public alias newPath = beginPath; /// Ditto.
/// Starts new sub-path with specified point as first point.
/// Group: paths
@scriptable
public void moveTo (NVGContext ctx, in float x, in float y) nothrow @trusted @nogc {
nvg__appendCommands(ctx, Command.MoveTo, x, y);
}
/// Starts new sub-path with specified point as first point.
/// Arguments: [x, y]*
/// Group: paths
public void moveTo (NVGContext ctx, in float[] args) nothrow @trusted @nogc {
enum ArgC = 2;
if (args.length%ArgC != 0) assert(0, "NanoVega: invalid [moveTo] call");
if (args.length < ArgC) return;
nvg__appendCommands(ctx, Command.MoveTo, args[$-2..$]);
}
/// Adds line segment from the last point in the path to the specified point.
/// Group: paths
@scriptable
public void lineTo (NVGContext ctx, in float x, in float y) nothrow @trusted @nogc {
nvg__appendCommands(ctx, Command.LineTo, x, y);
}
/// Adds line segment from the last point in the path to the specified point.
/// Arguments: [x, y]*
/// Group: paths
public void lineTo (NVGContext ctx, in float[] args) nothrow @trusted @nogc {
enum ArgC = 2;
if (args.length%ArgC != 0) assert(0, "NanoVega: invalid [lineTo] call");
if (args.length < ArgC) return;
foreach (immutable idx; 0..args.length/ArgC) {
nvg__appendCommands(ctx, Command.LineTo, args.ptr[idx*ArgC..idx*ArgC+ArgC]);
}
}
/// Adds cubic bezier segment from last point in the path via two control points to the specified point.
/// Group: paths
public void bezierTo (NVGContext ctx, in float c1x, in float c1y, in float c2x, in float c2y, in float x, in float y) nothrow @trusted @nogc {
nvg__appendCommands(ctx, Command.BezierTo, c1x, c1y, c2x, c2y, x, y);
}
/// Adds cubic bezier segment from last point in the path via two control points to the specified point.
/// Arguments: [c1x, c1y, c2x, c2y, x, y]*
/// Group: paths
public void bezierTo (NVGContext ctx, in float[] args) nothrow @trusted @nogc {
enum ArgC = 6;
if (args.length%ArgC != 0) assert(0, "NanoVega: invalid [bezierTo] call");
if (args.length < ArgC) return;
foreach (immutable idx; 0..args.length/ArgC) {
nvg__appendCommands(ctx, Command.BezierTo, args.ptr[idx*ArgC..idx*ArgC+ArgC]);
}
}
/// Adds quadratic bezier segment from last point in the path via a control point to the specified point.
/// Group: paths
public void quadTo (NVGContext ctx, in float cx, in float cy, in float x, in float y) nothrow @trusted @nogc {
immutable float x0 = ctx.commandx;
immutable float y0 = ctx.commandy;
nvg__appendCommands(ctx,
Command.BezierTo,
x0+2.0f/3.0f*(cx-x0), y0+2.0f/3.0f*(cy-y0),
x+2.0f/3.0f*(cx-x), y+2.0f/3.0f*(cy-y),
x, y,
);
}
/// Adds quadratic bezier segment from last point in the path via a control point to the specified point.
/// Arguments: [cx, cy, x, y]*
/// Group: paths
public void quadTo (NVGContext ctx, in float[] args) nothrow @trusted @nogc {
enum ArgC = 4;
if (args.length%ArgC != 0) assert(0, "NanoVega: invalid [quadTo] call");
if (args.length < ArgC) return;
const(float)* aptr = args.ptr;
foreach (immutable idx; 0..args.length/ArgC) {
immutable float x0 = ctx.commandx;
immutable float y0 = ctx.commandy;
immutable float cx = *aptr++;
immutable float cy = *aptr++;
immutable float x = *aptr++;
immutable float y = *aptr++;
nvg__appendCommands(ctx,
Command.BezierTo,
x0+2.0f/3.0f*(cx-x0), y0+2.0f/3.0f*(cy-y0),
x+2.0f/3.0f*(cx-x), y+2.0f/3.0f*(cy-y),
x, y,
);
}
}
/// Adds an arc segment at the corner defined by the last path point, and two specified points.
/// Group: paths
public void arcTo (NVGContext ctx, in float x1, in float y1, in float x2, in float y2, in float radius) nothrow @trusted @nogc {
if (ctx.ncommands == 0) return;
immutable float x0 = ctx.commandx;
immutable float y0 = ctx.commandy;
// handle degenerate cases
if (nvg__ptEquals(x0, y0, x1, y1, ctx.distTol) ||
nvg__ptEquals(x1, y1, x2, y2, ctx.distTol) ||
nvg__distPtSeg(x1, y1, x0, y0, x2, y2) < ctx.distTol*ctx.distTol ||
radius < ctx.distTol)
{
ctx.lineTo(x1, y1);
return;
}
// calculate tangential circle to lines (x0, y0)-(x1, y1) and (x1, y1)-(x2, y2)
float dx0 = x0-x1;
float dy0 = y0-y1;
float dx1 = x2-x1;
float dy1 = y2-y1;
nvg__normalize(&dx0, &dy0);
nvg__normalize(&dx1, &dy1);
immutable float a = nvg__acosf(dx0*dx1+dy0*dy1);
immutable float d = radius/nvg__tanf(a/2.0f);
//printf("a=%f° d=%f\n", a/NVG_PI*180.0f, d);
if (d > 10000.0f) {
ctx.lineTo(x1, y1);
return;
}
float cx = void, cy = void, a0 = void, a1 = void;
NVGWinding dir;
if (nvg__cross(dx0, dy0, dx1, dy1) > 0.0f) {
cx = x1+dx0*d+dy0*radius;
cy = y1+dy0*d+-dx0*radius;
a0 = nvg__atan2f(dx0, -dy0);
a1 = nvg__atan2f(-dx1, dy1);
dir = NVGWinding.CW;
//printf("CW c=(%f, %f) a0=%f° a1=%f°\n", cx, cy, a0/NVG_PI*180.0f, a1/NVG_PI*180.0f);
} else {
cx = x1+dx0*d+-dy0*radius;
cy = y1+dy0*d+dx0*radius;
a0 = nvg__atan2f(-dx0, dy0);
a1 = nvg__atan2f(dx1, -dy1);
dir = NVGWinding.CCW;
//printf("CCW c=(%f, %f) a0=%f° a1=%f°\n", cx, cy, a0/NVG_PI*180.0f, a1/NVG_PI*180.0f);
}
ctx.arc(dir, cx, cy, radius, a0, a1); // first is line
}
/// Adds an arc segment at the corner defined by the last path point, and two specified points.
/// Arguments: [x1, y1, x2, y2, radius]*
/// Group: paths
public void arcTo (NVGContext ctx, in float[] args) nothrow @trusted @nogc {
enum ArgC = 5;
if (args.length%ArgC != 0) assert(0, "NanoVega: invalid [arcTo] call");
if (args.length < ArgC) return;
if (ctx.ncommands == 0) return;
const(float)* aptr = args.ptr;
foreach (immutable idx; 0..args.length/ArgC) {
immutable float x0 = ctx.commandx;
immutable float y0 = ctx.commandy;
immutable float x1 = *aptr++;
immutable float y1 = *aptr++;
immutable float x2 = *aptr++;
immutable float y2 = *aptr++;
immutable float radius = *aptr++;
ctx.arcTo(x1, y1, x2, y2, radius);
}
}
/// Closes current sub-path with a line segment.
/// Group: paths
@scriptable
public void closePath (NVGContext ctx) nothrow @trusted @nogc {
nvg__appendCommands(ctx, Command.Close);
}
/// Sets the current sub-path winding, see NVGWinding and NVGSolidity.
/// Group: paths
public void pathWinding (NVGContext ctx, NVGWinding dir) nothrow @trusted @nogc {
nvg__appendCommands(ctx, Command.Winding, cast(float)dir);
}
/// Ditto.
public void pathWinding (NVGContext ctx, NVGSolidity dir) nothrow @trusted @nogc {
nvg__appendCommands(ctx, Command.Winding, cast(float)dir);
}
/** Creates new circle arc shaped sub-path. The arc center is at (cx, cy), the arc radius is r,
* and the arc is drawn from angle a0 to a1, and swept in direction dir (NVGWinding.CCW, or NVGWinding.CW).
* Angles are specified in radians.
*
* [mode] is: "original", "move", "line" -- first command will be like original NanoVega, MoveTo, or LineTo
*
* Group: paths
*/
public void arc(string mode="original") (NVGContext ctx, NVGWinding dir, in float cx, in float cy, in float r, in float a0, in float a1) nothrow @trusted @nogc {
static assert(mode == "original" || mode == "move" || mode == "line");
float[3+5*7+100] vals = void;
//int move = (ctx.ncommands > 0 ? Command.LineTo : Command.MoveTo);
static if (mode == "original") {
immutable int move = (ctx.ncommands > 0 ? Command.LineTo : Command.MoveTo);
} else static if (mode == "move") {
enum move = Command.MoveTo;
} else static if (mode == "line") {
enum move = Command.LineTo;
} else {
static assert(0, "wtf?!");
}
// Clamp angles
float da = a1-a0;
if (dir == NVGWinding.CW) {
if (nvg__absf(da) >= NVG_PI*2) {
da = NVG_PI*2;
} else {
while (da < 0.0f) da += NVG_PI*2;
}
} else {
if (nvg__absf(da) >= NVG_PI*2) {
da = -NVG_PI*2;
} else {
while (da > 0.0f) da -= NVG_PI*2;
}
}
// Split arc into max 90 degree segments.
immutable int ndivs = nvg__max(1, nvg__min(cast(int)(nvg__absf(da)/(NVG_PI*0.5f)+0.5f), 5));
immutable float hda = (da/cast(float)ndivs)/2.0f;
float kappa = nvg__absf(4.0f/3.0f*(1.0f-nvg__cosf(hda))/nvg__sinf(hda));
if (dir == NVGWinding.CCW) kappa = -kappa;
int nvals = 0;
float px = 0, py = 0, ptanx = 0, ptany = 0;
foreach (int i; 0..ndivs+1) {
immutable float a = a0+da*(i/cast(float)ndivs);
immutable float dx = nvg__cosf(a);
immutable float dy = nvg__sinf(a);
immutable float x = cx+dx*r;
immutable float y = cy+dy*r;
immutable float tanx = -dy*r*kappa;
immutable float tany = dx*r*kappa;
if (i == 0) {
if (vals.length-nvals < 3) {
// flush
nvg__appendCommands!false(ctx, Command.MoveTo, vals.ptr[0..nvals]); // ignore command
nvals = 0;
}
vals.ptr[nvals++] = cast(float)move;
vals.ptr[nvals++] = x;
vals.ptr[nvals++] = y;
} else {
if (vals.length-nvals < 7) {
// flush
nvg__appendCommands!false(ctx, Command.MoveTo, vals.ptr[0..nvals]); // ignore command
nvals = 0;
}
vals.ptr[nvals++] = Command.BezierTo;
vals.ptr[nvals++] = px+ptanx;
vals.ptr[nvals++] = py+ptany;
vals.ptr[nvals++] = x-tanx;
vals.ptr[nvals++] = y-tany;
vals.ptr[nvals++] = x;
vals.ptr[nvals++] = y;
}
px = x;
py = y;
ptanx = tanx;
ptany = tany;
}
nvg__appendCommands!false(ctx, Command.MoveTo, vals.ptr[0..nvals]); // ignore command
}
/** Creates new circle arc shaped sub-path. The arc center is at (cx, cy), the arc radius is r,
* and the arc is drawn from angle a0 to a1, and swept in direction dir (NVGWinding.CCW, or NVGWinding.CW).
* Angles are specified in radians.
*
* Arguments: [cx, cy, r, a0, a1]*
*
* [mode] is: "original", "move", "line" -- first command will be like original NanoVega, MoveTo, or LineTo
*
* Group: paths
*/
public void arc(string mode="original") (NVGContext ctx, NVGWinding dir, in float[] args) nothrow @trusted @nogc {
static assert(mode == "original" || mode == "move" || mode == "line");
enum ArgC = 5;
if (args.length%ArgC != 0) assert(0, "NanoVega: invalid [arc] call");
if (args.length < ArgC) return;
const(float)* aptr = args.ptr;
foreach (immutable idx; 0..args.length/ArgC) {
immutable cx = *aptr++;
immutable cy = *aptr++;
immutable r = *aptr++;
immutable a0 = *aptr++;
immutable a1 = *aptr++;
ctx.arc!mode(dir, cx, cy, r, a0, a1);
}
}
/// Creates new rectangle shaped sub-path.
/// Group: paths
@scriptable
public void rect (NVGContext ctx, in float x, in float y, in float w, in float h) nothrow @trusted @nogc {
nvg__appendCommands!false(ctx, Command.MoveTo, // ignore command
Command.MoveTo, x, y,
Command.LineTo, x, y+h,
Command.LineTo, x+w, y+h,
Command.LineTo, x+w, y,
Command.Close,
);
}
/// Creates new rectangle shaped sub-path.
/// Arguments: [x, y, w, h]*
/// Group: paths
public void rect (NVGContext ctx, in float[] args) nothrow @trusted @nogc {
enum ArgC = 4;
if (args.length%ArgC != 0) assert(0, "NanoVega: invalid [rect] call");
if (args.length < ArgC) return;
const(float)* aptr = args.ptr;
foreach (immutable idx; 0..args.length/ArgC) {
immutable x = *aptr++;
immutable y = *aptr++;
immutable w = *aptr++;
immutable h = *aptr++;
nvg__appendCommands!false(ctx, Command.MoveTo, // ignore command
Command.MoveTo, x, y,
Command.LineTo, x, y+h,
Command.LineTo, x+w, y+h,
Command.LineTo, x+w, y,
Command.Close,
);
}
}
/// Creates new rounded rectangle shaped sub-path.
/// Group: paths
@scriptable
public void roundedRect (NVGContext ctx, in float x, in float y, in float w, in float h, in float radius) nothrow @trusted @nogc {
ctx.roundedRectVarying(x, y, w, h, radius, radius, radius, radius);
}
/// Creates new rounded rectangle shaped sub-path.
/// Arguments: [x, y, w, h, radius]*
/// Group: paths
public void roundedRect (NVGContext ctx, in float[] args) nothrow @trusted @nogc {
enum ArgC = 5;
if (args.length%ArgC != 0) assert(0, "NanoVega: invalid [roundedRect] call");
if (args.length < ArgC) return;
const(float)* aptr = args.ptr;
foreach (immutable idx; 0..args.length/ArgC) {
immutable x = *aptr++;
immutable y = *aptr++;
immutable w = *aptr++;
immutable h = *aptr++;
immutable r = *aptr++;
ctx.roundedRectVarying(x, y, w, h, r, r, r, r);
}
}
/// Creates new rounded rectangle shaped sub-path. Specify ellipse width and height to round corners according to it.
/// Group: paths
@scriptable
public void roundedRectEllipse (NVGContext ctx, in float x, in float y, in float w, in float h, in float rw, in float rh) nothrow @trusted @nogc {
if (rw < 0.1f || rh < 0.1f) {
rect(ctx, x, y, w, h);
} else {
nvg__appendCommands!false(ctx, Command.MoveTo, // ignore command
Command.MoveTo, x+rw, y,
Command.LineTo, x+w-rw, y,
Command.BezierTo, x+w-rw*(1-NVG_KAPPA90), y, x+w, y+rh*(1-NVG_KAPPA90), x+w, y+rh,
Command.LineTo, x+w, y+h-rh,
Command.BezierTo, x+w, y+h-rh*(1-NVG_KAPPA90), x+w-rw*(1-NVG_KAPPA90), y+h, x+w-rw, y+h,
Command.LineTo, x+rw, y+h,
Command.BezierTo, x+rw*(1-NVG_KAPPA90), y+h, x, y+h-rh*(1-NVG_KAPPA90), x, y+h-rh,
Command.LineTo, x, y+rh,
Command.BezierTo, x, y+rh*(1-NVG_KAPPA90), x+rw*(1-NVG_KAPPA90), y, x+rw, y,
Command.Close,
);
}
}
/// Creates new rounded rectangle shaped sub-path. Specify ellipse width and height to round corners according to it.
/// Arguments: [x, y, w, h, rw, rh]*
/// Group: paths
public void roundedRectEllipse (NVGContext ctx, in float[] args) nothrow @trusted @nogc {
enum ArgC = 6;
if (args.length%ArgC != 0) assert(0, "NanoVega: invalid [roundedRectEllipse] call");
if (args.length < ArgC) return;
const(float)* aptr = args.ptr;
foreach (immutable idx; 0..args.length/ArgC) {
immutable x = *aptr++;
immutable y = *aptr++;
immutable w = *aptr++;
immutable h = *aptr++;
immutable rw = *aptr++;
immutable rh = *aptr++;
if (rw < 0.1f || rh < 0.1f) {
rect(ctx, x, y, w, h);
} else {
nvg__appendCommands!false(ctx, Command.MoveTo, // ignore command
Command.MoveTo, x+rw, y,
Command.LineTo, x+w-rw, y,
Command.BezierTo, x+w-rw*(1-NVG_KAPPA90), y, x+w, y+rh*(1-NVG_KAPPA90), x+w, y+rh,
Command.LineTo, x+w, y+h-rh,
Command.BezierTo, x+w, y+h-rh*(1-NVG_KAPPA90), x+w-rw*(1-NVG_KAPPA90), y+h, x+w-rw, y+h,
Command.LineTo, x+rw, y+h,
Command.BezierTo, x+rw*(1-NVG_KAPPA90), y+h, x, y+h-rh*(1-NVG_KAPPA90), x, y+h-rh,
Command.LineTo, x, y+rh,
Command.BezierTo, x, y+rh*(1-NVG_KAPPA90), x+rw*(1-NVG_KAPPA90), y, x+rw, y,
Command.Close,
);
}
}
}
/// Creates new rounded rectangle shaped sub-path. This one allows you to specify different rounding radii for each corner.
/// Group: paths
public void roundedRectVarying (NVGContext ctx, in float x, in float y, in float w, in float h, in float radTopLeft, in float radTopRight, in float radBottomRight, in float radBottomLeft) nothrow @trusted @nogc {
if (radTopLeft < 0.1f && radTopRight < 0.1f && radBottomRight < 0.1f && radBottomLeft < 0.1f) {
ctx.rect(x, y, w, h);
} else {
immutable float halfw = nvg__absf(w)*0.5f;
immutable float halfh = nvg__absf(h)*0.5f;
immutable float rxBL = nvg__min(radBottomLeft, halfw)*nvg__sign(w), ryBL = nvg__min(radBottomLeft, halfh)*nvg__sign(h);
immutable float rxBR = nvg__min(radBottomRight, halfw)*nvg__sign(w), ryBR = nvg__min(radBottomRight, halfh)*nvg__sign(h);
immutable float rxTR = nvg__min(radTopRight, halfw)*nvg__sign(w), ryTR = nvg__min(radTopRight, halfh)*nvg__sign(h);
immutable float rxTL = nvg__min(radTopLeft, halfw)*nvg__sign(w), ryTL = nvg__min(radTopLeft, halfh)*nvg__sign(h);
nvg__appendCommands!false(ctx, Command.MoveTo, // ignore command
Command.MoveTo, x, y+ryTL,
Command.LineTo, x, y+h-ryBL,
Command.BezierTo, x, y+h-ryBL*(1-NVG_KAPPA90), x+rxBL*(1-NVG_KAPPA90), y+h, x+rxBL, y+h,
Command.LineTo, x+w-rxBR, y+h,
Command.BezierTo, x+w-rxBR*(1-NVG_KAPPA90), y+h, x+w, y+h-ryBR*(1-NVG_KAPPA90), x+w, y+h-ryBR,
Command.LineTo, x+w, y+ryTR,
Command.BezierTo, x+w, y+ryTR*(1-NVG_KAPPA90), x+w-rxTR*(1-NVG_KAPPA90), y, x+w-rxTR, y,
Command.LineTo, x+rxTL, y,
Command.BezierTo, x+rxTL*(1-NVG_KAPPA90), y, x, y+ryTL*(1-NVG_KAPPA90), x, y+ryTL,
Command.Close,
);
}
}
/// Creates new rounded rectangle shaped sub-path. This one allows you to specify different rounding radii for each corner.
/// Arguments: [x, y, w, h, radTopLeft, radTopRight, radBottomRight, radBottomLeft]*
/// Group: paths
public void roundedRectVarying (NVGContext ctx, in float[] args) nothrow @trusted @nogc {
enum ArgC = 8;
if (args.length%ArgC != 0) assert(0, "NanoVega: invalid [roundedRectVarying] call");
if (args.length < ArgC) return;
const(float)* aptr = args.ptr;
foreach (immutable idx; 0..args.length/ArgC) {
immutable x = *aptr++;
immutable y = *aptr++;
immutable w = *aptr++;
immutable h = *aptr++;
immutable radTopLeft = *aptr++;
immutable radTopRight = *aptr++;
immutable radBottomRight = *aptr++;
immutable radBottomLeft = *aptr++;
if (radTopLeft < 0.1f && radTopRight < 0.1f && radBottomRight < 0.1f && radBottomLeft < 0.1f) {
ctx.rect(x, y, w, h);
} else {
immutable float halfw = nvg__absf(w)*0.5f;
immutable float halfh = nvg__absf(h)*0.5f;
immutable float rxBL = nvg__min(radBottomLeft, halfw)*nvg__sign(w), ryBL = nvg__min(radBottomLeft, halfh)*nvg__sign(h);
immutable float rxBR = nvg__min(radBottomRight, halfw)*nvg__sign(w), ryBR = nvg__min(radBottomRight, halfh)*nvg__sign(h);
immutable float rxTR = nvg__min(radTopRight, halfw)*nvg__sign(w), ryTR = nvg__min(radTopRight, halfh)*nvg__sign(h);
immutable float rxTL = nvg__min(radTopLeft, halfw)*nvg__sign(w), ryTL = nvg__min(radTopLeft, halfh)*nvg__sign(h);
nvg__appendCommands!false(ctx, Command.MoveTo, // ignore command
Command.MoveTo, x, y+ryTL,
Command.LineTo, x, y+h-ryBL,
Command.BezierTo, x, y+h-ryBL*(1-NVG_KAPPA90), x+rxBL*(1-NVG_KAPPA90), y+h, x+rxBL, y+h,
Command.LineTo, x+w-rxBR, y+h,
Command.BezierTo, x+w-rxBR*(1-NVG_KAPPA90), y+h, x+w, y+h-ryBR*(1-NVG_KAPPA90), x+w, y+h-ryBR,
Command.LineTo, x+w, y+ryTR,
Command.BezierTo, x+w, y+ryTR*(1-NVG_KAPPA90), x+w-rxTR*(1-NVG_KAPPA90), y, x+w-rxTR, y,
Command.LineTo, x+rxTL, y,
Command.BezierTo, x+rxTL*(1-NVG_KAPPA90), y, x, y+ryTL*(1-NVG_KAPPA90), x, y+ryTL,
Command.Close,
);
}
}
}
/// Creates new ellipse shaped sub-path.
/// Group: paths
public void ellipse (NVGContext ctx, in float cx, in float cy, in float rx, in float ry) nothrow @trusted @nogc {
nvg__appendCommands!false(ctx, Command.MoveTo, // ignore command
Command.MoveTo, cx-rx, cy,
Command.BezierTo, cx-rx, cy+ry*NVG_KAPPA90, cx-rx*NVG_KAPPA90, cy+ry, cx, cy+ry,
Command.BezierTo, cx+rx*NVG_KAPPA90, cy+ry, cx+rx, cy+ry*NVG_KAPPA90, cx+rx, cy,
Command.BezierTo, cx+rx, cy-ry*NVG_KAPPA90, cx+rx*NVG_KAPPA90, cy-ry, cx, cy-ry,
Command.BezierTo, cx-rx*NVG_KAPPA90, cy-ry, cx-rx, cy-ry*NVG_KAPPA90, cx-rx, cy,
Command.Close,
);
}
/// Creates new ellipse shaped sub-path.
/// Arguments: [cx, cy, rx, ry]*
/// Group: paths
public void ellipse (NVGContext ctx, in float[] args) nothrow @trusted @nogc {
enum ArgC = 4;
if (args.length%ArgC != 0) assert(0, "NanoVega: invalid [ellipse] call");
if (args.length < ArgC) return;
const(float)* aptr = args.ptr;
foreach (immutable idx; 0..args.length/ArgC) {
immutable cx = *aptr++;
immutable cy = *aptr++;
immutable rx = *aptr++;
immutable ry = *aptr++;
nvg__appendCommands!false(ctx, Command.MoveTo, // ignore command
Command.MoveTo, cx-rx, cy,
Command.BezierTo, cx-rx, cy+ry*NVG_KAPPA90, cx-rx*NVG_KAPPA90, cy+ry, cx, cy+ry,
Command.BezierTo, cx+rx*NVG_KAPPA90, cy+ry, cx+rx, cy+ry*NVG_KAPPA90, cx+rx, cy,
Command.BezierTo, cx+rx, cy-ry*NVG_KAPPA90, cx+rx*NVG_KAPPA90, cy-ry, cx, cy-ry,
Command.BezierTo, cx-rx*NVG_KAPPA90, cy-ry, cx-rx, cy-ry*NVG_KAPPA90, cx-rx, cy,
Command.Close,
);
}
}
/// Creates new circle shaped sub-path.
/// Group: paths
public void circle (NVGContext ctx, in float cx, in float cy, in float r) nothrow @trusted @nogc {
ctx.ellipse(cx, cy, r, r);
}
/// Creates new circle shaped sub-path.
/// Arguments: [cx, cy, r]*
/// Group: paths
public void circle (NVGContext ctx, in float[] args) nothrow @trusted @nogc {
enum ArgC = 3;
if (args.length%ArgC != 0) assert(0, "NanoVega: invalid [circle] call");
if (args.length < ArgC) return;
const(float)* aptr = args.ptr;
foreach (immutable idx; 0..args.length/ArgC) {
immutable cx = *aptr++;
immutable cy = *aptr++;
immutable r = *aptr++;
ctx.ellipse(cx, cy, r, r);
}
}
// Debug function to dump cached path data.
debug public void debugDumpPathCache (NVGContext ctx) nothrow @trusted @nogc {
import core.stdc.stdio : printf;
const(NVGpath)* path;
printf("Dumping %d cached paths\n", ctx.cache.npaths);
for (int i = 0; i < ctx.cache.npaths; ++i) {
path = &ctx.cache.paths[i];
printf("-Path %d\n", i);
if (path.nfill) {
printf("-fill: %d\n", path.nfill);
for (int j = 0; j < path.nfill; ++j) printf("%f\t%f\n", path.fill[j].x, path.fill[j].y);
}
if (path.nstroke) {
printf("-stroke: %d\n", path.nstroke);
for (int j = 0; j < path.nstroke; ++j) printf("%f\t%f\n", path.stroke[j].x, path.stroke[j].y);
}
}
}
// Flatten path, prepare it for fill operation.
void nvg__prepareFill (NVGContext ctx) nothrow @trusted @nogc {
NVGpathCache* cache = ctx.cache;
NVGstate* state = nvg__getState(ctx);
nvg__flattenPaths!false(ctx);
if (ctx.params.edgeAntiAlias && state.shapeAntiAlias) {
nvg__expandFill(ctx, ctx.fringeWidth, NVGLineCap.Miter, 2.4f);
} else {
nvg__expandFill(ctx, 0.0f, NVGLineCap.Miter, 2.4f);
}
cache.evenOddMode = state.evenOddMode;
cache.fringeWidth = ctx.fringeWidth;
cache.fillReady = true;
cache.strokeReady = false;
cache.clipmode = NVGClipMode.None;
}
// Flatten path, prepare it for stroke operation.
void nvg__prepareStroke (NVGContext ctx) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
NVGpathCache* cache = ctx.cache;
nvg__flattenPaths!true(ctx);
immutable float scale = nvg__getAverageScale(state.xform);
float strokeWidth = nvg__clamp(state.strokeWidth*scale, 0.0f, 200.0f);
if (strokeWidth < ctx.fringeWidth) {
// If the stroke width is less than pixel size, use alpha to emulate coverage.
// Since coverage is area, scale by alpha*alpha.
immutable float alpha = nvg__clamp(strokeWidth/ctx.fringeWidth, 0.0f, 1.0f);
cache.strokeAlphaMul = alpha*alpha;
strokeWidth = ctx.fringeWidth;
} else {
cache.strokeAlphaMul = 1.0f;
}
cache.strokeWidth = strokeWidth;
if (ctx.params.edgeAntiAlias && state.shapeAntiAlias) {
nvg__expandStroke(ctx, strokeWidth*0.5f+ctx.fringeWidth*0.5f, state.lineCap, state.lineJoin, state.miterLimit);
} else {
nvg__expandStroke(ctx, strokeWidth*0.5f, state.lineCap, state.lineJoin, state.miterLimit);
}
cache.fringeWidth = ctx.fringeWidth;
cache.fillReady = false;
cache.strokeReady = true;
cache.clipmode = NVGClipMode.None;
}
/// Fills the current path with current fill style.
/// Group: paths
@scriptable
public void fill (NVGContext ctx) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
if (ctx.pathPickId >= 0 && (ctx.pathPickRegistered&(NVGPickKind.Fill|(NVGPickKind.Fill<<16))) == NVGPickKind.Fill) {
ctx.pathPickRegistered |= NVGPickKind.Fill<<16;
ctx.currFillHitId = ctx.pathPickId;
}
nvg__prepareFill(ctx);
// apply global alpha
NVGPaint fillPaint = state.fill;
fillPaint.innerColor.a *= state.alpha;
fillPaint.middleColor.a *= state.alpha;
fillPaint.outerColor.a *= state.alpha;
ctx.appendCurrentPathToCache(ctx.recset, state.fill);
if (ctx.recblockdraw) return;
ctx.params.renderFill(ctx.params.userPtr, state.compositeOperation, NVGClipMode.None, &fillPaint, &state.scissor, ctx.fringeWidth, ctx.cache.bounds.ptr, ctx.cache.paths, ctx.cache.npaths, state.evenOddMode);
// count triangles
foreach (int i; 0..ctx.cache.npaths) {
NVGpath* path = &ctx.cache.paths[i];
ctx.fillTriCount += path.nfill-2;
ctx.fillTriCount += path.nstroke-2;
ctx.drawCallCount += 2;
}
}
/// Fills the current path with current stroke style.
/// Group: paths
@scriptable
public void stroke (NVGContext ctx) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
if (ctx.pathPickId >= 0 && (ctx.pathPickRegistered&(NVGPickKind.Stroke|(NVGPickKind.Stroke<<16))) == NVGPickKind.Stroke) {
ctx.pathPickRegistered |= NVGPickKind.Stroke<<16;
ctx.currStrokeHitId = ctx.pathPickId;
}
nvg__prepareStroke(ctx);
NVGpathCache* cache = ctx.cache;
NVGPaint strokePaint = state.stroke;
strokePaint.innerColor.a *= cache.strokeAlphaMul;
strokePaint.middleColor.a *= cache.strokeAlphaMul;
strokePaint.outerColor.a *= cache.strokeAlphaMul;
// apply global alpha
strokePaint.innerColor.a *= state.alpha;
strokePaint.middleColor.a *= state.alpha;
strokePaint.outerColor.a *= state.alpha;
ctx.appendCurrentPathToCache(ctx.recset, state.stroke);
if (ctx.recblockdraw) return;
ctx.params.renderStroke(ctx.params.userPtr, state.compositeOperation, NVGClipMode.None, &strokePaint, &state.scissor, ctx.fringeWidth, cache.strokeWidth, ctx.cache.paths, ctx.cache.npaths);
// count triangles
foreach (int i; 0..ctx.cache.npaths) {
NVGpath* path = &ctx.cache.paths[i];
ctx.strokeTriCount += path.nstroke-2;
++ctx.drawCallCount;
}
}
/// Sets current path as clipping region.
/// Group: clipping
public void clip (NVGContext ctx, NVGClipMode aclipmode=NVGClipMode.Union) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
if (aclipmode == NVGClipMode.None) return;
if (ctx.recblockdraw) return; //???
if (aclipmode == NVGClipMode.Replace) ctx.params.renderResetClip(ctx.params.userPtr);
/*
if (ctx.pathPickId >= 0 && (ctx.pathPickRegistered&(NVGPickKind.Fill|(NVGPickKind.Fill<<16))) == NVGPickKind.Fill) {
ctx.pathPickRegistered |= NVGPickKind.Fill<<16;
ctx.currFillHitId = ctx.pathPickId;
}
*/
nvg__prepareFill(ctx);
// apply global alpha
NVGPaint fillPaint = state.fill;
fillPaint.innerColor.a *= state.alpha;
fillPaint.middleColor.a *= state.alpha;
fillPaint.outerColor.a *= state.alpha;
//ctx.appendCurrentPathToCache(ctx.recset, state.fill);
ctx.params.renderFill(ctx.params.userPtr, state.compositeOperation, aclipmode, &fillPaint, &state.scissor, ctx.fringeWidth, ctx.cache.bounds.ptr, ctx.cache.paths, ctx.cache.npaths, state.evenOddMode);
// count triangles
foreach (int i; 0..ctx.cache.npaths) {
NVGpath* path = &ctx.cache.paths[i];
ctx.fillTriCount += path.nfill-2;
ctx.fillTriCount += path.nstroke-2;
ctx.drawCallCount += 2;
}
}
/// Sets current path as clipping region.
/// Group: clipping
public alias clipFill = clip;
/// Sets current path' stroke as clipping region.
/// Group: clipping
public void clipStroke (NVGContext ctx, NVGClipMode aclipmode=NVGClipMode.Union) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
if (aclipmode == NVGClipMode.None) return;
if (ctx.recblockdraw) return; //???
if (aclipmode == NVGClipMode.Replace) ctx.params.renderResetClip(ctx.params.userPtr);
/*
if (ctx.pathPickId >= 0 && (ctx.pathPickRegistered&(NVGPickKind.Stroke|(NVGPickKind.Stroke<<16))) == NVGPickKind.Stroke) {
ctx.pathPickRegistered |= NVGPickKind.Stroke<<16;
ctx.currStrokeHitId = ctx.pathPickId;
}
*/
nvg__prepareStroke(ctx);
NVGpathCache* cache = ctx.cache;
NVGPaint strokePaint = state.stroke;
strokePaint.innerColor.a *= cache.strokeAlphaMul;
strokePaint.middleColor.a *= cache.strokeAlphaMul;
strokePaint.outerColor.a *= cache.strokeAlphaMul;
// apply global alpha
strokePaint.innerColor.a *= state.alpha;
strokePaint.middleColor.a *= state.alpha;
strokePaint.outerColor.a *= state.alpha;
//ctx.appendCurrentPathToCache(ctx.recset, state.stroke);
ctx.params.renderStroke(ctx.params.userPtr, state.compositeOperation, aclipmode, &strokePaint, &state.scissor, ctx.fringeWidth, cache.strokeWidth, ctx.cache.paths, ctx.cache.npaths);
// count triangles
foreach (int i; 0..ctx.cache.npaths) {
NVGpath* path = &ctx.cache.paths[i];
ctx.strokeTriCount += path.nstroke-2;
++ctx.drawCallCount;
}
}
// ////////////////////////////////////////////////////////////////////////// //
// Picking API
// most of the code is by Michael Wynne <mike@mikesspace.net>
// https://github.com/memononen/nanovg/pull/230
// https://github.com/MikeWW/nanovg
/// Pick type query. Used in [hitTest] and [hitTestAll].
/// Group: picking_api
public enum NVGPickKind : ubyte {
Fill = 0x01, ///
Stroke = 0x02, ///
All = 0x03, ///
}
/// Marks the fill of the current path as pickable with the specified id.
/// Note that you can create and mark path without rasterizing it.
/// Group: picking_api
public void currFillHitId (NVGContext ctx, int id) nothrow @trusted @nogc {
NVGpickScene* ps = nvg__pickSceneGet(ctx);
NVGpickPath* pp = nvg__pickPathCreate(ctx, ctx.commands[0..ctx.ncommands], id, /*forStroke:*/false);
nvg__pickSceneInsert(ps, pp);
}
public alias currFillPickId = currFillHitId; /// Ditto.
/// Marks the stroke of the current path as pickable with the specified id.
/// Note that you can create and mark path without rasterizing it.
/// Group: picking_api
public void currStrokeHitId (NVGContext ctx, int id) nothrow @trusted @nogc {
NVGpickScene* ps = nvg__pickSceneGet(ctx);
NVGpickPath* pp = nvg__pickPathCreate(ctx, ctx.commands[0..ctx.ncommands], id, /*forStroke:*/true);
nvg__pickSceneInsert(ps, pp);
}
public alias currStrokePickId = currStrokeHitId; /// Ditto.
// Marks the saved path set (fill) as pickable with the specified id.
// $(WARNING this doesn't work right yet (it is using current context transformation and other settings instead of record settings)!)
// Group: picking_api
/+
public void pathSetFillHitId (NVGContext ctx, NVGPathSet svp, int id) nothrow @trusted @nogc {
if (svp is null) return;
if (svp.svctx !is ctx) assert(0, "NanoVega: cannot register path set from different context");
foreach (ref cp; svp.caches[0..svp.ncaches]) {
NVGpickScene* ps = nvg__pickSceneGet(ctx);
NVGpickPath* pp = nvg__pickPathCreate(ctx, cp.commands[0..cp.ncommands], id, /*forStroke:*/false);
nvg__pickSceneInsert(ps, pp);
}
}
+/
// Marks the saved path set (stroke) as pickable with the specified id.
// $(WARNING this doesn't work right yet (it is using current context transformation and other settings instead of record settings)!)
// Group: picking_api
/+
public void pathSetStrokeHitId (NVGContext ctx, NVGPathSet svp, int id) nothrow @trusted @nogc {
if (svp is null) return;
if (svp.svctx !is ctx) assert(0, "NanoVega: cannot register path set from different context");
foreach (ref cp; svp.caches[0..svp.ncaches]) {
NVGpickScene* ps = nvg__pickSceneGet(ctx);
NVGpickPath* pp = nvg__pickPathCreate(ctx, cp.commands[0..cp.ncommands], id, /*forStroke:*/true);
nvg__pickSceneInsert(ps, pp);
}
}
+/
private template IsGoodHitTestDG(DG) {
enum IsGoodHitTestDG =
__traits(compiles, (){ DG dg; bool res = dg(cast(int)42, cast(int)666); }) ||
__traits(compiles, (){ DG dg; dg(cast(int)42, cast(int)666); });
}
private template IsGoodHitTestInternalDG(DG) {
enum IsGoodHitTestInternalDG =
__traits(compiles, (){ DG dg; NVGpickPath* pp; bool res = dg(pp); }) ||
__traits(compiles, (){ DG dg; NVGpickPath* pp; dg(pp); });
}
/// Call delegate [dg] for each path under the specified position (in no particular order).
/// Returns the id of the path for which delegate [dg] returned true or [NVGNoPick].
/// dg is: `bool delegate (int id, int order)` -- [order] is path ordering (ascending).
/// Group: picking_api
public int hitTestDG(bool bestOrder=false, DG) (NVGContext ctx, in float x, in float y, NVGPickKind kind, scope DG dg) if (IsGoodHitTestDG!DG || IsGoodHitTestInternalDG!DG) {
if (ctx.pickScene is null || ctx.pickScene.npaths == 0 || (kind&NVGPickKind.All) == 0) return -1;
NVGpickScene* ps = ctx.pickScene;
int levelwidth = 1<<(ps.nlevels-1);
int cellx = nvg__clamp(cast(int)(x/ps.xdim), 0, levelwidth);
int celly = nvg__clamp(cast(int)(y/ps.ydim), 0, levelwidth);
int npicked = 0;
// if we are interested only in most-toplevel path, there is no reason to check paths with worser order.
// but we cannot just get out on the first path found, 'cause we are using quad tree to speed up bounds
// checking, so path walking order is not guaranteed.
static if (bestOrder) {
int lastBestOrder = int.min;
}
//{ import core.stdc.stdio; printf("npaths=%d\n", ps.npaths); }
for (int lvl = ps.nlevels-1; lvl >= 0; --lvl) {
for (NVGpickPath* pp = ps.levels[lvl][celly*levelwidth+cellx]; pp !is null; pp = pp.next) {
//{ import core.stdc.stdio; printf("... pos=(%g,%g); bounds=(%g,%g)-(%g,%g); flags=0x%02x; kind=0x%02x; kpx=0x%02x\n", x, y, pp.bounds[0], pp.bounds[1], pp.bounds[2], pp.bounds[3], pp.flags, kind, kind&pp.flags&3); }
static if (bestOrder) {
// reject earlier paths
if (pp.order <= lastBestOrder) continue; // not interesting
}
immutable uint kpx = kind&pp.flags&3;
if (kpx == 0) continue; // not interesting
if (!nvg__pickPathTestBounds(ctx, ps, pp, x, y)) continue; // not interesting
//{ import core.stdc.stdio; printf("in bounds!\n"); }
int hit = 0;
if (kpx&NVGPickKind.Stroke) hit = nvg__pickPathStroke(ps, pp, x, y);
if (!hit && (kpx&NVGPickKind.Fill)) hit = nvg__pickPath(ps, pp, x, y);
if (!hit) continue;
//{ import core.stdc.stdio; printf(" HIT!\n"); }
static if (bestOrder) lastBestOrder = pp.order;
static if (IsGoodHitTestDG!DG) {
static if (__traits(compiles, (){ DG dg; bool res = dg(cast(int)42, cast(int)666); })) {
if (dg(pp.id, cast(int)pp.order)) return pp.id;
} else {
dg(pp.id, cast(int)pp.order);
}
} else {
static if (__traits(compiles, (){ DG dg; NVGpickPath* pp; bool res = dg(pp); })) {
if (dg(pp)) return pp.id;
} else {
dg(pp);
}
}
}
cellx >>= 1;
celly >>= 1;
levelwidth >>= 1;
}
return -1;
}
/// Fills ids with a list of the top most hit ids (from bottom to top) under the specified position.
/// Returns the slice of [ids].
/// Group: picking_api
public int[] hitTestAll (NVGContext ctx, in float x, in float y, NVGPickKind kind, int[] ids) nothrow @trusted @nogc {
if (ctx.pickScene is null || ids.length == 0) return ids[0..0];
int npicked = 0;
NVGpickScene* ps = ctx.pickScene;
ctx.hitTestDG!false(x, y, kind, delegate (NVGpickPath* pp) nothrow @trusted @nogc {
if (npicked == ps.cpicked) {
int cpicked = ps.cpicked+ps.cpicked;
NVGpickPath** picked = cast(NVGpickPath**)realloc(ps.picked, (NVGpickPath*).sizeof*ps.cpicked);
if (picked is null) return true; // abort
ps.cpicked = cpicked;
ps.picked = picked;
}
ps.picked[npicked] = pp;
++npicked;
return false; // go on
});
qsort(ps.picked, npicked, (NVGpickPath*).sizeof, &nvg__comparePaths);
assert(npicked >= 0);
if (npicked > ids.length) npicked = cast(int)ids.length;
foreach (immutable nidx, ref int did; ids[0..npicked]) did = ps.picked[nidx].id;
return ids[0..npicked];
}
/// Returns the id of the pickable shape containing x,y or [NVGNoPick] if no shape was found.
/// Group: picking_api
public int hitTest (NVGContext ctx, in float x, in float y, NVGPickKind kind=NVGPickKind.All) nothrow @trusted @nogc {
if (ctx.pickScene is null) return -1;
int bestOrder = int.min;
int bestID = -1;
ctx.hitTestDG!true(x, y, kind, delegate (NVGpickPath* pp) {
if (pp.order > bestOrder) {
bestOrder = pp.order;
bestID = pp.id;
}
});
return bestID;
}
/// Returns `true` if the path with the given id contains x,y.
/// Group: picking_api
public bool hitTestForId (NVGContext ctx, in int id, in float x, in float y, NVGPickKind kind=NVGPickKind.All) nothrow @trusted @nogc {
if (ctx.pickScene is null || id == NVGNoPick) return false;
bool res = false;
ctx.hitTestDG!false(x, y, kind, delegate (NVGpickPath* pp) {
if (pp.id == id) {
res = true;
return true; // stop
}
return false; // continue
});
return res;
}
/// Returns `true` if the given point is within the fill of the currently defined path.
/// This operation can be done before rasterizing the current path.
/// Group: picking_api
public bool hitTestCurrFill (NVGContext ctx, in float x, in float y) nothrow @trusted @nogc {
NVGpickScene* ps = nvg__pickSceneGet(ctx);
int oldnpoints = ps.npoints;
int oldnsegments = ps.nsegments;
NVGpickPath* pp = nvg__pickPathCreate(ctx, ctx.commands[0..ctx.ncommands], 1, /*forStroke:*/false);
if (pp is null) return false; // oops
scope(exit) {
nvg__freePickPath(ps, pp);
ps.npoints = oldnpoints;
ps.nsegments = oldnsegments;
}
return (nvg__pointInBounds(x, y, pp.bounds) ? nvg__pickPath(ps, pp, x, y) : false);
}
public alias isPointInPath = hitTestCurrFill; /// Ditto.
/// Returns `true` if the given point is within the stroke of the currently defined path.
/// This operation can be done before rasterizing the current path.
/// Group: picking_api
public bool hitTestCurrStroke (NVGContext ctx, in float x, in float y) nothrow @trusted @nogc {
NVGpickScene* ps = nvg__pickSceneGet(ctx);
int oldnpoints = ps.npoints;
int oldnsegments = ps.nsegments;
NVGpickPath* pp = nvg__pickPathCreate(ctx, ctx.commands[0..ctx.ncommands], 1, /*forStroke:*/true);
if (pp is null) return false; // oops
scope(exit) {
nvg__freePickPath(ps, pp);
ps.npoints = oldnpoints;
ps.nsegments = oldnsegments;
}
return (nvg__pointInBounds(x, y, pp.bounds) ? nvg__pickPathStroke(ps, pp, x, y) : false);
}
nothrow @trusted @nogc {
extern(C) {
private alias _compare_fp_t = int function (const void*, const void*) nothrow @nogc;
private extern(C) void qsort (scope void* base, size_t nmemb, size_t size, _compare_fp_t compar) nothrow @nogc;
extern(C) int nvg__comparePaths (const void* a, const void* b) {
return (*cast(const(NVGpickPath)**)b).order-(*cast(const(NVGpickPath)**)a).order;
}
}
enum NVGPickEPS = 0.0001f;
// Segment flags
enum NVGSegmentFlags {
Corner = 1,
Bevel = 2,
InnerBevel = 4,
Cap = 8,
Endcap = 16,
}
// Path flags
enum NVGPathFlags : ushort {
Fill = NVGPickKind.Fill,
Stroke = NVGPickKind.Stroke,
Scissor = 0x80,
}
struct NVGsegment {
int firstPoint; // Index into NVGpickScene.points
short type; // NVG_LINETO or NVG_BEZIERTO
short flags; // Flags relate to the corner between the prev segment and this one.
float[4] bounds;
float[2] startDir; // Direction at t == 0
float[2] endDir; // Direction at t == 1
float[2] miterDir; // Direction of miter of corner between the prev segment and this one.
}
struct NVGpickSubPath {
short winding; // TODO: Merge to flag field
bool closed; // TODO: Merge to flag field
int firstSegment; // Index into NVGpickScene.segments
int nsegments;
float[4] bounds;
NVGpickSubPath* next;
}
struct NVGpickPath {
int id;
short flags;
short order;
float strokeWidth;
float miterLimit;
short lineCap;
short lineJoin;
bool evenOddMode;
float[4] bounds;
int scissor; // Indexes into ps->points and defines scissor rect as XVec, YVec and Center
NVGpickSubPath* subPaths;
NVGpickPath* next;
NVGpickPath* cellnext;
}
struct NVGpickScene {
int npaths;
NVGpickPath* paths; // Linked list of paths
NVGpickPath* lastPath; // The last path in the paths linked list (the first path added)
NVGpickPath* freePaths; // Linked list of free paths
NVGpickSubPath* freeSubPaths; // Linked list of free sub paths
int width;
int height;
// Points for all path sub paths.
float* points;
int npoints;
int cpoints;
// Segments for all path sub paths
NVGsegment* segments;
int nsegments;
int csegments;
// Implicit quadtree
float xdim; // Width / (1 << nlevels)
float ydim; // Height / (1 << nlevels)
int ncells; // Total number of cells in all levels
int nlevels;
NVGpickPath*** levels; // Index: [Level][LevelY * LevelW + LevelX] Value: Linked list of paths
// Temp storage for picking
int cpicked;
NVGpickPath** picked;
}
// bounds utilities
void nvg__initBounds (ref float[4] bounds) {
bounds.ptr[0] = bounds.ptr[1] = float.max;
bounds.ptr[2] = bounds.ptr[3] = -float.max;
}
void nvg__expandBounds (ref float[4] bounds, const(float)* points, int npoints) {
npoints *= 2;
for (int i = 0; i < npoints; i += 2) {
bounds.ptr[0] = nvg__min(bounds.ptr[0], points[i]);
bounds.ptr[1] = nvg__min(bounds.ptr[1], points[i+1]);
bounds.ptr[2] = nvg__max(bounds.ptr[2], points[i]);
bounds.ptr[3] = nvg__max(bounds.ptr[3], points[i+1]);
}
}
void nvg__unionBounds (ref float[4] bounds, in ref float[4] boundsB) {
bounds.ptr[0] = nvg__min(bounds.ptr[0], boundsB.ptr[0]);
bounds.ptr[1] = nvg__min(bounds.ptr[1], boundsB.ptr[1]);
bounds.ptr[2] = nvg__max(bounds.ptr[2], boundsB.ptr[2]);
bounds.ptr[3] = nvg__max(bounds.ptr[3], boundsB.ptr[3]);
}
void nvg__intersectBounds (ref float[4] bounds, in ref float[4] boundsB) {
bounds.ptr[0] = nvg__max(boundsB.ptr[0], bounds.ptr[0]);
bounds.ptr[1] = nvg__max(boundsB.ptr[1], bounds.ptr[1]);
bounds.ptr[2] = nvg__min(boundsB.ptr[2], bounds.ptr[2]);
bounds.ptr[3] = nvg__min(boundsB.ptr[3], bounds.ptr[3]);
bounds.ptr[2] = nvg__max(bounds.ptr[0], bounds.ptr[2]);
bounds.ptr[3] = nvg__max(bounds.ptr[1], bounds.ptr[3]);
}
bool nvg__pointInBounds (in float x, in float y, in ref float[4] bounds) {
pragma(inline, true);
return (x >= bounds.ptr[0] && x <= bounds.ptr[2] && y >= bounds.ptr[1] && y <= bounds.ptr[3]);
}
// building paths & sub paths
int nvg__pickSceneAddPoints (NVGpickScene* ps, const(float)* xy, int n) {
import core.stdc.string : memcpy;
if (ps.npoints+n > ps.cpoints) {
import core.stdc.stdlib : realloc;
int cpoints = ps.npoints+n+(ps.cpoints<<1);
float* points = cast(float*)realloc(ps.points, float.sizeof*2*cpoints);
if (points is null) assert(0, "NanoVega: out of memory");
ps.points = points;
ps.cpoints = cpoints;
}
int i = ps.npoints;
if (xy !is null) memcpy(&ps.points[i*2], xy, float.sizeof*2*n);
ps.npoints += n;
return i;
}
void nvg__pickSubPathAddSegment (NVGpickScene* ps, NVGpickSubPath* psp, int firstPoint, int type, short flags) {
NVGsegment* seg = null;
if (ps.nsegments == ps.csegments) {
int csegments = 1+ps.csegments+(ps.csegments<<1);
NVGsegment* segments = cast(NVGsegment*)realloc(ps.segments, NVGsegment.sizeof*csegments);
if (segments is null) assert(0, "NanoVega: out of memory");
ps.segments = segments;
ps.csegments = csegments;
}
if (psp.firstSegment == -1) psp.firstSegment = ps.nsegments;
seg = &ps.segments[ps.nsegments];
++ps.nsegments;
seg.firstPoint = firstPoint;
seg.type = cast(short)type;
seg.flags = flags;
++psp.nsegments;
nvg__segmentDir(ps, psp, seg, 0, seg.startDir);
nvg__segmentDir(ps, psp, seg, 1, seg.endDir);
}
void nvg__segmentDir (NVGpickScene* ps, NVGpickSubPath* psp, NVGsegment* seg, float t, ref float[2] d) {
const(float)* points = &ps.points[seg.firstPoint*2];
immutable float x0 = points[0*2+0], x1 = points[1*2+0];
immutable float y0 = points[0*2+1], y1 = points[1*2+1];
switch (seg.type) {
case Command.LineTo:
d.ptr[0] = x1-x0;
d.ptr[1] = y1-y0;
nvg__normalize(&d.ptr[0], &d.ptr[1]);
break;
case Command.BezierTo:
immutable float x2 = points[2*2+0];
immutable float y2 = points[2*2+1];
immutable float x3 = points[3*2+0];
immutable float y3 = points[3*2+1];
immutable float omt = 1.0f-t;
immutable float omt2 = omt*omt;
immutable float t2 = t*t;
d.ptr[0] =
3.0f*omt2*(x1-x0)+
6.0f*omt*t*(x2-x1)+
3.0f*t2*(x3-x2);
d.ptr[1] =
3.0f*omt2*(y1-y0)+
6.0f*omt*t*(y2-y1)+
3.0f*t2*(y3-y2);
nvg__normalize(&d.ptr[0], &d.ptr[1]);
break;
default:
break;
}
}
void nvg__pickSubPathAddFillSupports (NVGpickScene* ps, NVGpickSubPath* psp) {
if (psp.firstSegment == -1) return;
NVGsegment* segments = &ps.segments[psp.firstSegment];
for (int s = 0; s < psp.nsegments; ++s) {
NVGsegment* seg = &segments[s];
const(float)* points = &ps.points[seg.firstPoint*2];
if (seg.type == Command.LineTo) {
nvg__initBounds(seg.bounds);
nvg__expandBounds(seg.bounds, points, 2);
} else {
nvg__bezierBounds(points, seg.bounds);
}
}
}
void nvg__pickSubPathAddStrokeSupports (NVGpickScene* ps, NVGpickSubPath* psp, float strokeWidth, int lineCap, int lineJoin, float miterLimit) {
if (psp.firstSegment == -1) return;
immutable bool closed = psp.closed;
const(float)* points = ps.points;
NVGsegment* seg = null;
NVGsegment* segments = &ps.segments[psp.firstSegment];
int nsegments = psp.nsegments;
NVGsegment* prevseg = (closed ? &segments[psp.nsegments-1] : null);
int ns = 0; // nsupports
float[32] supportingPoints = void;
int firstPoint, lastPoint;
if (!closed) {
segments[0].flags |= NVGSegmentFlags.Cap;
segments[nsegments-1].flags |= NVGSegmentFlags.Endcap;
}
for (int s = 0; s < nsegments; ++s) {
seg = &segments[s];
nvg__initBounds(seg.bounds);
firstPoint = seg.firstPoint*2;
lastPoint = firstPoint+(seg.type == Command.LineTo ? 2 : 6);
ns = 0;
// First two supporting points are either side of the start point
supportingPoints.ptr[ns++] = points[firstPoint]-seg.startDir.ptr[1]*strokeWidth;
supportingPoints.ptr[ns++] = points[firstPoint+1]+seg.startDir.ptr[0]*strokeWidth;
supportingPoints.ptr[ns++] = points[firstPoint]+seg.startDir.ptr[1]*strokeWidth;
supportingPoints.ptr[ns++] = points[firstPoint+1]-seg.startDir.ptr[0]*strokeWidth;
// Second two supporting points are either side of the end point
supportingPoints.ptr[ns++] = points[lastPoint]-seg.endDir.ptr[1]*strokeWidth;
supportingPoints.ptr[ns++] = points[lastPoint+1]+seg.endDir.ptr[0]*strokeWidth;
supportingPoints.ptr[ns++] = points[lastPoint]+seg.endDir.ptr[1]*strokeWidth;
supportingPoints.ptr[ns++] = points[lastPoint+1]-seg.endDir.ptr[0]*strokeWidth;
if ((seg.flags&NVGSegmentFlags.Corner) && prevseg !is null) {
seg.miterDir.ptr[0] = 0.5f*(-prevseg.endDir.ptr[1]-seg.startDir.ptr[1]);
seg.miterDir.ptr[1] = 0.5f*(prevseg.endDir.ptr[0]+seg.startDir.ptr[0]);
immutable float M2 = seg.miterDir.ptr[0]*seg.miterDir.ptr[0]+seg.miterDir.ptr[1]*seg.miterDir.ptr[1];
if (M2 > 0.000001f) {
float scale = 1.0f/M2;
if (scale > 600.0f) scale = 600.0f;
seg.miterDir.ptr[0] *= scale;
seg.miterDir.ptr[1] *= scale;
}
//NVG_PICK_DEBUG_VECTOR_SCALE(&points[firstPoint], seg.miterDir, 10);
// Add an additional support at the corner on the other line
supportingPoints.ptr[ns++] = points[firstPoint]-prevseg.endDir.ptr[1]*strokeWidth;
supportingPoints.ptr[ns++] = points[firstPoint+1]+prevseg.endDir.ptr[0]*strokeWidth;
if (lineJoin == NVGLineCap.Miter || lineJoin == NVGLineCap.Bevel) {
// Set a corner as beveled if the join type is bevel or mitered and
// miterLimit is hit.
if (lineJoin == NVGLineCap.Bevel || (M2*miterLimit*miterLimit) < 1.0f) {
seg.flags |= NVGSegmentFlags.Bevel;
} else {
// Corner is mitered - add miter point as a support
supportingPoints.ptr[ns++] = points[firstPoint]+seg.miterDir.ptr[0]*strokeWidth;
supportingPoints.ptr[ns++] = points[firstPoint+1]+seg.miterDir.ptr[1]*strokeWidth;
}
} else if (lineJoin == NVGLineCap.Round) {
// ... and at the midpoint of the corner arc
float[2] vertexN = [ -seg.startDir.ptr[0]+prevseg.endDir.ptr[0], -seg.startDir.ptr[1]+prevseg.endDir.ptr[1] ];
nvg__normalize(&vertexN[0], &vertexN[1]);
supportingPoints.ptr[ns++] = points[firstPoint]+vertexN[0]*strokeWidth;
supportingPoints.ptr[ns++] = points[firstPoint+1]+vertexN[1]*strokeWidth;
}
}
if (seg.flags&NVGSegmentFlags.Cap) {
switch (lineCap) {
case NVGLineCap.Butt:
// supports for butt already added
break;
case NVGLineCap.Square:
// square cap supports are just the original two supports moved out along the direction
supportingPoints.ptr[ns++] = supportingPoints.ptr[0]-seg.startDir.ptr[0]*strokeWidth;
supportingPoints.ptr[ns++] = supportingPoints.ptr[1]-seg.startDir.ptr[1]*strokeWidth;
supportingPoints.ptr[ns++] = supportingPoints.ptr[2]-seg.startDir.ptr[0]*strokeWidth;
supportingPoints.ptr[ns++] = supportingPoints.ptr[3]-seg.startDir.ptr[1]*strokeWidth;
break;
case NVGLineCap.Round:
// add one additional support for the round cap along the dir
supportingPoints.ptr[ns++] = points[firstPoint]-seg.startDir.ptr[0]*strokeWidth;
supportingPoints.ptr[ns++] = points[firstPoint+1]-seg.startDir.ptr[1]*strokeWidth;
break;
default:
break;
}
}
if (seg.flags&NVGSegmentFlags.Endcap) {
// end supporting points, either side of line
int end = 4;
switch(lineCap) {
case NVGLineCap.Butt:
// supports for butt already added
break;
case NVGLineCap.Square:
// square cap supports are just the original two supports moved out along the direction
supportingPoints.ptr[ns++] = supportingPoints.ptr[end+0]+seg.endDir.ptr[0]*strokeWidth;
supportingPoints.ptr[ns++] = supportingPoints.ptr[end+1]+seg.endDir.ptr[1]*strokeWidth;
supportingPoints.ptr[ns++] = supportingPoints.ptr[end+2]+seg.endDir.ptr[0]*strokeWidth;
supportingPoints.ptr[ns++] = supportingPoints.ptr[end+3]+seg.endDir.ptr[1]*strokeWidth;
break;
case NVGLineCap.Round:
// add one additional support for the round cap along the dir
supportingPoints.ptr[ns++] = points[lastPoint]+seg.endDir.ptr[0]*strokeWidth;
supportingPoints.ptr[ns++] = points[lastPoint+1]+seg.endDir.ptr[1]*strokeWidth;
break;
default:
break;
}
}
nvg__expandBounds(seg.bounds, supportingPoints.ptr, ns/2);
prevseg = seg;
}
}
NVGpickPath* nvg__pickPathCreate (NVGContext context, const(float)[] acommands, int id, bool forStroke) {
NVGpickScene* ps = nvg__pickSceneGet(context);
if (ps is null) return null;
int i = 0;
int ncommands = cast(int)acommands.length;
const(float)* commands = acommands.ptr;
NVGpickPath* pp = null;
NVGpickSubPath* psp = null;
float[2] start = void;
int firstPoint;
//bool hasHoles = false;
NVGpickSubPath* prev = null;
float[8] points = void;
float[2] inflections = void;
int ninflections = 0;
NVGstate* state = nvg__getState(context);
float[4] totalBounds = void;
NVGsegment* segments = null;
const(NVGsegment)* seg = null;
NVGpickSubPath *curpsp;
pp = nvg__allocPickPath(ps);
if (pp is null) return null;
pp.id = id;
bool hasPoints = false;
void closeIt () {
if (psp is null || !hasPoints) return;
if (ps.points[(ps.npoints-1)*2] != start.ptr[0] || ps.points[(ps.npoints-1)*2+1] != start.ptr[1]) {
firstPoint = nvg__pickSceneAddPoints(ps, start.ptr, 1);
nvg__pickSubPathAddSegment(ps, psp, firstPoint-1, Command.LineTo, NVGSegmentFlags.Corner);
}
psp.closed = true;
}
while (i < ncommands) {
int cmd = cast(int)commands[i++];
switch (cmd) {
case Command.MoveTo: // one coordinate pair
const(float)* tfxy = commands+i;
i += 2;
// new starting point
start.ptr[0..2] = tfxy[0..2];
// start a new path for each sub path to handle sub paths that intersect other sub paths
prev = psp;
psp = nvg__allocPickSubPath(ps);
if (psp is null) { psp = prev; break; }
psp.firstSegment = -1;
psp.winding = NVGSolidity.Solid;
psp.next = prev;
nvg__pickSceneAddPoints(ps, tfxy, 1);
hasPoints = true;
break;
case Command.LineTo: // one coordinate pair
const(float)* tfxy = commands+i;
i += 2;
firstPoint = nvg__pickSceneAddPoints(ps, tfxy, 1);
nvg__pickSubPathAddSegment(ps, psp, firstPoint-1, cmd, NVGSegmentFlags.Corner);
hasPoints = true;
break;
case Command.BezierTo: // three coordinate pairs
const(float)* tfxy = commands+i;
i += 3*2;
// Split the curve at it's dx==0 or dy==0 inflection points.
// Thus:
// A horizontal line only ever interects the curves once.
// and
// Finding the closest point on any curve converges more reliably.
// NOTE: We could just split on dy==0 here.
memcpy(&points.ptr[0], &ps.points[(ps.npoints-1)*2], float.sizeof*2);
memcpy(&points.ptr[2], tfxy, float.sizeof*2*3);
ninflections = 0;
nvg__bezierInflections(points.ptr, 1, &ninflections, inflections.ptr);
nvg__bezierInflections(points.ptr, 0, &ninflections, inflections.ptr);
if (ninflections) {
float previnfl = 0;
float[8] pointsA = void, pointsB = void;
nvg__smallsort(inflections.ptr, ninflections);
for (int infl = 0; infl < ninflections; ++infl) {
if (nvg__absf(inflections.ptr[infl]-previnfl) < NVGPickEPS) continue;
immutable float t = (inflections.ptr[infl]-previnfl)*(1.0f/(1.0f-previnfl));
previnfl = inflections.ptr[infl];
nvg__splitBezier(points.ptr, t, pointsA.ptr, pointsB.ptr);
firstPoint = nvg__pickSceneAddPoints(ps, &pointsA.ptr[2], 3);
nvg__pickSubPathAddSegment(ps, psp, firstPoint-1, cmd, (infl == 0) ? NVGSegmentFlags.Corner : 0);
memcpy(points.ptr, pointsB.ptr, float.sizeof*8);
}
firstPoint = nvg__pickSceneAddPoints(ps, &pointsB.ptr[2], 3);
nvg__pickSubPathAddSegment(ps, psp, firstPoint-1, cmd, 0);
} else {
firstPoint = nvg__pickSceneAddPoints(ps, tfxy, 3);
nvg__pickSubPathAddSegment(ps, psp, firstPoint-1, cmd, NVGSegmentFlags.Corner);
}
hasPoints = true;
break;
case Command.Close:
closeIt();
break;
case Command.Winding:
psp.winding = cast(short)cast(int)commands[i];
//if (psp.winding == NVGSolidity.Hole) hasHoles = true;
i += 1;
break;
default:
break;
}
}
// force-close filled paths
if (psp !is null && !forStroke && hasPoints && !psp.closed) closeIt();
pp.flags = (forStroke ? NVGPathFlags.Stroke : NVGPathFlags.Fill);
pp.subPaths = psp;
pp.strokeWidth = state.strokeWidth*0.5f;
pp.miterLimit = state.miterLimit;
pp.lineCap = cast(short)state.lineCap;
pp.lineJoin = cast(short)state.lineJoin;
pp.evenOddMode = nvg__getState(context).evenOddMode;
nvg__initBounds(totalBounds);
for (curpsp = psp; curpsp; curpsp = curpsp.next) {
if (forStroke) {
nvg__pickSubPathAddStrokeSupports(ps, curpsp, pp.strokeWidth, pp.lineCap, pp.lineJoin, pp.miterLimit);
} else {
nvg__pickSubPathAddFillSupports(ps, curpsp);
}
if (curpsp.firstSegment == -1) continue;
segments = &ps.segments[curpsp.firstSegment];
nvg__initBounds(curpsp.bounds);
for (int s = 0; s < curpsp.nsegments; ++s) {
seg = &segments[s];
//NVG_PICK_DEBUG_BOUNDS(seg.bounds);
nvg__unionBounds(curpsp.bounds, seg.bounds);
}
nvg__unionBounds(totalBounds, curpsp.bounds);
}
// Store the scissor rect if present.
if (state.scissor.extent.ptr[0] != -1.0f) {
// Use points storage to store the scissor data
pp.scissor = nvg__pickSceneAddPoints(ps, null, 4);
float* scissor = &ps.points[pp.scissor*2];
//memcpy(scissor, state.scissor.xform.ptr, 6*float.sizeof);
scissor[0..6] = state.scissor.xform.mat[];
memcpy(scissor+6, state.scissor.extent.ptr, 2*float.sizeof);
pp.flags |= NVGPathFlags.Scissor;
}
memcpy(pp.bounds.ptr, totalBounds.ptr, float.sizeof*4);
return pp;
}
// Struct management
NVGpickPath* nvg__allocPickPath (NVGpickScene* ps) {
NVGpickPath* pp = ps.freePaths;
if (pp !is null) {
ps.freePaths = pp.next;
} else {
pp = cast(NVGpickPath*)malloc(NVGpickPath.sizeof);
}
memset(pp, 0, NVGpickPath.sizeof);
return pp;
}
// Put a pick path and any sub paths (back) to the free lists.
void nvg__freePickPath (NVGpickScene* ps, NVGpickPath* pp) {
// Add all sub paths to the sub path free list.
// Finds the end of the path sub paths, links that to the current
// sub path free list head and replaces the head ptr with the
// head path sub path entry.
NVGpickSubPath* psp = null;
for (psp = pp.subPaths; psp !is null && psp.next !is null; psp = psp.next) {}
if (psp) {
psp.next = ps.freeSubPaths;
ps.freeSubPaths = pp.subPaths;
}
pp.subPaths = null;
// Add the path to the path freelist
pp.next = ps.freePaths;
ps.freePaths = pp;
if (pp.next is null) ps.lastPath = pp;
}
NVGpickSubPath* nvg__allocPickSubPath (NVGpickScene* ps) {
NVGpickSubPath* psp = ps.freeSubPaths;
if (psp !is null) {
ps.freeSubPaths = psp.next;
} else {
psp = cast(NVGpickSubPath*)malloc(NVGpickSubPath.sizeof);
if (psp is null) return null;
}
memset(psp, 0, NVGpickSubPath.sizeof);
return psp;
}
void nvg__returnPickSubPath (NVGpickScene* ps, NVGpickSubPath* psp) {
psp.next = ps.freeSubPaths;
ps.freeSubPaths = psp;
}
NVGpickScene* nvg__allocPickScene () {
NVGpickScene* ps = cast(NVGpickScene*)malloc(NVGpickScene.sizeof);
if (ps is null) return null;
memset(ps, 0, NVGpickScene.sizeof);
ps.nlevels = 5;
return ps;
}
void nvg__deletePickScene (NVGpickScene* ps) {
NVGpickPath* pp;
NVGpickSubPath* psp;
// Add all paths (and thus sub paths) to the free list(s).
while (ps.paths !is null) {
pp = ps.paths.next;
nvg__freePickPath(ps, ps.paths);
ps.paths = pp;
}
// Delete all paths
while (ps.freePaths !is null) {
pp = ps.freePaths;
ps.freePaths = pp.next;
while (pp.subPaths !is null) {
psp = pp.subPaths;
pp.subPaths = psp.next;
free(psp);
}
free(pp);
}
// Delete all sub paths
while (ps.freeSubPaths !is null) {
psp = ps.freeSubPaths.next;
free(ps.freeSubPaths);
ps.freeSubPaths = psp;
}
ps.npoints = 0;
ps.nsegments = 0;
if (ps.levels !is null) {
free(ps.levels[0]);
free(ps.levels);
}
if (ps.picked !is null) free(ps.picked);
if (ps.points !is null) free(ps.points);
if (ps.segments !is null) free(ps.segments);
free(ps);
}
NVGpickScene* nvg__pickSceneGet (NVGContext ctx) {
if (ctx.pickScene is null) ctx.pickScene = nvg__allocPickScene();
return ctx.pickScene;
}
// Applies Casteljau's algorithm to a cubic bezier for a given parameter t
// points is 4 points (8 floats)
// lvl1 is 3 points (6 floats)
// lvl2 is 2 points (4 floats)
// lvl3 is 1 point (2 floats)
void nvg__casteljau (const(float)* points, float t, float* lvl1, float* lvl2, float* lvl3) {
enum x0 = 0*2+0; enum x1 = 1*2+0; enum x2 = 2*2+0; enum x3 = 3*2+0;
enum y0 = 0*2+1; enum y1 = 1*2+1; enum y2 = 2*2+1; enum y3 = 3*2+1;
// Level 1
lvl1[x0] = (points[x1]-points[x0])*t+points[x0];
lvl1[y0] = (points[y1]-points[y0])*t+points[y0];
lvl1[x1] = (points[x2]-points[x1])*t+points[x1];
lvl1[y1] = (points[y2]-points[y1])*t+points[y1];
lvl1[x2] = (points[x3]-points[x2])*t+points[x2];
lvl1[y2] = (points[y3]-points[y2])*t+points[y2];
// Level 2
lvl2[x0] = (lvl1[x1]-lvl1[x0])*t+lvl1[x0];
lvl2[y0] = (lvl1[y1]-lvl1[y0])*t+lvl1[y0];
lvl2[x1] = (lvl1[x2]-lvl1[x1])*t+lvl1[x1];
lvl2[y1] = (lvl1[y2]-lvl1[y1])*t+lvl1[y1];
// Level 3
lvl3[x0] = (lvl2[x1]-lvl2[x0])*t+lvl2[x0];
lvl3[y0] = (lvl2[y1]-lvl2[y0])*t+lvl2[y0];
}
// Calculates a point on a bezier at point t.
void nvg__bezierEval (const(float)* points, float t, ref float[2] tpoint) {
immutable float omt = 1-t;
immutable float omt3 = omt*omt*omt;
immutable float omt2 = omt*omt;
immutable float t3 = t*t*t;
immutable float t2 = t*t;
tpoint.ptr[0] =
points[0]*omt3+
points[2]*3.0f*omt2*t+
points[4]*3.0f*omt*t2+
points[6]*t3;
tpoint.ptr[1] =
points[1]*omt3+
points[3]*3.0f*omt2*t+
points[5]*3.0f*omt*t2+
points[7]*t3;
}
// Splits a cubic bezier curve into two parts at point t.
void nvg__splitBezier (const(float)* points, float t, float* pointsA, float* pointsB) {
enum x0 = 0*2+0; enum x1 = 1*2+0; enum x2 = 2*2+0; enum x3 = 3*2+0;
enum y0 = 0*2+1; enum y1 = 1*2+1; enum y2 = 2*2+1; enum y3 = 3*2+1;
float[6] lvl1 = void;
float[4] lvl2 = void;
float[2] lvl3 = void;
nvg__casteljau(points, t, lvl1.ptr, lvl2.ptr, lvl3.ptr);
// First half
pointsA[x0] = points[x0];
pointsA[y0] = points[y0];
pointsA[x1] = lvl1.ptr[x0];
pointsA[y1] = lvl1.ptr[y0];
pointsA[x2] = lvl2.ptr[x0];
pointsA[y2] = lvl2.ptr[y0];
pointsA[x3] = lvl3.ptr[x0];
pointsA[y3] = lvl3.ptr[y0];
// Second half
pointsB[x0] = lvl3.ptr[x0];
pointsB[y0] = lvl3.ptr[y0];
pointsB[x1] = lvl2.ptr[x1];
pointsB[y1] = lvl2.ptr[y1];
pointsB[x2] = lvl1.ptr[x2];
pointsB[y2] = lvl1.ptr[y2];
pointsB[x3] = points[x3];
pointsB[y3] = points[y3];
}
// Calculates the inflection points in coordinate coord (X = 0, Y = 1) of a cubic bezier.
// Appends any found inflection points to the array inflections and increments *ninflections.
// So finds the parameters where dx/dt or dy/dt is 0
void nvg__bezierInflections (const(float)* points, int coord, int* ninflections, float* inflections) {
immutable float v0 = points[0*2+coord], v1 = points[1*2+coord], v2 = points[2*2+coord], v3 = points[3*2+coord];
float[2] t = void;
int nvalid = *ninflections;
immutable float a = 3.0f*( -v0+3.0f*v1-3.0f*v2+v3 );
immutable float b = 6.0f*( v0-2.0f*v1+v2 );
immutable float c = 3.0f*( v1-v0 );
float d = b*b-4.0f*a*c;
if (nvg__absf(d-0.0f) < NVGPickEPS) {
// Zero or one root
t.ptr[0] = -b/2.0f*a;
if (t.ptr[0] > NVGPickEPS && t.ptr[0] < (1.0f-NVGPickEPS)) {
inflections[nvalid] = t.ptr[0];
++nvalid;
}
} else if (d > NVGPickEPS) {
// zero, one or two roots
d = nvg__sqrtf(d);
t.ptr[0] = (-b+d)/(2.0f*a);
t.ptr[1] = (-b-d)/(2.0f*a);
for (int i = 0; i < 2; ++i) {
if (t.ptr[i] > NVGPickEPS && t.ptr[i] < (1.0f-NVGPickEPS)) {
inflections[nvalid] = t.ptr[i];
++nvalid;
}
}
} else {
// zero roots
}
*ninflections = nvalid;
}
// Sort a small number of floats in ascending order (0 < n < 6)
void nvg__smallsort (float* values, int n) {
bool bSwapped = true;
for (int j = 0; j < n-1 && bSwapped; ++j) {
bSwapped = false;
for (int i = 0; i < n-1; ++i) {
if (values[i] > values[i+1]) {
auto tmp = values[i];
values[i] = values[i+1];
values[i+1] = tmp;
}
}
}
}
// Calculates the bounding rect of a given cubic bezier curve.
void nvg__bezierBounds (const(float)* points, ref float[4] bounds) {
float[4] inflections = void;
int ninflections = 0;
float[2] tpoint = void;
nvg__initBounds(bounds);
// Include start and end points in bounds
nvg__expandBounds(bounds, &points[0], 1);
nvg__expandBounds(bounds, &points[6], 1);
// Calculate dx==0 and dy==0 inflection points and add them to the bounds
nvg__bezierInflections(points, 0, &ninflections, inflections.ptr);
nvg__bezierInflections(points, 1, &ninflections, inflections.ptr);
foreach (immutable int i; 0..ninflections) {
nvg__bezierEval(points, inflections[i], tpoint);
nvg__expandBounds(bounds, tpoint.ptr, 1);
}
}
// Checks to see if a line originating from x,y along the +ve x axis
// intersects the given line (points[0],points[1]) -> (points[2], points[3]).
// Returns `true` on intersection.
// Horizontal lines are never hit.
bool nvg__intersectLine (const(float)* points, float x, float y) {
immutable float x1 = points[0];
immutable float y1 = points[1];
immutable float x2 = points[2];
immutable float y2 = points[3];
immutable float d = y2-y1;
if (d > NVGPickEPS || d < -NVGPickEPS) {
immutable float s = (x2-x1)/d;
immutable float lineX = x1+(y-y1)*s;
return (lineX > x);
} else {
return false;
}
}
// Checks to see if a line originating from x,y along the +ve x axis intersects the given bezier.
// It is assumed that the line originates from within the bounding box of
// the bezier and that the curve has no dy=0 inflection points.
// Returns the number of intersections found (which is either 1 or 0).
int nvg__intersectBezier (const(float)* points, float x, float y) {
immutable float x0 = points[0*2+0], x1 = points[1*2+0], x2 = points[2*2+0], x3 = points[3*2+0];
immutable float y0 = points[0*2+1], y1 = points[1*2+1], y2 = points[2*2+1], y3 = points[3*2+1];
if (y0 == y1 && y1 == y2 && y2 == y3) return 0;
// Initial t guess
float t = void;
if (y3 != y0) t = (y-y0)/(y3-y0);
else if (x3 != x0) t = (x-x0)/(x3-x0);
else t = 0.5f;
// A few Newton iterations
for (int iter = 0; iter < 6; ++iter) {
immutable float omt = 1-t;
immutable float omt2 = omt*omt;
immutable float t2 = t*t;
immutable float omt3 = omt2*omt;
immutable float t3 = t2*t;
immutable float ty = y0*omt3 +
y1*3.0f*omt2*t +
y2*3.0f*omt*t2 +
y3*t3;
// Newton iteration
immutable float dty = 3.0f*omt2*(y1-y0) +
6.0f*omt*t*(y2-y1) +
3.0f*t2*(y3-y2);
// dty will never == 0 since:
// Either omt, omt2 are zero OR t2 is zero
// y0 != y1 != y2 != y3 (checked above)
t = t-(ty-y)/dty;
}
{
immutable float omt = 1-t;
immutable float omt2 = omt*omt;
immutable float t2 = t*t;
immutable float omt3 = omt2*omt;
immutable float t3 = t2*t;
immutable float tx =
x0*omt3+
x1*3.0f*omt2*t+
x2*3.0f*omt*t2+
x3*t3;
return (tx > x ? 1 : 0);
}
}
// Finds the closest point on a line to a given point
void nvg__closestLine (const(float)* points, float x, float y, float* closest, float* ot) {
immutable float x1 = points[0];
immutable float y1 = points[1];
immutable float x2 = points[2];
immutable float y2 = points[3];
immutable float pqx = x2-x1;
immutable float pqz = y2-y1;
immutable float dx = x-x1;
immutable float dz = y-y1;
immutable float d = pqx*pqx+pqz*pqz;
float t = pqx*dx+pqz*dz;
if (d > 0) t /= d;
if (t < 0) t = 0; else if (t > 1) t = 1;
closest[0] = x1+t*pqx;
closest[1] = y1+t*pqz;
*ot = t;
}
// Finds the closest point on a curve for a given point (x,y).
// Assumes that the curve has no dx==0 or dy==0 inflection points.
void nvg__closestBezier (const(float)* points, float x, float y, float* closest, float *ot) {
immutable float x0 = points[0*2+0], x1 = points[1*2+0], x2 = points[2*2+0], x3 = points[3*2+0];
immutable float y0 = points[0*2+1], y1 = points[1*2+1], y2 = points[2*2+1], y3 = points[3*2+1];
// This assumes that the curve has no dy=0 inflection points.
// Initial t guess
float t = 0.5f;
// A few Newton iterations
for (int iter = 0; iter < 6; ++iter) {
immutable float omt = 1-t;
immutable float omt2 = omt*omt;
immutable float t2 = t*t;
immutable float omt3 = omt2*omt;
immutable float t3 = t2*t;
immutable float ty =
y0*omt3+
y1*3.0f*omt2*t+
y2*3.0f*omt*t2+
y3*t3;
immutable float tx =
x0*omt3+
x1*3.0f*omt2*t+
x2*3.0f*omt*t2+
x3*t3;
// Newton iteration
immutable float dty =
3.0f*omt2*(y1-y0)+
6.0f*omt*t*(y2-y1)+
3.0f*t2*(y3-y2);
immutable float ddty =
6.0f*omt*(y2-2.0f*y1+y0)+
6.0f*t*(y3-2.0f*y2+y1);
immutable float dtx =
3.0f*omt2*(x1-x0)+
6.0f*omt*t*(x2-x1)+
3.0f*t2*(x3-x2);
immutable float ddtx =
6.0f*omt*(x2-2.0f*x1+x0)+
6.0f*t*(x3-2.0f*x2+x1);
immutable float errorx = tx-x;
immutable float errory = ty-y;
immutable float n = errorx*dtx+errory*dty;
if (n == 0) break;
immutable float d = dtx*dtx+dty*dty+errorx*ddtx+errory*ddty;
if (d != 0) t = t-n/d; else break;
}
t = nvg__max(0, nvg__min(1.0, t));
*ot = t;
{
immutable float omt = 1-t;
immutable float omt2 = omt*omt;
immutable float t2 = t*t;
immutable float omt3 = omt2*omt;
immutable float t3 = t2*t;
immutable float ty =
y0*omt3+
y1*3.0f*omt2*t+
y2*3.0f*omt*t2+
y3*t3;
immutable float tx =
x0*omt3+
x1*3.0f*omt2*t+
x2*3.0f*omt*t2+
x3*t3;
closest[0] = tx;
closest[1] = ty;
}
}
// Returns:
// 1 If (x,y) is contained by the stroke of the path
// 0 If (x,y) is not contained by the path.
int nvg__pickSubPathStroke (const NVGpickScene* ps, const NVGpickSubPath* psp, float x, float y, float strokeWidth, int lineCap, int lineJoin) {
if (!nvg__pointInBounds(x, y, psp.bounds)) return 0;
if (psp.firstSegment == -1) return 0;
float[2] closest = void;
float[2] d = void;
float t = void;
// trace a line from x,y out along the positive x axis and count the number of intersections
int nsegments = psp.nsegments;
const(NVGsegment)* seg = ps.segments+psp.firstSegment;
const(NVGsegment)* prevseg = (psp.closed ? &ps.segments[psp.firstSegment+nsegments-1] : null);
immutable float strokeWidthSqd = strokeWidth*strokeWidth;
for (int s = 0; s < nsegments; ++s, prevseg = seg, ++seg) {
if (nvg__pointInBounds(x, y, seg.bounds)) {
// Line potentially hits stroke.
switch (seg.type) {
case Command.LineTo:
nvg__closestLine(&ps.points[seg.firstPoint*2], x, y, closest.ptr, &t);
break;
case Command.BezierTo:
nvg__closestBezier(&ps.points[seg.firstPoint*2], x, y, closest.ptr, &t);
break;
default:
continue;
}
d.ptr[0] = x-closest.ptr[0];
d.ptr[1] = y-closest.ptr[1];
if ((t >= NVGPickEPS && t <= 1.0f-NVGPickEPS) ||
(seg.flags&(NVGSegmentFlags.Corner|NVGSegmentFlags.Cap|NVGSegmentFlags.Endcap)) == 0 ||
(lineJoin == NVGLineCap.Round))
{
// Closest point is in the middle of the line/curve, at a rounded join/cap
// or at a smooth join
immutable float distSqd = d.ptr[0]*d.ptr[0]+d.ptr[1]*d.ptr[1];
if (distSqd < strokeWidthSqd) return 1;
} else if ((t > 1.0f-NVGPickEPS && (seg.flags&NVGSegmentFlags.Endcap)) ||
(t < NVGPickEPS && (seg.flags&NVGSegmentFlags.Cap))) {
switch (lineCap) {
case NVGLineCap.Butt:
immutable float distSqd = d.ptr[0]*d.ptr[0]+d.ptr[1]*d.ptr[1];
immutable float dirD = (t < NVGPickEPS ?
-(d.ptr[0]*seg.startDir.ptr[0]+d.ptr[1]*seg.startDir.ptr[1]) :
d.ptr[0]*seg.endDir.ptr[0]+d.ptr[1]*seg.endDir.ptr[1]);
if (dirD < -NVGPickEPS && distSqd < strokeWidthSqd) return 1;
break;
case NVGLineCap.Square:
if (nvg__absf(d.ptr[0]) < strokeWidth && nvg__absf(d.ptr[1]) < strokeWidth) return 1;
break;
case NVGLineCap.Round:
immutable float distSqd = d.ptr[0]*d.ptr[0]+d.ptr[1]*d.ptr[1];
if (distSqd < strokeWidthSqd) return 1;
break;
default:
break;
}
} else if (seg.flags&NVGSegmentFlags.Corner) {
// Closest point is at a corner
const(NVGsegment)* seg0, seg1;
if (t < NVGPickEPS) {
seg0 = prevseg;
seg1 = seg;
} else {
seg0 = seg;
seg1 = (s == nsegments-1 ? &ps.segments[psp.firstSegment] : seg+1);
}
if (!(seg1.flags&NVGSegmentFlags.Bevel)) {
immutable float prevNDist = -seg0.endDir.ptr[1]*d.ptr[0]+seg0.endDir.ptr[0]*d.ptr[1];
immutable float curNDist = seg1.startDir.ptr[1]*d.ptr[0]-seg1.startDir.ptr[0]*d.ptr[1];
if (nvg__absf(prevNDist) < strokeWidth && nvg__absf(curNDist) < strokeWidth) return 1;
} else {
d.ptr[0] -= -seg1.startDir.ptr[1]*strokeWidth;
d.ptr[1] -= +seg1.startDir.ptr[0]*strokeWidth;
if (seg1.miterDir.ptr[0]*d.ptr[0]+seg1.miterDir.ptr[1]*d.ptr[1] < 0) return 1;
}
}
}
}
return 0;
}
// Returns:
// 1 If (x,y) is contained by the path and the path is solid.
// -1 If (x,y) is contained by the path and the path is a hole.
// 0 If (x,y) is not contained by the path.
int nvg__pickSubPath (const NVGpickScene* ps, const NVGpickSubPath* psp, float x, float y, bool evenOddMode) {
if (!nvg__pointInBounds(x, y, psp.bounds)) return 0;
if (psp.firstSegment == -1) return 0;
const(NVGsegment)* seg = &ps.segments[psp.firstSegment];
int nsegments = psp.nsegments;
int nintersections = 0;
// trace a line from x,y out along the positive x axis and count the number of intersections
for (int s = 0; s < nsegments; ++s, ++seg) {
if ((seg.bounds.ptr[1]-NVGPickEPS) < y &&
(seg.bounds.ptr[3]-NVGPickEPS) > y &&
seg.bounds.ptr[2] > x)
{
// Line hits the box.
switch (seg.type) {
case Command.LineTo:
if (seg.bounds.ptr[0] > x) {
// line originates outside the box
++nintersections;
} else {
// line originates inside the box
nintersections += nvg__intersectLine(&ps.points[seg.firstPoint*2], x, y);
}
break;
case Command.BezierTo:
if (seg.bounds.ptr[0] > x) {
// line originates outside the box
++nintersections;
} else {
// line originates inside the box
nintersections += nvg__intersectBezier(&ps.points[seg.firstPoint*2], x, y);
}
break;
default:
break;
}
}
}
if (evenOddMode) {
return nintersections;
} else {
return (nintersections&1 ? (psp.winding == NVGSolidity.Solid ? 1 : -1) : 0);
}
}
bool nvg__pickPath (const(NVGpickScene)* ps, const(NVGpickPath)* pp, float x, float y) {
int pickCount = 0;
const(NVGpickSubPath)* psp = pp.subPaths;
while (psp !is null) {
pickCount += nvg__pickSubPath(ps, psp, x, y, pp.evenOddMode);
psp = psp.next;
}
return ((pp.evenOddMode ? pickCount&1 : pickCount) != 0);
}
bool nvg__pickPathStroke (const(NVGpickScene)* ps, const(NVGpickPath)* pp, float x, float y) {
const(NVGpickSubPath)* psp = pp.subPaths;
while (psp !is null) {
if (nvg__pickSubPathStroke(ps, psp, x, y, pp.strokeWidth, pp.lineCap, pp.lineJoin)) return true;
psp = psp.next;
}
return false;
}
bool nvg__pickPathTestBounds (NVGContext ctx, const NVGpickScene* ps, const NVGpickPath* pp, float x, float y) {
if (nvg__pointInBounds(x, y, pp.bounds)) {
//{ import core.stdc.stdio; printf(" (0): in bounds!\n"); }
if (pp.flags&NVGPathFlags.Scissor) {
const(float)* scissor = &ps.points[pp.scissor*2];
// untransform scissor translation
float stx = void, sty = void;
ctx.gpuUntransformPoint(&stx, &sty, scissor[4], scissor[5]);
immutable float rx = x-stx;
immutable float ry = y-sty;
//{ import core.stdc.stdio; printf(" (1): rxy=(%g,%g); scissor=[%g,%g,%g,%g,%g] [%g,%g]!\n", rx, ry, scissor[0], scissor[1], scissor[2], scissor[3], scissor[4], scissor[5], scissor[6], scissor[7]); }
if (nvg__absf((scissor[0]*rx)+(scissor[1]*ry)) > scissor[6] ||
nvg__absf((scissor[2]*rx)+(scissor[3]*ry)) > scissor[7])
{
//{ import core.stdc.stdio; printf(" (1): scissor reject!\n"); }
return false;
}
}
return true;
}
return false;
}
int nvg__countBitsUsed (uint v) pure {
pragma(inline, true);
import core.bitop : bsr;
return (v != 0 ? bsr(v)+1 : 0);
}
void nvg__pickSceneInsert (NVGpickScene* ps, NVGpickPath* pp) {
if (ps is null || pp is null) return;
int[4] cellbounds;
int base = ps.nlevels-1;
int level;
int levelwidth;
int levelshift;
int levelx;
int levely;
NVGpickPath** cell = null;
// Bit tricks for inserting into an implicit quadtree.
// Calc bounds of path in cells at the lowest level
cellbounds.ptr[0] = cast(int)(pp.bounds.ptr[0]/ps.xdim);
cellbounds.ptr[1] = cast(int)(pp.bounds.ptr[1]/ps.ydim);
cellbounds.ptr[2] = cast(int)(pp.bounds.ptr[2]/ps.xdim);
cellbounds.ptr[3] = cast(int)(pp.bounds.ptr[3]/ps.ydim);
// Find which bits differ between the min/max x/y coords
cellbounds.ptr[0] ^= cellbounds.ptr[2];
cellbounds.ptr[1] ^= cellbounds.ptr[3];
// Use the number of bits used (countBitsUsed(x) == sizeof(int) * 8 - clz(x);
// to calculate the level to insert at (the level at which the bounds fit in a single cell)
level = nvg__min(base-nvg__countBitsUsed(cellbounds.ptr[0]), base-nvg__countBitsUsed(cellbounds.ptr[1]));
if (level < 0) level = 0;
//{ import core.stdc.stdio; printf("LEVEL: %d; bounds=(%g,%g)-(%g,%g)\n", level, pp.bounds[0], pp.bounds[1], pp.bounds[2], pp.bounds[3]); }
//level = 0;
// Find the correct cell in the chosen level, clamping to the edges.
levelwidth = 1<<level;
levelshift = (ps.nlevels-level)-1;
levelx = nvg__clamp(cellbounds.ptr[2]>>levelshift, 0, levelwidth-1);
levely = nvg__clamp(cellbounds.ptr[3]>>levelshift, 0, levelwidth-1);
// Insert the path into the linked list at that cell.
cell = &ps.levels[level][levely*levelwidth+levelx];
pp.cellnext = *cell;
*cell = pp;
if (ps.paths is null) ps.lastPath = pp;
pp.next = ps.paths;
ps.paths = pp;
// Store the order (depth) of the path for picking ops.
pp.order = cast(short)ps.npaths;
++ps.npaths;
}
void nvg__pickBeginFrame (NVGContext ctx, int width, int height) {
NVGpickScene* ps = nvg__pickSceneGet(ctx);
//NVG_PICK_DEBUG_NEWFRAME();
// Return all paths & sub paths from last frame to the free list
while (ps.paths !is null) {
NVGpickPath* pp = ps.paths.next;
nvg__freePickPath(ps, ps.paths);
ps.paths = pp;
}
ps.paths = null;
ps.npaths = 0;
// Store the screen metrics for the quadtree
ps.width = width;
ps.height = height;
immutable float lowestSubDiv = cast(float)(1<<(ps.nlevels-1));
ps.xdim = cast(float)width/lowestSubDiv;
ps.ydim = cast(float)height/lowestSubDiv;
// Allocate the quadtree if required.
if (ps.levels is null) {
int ncells = 1;
ps.levels = cast(NVGpickPath***)malloc((NVGpickPath**).sizeof*ps.nlevels);
for (int l = 0; l < ps.nlevels; ++l) {
int leveldim = 1<<l;
ncells += leveldim*leveldim;
}
ps.levels[0] = cast(NVGpickPath**)malloc((NVGpickPath*).sizeof*ncells);
int cell = 1;
for (int l = 1; l < ps.nlevels; ++l) {
ps.levels[l] = &ps.levels[0][cell];
int leveldim = 1<<l;
cell += leveldim*leveldim;
}
ps.ncells = ncells;
}
memset(ps.levels[0], 0, ps.ncells*(NVGpickPath*).sizeof);
// Allocate temporary storage for nvgHitTestAll results if required.
if (ps.picked is null) {
ps.cpicked = 16;
ps.picked = cast(NVGpickPath**)malloc((NVGpickPath*).sizeof*ps.cpicked);
}
ps.npoints = 0;
ps.nsegments = 0;
}
} // nothrow @trusted @nogc
/// Return outline of the current path. Returned outline is not flattened.
/// Group: paths
public NVGPathOutline getCurrPathOutline (NVGContext ctx) nothrow @trusted @nogc {
if (ctx is null || !ctx.contextAlive || ctx.ncommands == 0) return NVGPathOutline.init;
auto res = NVGPathOutline.createNew();
const(float)[] acommands = ctx.commands[0..ctx.ncommands];
int ncommands = cast(int)acommands.length;
const(float)* commands = acommands.ptr;
float cx = 0, cy = 0;
float[2] start = void;
float[4] totalBounds = [float.max, float.max, -float.max, -float.max];
float[8] bcp = void; // bezier curve points; used to calculate bounds
void addToBounds (in float x, in float y) nothrow @trusted @nogc {
totalBounds.ptr[0] = nvg__min(totalBounds.ptr[0], x);
totalBounds.ptr[1] = nvg__min(totalBounds.ptr[1], y);
totalBounds.ptr[2] = nvg__max(totalBounds.ptr[2], x);
totalBounds.ptr[3] = nvg__max(totalBounds.ptr[3], y);
}
bool hasPoints = false;
void closeIt () nothrow @trusted @nogc {
if (!hasPoints) return;
if (cx != start.ptr[0] || cy != start.ptr[1]) {
res.ds.putCommand(NVGPathOutline.Command.Kind.LineTo);
res.ds.putArgs(start[]);
cx = start.ptr[0];
cy = start.ptr[1];
addToBounds(cx, cy);
}
}
int i = 0;
while (i < ncommands) {
int cmd = cast(int)commands[i++];
switch (cmd) {
case Command.MoveTo: // one coordinate pair
const(float)* tfxy = commands+i;
i += 2;
// add command
res.ds.putCommand(NVGPathOutline.Command.Kind.MoveTo);
res.ds.putArgs(tfxy[0..2]);
// new starting point
start.ptr[0..2] = tfxy[0..2];
cx = tfxy[0];
cy = tfxy[0];
addToBounds(cx, cy);
hasPoints = true;
break;
case Command.LineTo: // one coordinate pair
const(float)* tfxy = commands+i;
i += 2;
// add command
res.ds.putCommand(NVGPathOutline.Command.Kind.LineTo);
res.ds.putArgs(tfxy[0..2]);
cx = tfxy[0];
cy = tfxy[0];
addToBounds(cx, cy);
hasPoints = true;
break;
case Command.BezierTo: // three coordinate pairs
const(float)* tfxy = commands+i;
i += 3*2;
// add command
res.ds.putCommand(NVGPathOutline.Command.Kind.BezierTo);
res.ds.putArgs(tfxy[0..6]);
// bounds
bcp.ptr[0] = cx;
bcp.ptr[1] = cy;
bcp.ptr[2..8] = tfxy[0..6];
nvg__bezierBounds(bcp.ptr, totalBounds);
cx = tfxy[4];
cy = tfxy[5];
hasPoints = true;
break;
case Command.Close:
closeIt();
hasPoints = false;
break;
case Command.Winding:
//psp.winding = cast(short)cast(int)commands[i];
i += 1;
break;
default:
break;
}
}
res.ds.bounds[] = totalBounds[];
return res;
}
// ////////////////////////////////////////////////////////////////////////// //
// Text
/** Creates font by loading it from the disk from specified file name.
* Returns handle to the font or FONS_INVALID (aka -1) on error.
* Use "fontname:noaa" as [name] to turn off antialiasing (if font driver supports that).
*
* On POSIX systems it is possible to use fontconfig font names too.
* `:noaa` in font path is still allowed, but it must be the last option.
*
* Group: text_api
*/
public int createFont (NVGContext ctx, const(char)[] name, const(char)[] path) nothrow @trusted {
return ctx.fs.addFont(name, path, ctx.params.fontAA);
}
/** Creates font by loading it from the specified memory chunk.
* Returns handle to the font or FONS_INVALID (aka -1) on error.
* Won't free data on error.
*
* Group: text_api
*/
public int createFontMem (NVGContext ctx, const(char)[] name, ubyte* data, int ndata, bool freeData) nothrow @trusted @nogc {
return ctx.fs.addFontMem(name, data, ndata, freeData, ctx.params.fontAA);
}
/// Add fonts from another context.
/// This is more effective than reloading fonts, 'cause font data will be shared.
/// Group: text_api
public void addFontsFrom (NVGContext ctx, NVGContext source) nothrow @trusted @nogc {
if (ctx is null || source is null) return;
ctx.fs.addFontsFrom(source.fs);
}
/// Finds a loaded font of specified name, and returns handle to it, or FONS_INVALID (aka -1) if the font is not found.
/// Group: text_api
public int findFont (NVGContext ctx, const(char)[] name) nothrow @trusted @nogc {
pragma(inline, true);
return (name.length == 0 ? FONS_INVALID : ctx.fs.getFontByName(name));
}
/// Sets the font size of current text style.
/// Group: text_api
public void fontSize (NVGContext ctx, float size) nothrow @trusted @nogc {
pragma(inline, true);
nvg__getState(ctx).fontSize = size;
}
/// Gets the font size of current text style.
/// Group: text_api
public float fontSize (NVGContext ctx) nothrow @trusted @nogc {
pragma(inline, true);
return nvg__getState(ctx).fontSize;
}
/// Sets the blur of current text style.
/// Group: text_api
public void fontBlur (NVGContext ctx, float blur) nothrow @trusted @nogc {
pragma(inline, true);
nvg__getState(ctx).fontBlur = blur;
}
/// Gets the blur of current text style.
/// Group: text_api
public float fontBlur (NVGContext ctx) nothrow @trusted @nogc {
pragma(inline, true);
return nvg__getState(ctx).fontBlur;
}
/// Sets the letter spacing of current text style.
/// Group: text_api
public void textLetterSpacing (NVGContext ctx, float spacing) nothrow @trusted @nogc {
pragma(inline, true);
nvg__getState(ctx).letterSpacing = spacing;
}
/// Gets the letter spacing of current text style.
/// Group: text_api
public float textLetterSpacing (NVGContext ctx) nothrow @trusted @nogc {
pragma(inline, true);
return nvg__getState(ctx).letterSpacing;
}
/// Sets the proportional line height of current text style. The line height is specified as multiple of font size.
/// Group: text_api
public void textLineHeight (NVGContext ctx, float lineHeight) nothrow @trusted @nogc {
pragma(inline, true);
nvg__getState(ctx).lineHeight = lineHeight;
}
/// Gets the proportional line height of current text style. The line height is specified as multiple of font size.
/// Group: text_api
public float textLineHeight (NVGContext ctx) nothrow @trusted @nogc {
pragma(inline, true);
return nvg__getState(ctx).lineHeight;
}
/// Sets the text align of current text style, see [NVGTextAlign] for options.
/// Group: text_api
public void textAlign (NVGContext ctx, NVGTextAlign talign) nothrow @trusted @nogc {
pragma(inline, true);
nvg__getState(ctx).textAlign = talign;
}
/// Ditto.
public void textAlign (NVGContext ctx, NVGTextAlign.H h) nothrow @trusted @nogc {
pragma(inline, true);
nvg__getState(ctx).textAlign.horizontal = h;
}
/// Ditto.
public void textAlign (NVGContext ctx, NVGTextAlign.V v) nothrow @trusted @nogc {
pragma(inline, true);
nvg__getState(ctx).textAlign.vertical = v;
}
/// Ditto.
public void textAlign (NVGContext ctx, NVGTextAlign.H h, NVGTextAlign.V v) nothrow @trusted @nogc {
pragma(inline, true);
nvg__getState(ctx).textAlign.reset(h, v);
}
/// Ditto.
public void textAlign (NVGContext ctx, NVGTextAlign.V v, NVGTextAlign.H h) nothrow @trusted @nogc {
pragma(inline, true);
nvg__getState(ctx).textAlign.reset(h, v);
}
/// Gets the text align of current text style, see [NVGTextAlign] for options.
/// Group: text_api
public NVGTextAlign textAlign (NVGContext ctx) nothrow @trusted @nogc {
pragma(inline, true);
return nvg__getState(ctx).textAlign;
}
/// Sets the font face based on specified id of current text style.
/// Group: text_api
public void fontFaceId (NVGContext ctx, int font) nothrow @trusted @nogc {
pragma(inline, true);
nvg__getState(ctx).fontId = font;
}
/// Gets the font face based on specified id of current text style.
/// Group: text_api
public int fontFaceId (NVGContext ctx) nothrow @trusted @nogc {
pragma(inline, true);
return nvg__getState(ctx).fontId;
}
/** Sets the font face based on specified name of current text style.
*
* The underlying implementation is using O(1) data structure to lookup
* font names, so you probably should use this function instead of [fontFaceId]
* to make your code more robust and less error-prone.
*
* Group: text_api
*/
public void fontFace (NVGContext ctx, const(char)[] font) nothrow @trusted @nogc {
pragma(inline, true);
nvg__getState(ctx).fontId = ctx.fs.getFontByName(font);
}
static if (is(typeof(&fons__nvg__toPath))) {
public enum NanoVegaHasCharToPath = true; ///
} else {
public enum NanoVegaHasCharToPath = false; ///
}
/// Adds glyph outlines to the current path. Vertical 0 is baseline.
/// The glyph is not scaled in any way, so you have to use NanoVega transformations instead.
/// Returns `false` if there is no such glyph, or current font is not scalable.
/// Group: text_api
public bool charToPath (NVGContext ctx, dchar dch, float[] bounds=null) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
ctx.fs.fontId = state.fontId;
return ctx.fs.toPath(ctx, dch, bounds);
}
static if (is(typeof(&fons__nvg__bounds))) {
public enum NanoVegaHasCharPathBounds = true; ///
} else {
public enum NanoVegaHasCharPathBounds = false; ///
}
/// Returns bounds of the glyph outlines. Vertical 0 is baseline.
/// The glyph is not scaled in any way.
/// Returns `false` if there is no such glyph, or current font is not scalable.
/// Group: text_api
public bool charPathBounds (NVGContext ctx, dchar dch, float[] bounds) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
ctx.fs.fontId = state.fontId;
return ctx.fs.getPathBounds(dch, bounds);
}
/** [charOutline] will return [NVGPathOutline].
some usage samples:
---
float[4] bounds = void;
nvg.scale(0.5, 0.5);
nvg.translate(500, 800);
nvg.evenOddFill;
nvg.newPath();
nvg.charToPath('&', bounds[]);
conwriteln(bounds[]);
nvg.fillPaint(nvg.linearGradient(0, 0, 600, 600, NVGColor("#f70"), NVGColor("#ff0")));
nvg.strokeColor(NVGColor("#0f0"));
nvg.strokeWidth = 3;
nvg.fill();
nvg.stroke();
// glyph bounds
nvg.newPath();
nvg.rect(bounds[0], bounds[1], bounds[2]-bounds[0], bounds[3]-bounds[1]);
nvg.strokeColor(NVGColor("#00f"));
nvg.stroke();
nvg.newPath();
nvg.charToPath('g', bounds[]);
conwriteln(bounds[]);
nvg.fill();
nvg.strokeColor(NVGColor("#0f0"));
nvg.stroke();
// glyph bounds
nvg.newPath();
nvg.rect(bounds[0], bounds[1], bounds[2]-bounds[0], bounds[3]-bounds[1]);
nvg.strokeColor(NVGColor("#00f"));
nvg.stroke();
nvg.newPath();
nvg.moveTo(0, 0);
nvg.lineTo(600, 0);
nvg.strokeColor(NVGColor("#0ff"));
nvg.stroke();
if (auto ol = nvg.charOutline('Q')) {
scope(exit) ol.kill();
nvg.newPath();
conwriteln("==== length: ", ol.length, " ====");
foreach (const ref cmd; ol.commands) {
//conwriteln(" ", cmd.code, ": ", cmd.args[]);
assert(cmd.valid);
final switch (cmd.code) {
case cmd.Kind.MoveTo: nvg.moveTo(cmd.args[0], cmd.args[1]); break;
case cmd.Kind.LineTo: nvg.lineTo(cmd.args[0], cmd.args[1]); break;
case cmd.Kind.QuadTo: nvg.quadTo(cmd.args[0], cmd.args[1], cmd.args[2], cmd.args[3]); break;
case cmd.Kind.BezierTo: nvg.bezierTo(cmd.args[0], cmd.args[1], cmd.args[2], cmd.args[3], cmd.args[4], cmd.args[5]); break;
}
}
nvg.strokeColor(NVGColor("#f00"));
nvg.stroke();
}
---
Group: text_api
*/
public struct NVGPathOutline {
private nothrow @trusted @nogc:
struct DataStore {
uint rc; // refcount
ubyte* data;
uint used;
uint size;
uint ccount; // number of commands
float[4] bounds = 0; /// outline bounds
nothrow @trusted @nogc:
void putBytes (const(void)[] b) {
if (b.length == 0) return;
if (b.length >= int.max/8) assert(0, "NanoVega: out of memory");
if (int.max/8-used < b.length) assert(0, "NanoVega: out of memory");
if (used+cast(uint)b.length > size) {
import core.stdc.stdlib : realloc;
uint newsz = size;
while (newsz < used+cast(uint)b.length) newsz = (newsz == 0 ? 1024 : newsz < 32768 ? newsz*2 : newsz+8192);
assert(used+cast(uint)b.length <= newsz);
data = cast(ubyte*)realloc(data, newsz);
if (data is null) assert(0, "NanoVega: out of memory");
size = newsz;
}
import core.stdc.string : memcpy;
memcpy(data+used, b.ptr, b.length);
used += cast(uint)b.length;
}
void putCommand (ubyte cmd) { pragma(inline, true); ++ccount; putBytes((&cmd)[0..1]); }
void putArgs (const(float)[] f...) { pragma(inline, true); putBytes(f[]); }
}
static void incRef (DataStore* ds) {
pragma(inline, true);
if (ds !is null) {
++ds.rc;
//{ import core.stdc.stdio; printf("ods(%p): incref: newrc=%u\n", ds, ds.rc); }
}
}
static void decRef (DataStore* ds) {
version(aliced) pragma(inline, true);
if (ds !is null) {
//{ import core.stdc.stdio; printf("ods(%p): decref: newrc=%u\n", ds, ds.rc-1); }
if (--ds.rc == 0) {
import core.stdc.stdlib : free;
import core.stdc.string : memset;
if (ds.data !is null) free(ds.data);
memset(ds, 0, DataStore.sizeof); // just in case
free(ds);
//{ import core.stdc.stdio; printf(" ods(%p): killed.\n"); }
}
}
}
private:
static NVGPathOutline createNew () {
import core.stdc.stdlib : malloc;
import core.stdc.string : memset;
auto ds = cast(DataStore*)malloc(DataStore.sizeof);
if (ds is null) assert(0, "NanoVega: out of memory");
memset(ds, 0, DataStore.sizeof);
ds.rc = 1;
NVGPathOutline res;
res.dsaddr = cast(usize)ds;
return res;
}
private:
usize dsaddr; // fool GC
@property inout(DataStore)* ds () inout pure { pragma(inline, true); return cast(DataStore*)dsaddr; }
public:
/// commands
static struct Command {
///
enum Kind : ubyte {
MoveTo, ///
LineTo, ///
QuadTo, ///
BezierTo, ///
End, /// no more commands (this command is not `valid`!)
}
Kind code; ///
const(float)[] args; ///
@property bool valid () const pure nothrow @safe @nogc { pragma(inline, true); return (code >= Kind.min && code < Kind.End && args.length >= 2); } ///
static uint arglen (Kind code) pure nothrow @safe @nogc {
pragma(inline, true);
return
code == Kind.MoveTo || code == Kind.LineTo ? 2 :
code == Kind.QuadTo ? 4 :
code == Kind.BezierTo ? 6 :
0;
}
/// perform NanoVega command with stored data.
void perform (NVGContext ctx) const nothrow @trusted @nogc {
if (ctx is null) return;
final switch (code) {
case Kind.MoveTo: if (args.length > 1) ctx.moveTo(args.ptr[0..2]); break;
case Kind.LineTo: if (args.length > 1) ctx.lineTo(args.ptr[0..2]); break;
case Kind.QuadTo: if (args.length > 3) ctx.quadTo(args.ptr[0..4]); break;
case Kind.BezierTo: if (args.length > 5) ctx.bezierTo(args.ptr[0..6]); break;
case Kind.End: break;
}
}
/// perform NanoVega command with stored data, transforming points with [xform] transformation matrix.
void perform() (NVGContext ctx, in auto ref NVGMatrix xform) const nothrow @trusted @nogc {
if (ctx is null || !valid) return;
float[6] pts = void;
pts[0..args.length] = args[];
foreach (immutable pidx; 0..args.length/2) xform.point(pts.ptr[pidx*2+0], pts.ptr[pidx*2+1]);
final switch (code) {
case Kind.MoveTo: if (args.length > 1) ctx.moveTo(pts.ptr[0..2]); break;
case Kind.LineTo: if (args.length > 1) ctx.lineTo(pts.ptr[0..2]); break;
case Kind.QuadTo: if (args.length > 3) ctx.quadTo(pts.ptr[0..4]); break;
case Kind.BezierTo: if (args.length > 5) ctx.bezierTo(pts.ptr[0..6]); break;
case Kind.End: break;
}
}
}
public:
/// Create new path with quadratic bezier (first command is MoveTo, second command is QuadTo).
static NVGPathOutline createNewQuad (in float x0, in float y0, in float cx, in float cy, in float x, in float y) {
auto res = createNew();
res.ds.putCommand(Command.Kind.MoveTo);
res.ds.putArgs(x0, y0);
res.ds.putCommand(Command.Kind.QuadTo);
res.ds.putArgs(cx, cy, x, y);
return res;
}
/// Create new path with cubic bezier (first command is MoveTo, second command is BezierTo).
static NVGPathOutline createNewBezier (in float x1, in float y1, in float x2, in float y2, in float x3, in float y3, in float x4, in float y4) {
auto res = createNew();
res.ds.putCommand(Command.Kind.MoveTo);
res.ds.putArgs(x1, y1);
res.ds.putCommand(Command.Kind.BezierTo);
res.ds.putArgs(x2, y2, x3, y3, x4, y4);
return res;
}
public:
this (this) { pragma(inline, true); incRef(cast(DataStore*)dsaddr); }
~this () { pragma(inline, true); decRef(cast(DataStore*)dsaddr); }
void opAssign() (in auto ref NVGPathOutline a) {
incRef(cast(DataStore*)a.dsaddr);
decRef(cast(DataStore*)dsaddr);
dsaddr = a.dsaddr;
}
/// Clear storage.
void clear () {
pragma(inline, true);
decRef(ds);
dsaddr = 0;
}
/// Is this outline empty?
@property empty () const pure { pragma(inline, true); return (dsaddr == 0 || ds.ccount == 0); }
/// Returns number of commands in outline.
@property int length () const pure { pragma(inline, true); return (dsaddr ? ds.ccount : 0); }
/// Returns "flattened" path. Flattened path consists of only two commands kinds: MoveTo and LineTo.
NVGPathOutline flatten () const { pragma(inline, true); return flattenInternal(null); }
/// Returns "flattened" path, transformed by the given matrix. Flattened path consists of only two commands kinds: MoveTo and LineTo.
NVGPathOutline flatten() (in auto ref NVGMatrix mt) const { pragma(inline, true); return flattenInternal(&mt); }
// Returns "flattened" path, transformed by the given matrix. Flattened path consists of only two commands kinds: MoveTo and LineTo.
private NVGPathOutline flattenInternal (scope NVGMatrix* tfm) const {
import core.stdc.string : memset;
NVGPathOutline res;
if (dsaddr == 0 || ds.ccount == 0) { res = this; return res; } // nothing to do
// check if we need to flatten the path
if (tfm is null) {
bool dowork = false;
foreach (const ref cs; commands) {
if (cs.code != Command.Kind.MoveTo && cs.code != Command.Kind.LineTo) {
dowork = true;
break;
}
}
if (!dowork) { res = this; return res; } // nothing to do
}
NVGcontextinternal ctx;
memset(&ctx, 0, ctx.sizeof);
ctx.cache = nvg__allocPathCache();
scope(exit) {
import core.stdc.stdlib : free;
nvg__deletePathCache(ctx.cache);
}
ctx.tessTol = 0.25f;
ctx.angleTol = 0; // 0 -- angle tolerance for McSeem Bezier rasterizer
ctx.cuspLimit = 0; // 0 -- cusp limit for McSeem Bezier rasterizer (0: real cusps)
ctx.distTol = 0.01f;
ctx.tesselatortype = NVGTesselation.DeCasteljau;
nvg__addPath(&ctx); // we need this for `nvg__addPoint()`
// has some curves or transformations, convert path
res = createNew();
float[8] args = void;
res.ds.bounds = [float.max, float.max, -float.max, -float.max];
float lastX = float.max, lastY = float.max;
bool lastWasMove = false;
void addPoint (float x, float y, Command.Kind cmd=Command.Kind.LineTo) nothrow @trusted @nogc {
if (tfm !is null) tfm.point(x, y);
bool isMove = (cmd == Command.Kind.MoveTo);
if (isMove) {
// moveto
if (lastWasMove && nvg__ptEquals(lastX, lastY, x, y, ctx.distTol)) return;
} else {
// lineto
if (nvg__ptEquals(lastX, lastY, x, y, ctx.distTol)) return;
}
lastWasMove = isMove;
lastX = x;
lastY = y;
res.ds.putCommand(cmd);
res.ds.putArgs(x, y);
res.ds.bounds.ptr[0] = nvg__min(res.ds.bounds.ptr[0], x);
res.ds.bounds.ptr[1] = nvg__min(res.ds.bounds.ptr[1], y);
res.ds.bounds.ptr[2] = nvg__max(res.ds.bounds.ptr[2], x);
res.ds.bounds.ptr[3] = nvg__max(res.ds.bounds.ptr[3], y);
}
// sorry for this pasta
void flattenBezier (in float x1, in float y1, in float x2, in float y2, in float x3, in float y3, in float x4, in float y4, in int level) nothrow @trusted @nogc {
ctx.cache.npoints = 0;
if (ctx.tesselatortype == NVGTesselation.DeCasteljau) {
nvg__tesselateBezier(&ctx, x1, y1, x2, y2, x3, y3, x4, y4, 0, PointFlag.Corner);
} else if (ctx.tesselatortype == NVGTesselation.DeCasteljauMcSeem) {
nvg__tesselateBezierMcSeem(&ctx, x1, y1, x2, y2, x3, y3, x4, y4, 0, PointFlag.Corner);
} else {
nvg__tesselateBezierAFD(&ctx, x1, y1, x2, y2, x3, y3, x4, y4, PointFlag.Corner);
}
// add generated points
foreach (const ref pt; ctx.cache.points[0..ctx.cache.npoints]) addPoint(pt.x, pt.y);
}
void flattenQuad (in float x0, in float y0, in float cx, in float cy, in float x, in float y) {
flattenBezier(
x0, y0,
x0+2.0f/3.0f*(cx-x0), y0+2.0f/3.0f*(cy-y0),
x+2.0f/3.0f*(cx-x), y+2.0f/3.0f*(cy-y),
x, y,
0,
);
}
float cx = 0, cy = 0;
foreach (const ref cs; commands) {
switch (cs.code) {
case Command.Kind.LineTo:
case Command.Kind.MoveTo:
addPoint(cs.args[0], cs.args[1], cs.code);
cx = cs.args[0];
cy = cs.args[1];
break;
case Command.Kind.QuadTo:
flattenQuad(cx, cy, cs.args[0], cs.args[1], cs.args[2], cs.args[3]);
cx = cs.args[2];
cy = cs.args[3];
break;
case Command.Kind.BezierTo:
flattenBezier(cx, cy, cs.args[0], cs.args[1], cs.args[2], cs.args[3], cs.args[4], cs.args[5], 0);
cx = cs.args[4];
cy = cs.args[5];
break;
default:
break;
}
}
return res;
}
/// Returns forward range with all glyph commands.
auto commands () const nothrow @trusted @nogc {
static struct Range {
private nothrow @trusted @nogc:
usize dsaddr;
uint cpos; // current position in data
uint cleft; // number of commands left
@property const(ubyte)* data () inout pure { pragma(inline, true); return (dsaddr ? (cast(DataStore*)dsaddr).data : null); }
public:
this (this) { pragma(inline, true); incRef(cast(DataStore*)dsaddr); }
~this () { pragma(inline, true); decRef(cast(DataStore*)dsaddr); }
void opAssign() (in auto ref Range a) {
incRef(cast(DataStore*)a.dsaddr);
decRef(cast(DataStore*)dsaddr);
dsaddr = a.dsaddr;
cpos = a.cpos;
cleft = a.cleft;
}
float[4] bounds () const pure { float[4] res = 0; pragma(inline, true); if (dsaddr) res[] = (cast(DataStore*)dsaddr).bounds[]; return res; } /// outline bounds
@property bool empty () const pure { pragma(inline, true); return (cleft == 0); }
@property int length () const pure { pragma(inline, true); return cleft; }
@property Range save () const { pragma(inline, true); Range res = this; return res; }
@property Command front () const {
Command res = void;
if (cleft > 0) {
res.code = cast(Command.Kind)data[cpos];
switch (res.code) {
case Command.Kind.MoveTo:
case Command.Kind.LineTo:
res.args = (cast(const(float*))(data+cpos+1))[0..1*2];
break;
case Command.Kind.QuadTo:
res.args = (cast(const(float*))(data+cpos+1))[0..2*2];
break;
case Command.Kind.BezierTo:
res.args = (cast(const(float*))(data+cpos+1))[0..3*2];
break;
default:
res.code = Command.Kind.End;
res.args = null;
break;
}
} else {
res.code = Command.Kind.End;
res.args = null;
}
return res;
}
void popFront () {
if (cleft <= 1) { cleft = 0; return; } // don't waste time skipping last command
--cleft;
switch (data[cpos]) {
case Command.Kind.MoveTo:
case Command.Kind.LineTo:
cpos += 1+1*2*cast(uint)float.sizeof;
break;
case Command.Kind.QuadTo:
cpos += 1+2*2*cast(uint)float.sizeof;
break;
case Command.Kind.BezierTo:
cpos += 1+3*2*cast(uint)float.sizeof;
break;
default:
cleft = 0;
break;
}
}
}
if (dsaddr) {
incRef(cast(DataStore*)dsaddr); // range anchors it
return Range(dsaddr, 0, ds.ccount);
} else {
return Range.init;
}
}
}
public alias NVGGlyphOutline = NVGPathOutline; /// For backwards compatibility.
/// Destroy glyph outiline and free allocated memory.
/// Group: text_api
public void kill (ref NVGPathOutline ol) nothrow @trusted @nogc {
pragma(inline, true);
ol.clear();
}
static if (is(typeof(&fons__nvg__toOutline))) {
public enum NanoVegaHasCharOutline = true; ///
} else {
public enum NanoVegaHasCharOutline = false; ///
}
/// Returns glyph outlines as array of commands. Vertical 0 is baseline.
/// The glyph is not scaled in any way, so you have to use NanoVega transformations instead.
/// Returns `null` if there is no such glyph, or current font is not scalable.
/// Group: text_api
public NVGPathOutline charOutline (NVGContext ctx, dchar dch) nothrow @trusted @nogc {
import core.stdc.stdlib : malloc;
import core.stdc.string : memcpy;
NVGstate* state = nvg__getState(ctx);
ctx.fs.fontId = state.fontId;
auto oline = NVGPathOutline.createNew();
if (!ctx.fs.toOutline(dch, oline.ds)) oline.clear();
return oline;
}
float nvg__quantize (float a, float d) pure nothrow @safe @nogc {
pragma(inline, true);
return (cast(int)(a/d+0.5f))*d;
}
float nvg__getFontScale (NVGstate* state) /*pure*/ nothrow @safe @nogc {
pragma(inline, true);
return nvg__min(nvg__quantize(nvg__getAverageScale(state.xform), 0.01f), 4.0f);
}
void nvg__flushTextTexture (NVGContext ctx) nothrow @trusted @nogc {
int[4] dirty = void;
if (ctx.fs.validateTexture(dirty.ptr)) {
auto fontImage = &ctx.fontImages[ctx.fontImageIdx];
// Update texture
if (fontImage.valid) {
int iw, ih;
const(ubyte)* data = ctx.fs.getTextureData(&iw, &ih);
int x = dirty[0];
int y = dirty[1];
int w = dirty[2]-dirty[0];
int h = dirty[3]-dirty[1];
ctx.params.renderUpdateTexture(ctx.params.userPtr, fontImage.id, x, y, w, h, data);
}
}
}
bool nvg__allocTextAtlas (NVGContext ctx) nothrow @trusted @nogc {
int iw, ih;
nvg__flushTextTexture(ctx);
if (ctx.fontImageIdx >= NVG_MAX_FONTIMAGES-1) return false;
// if next fontImage already have a texture
if (ctx.fontImages[ctx.fontImageIdx+1].valid) {
ctx.imageSize(ctx.fontImages[ctx.fontImageIdx+1], iw, ih);
} else {
// calculate the new font image size and create it
ctx.imageSize(ctx.fontImages[ctx.fontImageIdx], iw, ih);
if (iw > ih) ih *= 2; else iw *= 2;
if (iw > NVG_MAX_FONTIMAGE_SIZE || ih > NVG_MAX_FONTIMAGE_SIZE) iw = ih = NVG_MAX_FONTIMAGE_SIZE;
ctx.fontImages[ctx.fontImageIdx+1].id = ctx.params.renderCreateTexture(ctx.params.userPtr, NVGtexture.Alpha, iw, ih, (ctx.params.fontAA ? 0 : NVGImageFlag.NoFiltering), null);
if (ctx.fontImages[ctx.fontImageIdx+1].id > 0) {
ctx.fontImages[ctx.fontImageIdx+1].ctx = ctx;
ctx.nvg__imageIncRef(ctx.fontImages[ctx.fontImageIdx+1].id, false); // don't increment driver refcount
}
}
++ctx.fontImageIdx;
ctx.fs.resetAtlas(iw, ih);
return true;
}
void nvg__renderText (NVGContext ctx, NVGVertex* verts, int nverts) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
NVGPaint paint = state.fill;
// Render triangles.
paint.image = ctx.fontImages[ctx.fontImageIdx];
// Apply global alpha
paint.innerColor.a *= state.alpha;
paint.middleColor.a *= state.alpha;
paint.outerColor.a *= state.alpha;
ctx.params.renderTriangles(ctx.params.userPtr, state.compositeOperation, NVGClipMode.None, &paint, &state.scissor, verts, nverts);
++ctx.drawCallCount;
ctx.textTriCount += nverts/3;
}
/// Draws text string at specified location. Returns next x position.
/// Group: text_api
public float text(T) (NVGContext ctx, float x, float y, const(T)[] str) nothrow @trusted @nogc if (isAnyCharType!T) {
NVGstate* state = nvg__getState(ctx);
FONSTextIter!T iter, prevIter;
FONSQuad q;
NVGVertex* verts;
float scale = nvg__getFontScale(state)*ctx.devicePxRatio;
float invscale = 1.0f/scale;
int cverts = 0;
int nverts = 0;
if (state.fontId == FONS_INVALID) return x;
if (str.length == 0) return x;
ctx.fs.size = state.fontSize*scale;
ctx.fs.spacing = state.letterSpacing*scale;
ctx.fs.blur = state.fontBlur*scale;
ctx.fs.textAlign = state.textAlign;
ctx.fs.fontId = state.fontId;
cverts = nvg__max(2, cast(int)(str.length))*6; // conservative estimate
verts = nvg__allocTempVerts(ctx, cverts);
if (verts is null) return x;
if (!iter.setup(ctx.fs, x*scale, y*scale, str, FONSBitmapFlag.Required)) return x;
prevIter = iter;
while (iter.next(q)) {
float[4*2] c = void;
if (iter.prevGlyphIndex < 0) { // can not retrieve glyph?
if (nverts != 0) {
// TODO: add back-end bit to do this just once per frame
nvg__flushTextTexture(ctx);
nvg__renderText(ctx, verts, nverts);
nverts = 0;
}
if (!nvg__allocTextAtlas(ctx)) break; // no memory :(
iter = prevIter;
iter.next(q); // try again
if (iter.prevGlyphIndex < 0) {
// still can not find glyph, try replacement
iter = prevIter;
if (!iter.getDummyChar(q)) break;
}
}
prevIter = iter;
// transform corners
state.xform.point(&c[0], &c[1], q.x0*invscale, q.y0*invscale);
state.xform.point(&c[2], &c[3], q.x1*invscale, q.y0*invscale);
state.xform.point(&c[4], &c[5], q.x1*invscale, q.y1*invscale);
state.xform.point(&c[6], &c[7], q.x0*invscale, q.y1*invscale);
// create triangles
if (nverts+6 <= cverts) {
nvg__vset(&verts[nverts], c[0], c[1], q.s0, q.t0); ++nverts;
nvg__vset(&verts[nverts], c[4], c[5], q.s1, q.t1); ++nverts;
nvg__vset(&verts[nverts], c[2], c[3], q.s1, q.t0); ++nverts;
nvg__vset(&verts[nverts], c[0], c[1], q.s0, q.t0); ++nverts;
nvg__vset(&verts[nverts], c[6], c[7], q.s0, q.t1); ++nverts;
nvg__vset(&verts[nverts], c[4], c[5], q.s1, q.t1); ++nverts;
}
}
// TODO: add back-end bit to do this just once per frame
if (nverts > 0) {
nvg__flushTextTexture(ctx);
nvg__renderText(ctx, verts, nverts);
}
return iter.nextx/scale;
}
/** Draws multi-line text string at specified location wrapped at the specified width.
* White space is stripped at the beginning of the rows, the text is split at word boundaries or when new-line characters are encountered.
* Words longer than the max width are slit at nearest character (i.e. no hyphenation).
*
* Group: text_api
*/
public void textBox(T) (NVGContext ctx, float x, float y, float breakRowWidth, const(T)[] str) nothrow @trusted @nogc if (isAnyCharType!T) {
NVGstate* state = nvg__getState(ctx);
if (state.fontId == FONS_INVALID) return;
NVGTextRow!T[2] rows;
auto oldAlign = state.textAlign;
scope(exit) state.textAlign = oldAlign;
auto halign = state.textAlign.horizontal;
float lineh = 0;
ctx.textMetrics(null, null, &lineh);
state.textAlign.horizontal = NVGTextAlign.H.Left;
for (;;) {
auto rres = ctx.textBreakLines(str, breakRowWidth, rows[]);
//{ import core.stdc.stdio : printf; printf("slen=%u; rlen=%u; bw=%f\n", cast(uint)str.length, cast(uint)rres.length, cast(double)breakRowWidth); }
if (rres.length == 0) break;
foreach (ref row; rres) {
final switch (halign) {
case NVGTextAlign.H.Left: ctx.text(x, y, row.row); break;
case NVGTextAlign.H.Center: ctx.text(x+breakRowWidth*0.5f-row.width*0.5f, y, row.row); break;
case NVGTextAlign.H.Right: ctx.text(x+breakRowWidth-row.width, y, row.row); break;
}
y += lineh*state.lineHeight;
}
str = rres[$-1].rest;
}
}
private template isGoodPositionDelegate(DG) {
private DG dg;
static if (is(typeof({ NVGGlyphPosition pos; bool res = dg(pos); })) ||
is(typeof({ NVGGlyphPosition pos; dg(pos); })))
enum isGoodPositionDelegate = true;
else
enum isGoodPositionDelegate = false;
}
/** Calculates the glyph x positions of the specified text.
* Measured values are returned in local coordinate space.
*
* Group: text_api
*/
public NVGGlyphPosition[] textGlyphPositions(T) (NVGContext ctx, float x, float y, const(T)[] str, NVGGlyphPosition[] positions) nothrow @trusted @nogc
if (isAnyCharType!T)
{
if (str.length == 0 || positions.length == 0) return positions[0..0];
usize posnum;
auto len = ctx.textGlyphPositions(x, y, str, (in ref NVGGlyphPosition pos) {
positions.ptr[posnum++] = pos;
return (posnum < positions.length);
});
return positions[0..len];
}
/// Ditto.
public int textGlyphPositions(T, DG) (NVGContext ctx, float x, float y, const(T)[] str, scope DG dg)
if (isAnyCharType!T && isGoodPositionDelegate!DG)
{
import std.traits : ReturnType;
static if (is(ReturnType!dg == void)) enum RetBool = false; else enum RetBool = true;
NVGstate* state = nvg__getState(ctx);
float scale = nvg__getFontScale(state)*ctx.devicePxRatio;
float invscale = 1.0f/scale;
FONSTextIter!T iter, prevIter;
FONSQuad q;
int npos = 0;
if (str.length == 0) return 0;
ctx.fs.size = state.fontSize*scale;
ctx.fs.spacing = state.letterSpacing*scale;
ctx.fs.blur = state.fontBlur*scale;
ctx.fs.textAlign = state.textAlign;
ctx.fs.fontId = state.fontId;
if (!iter.setup(ctx.fs, x*scale, y*scale, str, FONSBitmapFlag.Optional)) return npos;
prevIter = iter;
while (iter.next(q)) {
if (iter.prevGlyphIndex < 0) { // can not retrieve glyph?
if (!nvg__allocTextAtlas(ctx)) break; // no memory
iter = prevIter;
iter.next(q); // try again
if (iter.prevGlyphIndex < 0) {
// still can not find glyph, try replacement
iter = prevIter;
if (!iter.getDummyChar(q)) break;
}
}
prevIter = iter;
NVGGlyphPosition position = void; //WARNING!
position.strpos = cast(usize)(iter.stringp-str.ptr);
position.x = iter.x*invscale;
position.minx = nvg__min(iter.x, q.x0)*invscale;
position.maxx = nvg__max(iter.nextx, q.x1)*invscale;
++npos;
static if (RetBool) { if (!dg(position)) return npos; } else dg(position);
}
return npos;
}
private template isGoodRowDelegate(CT, DG) {
private DG dg;
static if (is(typeof({ NVGTextRow!CT row; bool res = dg(row); })) ||
is(typeof({ NVGTextRow!CT row; dg(row); })))
enum isGoodRowDelegate = true;
else
enum isGoodRowDelegate = false;
}
/** Breaks the specified text into lines.
* White space is stripped at the beginning of the rows, the text is split at word boundaries or when new-line characters are encountered.
* Words longer than the max width are slit at nearest character (i.e. no hyphenation).
*
* Group: text_api
*/
public NVGTextRow!T[] textBreakLines(T) (NVGContext ctx, const(T)[] str, float breakRowWidth, NVGTextRow!T[] rows) nothrow @trusted @nogc
if (isAnyCharType!T)
{
if (rows.length == 0) return rows;
if (rows.length > int.max-1) rows = rows[0..int.max-1];
int nrow = 0;
auto count = ctx.textBreakLines(str, breakRowWidth, (in ref NVGTextRow!T row) {
rows[nrow++] = row;
return (nrow < rows.length);
});
return rows[0..count];
}
/** Breaks the specified text into lines.
* White space is stripped at the beginning of the rows, the text is split at word boundaries or when new-line characters are encountered.
* Words longer than the max width are slit at nearest character (i.e. no hyphenation).
* Returns number of rows.
*
* Group: text_api
*/
public int textBreakLines(T, DG) (NVGContext ctx, const(T)[] str, float breakRowWidth, scope DG dg)
if (isAnyCharType!T && isGoodRowDelegate!(T, DG))
{
import std.traits : ReturnType;
static if (is(ReturnType!dg == void)) enum RetBool = false; else enum RetBool = true;
enum NVGcodepointType : int {
Space,
NewLine,
Char,
}
NVGstate* state = nvg__getState(ctx);
float scale = nvg__getFontScale(state)*ctx.devicePxRatio;
float invscale = 1.0f/scale;
FONSTextIter!T iter, prevIter;
FONSQuad q;
int nrows = 0;
float rowStartX = 0;
float rowWidth = 0;
float rowMinX = 0;
float rowMaxX = 0;
int rowStart = 0;
int rowEnd = 0;
int wordStart = 0;
float wordStartX = 0;
float wordMinX = 0;
int breakEnd = 0;
float breakWidth = 0;
float breakMaxX = 0;
int type = NVGcodepointType.Space, ptype = NVGcodepointType.Space;
uint pcodepoint = 0;
if (state.fontId == FONS_INVALID) return 0;
if (str.length == 0 || dg is null) return 0;
ctx.fs.size = state.fontSize*scale;
ctx.fs.spacing = state.letterSpacing*scale;
ctx.fs.blur = state.fontBlur*scale;
ctx.fs.textAlign = state.textAlign;
ctx.fs.fontId = state.fontId;
breakRowWidth *= scale;
enum Phase {
Normal, // searching for breaking point
SkipBlanks, // skip leading blanks
}
Phase phase = Phase.SkipBlanks; // don't skip blanks on first line
if (!iter.setup(ctx.fs, 0, 0, str, FONSBitmapFlag.Optional)) return 0;
prevIter = iter;
while (iter.next(q)) {
if (iter.prevGlyphIndex < 0) { // can not retrieve glyph?
if (!nvg__allocTextAtlas(ctx)) break; // no memory
iter = prevIter;
iter.next(q); // try again
if (iter.prevGlyphIndex < 0) {
// still can not find glyph, try replacement
iter = prevIter;
if (!iter.getDummyChar(q)) break;
}
}
prevIter = iter;
switch (iter.codepoint) {
case 9: // \t
case 11: // \v
case 12: // \f
case 32: // space
case 0x00a0: // NBSP
type = NVGcodepointType.Space;
break;
case 10: // \n
type = (pcodepoint == 13 ? NVGcodepointType.Space : NVGcodepointType.NewLine);
break;
case 13: // \r
type = (pcodepoint == 10 ? NVGcodepointType.Space : NVGcodepointType.NewLine);
break;
case 0x0085: // NEL
case 0x2028: // Line Separator
case 0x2029: // Paragraph Separator
type = NVGcodepointType.NewLine;
break;
default:
type = NVGcodepointType.Char;
break;
}
if (phase == Phase.SkipBlanks) {
// fix row start
rowStart = cast(int)(iter.stringp-str.ptr);
rowEnd = rowStart;
rowStartX = iter.x;
rowWidth = iter.nextx-rowStartX; // q.x1-rowStartX;
rowMinX = q.x0-rowStartX;
rowMaxX = q.x1-rowStartX;
wordStart = rowStart;
wordStartX = iter.x;
wordMinX = q.x0-rowStartX;
breakEnd = rowStart;
breakWidth = 0.0;
breakMaxX = 0.0;
if (type == NVGcodepointType.Space) continue;
phase = Phase.Normal;
}
if (type == NVGcodepointType.NewLine) {
// always handle new lines
NVGTextRow!T row;
row.string = str;
row.start = rowStart;
row.end = rowEnd;
row.width = rowWidth*invscale;
row.minx = rowMinX*invscale;
row.maxx = rowMaxX*invscale;
++nrows;
static if (RetBool) { if (!dg(row)) return nrows; } else dg(row);
phase = Phase.SkipBlanks;
} else {
float nextWidth = iter.nextx-rowStartX;
// track last non-white space character
if (type == NVGcodepointType.Char) {
rowEnd = cast(int)(iter.nextp-str.ptr);
rowWidth = iter.nextx-rowStartX;
rowMaxX = q.x1-rowStartX;
}
// track last end of a word
if (ptype == NVGcodepointType.Char && type == NVGcodepointType.Space) {
breakEnd = cast(int)(iter.stringp-str.ptr);
breakWidth = rowWidth;
breakMaxX = rowMaxX;
}
// track last beginning of a word
if (ptype == NVGcodepointType.Space && type == NVGcodepointType.Char) {
wordStart = cast(int)(iter.stringp-str.ptr);
wordStartX = iter.x;
wordMinX = q.x0-rowStartX;
}
// break to new line when a character is beyond break width
if (type == NVGcodepointType.Char && nextWidth > breakRowWidth) {
// the run length is too long, need to break to new line
NVGTextRow!T row;
row.string = str;
if (breakEnd == rowStart) {
// the current word is longer than the row length, just break it from here
row.start = rowStart;
row.end = cast(int)(iter.stringp-str.ptr);
row.width = rowWidth*invscale;
row.minx = rowMinX*invscale;
row.maxx = rowMaxX*invscale;
++nrows;
static if (RetBool) { if (!dg(row)) return nrows; } else dg(row);
rowStartX = iter.x;
rowStart = cast(int)(iter.stringp-str.ptr);
rowEnd = cast(int)(iter.nextp-str.ptr);
rowWidth = iter.nextx-rowStartX;
rowMinX = q.x0-rowStartX;
rowMaxX = q.x1-rowStartX;
wordStart = rowStart;
wordStartX = iter.x;
wordMinX = q.x0-rowStartX;
} else {
// break the line from the end of the last word, and start new line from the beginning of the new
//{ import core.stdc.stdio : printf; printf("rowStart=%u; rowEnd=%u; breakEnd=%u; len=%u\n", rowStart, rowEnd, breakEnd, cast(uint)str.length); }
row.start = rowStart;
row.end = breakEnd;
row.width = breakWidth*invscale;
row.minx = rowMinX*invscale;
row.maxx = breakMaxX*invscale;
++nrows;
static if (RetBool) { if (!dg(row)) return nrows; } else dg(row);
rowStartX = wordStartX;
rowStart = wordStart;
rowEnd = cast(int)(iter.nextp-str.ptr);
rowWidth = iter.nextx-rowStartX;
rowMinX = wordMinX;
rowMaxX = q.x1-rowStartX;
// no change to the word start
}
// set null break point
breakEnd = rowStart;
breakWidth = 0.0;
breakMaxX = 0.0;
}
}
pcodepoint = iter.codepoint;
ptype = type;
}
// break the line from the end of the last word, and start new line from the beginning of the new
if (phase != Phase.SkipBlanks && rowStart < str.length) {
//{ import core.stdc.stdio : printf; printf(" rowStart=%u; len=%u\n", rowStart, cast(uint)str.length); }
NVGTextRow!T row;
row.string = str;
row.start = rowStart;
row.end = cast(int)str.length;
row.width = rowWidth*invscale;
row.minx = rowMinX*invscale;
row.maxx = rowMaxX*invscale;
++nrows;
static if (RetBool) { if (!dg(row)) return nrows; } else dg(row);
}
return nrows;
}
/** Returns iterator which you can use to calculate text bounds and advancement.
* This is usable when you need to do some text layouting with wrapping, to avoid
* guesswork ("will advancement for this space stay the same?"), and Schlemiel's
* algorithm. Note that you can copy the returned struct to save iterator state.
*
* You can check if iterator is valid with [valid] property, put new chars with
* [put] method, get current advance with [advance] property, and current
* bounds with `getBounds(ref float[4] bounds)` method.
*
* $(WARNING Don't change font parameters while iterating! Or use [restoreFont] method.)
*
* Group: text_api
*/
public struct TextBoundsIterator {
private:
NVGContext ctx;
FONSTextBoundsIterator fsiter; // fontstash iterator
float scale, invscale, xscaled, yscaled;
// font settings
float fsSize, fsSpacing, fsBlur;
int fsFontId;
NVGTextAlign fsAlign;
public:
/// Setups iteration. Takes current font parameters from the given NanoVega context.
this (NVGContext actx, float ax=0, float ay=0) nothrow @trusted @nogc { reset(actx, ax, ay); }
/// Resets iteration. Takes current font parameters from the given NanoVega context.
void reset (NVGContext actx, float ax=0, float ay=0) nothrow @trusted @nogc {
fsiter = fsiter.init;
this = this.init;
if (actx is null) return;
NVGstate* state = nvg__getState(actx);
if (state is null) return;
if (state.fontId == FONS_INVALID) { ctx = null; return; }
ctx = actx;
scale = nvg__getFontScale(state)*ctx.devicePxRatio;
invscale = 1.0f/scale;
fsSize = state.fontSize*scale;
fsSpacing = state.letterSpacing*scale;
fsBlur = state.fontBlur*scale;
fsAlign = state.textAlign;
fsFontId = state.fontId;
restoreFont();
xscaled = ax*scale;
yscaled = ay*scale;
fsiter.reset(ctx.fs, xscaled, yscaled);
}
/// Restart iteration. Will not restore font.
void restart () nothrow @trusted @nogc {
if (ctx !is null) fsiter.reset(ctx.fs, xscaled, yscaled);
}
/// Restore font settings for the context.
void restoreFont () nothrow @trusted @nogc {
if (ctx !is null) {
ctx.fs.size = fsSize;
ctx.fs.spacing = fsSpacing;
ctx.fs.blur = fsBlur;
ctx.fs.textAlign = fsAlign;
ctx.fs.fontId = fsFontId;
}
}
/// Is this iterator valid?
@property bool valid () const pure nothrow @safe @nogc { pragma(inline, true); return (ctx !is null); }
/// Add chars.
void put(T) (const(T)[] str...) nothrow @trusted @nogc if (isAnyCharType!T) { pragma(inline, true); if (ctx !is null) fsiter.put(str[]); }
/// Returns current advance
@property float advance () const pure nothrow @safe @nogc { pragma(inline, true); return (ctx !is null ? fsiter.advance*invscale : 0); }
/// Returns current text bounds.
void getBounds (ref float[4] bounds) nothrow @trusted @nogc {
if (ctx !is null) {
fsiter.getBounds(bounds);
ctx.fs.getLineBounds(yscaled, &bounds[1], &bounds[3]);
bounds[0] *= invscale;
bounds[1] *= invscale;
bounds[2] *= invscale;
bounds[3] *= invscale;
} else {
bounds[] = 0;
}
}
/// Returns current horizontal text bounds.
void getHBounds (out float xmin, out float xmax) nothrow @trusted @nogc {
if (ctx !is null) {
fsiter.getHBounds(xmin, xmax);
xmin *= invscale;
xmax *= invscale;
}
}
/// Returns current vertical text bounds.
void getVBounds (out float ymin, out float ymax) nothrow @trusted @nogc {
if (ctx !is null) {
//fsiter.getVBounds(ymin, ymax);
ctx.fs.getLineBounds(yscaled, &ymin, &ymax);
ymin *= invscale;
ymax *= invscale;
}
}
}
/// Returns font line height (without line spacing), measured in local coordinate space.
/// Group: text_api
public float textFontHeight (NVGContext ctx) nothrow @trusted @nogc {
float res = void;
ctx.textMetrics(null, null, &res);
return res;
}
/// Returns font ascender (positive), measured in local coordinate space.
/// Group: text_api
public float textFontAscender (NVGContext ctx) nothrow @trusted @nogc {
float res = void;
ctx.textMetrics(&res, null, null);
return res;
}
/// Returns font descender (negative), measured in local coordinate space.
/// Group: text_api
public float textFontDescender (NVGContext ctx) nothrow @trusted @nogc {
float res = void;
ctx.textMetrics(null, &res, null);
return res;
}
/** Measures the specified text string. Returns horizontal and vertical sizes of the measured text.
* Measured values are returned in local coordinate space.
*
* Group: text_api
*/
public void textExtents(T) (NVGContext ctx, const(T)[] str, float *w, float *h) nothrow @trusted @nogc if (isAnyCharType!T) {
float[4] bnd = void;
ctx.textBounds(0, 0, str, bnd[]);
if (!ctx.fs.getFontAA(nvg__getState(ctx).fontId)) {
if (w !is null) *w = nvg__lrintf(bnd.ptr[2]-bnd.ptr[0]);
if (h !is null) *h = nvg__lrintf(bnd.ptr[3]-bnd.ptr[1]);
} else {
if (w !is null) *w = bnd.ptr[2]-bnd.ptr[0];
if (h !is null) *h = bnd.ptr[3]-bnd.ptr[1];
}
}
/** Measures the specified text string. Returns horizontal size of the measured text.
* Measured values are returned in local coordinate space.
*
* Group: text_api
*/
public float textWidth(T) (NVGContext ctx, const(T)[] str) nothrow @trusted @nogc if (isAnyCharType!T) {
float w = void;
ctx.textExtents(str, &w, null);
return w;
}
/** Measures the specified text string. Parameter bounds should be a float[4],
* if the bounding box of the text should be returned. The bounds value are [xmin, ymin, xmax, ymax]
* Returns the horizontal advance of the measured text (i.e. where the next character should drawn).
* Measured values are returned in local coordinate space.
*
* Group: text_api
*/
public float textBounds(T) (NVGContext ctx, float x, float y, const(T)[] str, float[] bounds) nothrow @trusted @nogc
if (isAnyCharType!T)
{
NVGstate* state = nvg__getState(ctx);
if (state.fontId == FONS_INVALID) {
bounds[] = 0;
return 0;
}
immutable float scale = nvg__getFontScale(state)*ctx.devicePxRatio;
ctx.fs.size = state.fontSize*scale;
ctx.fs.spacing = state.letterSpacing*scale;
ctx.fs.blur = state.fontBlur*scale;
ctx.fs.textAlign = state.textAlign;
ctx.fs.fontId = state.fontId;
float[4] b = void;
immutable float width = ctx.fs.getTextBounds(x*scale, y*scale, str, b[]);
immutable float invscale = 1.0f/scale;
if (bounds.length) {
// use line bounds for height
ctx.fs.getLineBounds(y*scale, b.ptr+1, b.ptr+3);
if (bounds.length > 0) bounds.ptr[0] = b.ptr[0]*invscale;
if (bounds.length > 1) bounds.ptr[1] = b.ptr[1]*invscale;
if (bounds.length > 2) bounds.ptr[2] = b.ptr[2]*invscale;
if (bounds.length > 3) bounds.ptr[3] = b.ptr[3]*invscale;
}
return width*invscale;
}
/// Ditto.
public void textBoxBounds(T) (NVGContext ctx, float x, float y, float breakRowWidth, const(T)[] str, float[] bounds) if (isAnyCharType!T) {
NVGstate* state = nvg__getState(ctx);
NVGTextRow!T[2] rows;
float scale = nvg__getFontScale(state)*ctx.devicePxRatio;
float invscale = 1.0f/scale;
float lineh = 0, rminy = 0, rmaxy = 0;
float minx, miny, maxx, maxy;
if (state.fontId == FONS_INVALID) {
bounds[] = 0;
return;
}
auto oldAlign = state.textAlign;
scope(exit) state.textAlign = oldAlign;
auto halign = state.textAlign.horizontal;
ctx.textMetrics(null, null, &lineh);
state.textAlign.horizontal = NVGTextAlign.H.Left;
minx = maxx = x;
miny = maxy = y;
ctx.fs.size = state.fontSize*scale;
ctx.fs.spacing = state.letterSpacing*scale;
ctx.fs.blur = state.fontBlur*scale;
ctx.fs.textAlign = state.textAlign;
ctx.fs.fontId = state.fontId;
ctx.fs.getLineBounds(0, &rminy, &rmaxy);
rminy *= invscale;
rmaxy *= invscale;
for (;;) {
auto rres = ctx.textBreakLines(str, breakRowWidth, rows[]);
if (rres.length == 0) break;
foreach (ref row; rres) {
float rminx, rmaxx, dx = 0;
// horizontal bounds
final switch (halign) {
case NVGTextAlign.H.Left: dx = 0; break;
case NVGTextAlign.H.Center: dx = breakRowWidth*0.5f-row.width*0.5f; break;
case NVGTextAlign.H.Right: dx = breakRowWidth-row.width; break;
}
rminx = x+row.minx+dx;
rmaxx = x+row.maxx+dx;
minx = nvg__min(minx, rminx);
maxx = nvg__max(maxx, rmaxx);
// vertical bounds
miny = nvg__min(miny, y+rminy);
maxy = nvg__max(maxy, y+rmaxy);
y += lineh*state.lineHeight;
}
str = rres[$-1].rest;
}
if (bounds.length) {
if (bounds.length > 0) bounds.ptr[0] = minx;
if (bounds.length > 1) bounds.ptr[1] = miny;
if (bounds.length > 2) bounds.ptr[2] = maxx;
if (bounds.length > 3) bounds.ptr[3] = maxy;
}
}
/// Returns the vertical metrics based on the current text style. Measured values are returned in local coordinate space.
/// Group: text_api
public void textMetrics (NVGContext ctx, float* ascender, float* descender, float* lineh) nothrow @trusted @nogc {
NVGstate* state = nvg__getState(ctx);
if (state.fontId == FONS_INVALID) {
if (ascender !is null) *ascender *= 0;
if (descender !is null) *descender *= 0;
if (lineh !is null) *lineh *= 0;
return;
}
immutable float scale = nvg__getFontScale(state)*ctx.devicePxRatio;
immutable float invscale = 1.0f/scale;
ctx.fs.size = state.fontSize*scale;
ctx.fs.spacing = state.letterSpacing*scale;
ctx.fs.blur = state.fontBlur*scale;
ctx.fs.textAlign = state.textAlign;
ctx.fs.fontId = state.fontId;
ctx.fs.getVertMetrics(ascender, descender, lineh);
if (ascender !is null) *ascender *= invscale;
if (descender !is null) *descender *= invscale;
if (lineh !is null) *lineh *= invscale;
}
// ////////////////////////////////////////////////////////////////////////// //
// fontstash
// ////////////////////////////////////////////////////////////////////////// //
import core.stdc.stdlib : malloc, realloc, free;
import core.stdc.string : memset, memcpy, strncpy, strcmp, strlen;
import core.stdc.stdio : FILE, fopen, fclose, fseek, ftell, fread, SEEK_END, SEEK_SET;
public:
// welcome to version hell!
version(nanovg_force_stb_ttf) {
} else {
version(nanovg_force_detect) {} else version(nanovg_use_freetype) { version = nanovg_use_freetype_ii; }
}
version(nanovg_ignore_iv_stb_ttf) enum nanovg_ignore_iv_stb_ttf = true; else enum nanovg_ignore_iv_stb_ttf = false;
//version(nanovg_ignore_mono);
version(nanovg_force_stb_ttf) {
private enum NanoVegaForceFreeType = false;
} else {
version (nanovg_builtin_freetype_bindings) {
version(Posix) {
private enum NanoVegaForceFreeType = true;
} else {
private enum NanoVegaForceFreeType = false;
}
} else {
version(Posix) {
private enum NanoVegaForceFreeType = true;
} else {
private enum NanoVegaForceFreeType = false;
}
}
}
version(nanovg_use_freetype_ii) {
enum NanoVegaIsUsingSTBTTF = false;
//pragma(msg, "iv.freetype: forced");
} else {
static if (NanoVegaForceFreeType) {
enum NanoVegaIsUsingSTBTTF = false;
} else {
static if (!nanovg_ignore_iv_stb_ttf && __traits(compiles, { import iv.stb.ttf; })) {
import iv.stb.ttf;
enum NanoVegaIsUsingSTBTTF = true;
version(nanovg_report_stb_ttf) pragma(msg, "iv.stb.ttf");
} else static if (__traits(compiles, { import arsd.ttf; })) {
import arsd.ttf;
enum NanoVegaIsUsingSTBTTF = true;
version(nanovg_report_stb_ttf) pragma(msg, "arsd.ttf");
} else static if (__traits(compiles, { import stb_truetype; })) {
import stb_truetype;
enum NanoVegaIsUsingSTBTTF = true;
version(nanovg_report_stb_ttf) pragma(msg, "stb_truetype");
} else static if (__traits(compiles, { import iv.freetype; })) {
version (nanovg_builtin_freetype_bindings) {
enum NanoVegaIsUsingSTBTTF = false;
version = nanovg_builtin_freetype_bindings;
} else {
import iv.freetype;
enum NanoVegaIsUsingSTBTTF = false;
}
version(nanovg_report_stb_ttf) pragma(msg, "freetype");
} else {
static assert(0, "no stb_ttf/iv.freetype found!");
}
}
}
// ////////////////////////////////////////////////////////////////////////// //
//version = nanovg_ft_mono;
/// Invald font id.
/// Group: font_stash
public enum FONS_INVALID = -1;
public enum FONSBitmapFlag : uint {
Required = 0,
Optional = 1,
}
public enum FONSError : int {
NoError = 0,
AtlasFull = 1, // Font atlas is full.
ScratchFull = 2, // Scratch memory used to render glyphs is full, requested size reported in 'val', you may need to bump up FONS_SCRATCH_BUF_SIZE.
StatesOverflow = 3, // Calls to fonsPushState has created too large stack, if you need deep state stack bump up FONS_MAX_STATES.
StatesUnderflow = 4, // Trying to pop too many states fonsPopState().
}
/// Initial parameters for new FontStash.
/// Group: font_stash
public struct FONSParams {
enum Flag : uint {
ZeroTopLeft = 0U, // default
ZeroBottomLeft = 1U,
}
int width, height;
Flag flags = Flag.ZeroTopLeft;
void* userPtr;
bool function (void* uptr, int width, int height) nothrow @trusted @nogc renderCreate;
int function (void* uptr, int width, int height) nothrow @trusted @nogc renderResize;
void function (void* uptr, int* rect, const(ubyte)* data) nothrow @trusted @nogc renderUpdate;
void function (void* uptr) nothrow @trusted @nogc renderDelete;
@property bool isZeroTopLeft () const pure nothrow @trusted @nogc { pragma(inline, true); return ((flags&Flag.ZeroBottomLeft) == 0); }
}
//TODO: document this
public struct FONSQuad {
float x0=0, y0=0, s0=0, t0=0;
float x1=0, y1=0, s1=0, t1=0;
}
//TODO: document this
public struct FONSTextIter(CT) if (isAnyCharType!CT) {
alias CharType = CT;
float x=0, y=0, nextx=0, nexty=0, scale=0, spacing=0;
uint codepoint;
short isize, iblur;
FONSContext stash;
FONSfont* font;
int prevGlyphIndex;
const(CT)* s; // string
const(CT)* n; // next
const(CT)* e; // end
FONSBitmapFlag bitmapOption;
static if (is(CT == char)) {
uint utf8state;
}
this (FONSContext astash, float ax, float ay, const(CharType)[] astr, FONSBitmapFlag abitmapOption) nothrow @trusted @nogc { setup(astash, ax, ay, astr, abitmapOption); }
~this () nothrow @trusted @nogc { pragma(inline, true); static if (is(CT == char)) utf8state = 0; s = n = e = null; }
@property const(CT)* stringp () const pure nothrow @trusted @nogc { pragma(inline, true); return s; }
@property const(CT)* nextp () const pure nothrow @trusted @nogc { pragma(inline, true); return n; }
@property const(CT)* endp () const pure nothrow @trusted @nogc { pragma(inline, true); return e; }
bool setup (FONSContext astash, float ax, float ay, const(CharType)[] astr, FONSBitmapFlag abitmapOption) nothrow @trusted @nogc {
import core.stdc.string : memset;
memset(&this, 0, this.sizeof);
if (astash is null) return false;
FONSstate* state = astash.getState;
if (state.font < 0 || state.font >= astash.nfonts) return false;
font = astash.fonts[state.font];
if (font is null || font.fdata is null) return false;
isize = cast(short)(state.size*10.0f);
iblur = cast(short)state.blur;
scale = fons__tt_getPixelHeightScale(&font.font, cast(float)isize/10.0f);
// align horizontally
if (state.talign.left) {
// empty
} else if (state.talign.right) {
immutable float width = astash.getTextBounds(ax, ay, astr, null);
ax -= width;
} else if (state.talign.center) {
immutable float width = astash.getTextBounds(ax, ay, astr, null);
ax -= width*0.5f;
}
// align vertically
ay += astash.getVertAlign(font, state.talign, isize);
x = nextx = ax;
y = nexty = ay;
spacing = state.spacing;
if (astr.ptr is null) {
static if (is(CharType == char)) astr = "";
else static if (is(CharType == wchar)) astr = ""w;
else static if (is(CharType == dchar)) astr = ""d;
else static assert(0, "wtf?!");
}
s = astr.ptr;
n = astr.ptr;
e = astr.ptr+astr.length;
codepoint = 0;
prevGlyphIndex = -1;
bitmapOption = abitmapOption;
stash = astash;
return true;
}
bool getDummyChar (ref FONSQuad quad) nothrow @trusted @nogc {
if (stash is null || font is null) return false;
// get glyph and quad
x = nextx;
y = nexty;
FONSglyph* glyph = stash.getGlyph(font, 0xFFFD, isize, iblur, bitmapOption);
if (glyph !is null) {
stash.getQuad(font, prevGlyphIndex, glyph, isize/10.0f, scale, spacing, &nextx, &nexty, &quad);
prevGlyphIndex = glyph.index;
return true;
} else {
prevGlyphIndex = -1;
return false;
}
}
bool next (ref FONSQuad quad) nothrow @trusted @nogc {
if (stash is null || font is null) return false;
FONSglyph* glyph = null;
static if (is(CharType == char)) {
const(char)* str = this.n;
this.s = this.n;
if (str is this.e) return false;
const(char)* e = this.e;
for (; str !is e; ++str) {
/*if (fons__decutf8(&utf8state, &codepoint, *cast(const(ubyte)*)str)) continue;*/
mixin(DecUtfMixin!("this.utf8state", "this.codepoint", "*cast(const(ubyte)*)str"));
if (utf8state) continue;
++str; // 'cause we'll break anyway
// get glyph and quad
x = nextx;
y = nexty;
glyph = stash.getGlyph(font, codepoint, isize, iblur, bitmapOption);
if (glyph !is null) {
stash.getQuad(font, prevGlyphIndex, glyph, isize/10.0f, scale, spacing, &nextx, &nexty, &quad);
prevGlyphIndex = glyph.index;
} else {
prevGlyphIndex = -1;
}
break;
}
this.n = str;
} else {
const(CharType)* str = this.n;
this.s = this.n;
if (str is this.e) return false;
codepoint = cast(uint)(*str++);
if (codepoint > dchar.max) codepoint = 0xFFFD;
// get glyph and quad
x = nextx;
y = nexty;
glyph = stash.getGlyph(font, codepoint, isize, iblur, bitmapOption);
if (glyph !is null) {
stash.getQuad(font, prevGlyphIndex, glyph, isize/10.0f, scale, spacing, &nextx, &nexty, &quad);
prevGlyphIndex = glyph.index;
} else {
prevGlyphIndex = -1;
}
this.n = str;
}
return true;
}
}
// ////////////////////////////////////////////////////////////////////////// //
//static if (!HasAST) version = nanovg_use_freetype_ii_x;
/*version(nanovg_use_freetype_ii_x)*/ static if (!NanoVegaIsUsingSTBTTF) {
version(nanovg_builtin_freetype_bindings) {
pragma(lib, "freetype");
private extern(C) nothrow @trusted @nogc {
private import core.stdc.config : c_long, c_ulong;
alias FT_Pos = c_long;
// config/ftconfig.h
alias FT_Int16 = short;
alias FT_UInt16 = ushort;
alias FT_Int32 = int;
alias FT_UInt32 = uint;
alias FT_Fast = int;
alias FT_UFast = uint;
alias FT_Int64 = long;
alias FT_Uint64 = ulong;
// fttypes.h
alias FT_Bool = ubyte;
alias FT_FWord = short;
alias FT_UFWord = ushort;
alias FT_Char = char;
alias FT_Byte = ubyte;
alias FT_Bytes = FT_Byte*;
alias FT_Tag = FT_UInt32;
alias FT_String = char;
alias FT_Short = short;
alias FT_UShort = ushort;
alias FT_Int = int;
alias FT_UInt = uint;
alias FT_Long = c_long;
alias FT_ULong = c_ulong;
alias FT_F2Dot14 = short;
alias FT_F26Dot6 = c_long;
alias FT_Fixed = c_long;
alias FT_Error = int;
alias FT_Pointer = void*;
alias FT_Offset = usize;
alias FT_PtrDist = ptrdiff_t;
struct FT_UnitVector {
FT_F2Dot14 x;
FT_F2Dot14 y;
}
struct FT_Matrix {
FT_Fixed xx, xy;
FT_Fixed yx, yy;
}
struct FT_Data {
const(FT_Byte)* pointer;
FT_Int length;
}
alias FT_Face = FT_FaceRec*;
struct FT_FaceRec {
FT_Long num_faces;
FT_Long face_index;
FT_Long face_flags;
FT_Long style_flags;
FT_Long num_glyphs;
FT_String* family_name;
FT_String* style_name;
FT_Int num_fixed_sizes;
FT_Bitmap_Size* available_sizes;
FT_Int num_charmaps;
FT_CharMap* charmaps;
FT_Generic generic;
FT_BBox bbox;
FT_UShort units_per_EM;
FT_Short ascender;
FT_Short descender;
FT_Short height;
FT_Short max_advance_width;
FT_Short max_advance_height;
FT_Short underline_position;
FT_Short underline_thickness;
FT_GlyphSlot glyph;
FT_Size size;
FT_CharMap charmap;
FT_Driver driver;
FT_Memory memory;
FT_Stream stream;
FT_ListRec sizes_list;
FT_Generic autohint;
void* extensions;
FT_Face_Internal internal;
}
struct FT_Bitmap_Size {
FT_Short height;
FT_Short width;
FT_Pos size;
FT_Pos x_ppem;
FT_Pos y_ppem;
}
alias FT_CharMap = FT_CharMapRec*;
struct FT_CharMapRec {
FT_Face face;
FT_Encoding encoding;
FT_UShort platform_id;
FT_UShort encoding_id;
}
extern(C) nothrow @nogc { alias FT_Generic_Finalizer = void function (void* object); }
struct FT_Generic {
void* data;
FT_Generic_Finalizer finalizer;
}
struct FT_Vector {
FT_Pos x;
FT_Pos y;
}
struct FT_BBox {
FT_Pos xMin, yMin;
FT_Pos xMax, yMax;
}
alias FT_Pixel_Mode = int;
enum {
FT_PIXEL_MODE_NONE = 0,
FT_PIXEL_MODE_MONO,
FT_PIXEL_MODE_GRAY,
FT_PIXEL_MODE_GRAY2,
FT_PIXEL_MODE_GRAY4,
FT_PIXEL_MODE_LCD,
FT_PIXEL_MODE_LCD_V,
FT_PIXEL_MODE_MAX
}
struct FT_Bitmap {
uint rows;
uint width;
int pitch;
ubyte* buffer;
ushort num_grays;
ubyte pixel_mode;
ubyte palette_mode;
void* palette;
}
struct FT_Outline {
short n_contours;
short n_points;
FT_Vector* points;
byte* tags;
short* contours;
int flags;
}
alias FT_GlyphSlot = FT_GlyphSlotRec*;
struct FT_GlyphSlotRec {
FT_Library library;
FT_Face face;
FT_GlyphSlot next;
FT_UInt reserved;
FT_Generic generic;
FT_Glyph_Metrics metrics;
FT_Fixed linearHoriAdvance;
FT_Fixed linearVertAdvance;
FT_Vector advance;
FT_Glyph_Format format;
FT_Bitmap bitmap;
FT_Int bitmap_left;
FT_Int bitmap_top;
FT_Outline outline;
FT_UInt num_subglyphs;
FT_SubGlyph subglyphs;
void* control_data;
c_long control_len;
FT_Pos lsb_delta;
FT_Pos rsb_delta;
void* other;
FT_Slot_Internal internal;
}
alias FT_Size = FT_SizeRec*;
struct FT_SizeRec {
FT_Face face;
FT_Generic generic;
FT_Size_Metrics metrics;
FT_Size_Internal internal;
}
alias FT_Encoding = FT_Tag;
alias FT_Face_Internal = void*;
alias FT_Driver = void*;
alias FT_Memory = void*;
alias FT_Stream = void*;
alias FT_Library = void*;
alias FT_SubGlyph = void*;
alias FT_Slot_Internal = void*;
alias FT_Size_Internal = void*;
alias FT_ListNode = FT_ListNodeRec*;
alias FT_List = FT_ListRec*;
struct FT_ListNodeRec {
FT_ListNode prev;
FT_ListNode next;
void* data;
}
struct FT_ListRec {
FT_ListNode head;
FT_ListNode tail;
}
struct FT_Glyph_Metrics {
FT_Pos width;
FT_Pos height;
FT_Pos horiBearingX;
FT_Pos horiBearingY;
FT_Pos horiAdvance;
FT_Pos vertBearingX;
FT_Pos vertBearingY;
FT_Pos vertAdvance;
}
alias FT_Glyph_Format = FT_Tag;
FT_Tag FT_MAKE_TAG (char x1, char x2, char x3, char x4) pure nothrow @safe @nogc {
pragma(inline, true);
return cast(FT_UInt32)((x1<<24)|(x2<<16)|(x3<<8)|x4);
}
enum : FT_Tag {
FT_GLYPH_FORMAT_NONE = 0,
FT_GLYPH_FORMAT_COMPOSITE = FT_MAKE_TAG('c','o','m','p'),
FT_GLYPH_FORMAT_BITMAP = FT_MAKE_TAG('b','i','t','s'),
FT_GLYPH_FORMAT_OUTLINE = FT_MAKE_TAG('o','u','t','l'),
FT_GLYPH_FORMAT_PLOTTER = FT_MAKE_TAG('p','l','o','t'),
}
struct FT_Size_Metrics {
FT_UShort x_ppem;
FT_UShort y_ppem;
FT_Fixed x_scale;
FT_Fixed y_scale;
FT_Pos ascender;
FT_Pos descender;
FT_Pos height;
FT_Pos max_advance;
}
enum FT_LOAD_DEFAULT = 0x0U;
enum FT_LOAD_NO_SCALE = 1U<<0;
enum FT_LOAD_NO_HINTING = 1U<<1;
enum FT_LOAD_RENDER = 1U<<2;
enum FT_LOAD_NO_BITMAP = 1U<<3;
enum FT_LOAD_VERTICAL_LAYOUT = 1U<<4;
enum FT_LOAD_FORCE_AUTOHINT = 1U<<5;
enum FT_LOAD_CROP_BITMAP = 1U<<6;
enum FT_LOAD_PEDANTIC = 1U<<7;
enum FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH = 1U<<9;
enum FT_LOAD_NO_RECURSE = 1U<<10;
enum FT_LOAD_IGNORE_TRANSFORM = 1U<<11;
enum FT_LOAD_MONOCHROME = 1U<<12;
enum FT_LOAD_LINEAR_DESIGN = 1U<<13;
enum FT_LOAD_NO_AUTOHINT = 1U<<15;
enum FT_LOAD_COLOR = 1U<<20;
enum FT_LOAD_COMPUTE_METRICS = 1U<<21;
enum FT_FACE_FLAG_KERNING = 1U<<6;
alias FT_Kerning_Mode = int;
enum /*FT_Kerning_Mode*/ {
FT_KERNING_DEFAULT = 0,
FT_KERNING_UNFITTED,
FT_KERNING_UNSCALED
}
extern(C) nothrow @nogc {
alias FT_Outline_MoveToFunc = int function (const(FT_Vector)*, void*);
alias FT_Outline_LineToFunc = int function (const(FT_Vector)*, void*);
alias FT_Outline_ConicToFunc = int function (const(FT_Vector)*, const(FT_Vector)*, void*);
alias FT_Outline_CubicToFunc = int function (const(FT_Vector)*, const(FT_Vector)*, const(FT_Vector)*, void*);
}
struct FT_Outline_Funcs {
FT_Outline_MoveToFunc move_to;
FT_Outline_LineToFunc line_to;
FT_Outline_ConicToFunc conic_to;
FT_Outline_CubicToFunc cubic_to;
int shift;
FT_Pos delta;
}
FT_Error FT_Init_FreeType (FT_Library*);
FT_Error FT_New_Memory_Face (FT_Library, const(FT_Byte)*, FT_Long, FT_Long, FT_Face*);
FT_UInt FT_Get_Char_Index (FT_Face, FT_ULong);
FT_Error FT_Set_Pixel_Sizes (FT_Face, FT_UInt, FT_UInt);
FT_Error FT_Load_Glyph (FT_Face, FT_UInt, FT_Int32);
FT_Error FT_Get_Advance (FT_Face, FT_UInt, FT_Int32, FT_Fixed*);
FT_Error FT_Get_Kerning (FT_Face, FT_UInt, FT_UInt, FT_UInt, FT_Vector*);
void FT_Outline_Get_CBox (const(FT_Outline)*, FT_BBox*);
FT_Error FT_Outline_Decompose (FT_Outline*, const(FT_Outline_Funcs)*, void*);
}
} else {
import iv.freetype;
}
struct FONSttFontImpl {
FT_Face font;
bool mono; // no aa?
}
__gshared FT_Library ftLibrary;
int fons__tt_init (FONSContext context) nothrow @trusted @nogc {
FT_Error ftError;
//FONS_NOTUSED(context);
ftError = FT_Init_FreeType(&ftLibrary);
return (ftError == 0);
}
void fons__tt_setMono (FONSContext context, FONSttFontImpl* font, bool v) nothrow @trusted @nogc {
font.mono = v;
}
bool fons__tt_getMono (FONSContext context, FONSttFontImpl* font) nothrow @trusted @nogc {
return font.mono;
}
int fons__tt_loadFont (FONSContext context, FONSttFontImpl* font, ubyte* data, int dataSize) nothrow @trusted @nogc {
FT_Error ftError;
//font.font.userdata = stash;
ftError = FT_New_Memory_Face(ftLibrary, cast(const(FT_Byte)*)data, dataSize, 0, &font.font);
return ftError == 0;
}
void fons__tt_getFontVMetrics (FONSttFontImpl* font, int* ascent, int* descent, int* lineGap) nothrow @trusted @nogc {
*ascent = font.font.ascender;
*descent = font.font.descender;
*lineGap = font.font.height-(*ascent - *descent);
}
float fons__tt_getPixelHeightScale (FONSttFontImpl* font, float size) nothrow @trusted @nogc {
return size/(font.font.ascender-font.font.descender);
}
int fons__tt_getGlyphIndex (FONSttFontImpl* font, int codepoint) nothrow @trusted @nogc {
return FT_Get_Char_Index(font.font, codepoint);
}
int fons__tt_buildGlyphBitmap (FONSttFontImpl* font, int glyph, float size, float scale, int* advance, int* lsb, int* x0, int* y0, int* x1, int* y1) nothrow @trusted @nogc {
FT_Error ftError;
FT_GlyphSlot ftGlyph;
//version(nanovg_ignore_mono) enum exflags = 0;
//else version(nanovg_ft_mono) enum exflags = FT_LOAD_MONOCHROME; else enum exflags = 0;
uint exflags = (font.mono ? FT_LOAD_MONOCHROME : 0);
ftError = FT_Set_Pixel_Sizes(font.font, 0, cast(FT_UInt)(size*cast(float)font.font.units_per_EM/cast(float)(font.font.ascender-font.font.descender)));
if (ftError) return 0;
ftError = FT_Load_Glyph(font.font, glyph, FT_LOAD_RENDER|/*FT_LOAD_NO_AUTOHINT|*/exflags);
if (ftError) return 0;
ftError = FT_Get_Advance(font.font, glyph, FT_LOAD_NO_SCALE|/*FT_LOAD_NO_AUTOHINT|*/exflags, cast(FT_Fixed*)advance);
if (ftError) return 0;
ftGlyph = font.font.glyph;
*lsb = cast(int)ftGlyph.metrics.horiBearingX;
*x0 = ftGlyph.bitmap_left;
*x1 = *x0+ftGlyph.bitmap.width;
*y0 = -ftGlyph.bitmap_top;
*y1 = *y0+ftGlyph.bitmap.rows;
return 1;
}
void fons__tt_renderGlyphBitmap (FONSttFontImpl* font, ubyte* output, int outWidth, int outHeight, int outStride, float scaleX, float scaleY, int glyph) nothrow @trusted @nogc {
FT_GlyphSlot ftGlyph = font.font.glyph;
//FONS_NOTUSED(glyph); // glyph has already been loaded by fons__tt_buildGlyphBitmap
//version(nanovg_ignore_mono) enum RenderAA = true;
//else version(nanovg_ft_mono) enum RenderAA = false;
//else enum RenderAA = true;
if (font.mono) {
auto src = ftGlyph.bitmap.buffer;
auto dst = output;
auto spt = ftGlyph.bitmap.pitch;
if (spt < 0) spt = -spt;
foreach (int y; 0..ftGlyph.bitmap.rows) {
ubyte count = 0, b = 0;
auto s = src;
auto d = dst;
foreach (int x; 0..ftGlyph.bitmap.width) {
if (count-- == 0) { count = 7; b = *s++; } else b <<= 1;
*d++ = (b&0x80 ? 255 : 0);
}
src += spt;
dst += outStride;
}
} else {
auto src = ftGlyph.bitmap.buffer;
auto dst = output;
auto spt = ftGlyph.bitmap.pitch;
if (spt < 0) spt = -spt;
foreach (int y; 0..ftGlyph.bitmap.rows) {
import core.stdc.string : memcpy;
//dst[0..ftGlyph.bitmap.width] = src[0..ftGlyph.bitmap.width];
memcpy(dst, src, ftGlyph.bitmap.width);
src += spt;
dst += outStride;
}
}
}
float fons__tt_getGlyphKernAdvance (FONSttFontImpl* font, float size, int glyph1, int glyph2) nothrow @trusted @nogc {
FT_Vector ftKerning;
version(none) {
// fitted kerning
FT_Get_Kerning(font.font, glyph1, glyph2, FT_KERNING_DEFAULT, &ftKerning);
//{ import core.stdc.stdio : printf; printf("kern for %u:%u: %d %d\n", glyph1, glyph2, ftKerning.x, ftKerning.y); }
return cast(int)ftKerning.x; // round up and convert to integer
} else {
// unfitted kerning
//FT_Get_Kerning(font.font, glyph1, glyph2, FT_KERNING_UNFITTED, &ftKerning);
if (glyph1 <= 0 || glyph2 <= 0 || (font.font.face_flags&FT_FACE_FLAG_KERNING) == 0) return 0;
if (FT_Set_Pixel_Sizes(font.font, 0, cast(FT_UInt)(size*cast(float)font.font.units_per_EM/cast(float)(font.font.ascender-font.font.descender)))) return 0;
if (FT_Get_Kerning(font.font, glyph1, glyph2, FT_KERNING_DEFAULT, &ftKerning)) return 0;
version(none) {
if (ftKerning.x) {
//{ import core.stdc.stdio : printf; printf("has kerning: %u\n", cast(uint)(font.font.face_flags&FT_FACE_FLAG_KERNING)); }
{ import core.stdc.stdio : printf; printf("kern for %u:%u: %d %d (size=%g)\n", glyph1, glyph2, ftKerning.x, ftKerning.y, cast(double)size); }
}
}
version(none) {
FT_Vector kk;
if (FT_Get_Kerning(font.font, glyph1, glyph2, FT_KERNING_UNSCALED, &kk)) assert(0, "wtf?!");
auto kadvfrac = FT_MulFix(kk.x, font.font.size.metrics.x_scale); // 1/64 of pixel
//return cast(int)((kadvfrac/*+(kadvfrac < 0 ? -32 : 32)*/)>>6);
//assert(ftKerning.x == kadvfrac);
if (ftKerning.x || kadvfrac) {
{ import core.stdc.stdio : printf; printf("kern for %u:%u: %d %d (%d) (size=%g)\n", glyph1, glyph2, ftKerning.x, cast(int)kadvfrac, cast(int)(kadvfrac+(kadvfrac < 0 ? -31 : 32)>>6), cast(double)size); }
}
//return cast(int)(kadvfrac+(kadvfrac < 0 ? -31 : 32)>>6); // round up and convert to integer
return kadvfrac/64.0f;
}
//return cast(int)(ftKerning.x+(ftKerning.x < 0 ? -31 : 32)>>6); // round up and convert to integer
return ftKerning.x/64.0f;
}
}
extern(C) nothrow @trusted @nogc {
static struct OutlinerData {
@disable this (this);
void opAssign() (in auto ref OutlinerData a) { static assert(0, "no copies!"); }
NVGContext vg;
NVGPathOutline.DataStore* ol;
FT_BBox outlineBBox;
nothrow @trusted @nogc:
static float transx(T) (T v) pure { pragma(inline, true); return cast(float)v; }
static float transy(T) (T v) pure { pragma(inline, true); return -cast(float)v; }
}
int fons__nvg__moveto_cb (const(FT_Vector)* to, void* user) {
auto odata = cast(OutlinerData*)user;
if (odata.vg !is null) odata.vg.moveTo(odata.transx(to.x), odata.transy(to.y));
if (odata.ol !is null) {
odata.ol.putCommand(NVGPathOutline.Command.Kind.MoveTo);
odata.ol.putArgs(odata.transx(to.x));
odata.ol.putArgs(odata.transy(to.y));
}
return 0;
}
int fons__nvg__lineto_cb (const(FT_Vector)* to, void* user) {
auto odata = cast(OutlinerData*)user;
if (odata.vg !is null) odata.vg.lineTo(odata.transx(to.x), odata.transy(to.y));
if (odata.ol !is null) {
odata.ol.putCommand(NVGPathOutline.Command.Kind.LineTo);
odata.ol.putArgs(odata.transx(to.x));
odata.ol.putArgs(odata.transy(to.y));
}
return 0;
}
int fons__nvg__quadto_cb (const(FT_Vector)* c1, const(FT_Vector)* to, void* user) {
auto odata = cast(OutlinerData*)user;
if (odata.vg !is null) odata.vg.quadTo(odata.transx(c1.x), odata.transy(c1.y), odata.transx(to.x), odata.transy(to.y));
if (odata.ol !is null) {
odata.ol.putCommand(NVGPathOutline.Command.Kind.QuadTo);
odata.ol.putArgs(odata.transx(c1.x));
odata.ol.putArgs(odata.transy(c1.y));
odata.ol.putArgs(odata.transx(to.x));
odata.ol.putArgs(odata.transy(to.y));
}
return 0;
}
int fons__nvg__cubicto_cb (const(FT_Vector)* c1, const(FT_Vector)* c2, const(FT_Vector)* to, void* user) {
auto odata = cast(OutlinerData*)user;
if (odata.vg !is null) odata.vg.bezierTo(odata.transx(c1.x), odata.transy(c1.y), odata.transx(c2.x), odata.transy(c2.y), odata.transx(to.x), odata.transy(to.y));
if (odata.ol !is null) {
odata.ol.putCommand(NVGPathOutline.Command.Kind.BezierTo);
odata.ol.putArgs(odata.transx(c1.x));
odata.ol.putArgs(odata.transy(c1.y));
odata.ol.putArgs(odata.transx(c2.x));
odata.ol.putArgs(odata.transy(c2.y));
odata.ol.putArgs(odata.transx(to.x));
odata.ol.putArgs(odata.transy(to.y));
}
return 0;
}
}
bool fons__nvg__toPath (NVGContext vg, FONSttFontImpl* font, uint glyphidx, float[] bounds=null) nothrow @trusted @nogc {
if (bounds.length > 4) bounds = bounds.ptr[0..4];
FT_Outline_Funcs funcs;
funcs.move_to = &fons__nvg__moveto_cb;
funcs.line_to = &fons__nvg__lineto_cb;
funcs.conic_to = &fons__nvg__quadto_cb;
funcs.cubic_to = &fons__nvg__cubicto_cb;
auto err = FT_Load_Glyph(font.font, glyphidx, FT_LOAD_NO_BITMAP|FT_LOAD_NO_SCALE);
if (err) { bounds[] = 0; return false; }
if (font.font.glyph.format != FT_GLYPH_FORMAT_OUTLINE) { bounds[] = 0; return false; }
FT_Outline outline = font.font.glyph.outline;
OutlinerData odata;
odata.vg = vg;
FT_Outline_Get_CBox(&outline, &odata.outlineBBox);
err = FT_Outline_Decompose(&outline, &funcs, &odata);
if (err) { bounds[] = 0; return false; }
if (bounds.length > 0) bounds.ptr[0] = odata.outlineBBox.xMin;
if (bounds.length > 1) bounds.ptr[1] = -odata.outlineBBox.yMax;
if (bounds.length > 2) bounds.ptr[2] = odata.outlineBBox.xMax;
if (bounds.length > 3) bounds.ptr[3] = -odata.outlineBBox.yMin;
return true;
}
bool fons__nvg__toOutline (FONSttFontImpl* font, uint glyphidx, NVGPathOutline.DataStore* ol) nothrow @trusted @nogc {
FT_Outline_Funcs funcs;
funcs.move_to = &fons__nvg__moveto_cb;
funcs.line_to = &fons__nvg__lineto_cb;
funcs.conic_to = &fons__nvg__quadto_cb;
funcs.cubic_to = &fons__nvg__cubicto_cb;
auto err = FT_Load_Glyph(font.font, glyphidx, FT_LOAD_NO_BITMAP|FT_LOAD_NO_SCALE);
if (err) return false;
if (font.font.glyph.format != FT_GLYPH_FORMAT_OUTLINE) return false;
FT_Outline outline = font.font.glyph.outline;
OutlinerData odata;
odata.ol = ol;
FT_Outline_Get_CBox(&outline, &odata.outlineBBox);
err = FT_Outline_Decompose(&outline, &funcs, &odata);
if (err) return false;
ol.bounds.ptr[0] = odata.outlineBBox.xMin;
ol.bounds.ptr[1] = -odata.outlineBBox.yMax;
ol.bounds.ptr[2] = odata.outlineBBox.xMax;
ol.bounds.ptr[3] = -odata.outlineBBox.yMin;
return true;
}
bool fons__nvg__bounds (FONSttFontImpl* font, uint glyphidx, float[] bounds) nothrow @trusted @nogc {
if (bounds.length > 4) bounds = bounds.ptr[0..4];
auto err = FT_Load_Glyph(font.font, glyphidx, FT_LOAD_NO_BITMAP|FT_LOAD_NO_SCALE);
if (err) return false;
if (font.font.glyph.format != FT_GLYPH_FORMAT_OUTLINE) { bounds[] = 0; return false; }
FT_Outline outline = font.font.glyph.outline;
FT_BBox outlineBBox;
FT_Outline_Get_CBox(&outline, &outlineBBox);
if (bounds.length > 0) bounds.ptr[0] = outlineBBox.xMin;
if (bounds.length > 1) bounds.ptr[1] = -outlineBBox.yMax;
if (bounds.length > 2) bounds.ptr[2] = outlineBBox.xMax;
if (bounds.length > 3) bounds.ptr[3] = -outlineBBox.yMin;
return true;
}
} else {
// ////////////////////////////////////////////////////////////////////////// //
// sorry
import std.traits : isFunctionPointer, isDelegate;
private auto assumeNoThrowNoGC(T) (scope T t) if (isFunctionPointer!T || isDelegate!T) {
import std.traits;
enum attrs = functionAttributes!T|FunctionAttribute.nogc|FunctionAttribute.nothrow_;
return cast(SetFunctionAttributes!(T, functionLinkage!T, attrs)) t;
}
private auto forceNoThrowNoGC(T) (scope T t) if (isFunctionPointer!T || isDelegate!T) {
try {
return assumeNoThrowNoGC(t)();
} catch (Exception e) {
assert(0, "OOPS!");
}
}
struct FONSttFontImpl {
stbtt_fontinfo font;
bool mono; // no aa?
}
int fons__tt_init (FONSContext context) nothrow @trusted @nogc {
return 1;
}
void fons__tt_setMono (FONSContext context, FONSttFontImpl* font, bool v) nothrow @trusted @nogc {
font.mono = v;
}
bool fons__tt_getMono (FONSContext context, FONSttFontImpl* font) nothrow @trusted @nogc {
return font.mono;
}
int fons__tt_loadFont (FONSContext context, FONSttFontImpl* font, ubyte* data, int dataSize) nothrow @trusted @nogc {
int stbError;
font.font.userdata = context;
forceNoThrowNoGC({ stbError = stbtt_InitFont(&font.font, data, 0); });
return stbError;
}
void fons__tt_getFontVMetrics (FONSttFontImpl* font, int* ascent, int* descent, int* lineGap) nothrow @trusted @nogc {
forceNoThrowNoGC({ stbtt_GetFontVMetrics(&font.font, ascent, descent, lineGap); });
}
float fons__tt_getPixelHeightScale (FONSttFontImpl* font, float size) nothrow @trusted @nogc {
float res = void;
forceNoThrowNoGC({ res = stbtt_ScaleForPixelHeight(&font.font, size); });
return res;
}
int fons__tt_getGlyphIndex (FONSttFontImpl* font, int codepoint) nothrow @trusted @nogc {
int res;
forceNoThrowNoGC({ res = stbtt_FindGlyphIndex(&font.font, codepoint); });
return res;
}
int fons__tt_buildGlyphBitmap (FONSttFontImpl* font, int glyph, float size, float scale, int* advance, int* lsb, int* x0, int* y0, int* x1, int* y1) nothrow @trusted @nogc {
forceNoThrowNoGC({ stbtt_GetGlyphHMetrics(&font.font, glyph, advance, lsb); });
forceNoThrowNoGC({ stbtt_GetGlyphBitmapBox(&font.font, glyph, scale, scale, x0, y0, x1, y1); });
return 1;
}
void fons__tt_renderGlyphBitmap (FONSttFontImpl* font, ubyte* output, int outWidth, int outHeight, int outStride, float scaleX, float scaleY, int glyph) nothrow @trusted @nogc {
forceNoThrowNoGC({ stbtt_MakeGlyphBitmap(&font.font, output, outWidth, outHeight, outStride, scaleX, scaleY, glyph); });
}
float fons__tt_getGlyphKernAdvance (FONSttFontImpl* font, float size, int glyph1, int glyph2) nothrow @trusted @nogc {
// FUnits -> pixels: pointSize * resolution / (72 points per inch * units_per_em)
// https://developer.apple.com/fonts/TrueType-Reference-Manual/RM02/Chap2.html#converting
float res = void;
forceNoThrowNoGC({
res = stbtt_GetGlyphKernAdvance(&font.font, glyph1, glyph2);
res *= stbtt_ScaleForPixelHeight(&font.font, size);
});
/*
if (res != 0) {
{ import core.stdc.stdio; printf("fres=%g; size=%g; %g (%g); rv=%g\n", res, size, res*stbtt_ScaleForMappingEmToPixels(&font.font, size), stbtt_ScaleForPixelHeight(&font.font, size*100), res*stbtt_ScaleForPixelHeight(&font.font, size*100)); }
}
*/
//k8: dunno if this is right; i guess it isn't but...
return res;
}
// old arsd.ttf sux! ;-)
static if (is(typeof(STBTT_vcubic))) {
static struct OutlinerData {
@disable this (this);
void opAssign() (in auto ref OutlinerData a) { static assert(0, "no copies!"); }
NVGPathOutline.DataStore* ol;
nothrow @trusted @nogc:
static float transx(T) (T v) pure { pragma(inline, true); return cast(float)v; }
static float transy(T) (T v) pure { pragma(inline, true); return -cast(float)v; }
}
bool fons__nvg__toPath (NVGContext vg, FONSttFontImpl* font, uint glyphidx, float[] bounds=null) nothrow @trusted @nogc {
if (bounds.length > 4) bounds = bounds.ptr[0..4];
bool okflag = false;
forceNoThrowNoGC({
int x0, y0, x1, y1;
if (!stbtt_GetGlyphBox(&font.font, glyphidx, &x0, &y0, &x1, &y1)) {
bounds[] = 0;
return;
}
if (bounds.length > 0) bounds.ptr[0] = x0;
if (bounds.length > 1) bounds.ptr[1] = -y1;
if (bounds.length > 2) bounds.ptr[2] = x1;
if (bounds.length > 3) bounds.ptr[3] = -y0;
static float transy(T) (T v) pure { pragma(inline, true); return -cast(float)v; }
stbtt_vertex* verts = null;
scope(exit) { import core.stdc.stdlib : free; if (verts !is null) free(verts); }
int vcount = stbtt_GetGlyphShape(&font.font, glyphidx, &verts);
if (vcount < 1) return;
foreach (const ref vt; verts[0..vcount]) {
switch (vt.type) {
case STBTT_vmove: vg.moveTo(vt.x, transy(vt.y)); break;
case STBTT_vline: vg.lineTo(vt.x, transy(vt.y)); break;
case STBTT_vcurve: vg.quadTo(vt.x, transy(vt.y), vt.cx, transy(vt.cy)); break;
case STBTT_vcubic: vg.bezierTo(vt.x, transy(vt.y), vt.cx, transy(vt.cy), vt.cx1, transy(vt.cy1)); break;
default:
}
}
okflag = true;
});
return okflag;
}
bool fons__nvg__toOutline (FONSttFontImpl* font, uint glyphidx, NVGPathOutline.DataStore* ol) nothrow @trusted @nogc {
bool okflag = false;
forceNoThrowNoGC({
int x0, y0, x1, y1;
if (!stbtt_GetGlyphBox(&font.font, glyphidx, &x0, &y0, &x1, &y1)) {
ol.bounds[] = 0;
return;
}
ol.bounds.ptr[0] = x0;
ol.bounds.ptr[1] = -y1;
ol.bounds.ptr[2] = x1;
ol.bounds.ptr[3] = -y0;
stbtt_vertex* verts = null;
scope(exit) { import core.stdc.stdlib : free; if (verts !is null) free(verts); }
int vcount = stbtt_GetGlyphShape(&font.font, glyphidx, &verts);
if (vcount < 1) return;
OutlinerData odata;
odata.ol = ol;
foreach (const ref vt; verts[0..vcount]) {
switch (vt.type) {
case STBTT_vmove:
odata.ol.putCommand(NVGPathOutline.Command.Kind.MoveTo);
odata.ol.putArgs(odata.transx(vt.x));
odata.ol.putArgs(odata.transy(vt.y));
break;
case STBTT_vline:
odata.ol.putCommand(NVGPathOutline.Command.Kind.LineTo);
odata.ol.putArgs(odata.transx(vt.x));
odata.ol.putArgs(odata.transy(vt.y));
break;
case STBTT_vcurve:
odata.ol.putCommand(NVGPathOutline.Command.Kind.QuadTo);
odata.ol.putArgs(odata.transx(vt.x));
odata.ol.putArgs(odata.transy(vt.y));
odata.ol.putArgs(odata.transx(vt.cx));
odata.ol.putArgs(odata.transy(vt.cy));
break;
case STBTT_vcubic:
odata.ol.putCommand(NVGPathOutline.Command.Kind.BezierTo);
odata.ol.putArgs(odata.transx(vt.x));
odata.ol.putArgs(odata.transy(vt.y));
odata.ol.putArgs(odata.transx(vt.cx));
odata.ol.putArgs(odata.transy(vt.cy));
odata.ol.putArgs(odata.transx(vt.cx1));
odata.ol.putArgs(odata.transy(vt.cy1));
break;
default:
}
}
okflag = true;
});
return okflag;
}
bool fons__nvg__bounds (FONSttFontImpl* font, uint glyphidx, float[] bounds) nothrow @trusted @nogc {
if (bounds.length > 4) bounds = bounds.ptr[0..4];
bool okflag = false;
forceNoThrowNoGC({
int x0, y0, x1, y1;
if (stbtt_GetGlyphBox(&font.font, glyphidx, &x0, &y0, &x1, &y1)) {
if (bounds.length > 0) bounds.ptr[0] = x0;
if (bounds.length > 1) bounds.ptr[1] = -y1;
if (bounds.length > 2) bounds.ptr[2] = x1;
if (bounds.length > 3) bounds.ptr[3] = -y0;
okflag = true;
} else {
bounds[] = 0;
}
});
return okflag;
}
} // check for old stb_ttf
} // version
// ////////////////////////////////////////////////////////////////////////// //
private:
enum FONS_SCRATCH_BUF_SIZE = 64000;
enum FONS_HASH_LUT_SIZE = 256;
enum FONS_INIT_FONTS = 4;
enum FONS_INIT_GLYPHS = 256;
enum FONS_INIT_ATLAS_NODES = 256;
enum FONS_VERTEX_COUNT = 1024;
enum FONS_MAX_STATES = 20;
enum FONS_MAX_FALLBACKS = 20;
struct FONSglyph {
uint codepoint;
int index;
int next;
short size, blur;
short x0, y0, x1, y1;
short xadv, xoff, yoff;
}
// refcounted
struct FONSfontData {
ubyte* data;
int dataSize;
bool freeData;
int rc;
@disable this (this); // no copies
void opAssign() (in auto ref FONSfontData a) { static assert(0, "no copies!"); }
}
// won't set rc to 1
FONSfontData* fons__createFontData (ubyte* adata, int asize, bool afree) nothrow @trusted @nogc {
import core.stdc.stdlib : malloc;
assert(adata !is null);
assert(asize > 0);
auto res = cast(FONSfontData*)malloc(FONSfontData.sizeof);
if (res is null) assert(0, "FONS: out of memory");
res.data = adata;
res.dataSize = asize;
res.freeData = afree;
res.rc = 0;
return res;
}
void incref (FONSfontData* fd) pure nothrow @trusted @nogc {
pragma(inline, true);
if (fd !is null) ++fd.rc;
}
void decref (ref FONSfontData* fd) nothrow @trusted @nogc {
if (fd !is null) {
if (--fd.rc == 0) {
import core.stdc.stdlib : free;
if (fd.freeData && fd.data !is null) {
free(fd.data);
fd.data = null;
}
free(fd);
fd = null;
}
}
}
// as creating and destroying fonts is a rare operation, malloc some data
struct FONSfont {
FONSttFontImpl font;
char* name; // malloced, strz, always lowercase
uint namelen;
uint namehash;
char* path; // malloced, strz
FONSfontData* fdata;
float ascender;
float descender;
float lineh;
FONSglyph* glyphs;
int cglyphs;
int nglyphs;
int[FONS_HASH_LUT_SIZE] lut;
int[FONS_MAX_FALLBACKS] fallbacks;
int nfallbacks;
@disable this (this);
void opAssign() (in auto ref FONSfont a) { static assert(0, "no copies"); }
static uint djbhash (const(void)[] s) pure nothrow @safe @nogc {
uint hash = 5381;
foreach (ubyte b; cast(const(ubyte)[])s) {
if (b >= 'A' && b <= 'Z') b += 32; // poor man's tolower
hash = ((hash<<5)+hash)+b;
}
return hash;
}
// except glyphs
void freeMemory () nothrow @trusted @nogc {
import core.stdc.stdlib : free;
if (name !is null) { free(name); name = null; }
namelen = namehash = 0;
if (path !is null) { free(path); path = null; }
fdata.decref();
}
// this also calcs name hash
void setName (const(char)[] aname) nothrow @trusted @nogc {
//{ import core.stdc.stdio; printf("setname: [%.*s]\n", cast(uint)aname.length, aname.ptr); }
import core.stdc.stdlib : realloc;
if (aname.length > int.max/32) assert(0, "FONS: invalid font name");
namelen = cast(uint)aname.length;
name = cast(char*)realloc(name, namelen+1);
if (name is null) assert(0, "FONS: out of memory");
if (aname.length) name[0..aname.length] = aname[];
name[namelen] = 0;
// lowercase it
foreach (ref char ch; name[0..namelen]) if (ch >= 'A' && ch <= 'Z') ch += 32; // poor man's tolower
namehash = djbhash(name[0..namelen]);
//{ import core.stdc.stdio; printf(" [%s] [%.*s] [0x%08x]\n", name, namelen, name, namehash); }
}
void setPath (const(char)[] apath) nothrow @trusted @nogc {
import core.stdc.stdlib : realloc;
if (apath.length > int.max/32) assert(0, "FONS: invalid font path");
path = cast(char*)realloc(path, apath.length+1);
if (path is null) assert(0, "FONS: out of memory");
if (apath.length) path[0..apath.length] = apath[];
path[apath.length] = 0;
}
// this won't check hash
bool nameEqu (const(char)[] aname) const pure nothrow @trusted @nogc {
//{ import core.stdc.stdio; printf("nameEqu: aname=[%.*s]; namelen=%u; aslen=%u\n", cast(uint)aname.length, aname.ptr, namelen, cast(uint)aname.length); }
if (namelen != aname.length) return false;
const(char)* ns = name;
// name part
foreach (char ch; aname) {
if (ch >= 'A' && ch <= 'Z') ch += 32; // poor man's tolower
if (ch != *ns++) return false;
}
// done (length was checked earlier)
return true;
}
void clear () nothrow @trusted @nogc {
import core.stdc.stdlib : free;
import core.stdc.string : memset;
if (glyphs !is null) free(glyphs);
freeMemory();
memset(&this, 0, this.sizeof);
}
FONSglyph* allocGlyph () nothrow @trusted @nogc {
if (nglyphs+1 > cglyphs) {
import core.stdc.stdlib : realloc;
cglyphs = (cglyphs == 0 ? 8 : cglyphs*2);
glyphs = cast(FONSglyph*)realloc(glyphs, FONSglyph.sizeof*cglyphs);
if (glyphs is null) assert(0, "FontStash: out of memory");
}
++nglyphs;
return &glyphs[nglyphs-1];
}
}
void kill (ref FONSfont* font) nothrow @trusted @nogc {
if (font !is null) {
import core.stdc.stdlib : free;
font.clear();
free(font);
font = null;
}
}
// ////////////////////////////////////////////////////////////////////////// //
struct FONSstate {
int font;
NVGTextAlign talign;
float size = 0;
float blur = 0;
float spacing = 0;
}
// ////////////////////////////////////////////////////////////////////////// //
// atlas based on Skyline Bin Packer by Jukka Jylänki
alias FONSAtlas = FONSatlasInternal*;
struct FONSatlasInternal {
static struct Node {
short x, y, width;
}
int width, height;
Node* nodes;
int nnodes;
int cnodes;
@disable this (this);
void opAssign() (in auto ref FONSatlasInternal a) { static assert(0, "no copies"); }
nothrow @trusted @nogc:
static FONSAtlas create (int w, int h, int nnodes) {
import core.stdc.stdlib : malloc;
import core.stdc.string : memset;
FONSAtlas atlas = cast(FONSAtlas)malloc(FONSatlasInternal.sizeof);
if (atlas is null) assert(0, "FontStash: out of memory");
memset(atlas, 0, FONSatlasInternal.sizeof);
atlas.width = w;
atlas.height = h;
// allocate space for skyline nodes
atlas.nodes = cast(Node*)malloc(Node.sizeof*nnodes);
if (atlas.nodes is null) assert(0, "FontStash: out of memory");
memset(atlas.nodes, 0, Node.sizeof*nnodes);
atlas.nnodes = 0;
atlas.cnodes = nnodes;
// init root node
atlas.nodes[0].x = 0;
atlas.nodes[0].y = 0;
atlas.nodes[0].width = cast(short)w;
++atlas.nnodes;
return atlas;
}
void clear () {
import core.stdc.stdlib : free;
import core.stdc.string : memset;
if (nodes !is null) free(nodes);
memset(&this, 0, this.sizeof);
}
void insertNode (int idx, int x, int y, int w) {
if (nnodes+1 > cnodes) {
import core.stdc.stdlib : realloc;
cnodes = (cnodes == 0 ? 8 : cnodes*2);
nodes = cast(Node*)realloc(nodes, Node.sizeof*cnodes);
if (nodes is null) assert(0, "FontStash: out of memory");
}
for (int i = nnodes; i > idx; --i) nodes[i] = nodes[i-1];
nodes[idx].x = cast(short)x;
nodes[idx].y = cast(short)y;
nodes[idx].width = cast(short)w;
++nnodes;
}
void removeNode (int idx) {
if (nnodes == 0) return;
foreach (immutable int i; idx+1..nnodes) nodes[i-1] = nodes[i];
--nnodes;
}
// insert node for empty space
void expand (int w, int h) {
if (w > width) insertNode(nnodes, width, 0, w-width);
width = w;
height = h;
}
void reset (int w, int h) {
width = w;
height = h;
nnodes = 0;
// init root node
nodes[0].x = 0;
nodes[0].y = 0;
nodes[0].width = cast(short)w;
++nnodes;
}
void addSkylineLevel (int idx, int x, int y, int w, int h) {
insertNode(idx, x, y+h, w);
// delete skyline segments that fall under the shadow of the new segment
for (int i = idx+1; i < nnodes; ++i) {
if (nodes[i].x < nodes[i-1].x+nodes[i-1].width) {
int shrink = nodes[i-1].x+nodes[i-1].width-nodes[i].x;
nodes[i].x += cast(short)shrink;
nodes[i].width -= cast(short)shrink;
if (nodes[i].width <= 0) {
removeNode(i);
--i;
} else {
break;
}
} else {
break;
}
}
// Merge same height skyline segments that are next to each other
for (int i = 0; i < nnodes-1; ++i) {
if (nodes[i].y == nodes[i+1].y) {
nodes[i].width += nodes[i+1].width;
removeNode(i+1);
--i;
}
}
}
// checks if there is enough space at the location of skyline span 'i',
// and return the max height of all skyline spans under that at that location,
// (think tetris block being dropped at that position); or -1 if no space found
int rectFits (int i, int w, int h) {
int x = nodes[i].x;
int y = nodes[i].y;
if (x+w > width) return -1;
int spaceLeft = w;
while (spaceLeft > 0) {
if (i == nnodes) return -1;
y = nvg__max(y, nodes[i].y);
if (y+h > height) return -1;
spaceLeft -= nodes[i].width;
++i;
}
return y;
}
bool addRect (int rw, int rh, int* rx, int* ry) {
int besth = height, bestw = width, besti = -1;
int bestx = -1, besty = -1;
// Bottom left fit heuristic.
for (int i = 0; i < nnodes; ++i) {
int y = rectFits(i, rw, rh);
if (y != -1) {
if (y+rh < besth || (y+rh == besth && nodes[i].width < bestw)) {
besti = i;
bestw = nodes[i].width;
besth = y+rh;
bestx = nodes[i].x;
besty = y;
}
}
}
if (besti == -1) return false;
// perform the actual packing
addSkylineLevel(besti, bestx, besty, rw, rh);
*rx = bestx;
*ry = besty;
return true;
}
}
void kill (ref FONSAtlas atlas) nothrow @trusted @nogc {
if (atlas !is null) {
import core.stdc.stdlib : free;
atlas.clear();
free(atlas);
atlas = null;
}
}
// ////////////////////////////////////////////////////////////////////////// //
/// FontStash context (internal definition). Don't use it derectly, it was made public only to generate documentation.
/// Group: font_stash
public struct FONScontextInternal {
private:
FONSParams params;
float itw, ith;
ubyte* texData;
int[4] dirtyRect;
FONSfont** fonts; // actually, a simple hash table; can't grow yet
int cfonts; // allocated
int nfonts; // used (so we can track hash table stats)
int* hashidx; // [hsize] items; holds indicies in [fonts] array
int hused, hsize;// used items and total items in [hashidx]
FONSAtlas atlas;
ubyte* scratch;
int nscratch;
FONSstate[FONS_MAX_STATES] states;
int nstates;
void delegate (FONSError error, int val) nothrow @trusted @nogc handleError;
@disable this (this);
void opAssign() (in auto ref FONScontextInternal ctx) { static assert(0, "FONS copying is not allowed"); }
private:
static bool strequci (const(char)[] s0, const(char)[] s1) pure nothrow @trusted @nogc {
if (s0.length != s1.length) return false;
const(char)* sp0 = s0.ptr;
const(char)* sp1 = s1.ptr;
foreach (immutable _; 0..s0.length) {
char c0 = *sp0++;
char c1 = *sp1++;
if (c0 != c1) {
if (c0 >= 'A' && c0 <= 'Z') c0 += 32; // poor man tolower
if (c1 >= 'A' && c1 <= 'Z') c1 += 32; // poor man tolower
if (c0 != c1) return false;
}
}
return true;
}
inout(FONSstate)* getState () inout pure nothrow @trusted @nogc {
pragma(inline, true);
return cast(inout)(&states[(nstates > 0 ? nstates-1 : 0)]);
}
// simple linear probing; returns [FONS_INVALID] if not found
int findNameInHash (const(char)[] name) const pure nothrow @trusted @nogc {
if (nfonts == 0) return FONS_INVALID;
auto nhash = FONSfont.djbhash(name);
//{ import core.stdc.stdio; printf("findinhash: name=[%.*s]; nhash=0x%08x\n", cast(uint)name.length, name.ptr, nhash); }
auto res = nhash%hsize;
// hash will never be 100% full, so this loop is safe
for (;;) {
int idx = hashidx[res];
if (idx == -1) break;
auto font = fonts[idx];
if (font is null) assert(0, "FONS internal error");
if (font.namehash == nhash && font.nameEqu(name)) return idx;
//{ import core.stdc.stdio; printf("findinhash chained: name=[%.*s]; nhash=0x%08x\n", cast(uint)name.length, name.ptr, nhash); }
res = (res+1)%hsize;
}
return FONS_INVALID;
}
// should be called $(B before) freeing `fonts[fidx]`
void removeIndexFromHash (int fidx) nothrow @trusted @nogc {
if (fidx < 0 || fidx >= nfonts) assert(0, "FONS internal error");
if (fonts[fidx] is null) assert(0, "FONS internal error");
if (hused != nfonts) assert(0, "FONS internal error");
auto nhash = fonts[fidx].namehash;
auto res = nhash%hsize;
// hash will never be 100% full, so this loop is safe
for (;;) {
int idx = hashidx[res];
if (idx == -1) assert(0, "FONS INTERNAL ERROR");
if (idx == fidx) {
// i found her! copy rest here
int nidx = (res+1)%hsize;
for (;;) {
if ((hashidx[res] = hashidx[nidx]) == -1) break; // so it will copy `-1` too
res = nidx;
nidx = (nidx+1)%hsize;
}
return;
}
res = (res+1)%hsize;
}
}
// add font with the given index to hash
// prerequisite: font should not exists in hash
void addIndexToHash (int idx) nothrow @trusted @nogc {
if (idx < 0 || idx >= nfonts) assert(0, "FONS internal error");
if (fonts[idx] is null) assert(0, "FONS internal error");
import core.stdc.stdlib : realloc;
auto nhash = fonts[idx].namehash;
//{ import core.stdc.stdio; printf("addtohash: name=[%.*s]; nhash=0x%08x\n", cast(uint)name.length, name.ptr, nhash); }
// allocate new hash table if there was none
if (hsize == 0) {
enum InitSize = 256;
auto newlist = cast(int*)realloc(null, InitSize*hashidx[0].sizeof);
if (newlist is null) assert(0, "FONS: out of memory");
newlist[0..InitSize] = -1;
hsize = InitSize;
hused = 0;
hashidx = newlist;
}
int res = cast(int)(nhash%hsize);
// need to rehash? we want our hash table 50% full at max
if (hashidx[res] != -1 && hused >= hsize/2) {
uint nsz = hsize*2;
if (nsz > 1024*1024) assert(0, "FONS: out of memory for fonts");
auto newlist = cast(int*)realloc(fonts, nsz*hashidx[0].sizeof);
if (newlist is null) assert(0, "FONS: out of memory");
newlist[0..nsz] = -1;
hused = 0;
// rehash
foreach (immutable fidx, FONSfont* ff; fonts[0..nfonts]) {
if (ff is null) continue;
// find slot for this font (guaranteed to have one)
uint newslot = ff.namehash%nsz;
while (newlist[newslot] != -1) newslot = (newslot+1)%nsz;
newlist[newslot] = cast(int)fidx;
++hused;
}
hsize = nsz;
hashidx = newlist;
// we added everything, including [idx], so nothing more to do here
} else {
// find slot (guaranteed to have one)
while (hashidx[res] != -1) res = (res+1)%hsize;
// i found her!
hashidx[res] = idx;
++hused;
}
}
void addWhiteRect (int w, int h) nothrow @trusted @nogc {
int gx, gy;
ubyte* dst;
if (!atlas.addRect(w, h, &gx, &gy)) return;
// Rasterize
dst = &texData[gx+gy*params.width];
foreach (int y; 0..h) {
foreach (int x; 0..w) {
dst[x] = 0xff;
}
dst += params.width;
}
dirtyRect.ptr[0] = nvg__min(dirtyRect.ptr[0], gx);
dirtyRect.ptr[1] = nvg__min(dirtyRect.ptr[1], gy);
dirtyRect.ptr[2] = nvg__max(dirtyRect.ptr[2], gx+w);
dirtyRect.ptr[3] = nvg__max(dirtyRect.ptr[3], gy+h);
}
// returns fid, not hash slot
int allocFontAt (int atidx) nothrow @trusted @nogc {
if (atidx >= 0 && atidx >= nfonts) assert(0, "internal NanoVega fontstash error");
if (atidx < 0) {
if (nfonts >= cfonts) {
import core.stdc.stdlib : realloc;
import core.stdc.string : memset;
assert(nfonts == cfonts);
int newsz = cfonts+64;
if (newsz > 65535) assert(0, "FONS: too many fonts");
auto newlist = cast(FONSfont**)realloc(fonts, newsz*(FONSfont*).sizeof);
if (newlist is null) assert(0, "FONS: out of memory");
memset(newlist+cfonts, 0, (newsz-cfonts)*(FONSfont*).sizeof);
fonts = newlist;
cfonts = newsz;
}
assert(nfonts < cfonts);
}
FONSfont* font = cast(FONSfont*)malloc(FONSfont.sizeof);
if (font is null) assert(0, "FONS: out of memory");
memset(font, 0, FONSfont.sizeof);
font.glyphs = cast(FONSglyph*)malloc(FONSglyph.sizeof*FONS_INIT_GLYPHS);
if (font.glyphs is null) assert(0, "FONS: out of memory");
font.cglyphs = FONS_INIT_GLYPHS;
font.nglyphs = 0;
if (atidx < 0) {
fonts[nfonts] = font;
return nfonts++;
} else {
fonts[atidx] = font;
return atidx;
}
}
// 0: ooops
int findGlyphForCP (FONSfont *font, dchar dch, FONSfont** renderfont) nothrow @trusted @nogc {
if (renderfont !is null) *renderfont = font;
if (font is null || font.fdata is null) return 0;
auto g = fons__tt_getGlyphIndex(&font.font, cast(uint)dch);
// try to find the glyph in fallback fonts
if (g == 0) {
foreach (immutable i; 0..font.nfallbacks) {
FONSfont* fallbackFont = fonts[font.fallbacks.ptr[i]];
if (fallbackFont !is null) {
int fallbackIndex = fons__tt_getGlyphIndex(&fallbackFont.font, cast(uint)dch);
if (fallbackIndex != 0) {
if (renderfont !is null) *renderfont = fallbackFont;
return g;
}
}
}
// no char, try to find replacement one
if (dch != 0xFFFD) {
g = fons__tt_getGlyphIndex(&font.font, 0xFFFD);
if (g == 0) {
foreach (immutable i; 0..font.nfallbacks) {
FONSfont* fallbackFont = fonts[font.fallbacks.ptr[i]];
if (fallbackFont !is null) {
int fallbackIndex = fons__tt_getGlyphIndex(&fallbackFont.font, 0xFFFD);
if (fallbackIndex != 0) {
if (renderfont !is null) *renderfont = fallbackFont;
return g;
}
}
}
}
}
}
return g;
}
void clear () nothrow @trusted @nogc {
import core.stdc.stdlib : free;
if (params.renderDelete !is null) params.renderDelete(params.userPtr);
foreach (immutable int i; 0..nfonts) fonts[i].kill();
if (atlas !is null) atlas.kill();
if (fonts !is null) free(fonts);
if (texData !is null) free(texData);
if (scratch !is null) free(scratch);
if (hashidx !is null) free(hashidx);
}
// add font from another fontstash
int addCookedFont (FONSfont* font) nothrow @trusted @nogc {
if (font is null || font.fdata is null) return FONS_INVALID;
font.fdata.incref();
auto res = addFontWithData(font.name[0..font.namelen], font.fdata, !font.font.mono);
if (res == FONS_INVALID) font.fdata.decref(); // oops
return res;
}
// fdata refcount must be already increased; it won't be changed
int addFontWithData (const(char)[] name, FONSfontData* fdata, bool defAA) nothrow @trusted @nogc {
int i, ascent, descent, fh, lineGap;
if (name.length == 0 || strequci(name, NoAlias)) return FONS_INVALID;
if (name.length > 32767) return FONS_INVALID;
if (fdata is null) return FONS_INVALID;
// find a font with the given name
int newidx;
FONSfont* oldfont = null;
int oldidx = findNameInHash(name);
if (oldidx != FONS_INVALID) {
// replacement font
oldfont = fonts[oldidx];
newidx = oldidx;
} else {
// new font, allocate new bucket
newidx = -1;
}
newidx = allocFontAt(newidx);
FONSfont* font = fonts[newidx];
font.setName(name);
font.lut.ptr[0..FONS_HASH_LUT_SIZE] = -1; // init hash lookup
font.fdata = fdata; // set the font data (don't change reference count)
fons__tt_setMono(&this, &font.font, !defAA);
// init font
nscratch = 0;
if (!fons__tt_loadFont(&this, &font.font, fdata.data, fdata.dataSize)) {
// we promised to not free data on error, so just clear the data store (it will be freed by the caller)
font.fdata = null;
font.kill();
if (oldidx != FONS_INVALID) {
assert(oldidx == newidx);
fonts[oldidx] = oldfont;
} else {
assert(newidx == nfonts-1);
fonts[newidx] = null;
--nfonts;
}
return FONS_INVALID;
} else {
// free old font data, if any
if (oldfont !is null) oldfont.kill();
}
// add font to name hash
if (oldidx == FONS_INVALID) addIndexToHash(newidx);
// store normalized line height
// the real line height is got by multiplying the lineh by font size
fons__tt_getFontVMetrics(&font.font, &ascent, &descent, &lineGap);
fh = ascent-descent;
font.ascender = cast(float)ascent/cast(float)fh;
font.descender = cast(float)descent/cast(float)fh;
font.lineh = cast(float)(fh+lineGap)/cast(float)fh;
//{ import core.stdc.stdio; printf("created font [%.*s] (idx=%d)...\n", cast(uint)name.length, name.ptr, idx); }
return newidx;
}
// isize: size*10
float getVertAlign (FONSfont* font, NVGTextAlign talign, short isize) pure nothrow @trusted @nogc {
if (params.isZeroTopLeft) {
final switch (talign.vertical) {
case NVGTextAlign.V.Top: return font.ascender*cast(float)isize/10.0f;
case NVGTextAlign.V.Middle: return (font.ascender+font.descender)/2.0f*cast(float)isize/10.0f;
case NVGTextAlign.V.Baseline: return 0.0f;
case NVGTextAlign.V.Bottom: return font.descender*cast(float)isize/10.0f;
}
} else {
final switch (talign.vertical) {
case NVGTextAlign.V.Top: return -font.ascender*cast(float)isize/10.0f;
case NVGTextAlign.V.Middle: return -(font.ascender+font.descender)/2.0f*cast(float)isize/10.0f;
case NVGTextAlign.V.Baseline: return 0.0f;
case NVGTextAlign.V.Bottom: return -font.descender*cast(float)isize/10.0f;
}
}
assert(0);
}
public:
/** Create new FontStash context. It can be destroyed with `fs.kill()` later.
*
* Note that if you don't plan to rasterize glyphs (i.e. you will use created
* FontStash only to measure text), you can simply pass `FONSParams.init`).
*/
static FONSContext create() (in auto ref FONSParams params) nothrow @trusted @nogc {
import core.stdc.string : memcpy;
FONSContext stash = null;
// allocate memory for the font stash
stash = cast(FONSContext)malloc(FONScontextInternal.sizeof);
if (stash is null) goto error;
memset(stash, 0, FONScontextInternal.sizeof);
memcpy(&stash.params, ¶ms, params.sizeof);
if (stash.params.width < 1) stash.params.width = 32;
if (stash.params.height < 1) stash.params.height = 32;
// allocate scratch buffer
stash.scratch = cast(ubyte*)malloc(FONS_SCRATCH_BUF_SIZE);
if (stash.scratch is null) goto error;
// initialize implementation library
if (!fons__tt_init(stash)) goto error;
if (stash.params.renderCreate !is null) {
if (!stash.params.renderCreate(stash.params.userPtr, stash.params.width, stash.params.height)) goto error;
}
stash.atlas = FONSAtlas.create(stash.params.width, stash.params.height, FONS_INIT_ATLAS_NODES);
if (stash.atlas is null) goto error;
// don't allocate space for fonts: hash manager will do that for us later
//stash.cfonts = 0;
//stash.nfonts = 0;
// create texture for the cache
stash.itw = 1.0f/stash.params.width;
stash.ith = 1.0f/stash.params.height;
stash.texData = cast(ubyte*)malloc(stash.params.width*stash.params.height);
if (stash.texData is null) goto error;
memset(stash.texData, 0, stash.params.width*stash.params.height);
stash.dirtyRect.ptr[0] = stash.params.width;
stash.dirtyRect.ptr[1] = stash.params.height;
stash.dirtyRect.ptr[2] = 0;
stash.dirtyRect.ptr[3] = 0;
// add white rect at 0, 0 for debug drawing
stash.addWhiteRect(2, 2);
stash.pushState();
stash.clearState();
return stash;
error:
stash.kill();
return null;
}
public:
/// Add fallback font (FontStash will try to find missing glyph in all fallback fonts before giving up).
bool addFallbackFont (int base, int fallback) nothrow @trusted @nogc {
FONSfont* baseFont = fonts[base];
if (baseFont !is null && baseFont.nfallbacks < FONS_MAX_FALLBACKS) {
baseFont.fallbacks.ptr[baseFont.nfallbacks++] = fallback;
return true;
}
return false;
}
@property void size (float size) nothrow @trusted @nogc { pragma(inline, true); getState.size = size; } /// Set current font size.
@property float size () const pure nothrow @trusted @nogc { pragma(inline, true); return getState.size; } /// Get current font size.
@property void spacing (float spacing) nothrow @trusted @nogc { pragma(inline, true); getState.spacing = spacing; } /// Set current letter spacing.
@property float spacing () const pure nothrow @trusted @nogc { pragma(inline, true); return getState.spacing; } /// Get current letter spacing.
@property void blur (float blur) nothrow @trusted @nogc { pragma(inline, true); getState.blur = blur; } /// Set current letter blur.
@property float blur () const pure nothrow @trusted @nogc { pragma(inline, true); return getState.blur; } /// Get current letter blur.
@property void textAlign (NVGTextAlign talign) nothrow @trusted @nogc { pragma(inline, true); getState.talign = talign; } /// Set current text align.
@property NVGTextAlign textAlign () const pure nothrow @trusted @nogc { pragma(inline, true); return getState.talign; } /// Get current text align.
@property void fontId (int font) nothrow @trusted @nogc { pragma(inline, true); getState.font = font; } /// Set current font id.
@property int fontId () const pure nothrow @trusted @nogc { pragma(inline, true); return getState.font; } /// Get current font id.
@property void fontId (const(char)[] name) nothrow @trusted @nogc { pragma(inline, true); getState.font = getFontByName(name); } /// Set current font using its name.
/// Check if FontStash has a font with the given name loaded.
bool hasFont (const(char)[] name) const pure nothrow @trusted @nogc { pragma(inline, true); return (getFontByName(name) >= 0); }
/// Get AA for the current font, or for the specified font.
bool getFontAA (int font=-1) nothrow @trusted @nogc {
FONSstate* state = getState;
if (font < 0) font = state.font;
if (font < 0 || font >= nfonts) return false;
FONSfont* f = fonts[font];
return (f !is null ? !f.font.mono : false);
}
/// Push current state. Returns `false` if state stack overflowed.
bool pushState () nothrow @trusted @nogc {
if (nstates >= FONS_MAX_STATES) {
if (handleError !is null) handleError(FONSError.StatesOverflow, 0);
return false;
}
if (nstates > 0) {
import core.stdc.string : memcpy;
memcpy(&states[nstates], &states[nstates-1], FONSstate.sizeof);
}
++nstates;
return true;
}
/// Pop current state. Returns `false` if state stack underflowed.
bool popState () nothrow @trusted @nogc {
if (nstates <= 1) {
if (handleError !is null) handleError(FONSError.StatesUnderflow, 0);
return false;
}
--nstates;
return true;
}
/// Clear current state (i.e. set it to some sane defaults).
void clearState () nothrow @trusted @nogc {
FONSstate* state = getState;
state.size = 12.0f;
state.font = 0;
state.blur = 0;
state.spacing = 0;
state.talign.reset;
}
private enum NoAlias = ":noaa";
/** Add font to FontStash.
*
* Load scalable font from disk, and add it to FontStash. If you will try to load a font
* with same name and path several times, FontStash will load it only once. Also, you can
* load new disk font for any existing logical font.
*
* Params:
* name = logical font name, that will be used to select this font later.
* path = path to disk file with your font.
* defAA = should FontStash use antialiased font rasterizer?
*
* Returns:
* font id or [FONS_INVALID].
*/
int addFont (const(char)[] name, const(char)[] path, bool defAA=false) nothrow @trusted {
if (path.length == 0 || name.length == 0 || strequci(name, NoAlias)) return FONS_INVALID;
if (path.length > 32768) return FONS_INVALID; // arbitrary limit
// if font path ends with ":noaa", turn off antialiasing
if (path.length >= NoAlias.length && strequci(path[$-NoAlias.length..$], NoAlias)) {
path = path[0..$-NoAlias.length];
if (path.length == 0) return FONS_INVALID;
defAA = false;
}
// if font name ends with ":noaa", turn off antialiasing
if (name.length > NoAlias.length && strequci(name[$-NoAlias.length..$], NoAlias)) {
name = name[0..$-NoAlias.length];
defAA = false;
}
// find a font with the given name
int fidx = findNameInHash(name);
//{ import core.stdc.stdio; printf("loading font '%.*s' [%s] (fidx=%d)...\n", cast(uint)path.length, path.ptr, fontnamebuf.ptr, fidx); }
int loadFontFile (const(char)[] path) {
// check if existing font (if any) has the same path
if (fidx >= 0) {
import core.stdc.string : strlen;
auto plen = (fonts[fidx].path !is null ? strlen(fonts[fidx].path) : 0);
version(Posix) {
//{ import core.stdc.stdio; printf("+++ font [%.*s] was loaded from [%.*s]\n", cast(uint)blen, fontnamebuf.ptr, cast(uint)fonts[fidx].path.length, fonts[fidx].path.ptr); }
if (plen == path.length && fonts[fidx].path[0..plen] == path) {
//{ import core.stdc.stdio; printf("*** font [%.*s] already loaded from [%.*s]\n", cast(uint)blen, fontnamebuf.ptr, cast(uint)plen, path.ptr); }
// i found her!
return fidx;
}
} else {
if (plen == path.length && strequci(fonts[fidx].path[0..plen], path)) {
// i found her!
return fidx;
}
}
}
version(Windows) {
// special shitdows check: this will reject fontconfig font names (but still allow things like "c:myfont")
foreach (immutable char ch; path[(path.length >= 2 && path[1] == ':' ? 2 : 0)..$]) if (ch == ':') return FONS_INVALID;
}
// either no such font, or different path
//{ import core.stdc.stdio; printf("trying font [%.*s] from file [%.*s]\n", cast(uint)blen, fontnamebuf.ptr, cast(uint)path.length, path.ptr); }
int xres = FONS_INVALID;
try {
import core.stdc.stdlib : free, malloc;
static if (NanoVegaHasIVVFS) {
auto fl = VFile(path);
auto dataSize = fl.size;
if (dataSize < 16 || dataSize > int.max/32) return FONS_INVALID;
ubyte* data = cast(ubyte*)malloc(cast(uint)dataSize);
if (data is null) assert(0, "out of memory in NanoVega fontstash");
scope(failure) free(data); // oops
fl.rawReadExact(data[0..cast(uint)dataSize]);
fl.close();
} else {
import core.stdc.stdio : FILE, fopen, fclose, fread, ftell, fseek;
import std.internal.cstring : tempCString;
auto fl = fopen(path.tempCString, "rb");
if (fl is null) return FONS_INVALID;
scope(exit) fclose(fl);
if (fseek(fl, 0, 2/*SEEK_END*/) != 0) return FONS_INVALID;
auto dataSize = ftell(fl);
if (fseek(fl, 0, 0/*SEEK_SET*/) != 0) return FONS_INVALID;
if (dataSize < 16 || dataSize > int.max/32) return FONS_INVALID;
ubyte* data = cast(ubyte*)malloc(cast(uint)dataSize);
if (data is null) assert(0, "out of memory in NanoVega fontstash");
scope(failure) free(data); // oops
ubyte* dptr = data;
auto left = cast(uint)dataSize;
while (left > 0) {
auto rd = fread(dptr, 1, left, fl);
if (rd == 0) { free(data); return FONS_INVALID; } // unexpected EOF or reading error, it doesn't matter
dptr += rd;
left -= rd;
}
}
scope(failure) free(data); // oops
// create font data
FONSfontData* fdata = fons__createFontData(data, cast(int)dataSize, true); // free data
fdata.incref();
xres = addFontWithData(name, fdata, defAA);
if (xres == FONS_INVALID) {
fdata.decref(); // this will free [data] and [fdata]
} else {
// remember path
fonts[xres].setPath(path);
}
} catch (Exception e) {
// oops; sorry
}
return xres;
}
// first try direct path
auto res = loadFontFile(path);
// if loading failed, try fontconfig (if fontconfig is available)
static if (NanoVegaHasFontConfig) {
if (res == FONS_INVALID && fontconfigAvailable) {
// idiotic fontconfig NEVER fails; let's skip it if `path` looks like a path
bool ok = true;
if (path.length > 4 && (path[$-4..$] == ".ttf" || path[$-4..$] == ".ttc")) ok = false;
if (ok) { foreach (immutable char ch; path) if (ch == '/') { ok = false; break; } }
if (ok) {
import std.internal.cstring : tempCString;
FcPattern* pat = FcNameParse(path.tempCString);
if (pat !is null) {
scope(exit) FcPatternDestroy(pat);
if (FcConfigSubstitute(null, pat, FcMatchPattern)) {
FcDefaultSubstitute(pat);
// find the font
FcResult result;
FcPattern* font = FcFontMatch(null, pat, &result);
if (font !is null) {
scope(exit) FcPatternDestroy(font);
char* file = null;
if (FcPatternGetString(font, FC_FILE, 0, &file) == FcResultMatch) {
if (file !is null && file[0]) {
import core.stdc.string : strlen;
res = loadFontFile(file[0..strlen(file)]);
}
}
}
}
}
}
}
}
return res;
}
/** Add font to FontStash, using data from memory.
*
* And already loaded font to FontStash. You can replace existing logical fonts.
* But note that you can't remove logical font by passing "empty" data.
*
* $(WARNING If [FONS_INVALID] returned, `data` won't be freed even if `freeData` is `true`.)
*
* Params:
* name = logical font name, that will be used to select this font later.
* data = font data.
* dataSize = font data size.
* freeData = should FontStash take ownership of the font data?
* defAA = should FontStash use antialiased font rasterizer?
*
* Returns:
* font id or [FONS_INVALID].
*/
int addFontMem (const(char)[] name, ubyte* data, int dataSize, bool freeData, bool defAA=false) nothrow @trusted @nogc {
if (data is null || dataSize < 16) return FONS_INVALID;
FONSfontData* fdata = fons__createFontData(data, dataSize, freeData);
fdata.incref();
auto res = addFontWithData(name, fdata, defAA);
if (res == FONS_INVALID) {
// we promised to not free data on error
fdata.freeData = false;
fdata.decref(); // this will free [fdata]
}
return res;
}
/** Add fonts from another FontStash.
*
* This is more effective (and faster) than reloading fonts, because internally font data
* is reference counted.
*/
void addFontsFrom (FONSContext source) nothrow @trusted @nogc {
if (source is null) return;
foreach (FONSfont* font; source.fonts[0..source.nfonts]) {
if (font !is null) {
auto newidx = addCookedFont(font);
FONSfont* newfont = fonts[newidx];
assert(newfont !is null);
assert(newfont.path is null);
// copy path
if (font.path !is null && font.path[0]) {
import core.stdc.stdlib : malloc;
import core.stdc.string : strcpy, strlen;
newfont.path = cast(char*)malloc(strlen(font.path)+1);
if (newfont.path is null) assert(0, "FONS: out of memory");
strcpy(newfont.path, font.path);
}
}
}
}
/// Returns logical font name corresponding to the given font id, or `null`.
/// $(WARNING Copy returned name, as name buffer can be invalidated by next FontStash API call!)
const(char)[] getNameById (int idx) const pure nothrow @trusted @nogc {
if (idx < 0 || idx >= nfonts || fonts[idx] is null) return null;
return fonts[idx].name[0..fonts[idx].namelen];
}
/// Returns font id corresponding to the given logical font name, or [FONS_INVALID].
int getFontByName (const(char)[] name) const pure nothrow @trusted @nogc {
//{ import core.stdc.stdio; printf("fonsGetFontByName: [%.*s]\n", cast(uint)name.length, name.ptr); }
// remove ":noaa" suffix
if (name.length >= NoAlias.length && strequci(name[$-NoAlias.length..$], NoAlias)) {
name = name[0..$-NoAlias.length];
}
if (name.length == 0) return FONS_INVALID;
return findNameInHash(name);
}
/** Measures the specified text string. Parameter bounds should be a float[4],
* if the bounding box of the text should be returned. The bounds value are [xmin, ymin, xmax, ymax]
* Returns the horizontal advance of the measured text (i.e. where the next character should drawn).
*/
float getTextBounds(T) (float x, float y, const(T)[] str, float[] bounds) nothrow @trusted @nogc if (isAnyCharType!T) {
FONSstate* state = getState;
uint codepoint;
uint utf8state = 0;
FONSQuad q;
FONSglyph* glyph = null;
int prevGlyphIndex = -1;
short isize = cast(short)(state.size*10.0f);
short iblur = cast(short)state.blur;
FONSfont* font;
if (state.font < 0 || state.font >= nfonts) return 0;
font = fonts[state.font];
if (font is null || font.fdata is null) return 0;
float scale = fons__tt_getPixelHeightScale(&font.font, cast(float)isize/10.0f);
// Align vertically.
y += getVertAlign(font, state.talign, isize);
float minx = x, maxx = x;
float miny = y, maxy = y;
float startx = x;
foreach (T ch; str) {
static if (T.sizeof == 1) {
//if (fons__decutf8(&utf8state, &codepoint, *cast(const(ubyte)*)str)) continue;
mixin(DecUtfMixin!("utf8state", "codepoint", "(cast(ubyte)ch)"));
if (utf8state) continue;
} else {
static if (T.sizeof == 4) {
if (ch > dchar.max) ch = 0xFFFD;
}
codepoint = cast(uint)ch;
}
glyph = getGlyph(font, codepoint, isize, iblur, FONSBitmapFlag.Optional);
if (glyph !is null) {
getQuad(font, prevGlyphIndex, glyph, isize/10.0f, scale, state.spacing, &x, &y, &q);
if (q.x0 < minx) minx = q.x0;
if (q.x1 > maxx) maxx = q.x1;
if (params.isZeroTopLeft) {
if (q.y0 < miny) miny = q.y0;
if (q.y1 > maxy) maxy = q.y1;
} else {
if (q.y1 < miny) miny = q.y1;
if (q.y0 > maxy) maxy = q.y0;
}
prevGlyphIndex = glyph.index;
} else {
//{ import core.stdc.stdio; printf("NO GLYPH FOR 0x%04x\n", cast(uint)codepoint); }
prevGlyphIndex = -1;
}
}
float advance = x-startx;
//{ import core.stdc.stdio; printf("***: x=%g; startx=%g; advance=%g\n", cast(double)x, cast(double)startx, cast(double)advance); }
// Align horizontally
if (state.talign.left) {
// empty
} else if (state.talign.right) {
minx -= advance;
maxx -= advance;
} else if (state.talign.center) {
minx -= advance*0.5f;
maxx -= advance*0.5f;
}
if (bounds.length) {
if (bounds.length > 0) bounds.ptr[0] = minx;
if (bounds.length > 1) bounds.ptr[1] = miny;
if (bounds.length > 2) bounds.ptr[2] = maxx;
if (bounds.length > 3) bounds.ptr[3] = maxy;
}
return advance;
}
/// Returns various font metrics. Any argument can be `null` if you aren't interested in its value.
void getVertMetrics (float* ascender, float* descender, float* lineh) nothrow @trusted @nogc {
FONSstate* state = getState;
if (state.font < 0 || state.font >= nfonts) {
if (ascender !is null) *ascender = 0;
if (descender !is null) *descender = 0;
if (lineh !is null) *lineh = 0;
} else {
FONSfont* font = fonts[state.font];
if (font is null || font.fdata is null) {
if (ascender !is null) *ascender = 0;
if (descender !is null) *descender = 0;
if (lineh !is null) *lineh = 0;
} else {
short isize = cast(short)(state.size*10.0f);
if (ascender !is null) *ascender = font.ascender*isize/10.0f;
if (descender !is null) *descender = font.descender*isize/10.0f;
if (lineh !is null) *lineh = font.lineh*isize/10.0f;
}
}
}
/// Returns line bounds. Any argument can be `null` if you aren't interested in its value.
void getLineBounds (float y, float* minyp, float* maxyp) nothrow @trusted @nogc {
FONSfont* font;
FONSstate* state = getState;
short isize;
if (minyp !is null) *minyp = 0;
if (maxyp !is null) *maxyp = 0;
if (state.font < 0 || state.font >= nfonts) return;
font = fonts[state.font];
isize = cast(short)(state.size*10.0f);
if (font is null || font.fdata is null) return;
y += getVertAlign(font, state.talign, isize);
if (params.isZeroTopLeft) {
immutable float miny = y-font.ascender*cast(float)isize/10.0f;
immutable float maxy = miny+font.lineh*isize/10.0f;
if (minyp !is null) *minyp = miny;
if (maxyp !is null) *maxyp = maxy;
} else {
immutable float maxy = y+font.descender*cast(float)isize/10.0f;
immutable float miny = maxy-font.lineh*isize/10.0f;
if (minyp !is null) *minyp = miny;
if (maxyp !is null) *maxyp = maxy;
}
}
/// Returns font line height.
float fontHeight () nothrow @trusted @nogc {
float res = void;
getVertMetrics(null, null, &res);
return res;
}
/// Returns font ascender (positive).
float fontAscender () nothrow @trusted @nogc {
float res = void;
getVertMetrics(&res, null, null);
return res;
}
/// Returns font descender (negative).
float fontDescender () nothrow @trusted @nogc {
float res = void;
getVertMetrics(null, &res, null);
return res;
}
//TODO: document this
const(ubyte)* getTextureData (int* width, int* height) nothrow @trusted @nogc {
if (width !is null) *width = params.width;
if (height !is null) *height = params.height;
return texData;
}
//TODO: document this
bool validateTexture (int* dirty) nothrow @trusted @nogc {
if (dirtyRect.ptr[0] < dirtyRect.ptr[2] && dirtyRect.ptr[1] < dirtyRect.ptr[3]) {
dirty[0] = dirtyRect.ptr[0];
dirty[1] = dirtyRect.ptr[1];
dirty[2] = dirtyRect.ptr[2];
dirty[3] = dirtyRect.ptr[3];
// reset dirty rect
dirtyRect.ptr[0] = params.width;
dirtyRect.ptr[1] = params.height;
dirtyRect.ptr[2] = 0;
dirtyRect.ptr[3] = 0;
return true;
}
return false;
}
//TODO: document this
void errorCallback (void delegate (FONSError error, int val) nothrow @trusted @nogc callback) nothrow @trusted @nogc {
handleError = callback;
}
//TODO: document this
void getAtlasSize (int* width, int* height) const pure nothrow @trusted @nogc {
if (width !is null) *width = params.width;
if (height !is null) *height = params.height;
}
//TODO: document this
bool expandAtlas (int width, int height) nothrow @trusted @nogc {
import core.stdc.stdlib : free;
import core.stdc.string : memcpy, memset;
int maxy = 0;
ubyte* data = null;
width = nvg__max(width, params.width);
height = nvg__max(height, params.height);
if (width == params.width && height == params.height) return true;
// Flush pending glyphs.
flush();
// Create new texture
if (params.renderResize !is null) {
if (params.renderResize(params.userPtr, width, height) == 0) return false;
}
// Copy old texture data over.
data = cast(ubyte*)malloc(width*height);
if (data is null) return 0;
foreach (immutable int i; 0..params.height) {
ubyte* dst = &data[i*width];
ubyte* src = &texData[i*params.width];
memcpy(dst, src, params.width);
if (width > params.width) memset(dst+params.width, 0, width-params.width);
}
if (height > params.height) memset(&data[params.height*width], 0, (height-params.height)*width);
free(texData);
texData = data;
// Increase atlas size
atlas.expand(width, height);
// Add existing data as dirty.
foreach (immutable int i; 0..atlas.nnodes) maxy = nvg__max(maxy, atlas.nodes[i].y);
dirtyRect.ptr[0] = 0;
dirtyRect.ptr[1] = 0;
dirtyRect.ptr[2] = params.width;
dirtyRect.ptr[3] = maxy;
params.width = width;
params.height = height;
itw = 1.0f/params.width;
ith = 1.0f/params.height;
return true;
}
//TODO: document this
bool resetAtlas (int width, int height) nothrow @trusted @nogc {
import core.stdc.stdlib : realloc;
import core.stdc.string : memcpy, memset;
// flush pending glyphs
flush();
// create new texture
if (params.renderResize !is null) {
if (params.renderResize(params.userPtr, width, height) == 0) return false;
}
// reset atlas
atlas.reset(width, height);
// clear texture data
texData = cast(ubyte*)realloc(texData, width*height);
if (texData is null) assert(0, "FONS: out of memory");
memset(texData, 0, width*height);
// reset dirty rect
dirtyRect.ptr[0] = width;
dirtyRect.ptr[1] = height;
dirtyRect.ptr[2] = 0;
dirtyRect.ptr[3] = 0;
// Reset cached glyphs
foreach (FONSfont* font; fonts[0..nfonts]) {
if (font !is null) {
font.nglyphs = 0;
font.lut.ptr[0..FONS_HASH_LUT_SIZE] = -1;
}
}
params.width = width;
params.height = height;
itw = 1.0f/params.width;
ith = 1.0f/params.height;
// Add white rect at 0, 0 for debug drawing.
addWhiteRect(2, 2);
return true;
}
//TODO: document this
bool getPathBounds (dchar dch, float[] bounds) nothrow @trusted @nogc {
if (bounds.length > 4) bounds = bounds.ptr[0..4];
static if (is(typeof(&fons__nvg__bounds))) {
FONSstate* state = getState;
if (state.font < 0 || state.font >= nfonts) { bounds[] = 0; return false; }
FONSfont* font;
auto g = findGlyphForCP(fonts[state.font], dch, &font);
if (g == 0) { bounds[] = 0; return false; }
assert(font !is null);
return fons__nvg__bounds(&font.font, g, bounds);
} else {
bounds[] = 0;
return false;
}
}
//TODO: document this
bool toPath() (NVGContext vg, dchar dch, float[] bounds=null) nothrow @trusted @nogc {
if (bounds.length > 4) bounds = bounds.ptr[0..4];
static if (is(typeof(&fons__nvg__toPath))) {
if (vg is null) { bounds[] = 0; return false; }
FONSstate* state = getState;
if (state.font < 0 || state.font >= nfonts) { bounds[] = 0; return false; }
FONSfont* font;
auto g = findGlyphForCP(fonts[state.font], dch, &font);
if (g == 0) { bounds[] = 0; return false; }
assert(font !is null);
return fons__nvg__toPath(vg, &font.font, g, bounds);
} else {
bounds[] = 0;
return false;
}
}
//TODO: document this
bool toOutline (dchar dch, NVGPathOutline.DataStore* ol) nothrow @trusted @nogc {
if (ol is null) return false;
static if (is(typeof(&fons__nvg__toOutline))) {
FONSstate* state = getState;
if (state.font < 0 || state.font >= nfonts) return false;
FONSfont* font;
auto g = findGlyphForCP(fonts[state.font], dch, &font);
if (g == 0) return false;
assert(font !is null);
return fons__nvg__toOutline(&font.font, g, ol);
} else {
return false;
}
}
//TODO: document this
FONSglyph* getGlyph (FONSfont* font, uint codepoint, short isize, short iblur, FONSBitmapFlag bitmapOption) nothrow @trusted @nogc {
static uint fons__hashint() (uint a) pure nothrow @safe @nogc {
pragma(inline, true);
a += ~(a<<15);
a ^= (a>>10);
a += (a<<3);
a ^= (a>>6);
a += ~(a<<11);
a ^= (a>>16);
return a;
}
// based on Exponential blur, Jani Huhtanen, 2006
enum APREC = 16;
enum ZPREC = 7;
static void fons__blurCols (ubyte* dst, int w, int h, int dstStride, int alpha) nothrow @trusted @nogc {
foreach (immutable int y; 0..h) {
int z = 0; // force zero border
foreach (int x; 1..w) {
z += (alpha*((cast(int)(dst[x])<<ZPREC)-z))>>APREC;
dst[x] = cast(ubyte)(z>>ZPREC);
}
dst[w-1] = 0; // force zero border
z = 0;
for (int x = w-2; x >= 0; --x) {
z += (alpha*((cast(int)(dst[x])<<ZPREC)-z))>>APREC;
dst[x] = cast(ubyte)(z>>ZPREC);
}
dst[0] = 0; // force zero border
dst += dstStride;
}
}
static void fons__blurRows (ubyte* dst, int w, int h, int dstStride, int alpha) nothrow @trusted @nogc {
foreach (immutable int x; 0..w) {
int z = 0; // force zero border
for (int y = dstStride; y < h*dstStride; y += dstStride) {
z += (alpha*((cast(int)(dst[y])<<ZPREC)-z))>>APREC;
dst[y] = cast(ubyte)(z>>ZPREC);
}
dst[(h-1)*dstStride] = 0; // force zero border
z = 0;
for (int y = (h-2)*dstStride; y >= 0; y -= dstStride) {
z += (alpha*((cast(int)(dst[y])<<ZPREC)-z))>>APREC;
dst[y] = cast(ubyte)(z>>ZPREC);
}
dst[0] = 0; // force zero border
++dst;
}
}
static void fons__blur (ubyte* dst, int w, int h, int dstStride, int blur) nothrow @trusted @nogc {
import std.math : expf = exp;
if (blur < 1) return;
// Calculate the alpha such that 90% of the kernel is within the radius. (Kernel extends to infinity)
immutable float sigma = cast(float)blur*0.57735f; // 1/sqrt(3)
int alpha = cast(int)((1<<APREC)*(1.0f-expf(-2.3f/(sigma+1.0f))));
fons__blurRows(dst, w, h, dstStride, alpha);
fons__blurCols(dst, w, h, dstStride, alpha);
fons__blurRows(dst, w, h, dstStride, alpha);
fons__blurCols(dst, w, h, dstStride, alpha);
//fons__blurrows(dst, w, h, dstStride, alpha);
//fons__blurcols(dst, w, h, dstStride, alpha);
}
int advance, lsb, x0, y0, x1, y1, gx, gy;
FONSglyph* glyph = null;
float size = isize/10.0f;
FONSfont* renderFont = font;
if (isize < 2) return null;
if (iblur > 20) iblur = 20;
int pad = iblur+2;
// Reset allocator.
nscratch = 0;
// Find code point and size.
uint h = fons__hashint(codepoint)&(FONS_HASH_LUT_SIZE-1);
int i = font.lut.ptr[h];
while (i != -1) {
//if (font.glyphs[i].codepoint == codepoint && font.glyphs[i].size == isize && font.glyphs[i].blur == iblur) return &font.glyphs[i];
if (font.glyphs[i].codepoint == codepoint && font.glyphs[i].size == isize && font.glyphs[i].blur == iblur) {
glyph = &font.glyphs[i];
// Negative coordinate indicates there is no bitmap data created.
if (bitmapOption == FONSBitmapFlag.Optional || (glyph.x0 >= 0 && glyph.y0 >= 0)) return glyph;
// At this point, glyph exists but the bitmap data is not yet created.
break;
}
i = font.glyphs[i].next;
}
// Create a new glyph or rasterize bitmap data for a cached glyph.
//scale = fons__tt_getPixelHeightScale(&font.font, size);
int g = findGlyphForCP(font, cast(dchar)codepoint, &renderFont);
// It is possible that we did not find a fallback glyph.
// In that case the glyph index 'g' is 0, and we'll proceed below and cache empty glyph.
float scale = fons__tt_getPixelHeightScale(&renderFont.font, size);
fons__tt_buildGlyphBitmap(&renderFont.font, g, size, scale, &advance, &lsb, &x0, &y0, &x1, &y1);
int gw = x1-x0+pad*2;
int gh = y1-y0+pad*2;
// Determines the spot to draw glyph in the atlas.
if (bitmapOption == FONSBitmapFlag.Required) {
// Find free spot for the rect in the atlas.
bool added = atlas.addRect(gw, gh, &gx, &gy);
if (!added && handleError !is null) {
// Atlas is full, let the user to resize the atlas (or not), and try again.
handleError(FONSError.AtlasFull, 0);
added = atlas.addRect(gw, gh, &gx, &gy);
}
if (!added) return null;
} else {
// Negative coordinate indicates there is no bitmap data created.
gx = -1;
gy = -1;
}
// Init glyph.
if (glyph is null) {
glyph = font.allocGlyph();
glyph.codepoint = codepoint;
glyph.size = isize;
glyph.blur = iblur;
glyph.next = 0;
// Insert char to hash lookup.
glyph.next = font.lut.ptr[h];
font.lut.ptr[h] = font.nglyphs-1;
}
glyph.index = g;
glyph.x0 = cast(short)gx;
glyph.y0 = cast(short)gy;
glyph.x1 = cast(short)(glyph.x0+gw);
glyph.y1 = cast(short)(glyph.y0+gh);
glyph.xadv = cast(short)(scale*advance*10.0f);
glyph.xoff = cast(short)(x0-pad);
glyph.yoff = cast(short)(y0-pad);
if (bitmapOption == FONSBitmapFlag.Optional) return glyph;
// Rasterize
ubyte* dst = &texData[(glyph.x0+pad)+(glyph.y0+pad)*params.width];
fons__tt_renderGlyphBitmap(&font.font, dst, gw-pad*2, gh-pad*2, params.width, scale, scale, g);
// Make sure there is one pixel empty border.
dst = &texData[glyph.x0+glyph.y0*params.width];
foreach (immutable int y; 0..gh) {
dst[y*params.width] = 0;
dst[gw-1+y*params.width] = 0;
}
foreach (immutable int x; 0..gw) {
dst[x] = 0;
dst[x+(gh-1)*params.width] = 0;
}
// Debug code to color the glyph background
version(none) {
foreach (immutable yy; 0..gh) {
foreach (immutable xx; 0..gw) {
int a = cast(int)dst[xx+yy*params.width]+42;
if (a > 255) a = 255;
dst[xx+yy*params.width] = cast(ubyte)a;
}
}
}
// Blur
if (iblur > 0) {
nscratch = 0;
ubyte* bdst = &texData[glyph.x0+glyph.y0*params.width];
fons__blur(bdst, gw, gh, params.width, iblur);
}
dirtyRect.ptr[0] = nvg__min(dirtyRect.ptr[0], glyph.x0);
dirtyRect.ptr[1] = nvg__min(dirtyRect.ptr[1], glyph.y0);
dirtyRect.ptr[2] = nvg__max(dirtyRect.ptr[2], glyph.x1);
dirtyRect.ptr[3] = nvg__max(dirtyRect.ptr[3], glyph.y1);
return glyph;
}
//TODO: document this
void getQuad (FONSfont* font, int prevGlyphIndex, FONSglyph* glyph, float size, float scale, float spacing, float* x, float* y, FONSQuad* q) nothrow @trusted @nogc {
if (prevGlyphIndex >= 0) {
immutable float adv = fons__tt_getGlyphKernAdvance(&font.font, size, prevGlyphIndex, glyph.index)/**scale*/; //k8: do we really need scale here?
//if (adv != 0) { import core.stdc.stdio; printf("adv=%g (scale=%g; spacing=%g)\n", cast(double)adv, cast(double)scale, cast(double)spacing); }
*x += cast(int)(adv+spacing /*+0.5f*/); //k8: for me, it looks better this way (with non-aa fonts)
}
// Each glyph has 2px border to allow good interpolation,
// one pixel to prevent leaking, and one to allow good interpolation for rendering.
// Inset the texture region by one pixel for correct interpolation.
immutable float xoff = cast(short)(glyph.xoff+1);
immutable float yoff = cast(short)(glyph.yoff+1);
immutable float x0 = cast(float)(glyph.x0+1);
immutable float y0 = cast(float)(glyph.y0+1);
immutable float x1 = cast(float)(glyph.x1-1);
immutable float y1 = cast(float)(glyph.y1-1);
if (params.isZeroTopLeft) {
immutable float rx = cast(float)cast(int)(*x+xoff);
immutable float ry = cast(float)cast(int)(*y+yoff);
q.x0 = rx;
q.y0 = ry;
q.x1 = rx+x1-x0;
q.y1 = ry+y1-y0;
q.s0 = x0*itw;
q.t0 = y0*ith;
q.s1 = x1*itw;
q.t1 = y1*ith;
} else {
immutable float rx = cast(float)cast(int)(*x+xoff);
immutable float ry = cast(float)cast(int)(*y-yoff);
q.x0 = rx;
q.y0 = ry;
q.x1 = rx+x1-x0;
q.y1 = ry-y1+y0;
q.s0 = x0*itw;
q.t0 = y0*ith;
q.s1 = x1*itw;
q.t1 = y1*ith;
}
*x += cast(int)(glyph.xadv/10.0f+0.5f);
}
void flush () nothrow @trusted @nogc {
// flush texture
if (dirtyRect.ptr[0] < dirtyRect.ptr[2] && dirtyRect.ptr[1] < dirtyRect.ptr[3]) {
if (params.renderUpdate !is null) params.renderUpdate(params.userPtr, dirtyRect.ptr, texData);
// reset dirty rect
dirtyRect.ptr[0] = params.width;
dirtyRect.ptr[1] = params.height;
dirtyRect.ptr[2] = 0;
dirtyRect.ptr[3] = 0;
}
}
}
/// Free all resources used by the `stash`, and `stash` itself.
/// Group: font_stash
public void kill (ref FONSContext stash) nothrow @trusted @nogc {
import core.stdc.stdlib : free;
if (stash is null) return;
stash.clear();
free(stash);
stash = null;
}
// ////////////////////////////////////////////////////////////////////////// //
void* fons__tmpalloc (usize size, void* up) nothrow @trusted @nogc {
ubyte* ptr;
FONSContext stash = cast(FONSContext)up;
// 16-byte align the returned pointer
size = (size+0xf)&~0xf;
if (stash.nscratch+cast(int)size > FONS_SCRATCH_BUF_SIZE) {
if (stash.handleError !is null) stash.handleError(FONSError.ScratchFull, stash.nscratch+cast(int)size);
return null;
}
ptr = stash.scratch+stash.nscratch;
stash.nscratch += cast(int)size;
return ptr;
}
void fons__tmpfree (void* ptr, void* up) nothrow @trusted @nogc {
// empty
}
// ////////////////////////////////////////////////////////////////////////// //
// Copyright (c) 2008-2010 Bjoern Hoehrmann <bjoern@hoehrmann.de>
// See http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ for details.
enum FONS_UTF8_ACCEPT = 0;
enum FONS_UTF8_REJECT = 12;
static immutable ubyte[364] utf8d = [
// The first part of the table maps bytes to character classes that
// to reduce the size of the transition table and create bitmasks.
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
8, 8, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 11, 6, 6, 6, 5, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
// The second part is a transition table that maps a combination
// of a state of the automaton and a character class to a state.
0, 12, 24, 36, 60, 96, 84, 12, 12, 12, 48, 72, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 0, 12, 12, 12, 12, 12, 0, 12, 0, 12, 12, 12, 24, 12, 12, 12, 12, 12, 24, 12, 24, 12, 12,
12, 12, 12, 12, 12, 12, 12, 24, 12, 12, 12, 12, 12, 24, 12, 12, 12, 12, 12, 12, 12, 24, 12, 12,
12, 12, 12, 12, 12, 12, 12, 36, 12, 36, 12, 12, 12, 36, 12, 12, 12, 12, 12, 36, 12, 36, 12, 12,
12, 36, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
];
private enum DecUtfMixin(string state, string codep, string byte_) =
`{
uint type_ = utf8d.ptr[`~byte_~`];
`~codep~` = (`~state~` != FONS_UTF8_ACCEPT ? (`~byte_~`&0x3fu)|(`~codep~`<<6) : (0xff>>type_)&`~byte_~`);
if ((`~state~` = utf8d.ptr[256+`~state~`+type_]) == FONS_UTF8_REJECT) {
`~state~` = FONS_UTF8_ACCEPT;
`~codep~` = 0xFFFD;
}
}`;
/*
uint fons__decutf8 (uint* state, uint* codep, uint byte_) {
pragma(inline, true);
uint type = utf8d.ptr[byte_];
*codep = (*state != FONS_UTF8_ACCEPT ? (byte_&0x3fu)|(*codep<<6) : (0xff>>type)&byte_);
*state = utf8d.ptr[256 + *state+type];
return *state;
}
*/
// ////////////////////////////////////////////////////////////////////////// //
/// This iterator can be used to do text measurement.
/// $(WARNING Don't add new fonts to stash while you are iterating, or you WILL get segfault!)
/// Group: font_stash
public struct FONSTextBoundsIterator {
private:
FONSContext stash;
FONSstate state;
uint codepoint = 0xFFFD;
uint utf8state = 0;
int prevGlyphIndex = -1;
short isize, iblur;
float scale = 0;
FONSfont* font;
float startx = 0, x = 0, y = 0;
float minx = 0, miny = 0, maxx = 0, maxy = 0;
private:
void clear () nothrow @trusted @nogc {
import core.stdc.string : memset;
memset(&this, 0, this.sizeof);
this.prevGlyphIndex = -1;
this.codepoint = 0xFFFD;
}
public:
/// Initialize iterator with the current FontStash state. FontStash state can be changed after initialization without affecting the iterator.
this (FONSContext astash, float ax=0, float ay=0) nothrow @trusted @nogc { reset(astash, ax, ay); }
/// (Re)initialize iterator with the current FontStash state. FontStash state can be changed after initialization without affecting the iterator.
void reset (FONSContext astash, float ax=0, float ay=0) nothrow @trusted @nogc {
clear();
if (astash is null || astash.nstates == 0) return;
stash = astash;
state = *stash.getState;
if (state.font < 0 || state.font >= stash.nfonts) { clear(); return; }
font = stash.fonts[state.font];
if (font is null || font.fdata is null) { clear(); return; }
x = ax;
y = ay;
isize = cast(short)(state.size*10.0f);
iblur = cast(short)state.blur;
scale = fons__tt_getPixelHeightScale(&font.font, cast(float)isize/10.0f);
// align vertically
y += astash.getVertAlign(font, state.talign, isize);
minx = maxx = x;
miny = maxy = y;
startx = x;
}
/// Can this iterator be used?
@property bool valid () const pure nothrow @safe @nogc { pragma(inline, true); return (stash !is null); }
/// Put some text into iterator, calculate new values.
void put(T) (const(T)[] str...) nothrow @trusted @nogc if (isAnyCharType!T) {
enum DoCodePointMixin = q{
glyph = stash.getGlyph(font, codepoint, isize, iblur, FONSBitmapFlag.Optional);
if (glyph !is null) {
stash.getQuad(font, prevGlyphIndex, glyph, isize/10.0f, scale, state.spacing, &x, &y, &q);
if (q.x0 < minx) minx = q.x0;
if (q.x1 > maxx) maxx = q.x1;
if (stash.params.isZeroTopLeft) {
if (q.y0 < miny) miny = q.y0;
if (q.y1 > maxy) maxy = q.y1;
} else {
if (q.y1 < miny) miny = q.y1;
if (q.y0 > maxy) maxy = q.y0;
}
prevGlyphIndex = glyph.index;
} else {
prevGlyphIndex = -1;
}
};
if (stash is null || str.length == 0) return; // alas
FONSQuad q;
FONSglyph* glyph;
static if (is(T == char)) {
foreach (char ch; str) {
mixin(DecUtfMixin!("utf8state", "codepoint", "cast(ubyte)ch"));
if (utf8state) continue; // full char is not collected yet
mixin(DoCodePointMixin);
}
} else {
if (utf8state) {
utf8state = 0;
codepoint = 0xFFFD;
mixin(DoCodePointMixin);
}
foreach (T dch; str) {
static if (is(T == dchar)) {
if (dch > dchar.max) dch = 0xFFFD;
}
codepoint = cast(uint)dch;
mixin(DoCodePointMixin);
}
}
}
/// Returns current advance.
@property float advance () const pure nothrow @safe @nogc { pragma(inline, true); return (stash !is null ? x-startx : 0); }
/// Returns current text bounds.
void getBounds (ref float[4] bounds) const pure nothrow @safe @nogc {
if (stash is null) { bounds[] = 0; return; }
float lminx = minx, lmaxx = maxx;
// align horizontally
if (state.talign.left) {
// empty
} else if (state.talign.right) {
float ca = advance;
lminx -= ca;
lmaxx -= ca;
} else if (state.talign.center) {
float ca = advance*0.5f;
lminx -= ca;
lmaxx -= ca;
}
bounds[0] = lminx;
bounds[1] = miny;
bounds[2] = lmaxx;
bounds[3] = maxy;
}
/// Returns current horizontal text bounds.
void getHBounds (out float xmin, out float xmax) nothrow @trusted @nogc {
if (stash !is null) {
float lminx = minx, lmaxx = maxx;
// align horizontally
if (state.talign.left) {
// empty
} else if (state.talign.right) {
float ca = advance;
lminx -= ca;
lmaxx -= ca;
} else if (state.talign.center) {
float ca = advance*0.5f;
lminx -= ca;
lmaxx -= ca;
}
xmin = lminx;
xmax = lmaxx;
} else {
xmin = xmax = 0;
}
}
/// Returns current vertical text bounds.
void getVBounds (out float ymin, out float ymax) nothrow @trusted @nogc {
pragma(inline, true);
if (stash !is null) {
ymin = miny;
ymax = maxy;
} else {
ymin = ymax = 0;
}
}
/// Returns font line height.
float lineHeight () nothrow @trusted @nogc {
pragma(inline, true);
return (stash !is null ? stash.fonts[state.font].lineh*cast(short)(state.size*10.0f)/10.0f : 0);
}
/// Returns font ascender (positive).
float ascender () nothrow @trusted @nogc {
pragma(inline, true);
return (stash !is null ? stash.fonts[state.font].ascender*cast(short)(state.size*10.0f)/10.0f : 0);
}
/// Returns font descender (negative).
float descender () nothrow @trusted @nogc {
pragma(inline, true);
return (stash !is null ? stash.fonts[state.font].descender*cast(short)(state.size*10.0f)/10.0f : 0);
}
}
// ////////////////////////////////////////////////////////////////////////// //
// backgl
// ////////////////////////////////////////////////////////////////////////// //
import core.stdc.stdlib : malloc, realloc, free;
import core.stdc.string : memcpy, memset;
static if (__VERSION__ < 2076) {
private auto DGNoThrowNoGC(T) (scope T t) /*if (isFunctionPointer!T || isDelegate!T)*/ {
import std.traits;
enum attrs = functionAttributes!T|FunctionAttribute.nogc|FunctionAttribute.nothrow_;
return cast(SetFunctionAttributes!(T, functionLinkage!T, attrs)) t;
}
}
//import arsd.simpledisplay;
version(nanovg_builtin_opengl_bindings) { import arsd.simpledisplay; } else { import iv.glbinds; }
private:
// sdpy is missing that yet
static if (!is(typeof(GL_STENCIL_BUFFER_BIT))) enum uint GL_STENCIL_BUFFER_BIT = 0x00000400;
// OpenGL API missing from simpledisplay
private extern(System) nothrow @nogc {
alias GLvoid = void;
alias GLboolean = ubyte;
alias GLuint = uint;
alias GLenum = uint;
alias GLchar = char;
alias GLsizei = int;
alias GLfloat = float;
alias GLsizeiptr = ptrdiff_t;
enum uint GL_STENCIL_BUFFER_BIT = 0x00000400;
enum uint GL_INVALID_ENUM = 0x0500;
enum uint GL_ZERO = 0;
enum uint GL_ONE = 1;
enum uint GL_FLOAT = 0x1406;
enum uint GL_STREAM_DRAW = 0x88E0;
enum uint GL_CCW = 0x0901;
enum uint GL_STENCIL_TEST = 0x0B90;
enum uint GL_SCISSOR_TEST = 0x0C11;
enum uint GL_EQUAL = 0x0202;
enum uint GL_NOTEQUAL = 0x0205;
enum uint GL_ALWAYS = 0x0207;
enum uint GL_KEEP = 0x1E00;
enum uint GL_INCR = 0x1E02;
enum uint GL_INCR_WRAP = 0x8507;
enum uint GL_DECR_WRAP = 0x8508;
enum uint GL_CULL_FACE = 0x0B44;
enum uint GL_BACK = 0x0405;
enum uint GL_FRAGMENT_SHADER = 0x8B30;
enum uint GL_VERTEX_SHADER = 0x8B31;
enum uint GL_COMPILE_STATUS = 0x8B81;
enum uint GL_LINK_STATUS = 0x8B82;
enum uint GL_UNPACK_ALIGNMENT = 0x0CF5;
enum uint GL_UNPACK_ROW_LENGTH = 0x0CF2;
enum uint GL_UNPACK_SKIP_PIXELS = 0x0CF4;
enum uint GL_UNPACK_SKIP_ROWS = 0x0CF3;
enum uint GL_GENERATE_MIPMAP = 0x8191;
enum uint GL_LINEAR_MIPMAP_LINEAR = 0x2703;
enum uint GL_RED = 0x1903;
enum uint GL_TEXTURE0 = 0x84C0U;
enum uint GL_TEXTURE1 = 0x84C1U;
enum uint GL_ARRAY_BUFFER = 0x8892;
enum uint GL_SRC_COLOR = 0x0300;
enum uint GL_ONE_MINUS_SRC_COLOR = 0x0301;
enum uint GL_SRC_ALPHA = 0x0302;
enum uint GL_ONE_MINUS_SRC_ALPHA = 0x0303;
enum uint GL_DST_ALPHA = 0x0304;
enum uint GL_ONE_MINUS_DST_ALPHA = 0x0305;
enum uint GL_DST_COLOR = 0x0306;
enum uint GL_ONE_MINUS_DST_COLOR = 0x0307;
enum uint GL_SRC_ALPHA_SATURATE = 0x0308;
enum uint GL_INVERT = 0x150AU;
enum uint GL_DEPTH_STENCIL = 0x84F9U;
enum uint GL_UNSIGNED_INT_24_8 = 0x84FAU;
enum uint GL_FRAMEBUFFER = 0x8D40U;
enum uint GL_COLOR_ATTACHMENT0 = 0x8CE0U;
enum uint GL_DEPTH_STENCIL_ATTACHMENT = 0x821AU;
enum uint GL_FRAMEBUFFER_COMPLETE = 0x8CD5U;
enum uint GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6U;
enum uint GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7U;
enum uint GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9U;
enum uint GL_FRAMEBUFFER_UNSUPPORTED = 0x8CDDU;
enum uint GL_COLOR_LOGIC_OP = 0x0BF2U;
enum uint GL_CLEAR = 0x1500U;
enum uint GL_COPY = 0x1503U;
enum uint GL_XOR = 0x1506U;
enum uint GL_FRAMEBUFFER_BINDING = 0x8CA6U;
/*
version(Windows) {
private void* kglLoad (const(char)* name) {
void* res = glGetProcAddress(name);
if (res is null) {
import core.sys.windows.windef, core.sys.windows.winbase;
static HINSTANCE dll = null;
if (dll is null) {
dll = LoadLibraryA("opengl32.dll");
if (dll is null) return null; // <32, but idc
return GetProcAddress(dll, name);
}
}
}
} else {
alias kglLoad = glGetProcAddress;
}
*/
alias glbfn_glStencilMask = void function(GLuint);
__gshared glbfn_glStencilMask glStencilMask_NVGLZ; alias glStencilMask = glStencilMask_NVGLZ;
alias glbfn_glStencilFunc = void function(GLenum, GLint, GLuint);
__gshared glbfn_glStencilFunc glStencilFunc_NVGLZ; alias glStencilFunc = glStencilFunc_NVGLZ;
alias glbfn_glGetShaderInfoLog = void function(GLuint, GLsizei, GLsizei*, GLchar*);
__gshared glbfn_glGetShaderInfoLog glGetShaderInfoLog_NVGLZ; alias glGetShaderInfoLog = glGetShaderInfoLog_NVGLZ;
alias glbfn_glGetProgramInfoLog = void function(GLuint, GLsizei, GLsizei*, GLchar*);
__gshared glbfn_glGetProgramInfoLog glGetProgramInfoLog_NVGLZ; alias glGetProgramInfoLog = glGetProgramInfoLog_NVGLZ;
alias glbfn_glCreateProgram = GLuint function();
__gshared glbfn_glCreateProgram glCreateProgram_NVGLZ; alias glCreateProgram = glCreateProgram_NVGLZ;
alias glbfn_glCreateShader = GLuint function(GLenum);
__gshared glbfn_glCreateShader glCreateShader_NVGLZ; alias glCreateShader = glCreateShader_NVGLZ;
alias glbfn_glShaderSource = void function(GLuint, GLsizei, const(GLchar*)*, const(GLint)*);
__gshared glbfn_glShaderSource glShaderSource_NVGLZ; alias glShaderSource = glShaderSource_NVGLZ;
alias glbfn_glCompileShader = void function(GLuint);
__gshared glbfn_glCompileShader glCompileShader_NVGLZ; alias glCompileShader = glCompileShader_NVGLZ;
alias glbfn_glGetShaderiv = void function(GLuint, GLenum, GLint*);
__gshared glbfn_glGetShaderiv glGetShaderiv_NVGLZ; alias glGetShaderiv = glGetShaderiv_NVGLZ;
alias glbfn_glAttachShader = void function(GLuint, GLuint);
__gshared glbfn_glAttachShader glAttachShader_NVGLZ; alias glAttachShader = glAttachShader_NVGLZ;
alias glbfn_glBindAttribLocation = void function(GLuint, GLuint, const(GLchar)*);
__gshared glbfn_glBindAttribLocation glBindAttribLocation_NVGLZ; alias glBindAttribLocation = glBindAttribLocation_NVGLZ;
alias glbfn_glLinkProgram = void function(GLuint);
__gshared glbfn_glLinkProgram glLinkProgram_NVGLZ; alias glLinkProgram = glLinkProgram_NVGLZ;
alias glbfn_glGetProgramiv = void function(GLuint, GLenum, GLint*);
__gshared glbfn_glGetProgramiv glGetProgramiv_NVGLZ; alias glGetProgramiv = glGetProgramiv_NVGLZ;
alias glbfn_glDeleteProgram = void function(GLuint);
__gshared glbfn_glDeleteProgram glDeleteProgram_NVGLZ; alias glDeleteProgram = glDeleteProgram_NVGLZ;
alias glbfn_glDeleteShader = void function(GLuint);
__gshared glbfn_glDeleteShader glDeleteShader_NVGLZ; alias glDeleteShader = glDeleteShader_NVGLZ;
alias glbfn_glGetUniformLocation = GLint function(GLuint, const(GLchar)*);
__gshared glbfn_glGetUniformLocation glGetUniformLocation_NVGLZ; alias glGetUniformLocation = glGetUniformLocation_NVGLZ;
alias glbfn_glGenBuffers = void function(GLsizei, GLuint*);
__gshared glbfn_glGenBuffers glGenBuffers_NVGLZ; alias glGenBuffers = glGenBuffers_NVGLZ;
alias glbfn_glPixelStorei = void function(GLenum, GLint);
__gshared glbfn_glPixelStorei glPixelStorei_NVGLZ; alias glPixelStorei = glPixelStorei_NVGLZ;
alias glbfn_glUniform4fv = void function(GLint, GLsizei, const(GLfloat)*);
__gshared glbfn_glUniform4fv glUniform4fv_NVGLZ; alias glUniform4fv = glUniform4fv_NVGLZ;
alias glbfn_glColorMask = void function(GLboolean, GLboolean, GLboolean, GLboolean);
__gshared glbfn_glColorMask glColorMask_NVGLZ; alias glColorMask = glColorMask_NVGLZ;
alias glbfn_glStencilOpSeparate = void function(GLenum, GLenum, GLenum, GLenum);
__gshared glbfn_glStencilOpSeparate glStencilOpSeparate_NVGLZ; alias glStencilOpSeparate = glStencilOpSeparate_NVGLZ;
alias glbfn_glDrawArrays = void function(GLenum, GLint, GLsizei);
__gshared glbfn_glDrawArrays glDrawArrays_NVGLZ; alias glDrawArrays = glDrawArrays_NVGLZ;
alias glbfn_glStencilOp = void function(GLenum, GLenum, GLenum);
__gshared glbfn_glStencilOp glStencilOp_NVGLZ; alias glStencilOp = glStencilOp_NVGLZ;
alias glbfn_glUseProgram = void function(GLuint);
__gshared glbfn_glUseProgram glUseProgram_NVGLZ; alias glUseProgram = glUseProgram_NVGLZ;
alias glbfn_glCullFace = void function(GLenum);
__gshared glbfn_glCullFace glCullFace_NVGLZ; alias glCullFace = glCullFace_NVGLZ;
alias glbfn_glFrontFace = void function(GLenum);
__gshared glbfn_glFrontFace glFrontFace_NVGLZ; alias glFrontFace = glFrontFace_NVGLZ;
alias glbfn_glActiveTexture = void function(GLenum);
__gshared glbfn_glActiveTexture glActiveTexture_NVGLZ; alias glActiveTexture = glActiveTexture_NVGLZ;
alias glbfn_glBindBuffer = void function(GLenum, GLuint);
__gshared glbfn_glBindBuffer glBindBuffer_NVGLZ; alias glBindBuffer = glBindBuffer_NVGLZ;
alias glbfn_glBufferData = void function(GLenum, GLsizeiptr, const(void)*, GLenum);
__gshared glbfn_glBufferData glBufferData_NVGLZ; alias glBufferData = glBufferData_NVGLZ;
alias glbfn_glEnableVertexAttribArray = void function(GLuint);
__gshared glbfn_glEnableVertexAttribArray glEnableVertexAttribArray_NVGLZ; alias glEnableVertexAttribArray = glEnableVertexAttribArray_NVGLZ;
alias glbfn_glVertexAttribPointer = void function(GLuint, GLint, GLenum, GLboolean, GLsizei, const(void)*);
__gshared glbfn_glVertexAttribPointer glVertexAttribPointer_NVGLZ; alias glVertexAttribPointer = glVertexAttribPointer_NVGLZ;
alias glbfn_glUniform1i = void function(GLint, GLint);
__gshared glbfn_glUniform1i glUniform1i_NVGLZ; alias glUniform1i = glUniform1i_NVGLZ;
alias glbfn_glUniform2fv = void function(GLint, GLsizei, const(GLfloat)*);
__gshared glbfn_glUniform2fv glUniform2fv_NVGLZ; alias glUniform2fv = glUniform2fv_NVGLZ;
alias glbfn_glDisableVertexAttribArray = void function(GLuint);
__gshared glbfn_glDisableVertexAttribArray glDisableVertexAttribArray_NVGLZ; alias glDisableVertexAttribArray = glDisableVertexAttribArray_NVGLZ;
alias glbfn_glDeleteBuffers = void function(GLsizei, const(GLuint)*);
__gshared glbfn_glDeleteBuffers glDeleteBuffers_NVGLZ; alias glDeleteBuffers = glDeleteBuffers_NVGLZ;
alias glbfn_glBlendFuncSeparate = void function(GLenum, GLenum, GLenum, GLenum);
__gshared glbfn_glBlendFuncSeparate glBlendFuncSeparate_NVGLZ; alias glBlendFuncSeparate = glBlendFuncSeparate_NVGLZ;
alias glbfn_glLogicOp = void function (GLenum opcode);
__gshared glbfn_glLogicOp glLogicOp_NVGLZ; alias glLogicOp = glLogicOp_NVGLZ;
alias glbfn_glFramebufferTexture2D = void function (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
__gshared glbfn_glFramebufferTexture2D glFramebufferTexture2D_NVGLZ; alias glFramebufferTexture2D = glFramebufferTexture2D_NVGLZ;
alias glbfn_glDeleteFramebuffers = void function (GLsizei n, const(GLuint)* framebuffers);
__gshared glbfn_glDeleteFramebuffers glDeleteFramebuffers_NVGLZ; alias glDeleteFramebuffers = glDeleteFramebuffers_NVGLZ;
alias glbfn_glGenFramebuffers = void function (GLsizei n, GLuint* framebuffers);
__gshared glbfn_glGenFramebuffers glGenFramebuffers_NVGLZ; alias glGenFramebuffers = glGenFramebuffers_NVGLZ;
alias glbfn_glCheckFramebufferStatus = GLenum function (GLenum target);
__gshared glbfn_glCheckFramebufferStatus glCheckFramebufferStatus_NVGLZ; alias glCheckFramebufferStatus = glCheckFramebufferStatus_NVGLZ;
alias glbfn_glBindFramebuffer = void function (GLenum target, GLuint framebuffer);
__gshared glbfn_glBindFramebuffer glBindFramebuffer_NVGLZ; alias glBindFramebuffer = glBindFramebuffer_NVGLZ;
alias glbfn_glGetIntegerv = void function (GLenum pname, GLint* data);
__gshared glbfn_glGetIntegerv glGetIntegerv_NVGLZ; alias glGetIntegerv = glGetIntegerv_NVGLZ;
private void nanovgInitOpenGL () {
__gshared bool initialized = false;
if (initialized) return;
glStencilMask_NVGLZ = cast(glbfn_glStencilMask)glbindGetProcAddress(`glStencilMask`);
if (glStencilMask_NVGLZ is null) assert(0, `OpenGL function 'glStencilMask' not found!`);
glStencilFunc_NVGLZ = cast(glbfn_glStencilFunc)glbindGetProcAddress(`glStencilFunc`);
if (glStencilFunc_NVGLZ is null) assert(0, `OpenGL function 'glStencilFunc' not found!`);
glGetShaderInfoLog_NVGLZ = cast(glbfn_glGetShaderInfoLog)glbindGetProcAddress(`glGetShaderInfoLog`);
if (glGetShaderInfoLog_NVGLZ is null) assert(0, `OpenGL function 'glGetShaderInfoLog' not found!`);
glGetProgramInfoLog_NVGLZ = cast(glbfn_glGetProgramInfoLog)glbindGetProcAddress(`glGetProgramInfoLog`);
if (glGetProgramInfoLog_NVGLZ is null) assert(0, `OpenGL function 'glGetProgramInfoLog' not found!`);
glCreateProgram_NVGLZ = cast(glbfn_glCreateProgram)glbindGetProcAddress(`glCreateProgram`);
if (glCreateProgram_NVGLZ is null) assert(0, `OpenGL function 'glCreateProgram' not found!`);
glCreateShader_NVGLZ = cast(glbfn_glCreateShader)glbindGetProcAddress(`glCreateShader`);
if (glCreateShader_NVGLZ is null) assert(0, `OpenGL function 'glCreateShader' not found!`);
glShaderSource_NVGLZ = cast(glbfn_glShaderSource)glbindGetProcAddress(`glShaderSource`);
if (glShaderSource_NVGLZ is null) assert(0, `OpenGL function 'glShaderSource' not found!`);
glCompileShader_NVGLZ = cast(glbfn_glCompileShader)glbindGetProcAddress(`glCompileShader`);
if (glCompileShader_NVGLZ is null) assert(0, `OpenGL function 'glCompileShader' not found!`);
glGetShaderiv_NVGLZ = cast(glbfn_glGetShaderiv)glbindGetProcAddress(`glGetShaderiv`);
if (glGetShaderiv_NVGLZ is null) assert(0, `OpenGL function 'glGetShaderiv' not found!`);
glAttachShader_NVGLZ = cast(glbfn_glAttachShader)glbindGetProcAddress(`glAttachShader`);
if (glAttachShader_NVGLZ is null) assert(0, `OpenGL function 'glAttachShader' not found!`);
glBindAttribLocation_NVGLZ = cast(glbfn_glBindAttribLocation)glbindGetProcAddress(`glBindAttribLocation`);
if (glBindAttribLocation_NVGLZ is null) assert(0, `OpenGL function 'glBindAttribLocation' not found!`);
glLinkProgram_NVGLZ = cast(glbfn_glLinkProgram)glbindGetProcAddress(`glLinkProgram`);
if (glLinkProgram_NVGLZ is null) assert(0, `OpenGL function 'glLinkProgram' not found!`);
glGetProgramiv_NVGLZ = cast(glbfn_glGetProgramiv)glbindGetProcAddress(`glGetProgramiv`);
if (glGetProgramiv_NVGLZ is null) assert(0, `OpenGL function 'glGetProgramiv' not found!`);
glDeleteProgram_NVGLZ = cast(glbfn_glDeleteProgram)glbindGetProcAddress(`glDeleteProgram`);
if (glDeleteProgram_NVGLZ is null) assert(0, `OpenGL function 'glDeleteProgram' not found!`);
glDeleteShader_NVGLZ = cast(glbfn_glDeleteShader)glbindGetProcAddress(`glDeleteShader`);
if (glDeleteShader_NVGLZ is null) assert(0, `OpenGL function 'glDeleteShader' not found!`);
glGetUniformLocation_NVGLZ = cast(glbfn_glGetUniformLocation)glbindGetProcAddress(`glGetUniformLocation`);
if (glGetUniformLocation_NVGLZ is null) assert(0, `OpenGL function 'glGetUniformLocation' not found!`);
glGenBuffers_NVGLZ = cast(glbfn_glGenBuffers)glbindGetProcAddress(`glGenBuffers`);
if (glGenBuffers_NVGLZ is null) assert(0, `OpenGL function 'glGenBuffers' not found!`);
glPixelStorei_NVGLZ = cast(glbfn_glPixelStorei)glbindGetProcAddress(`glPixelStorei`);
if (glPixelStorei_NVGLZ is null) assert(0, `OpenGL function 'glPixelStorei' not found!`);
glUniform4fv_NVGLZ = cast(glbfn_glUniform4fv)glbindGetProcAddress(`glUniform4fv`);
if (glUniform4fv_NVGLZ is null) assert(0, `OpenGL function 'glUniform4fv' not found!`);
glColorMask_NVGLZ = cast(glbfn_glColorMask)glbindGetProcAddress(`glColorMask`);
if (glColorMask_NVGLZ is null) assert(0, `OpenGL function 'glColorMask' not found!`);
glStencilOpSeparate_NVGLZ = cast(glbfn_glStencilOpSeparate)glbindGetProcAddress(`glStencilOpSeparate`);
if (glStencilOpSeparate_NVGLZ is null) assert(0, `OpenGL function 'glStencilOpSeparate' not found!`);
glDrawArrays_NVGLZ = cast(glbfn_glDrawArrays)glbindGetProcAddress(`glDrawArrays`);
if (glDrawArrays_NVGLZ is null) assert(0, `OpenGL function 'glDrawArrays' not found!`);
glStencilOp_NVGLZ = cast(glbfn_glStencilOp)glbindGetProcAddress(`glStencilOp`);
if (glStencilOp_NVGLZ is null) assert(0, `OpenGL function 'glStencilOp' not found!`);
glUseProgram_NVGLZ = cast(glbfn_glUseProgram)glbindGetProcAddress(`glUseProgram`);
if (glUseProgram_NVGLZ is null) assert(0, `OpenGL function 'glUseProgram' not found!`);
glCullFace_NVGLZ = cast(glbfn_glCullFace)glbindGetProcAddress(`glCullFace`);
if (glCullFace_NVGLZ is null) assert(0, `OpenGL function 'glCullFace' not found!`);
glFrontFace_NVGLZ = cast(glbfn_glFrontFace)glbindGetProcAddress(`glFrontFace`);
if (glFrontFace_NVGLZ is null) assert(0, `OpenGL function 'glFrontFace' not found!`);
glActiveTexture_NVGLZ = cast(glbfn_glActiveTexture)glbindGetProcAddress(`glActiveTexture`);
if (glActiveTexture_NVGLZ is null) assert(0, `OpenGL function 'glActiveTexture' not found!`);
glBindBuffer_NVGLZ = cast(glbfn_glBindBuffer)glbindGetProcAddress(`glBindBuffer`);
if (glBindBuffer_NVGLZ is null) assert(0, `OpenGL function 'glBindBuffer' not found!`);
glBufferData_NVGLZ = cast(glbfn_glBufferData)glbindGetProcAddress(`glBufferData`);
if (glBufferData_NVGLZ is null) assert(0, `OpenGL function 'glBufferData' not found!`);
glEnableVertexAttribArray_NVGLZ = cast(glbfn_glEnableVertexAttribArray)glbindGetProcAddress(`glEnableVertexAttribArray`);
if (glEnableVertexAttribArray_NVGLZ is null) assert(0, `OpenGL function 'glEnableVertexAttribArray' not found!`);
glVertexAttribPointer_NVGLZ = cast(glbfn_glVertexAttribPointer)glbindGetProcAddress(`glVertexAttribPointer`);
if (glVertexAttribPointer_NVGLZ is null) assert(0, `OpenGL function 'glVertexAttribPointer' not found!`);
glUniform1i_NVGLZ = cast(glbfn_glUniform1i)glbindGetProcAddress(`glUniform1i`);
if (glUniform1i_NVGLZ is null) assert(0, `OpenGL function 'glUniform1i' not found!`);
glUniform2fv_NVGLZ = cast(glbfn_glUniform2fv)glbindGetProcAddress(`glUniform2fv`);
if (glUniform2fv_NVGLZ is null) assert(0, `OpenGL function 'glUniform2fv' not found!`);
glDisableVertexAttribArray_NVGLZ = cast(glbfn_glDisableVertexAttribArray)glbindGetProcAddress(`glDisableVertexAttribArray`);
if (glDisableVertexAttribArray_NVGLZ is null) assert(0, `OpenGL function 'glDisableVertexAttribArray' not found!`);
glDeleteBuffers_NVGLZ = cast(glbfn_glDeleteBuffers)glbindGetProcAddress(`glDeleteBuffers`);
if (glDeleteBuffers_NVGLZ is null) assert(0, `OpenGL function 'glDeleteBuffers' not found!`);
glBlendFuncSeparate_NVGLZ = cast(glbfn_glBlendFuncSeparate)glbindGetProcAddress(`glBlendFuncSeparate`);
if (glBlendFuncSeparate_NVGLZ is null) assert(0, `OpenGL function 'glBlendFuncSeparate' not found!`);
glLogicOp_NVGLZ = cast(glbfn_glLogicOp)glbindGetProcAddress(`glLogicOp`);
if (glLogicOp_NVGLZ is null) assert(0, `OpenGL function 'glLogicOp' not found!`);
glFramebufferTexture2D_NVGLZ = cast(glbfn_glFramebufferTexture2D)glbindGetProcAddress(`glFramebufferTexture2D`);
if (glFramebufferTexture2D_NVGLZ is null) assert(0, `OpenGL function 'glFramebufferTexture2D' not found!`);
glDeleteFramebuffers_NVGLZ = cast(glbfn_glDeleteFramebuffers)glbindGetProcAddress(`glDeleteFramebuffers`);
if (glDeleteFramebuffers_NVGLZ is null) assert(0, `OpenGL function 'glDeleteFramebuffers' not found!`);
glGenFramebuffers_NVGLZ = cast(glbfn_glGenFramebuffers)glbindGetProcAddress(`glGenFramebuffers`);
if (glGenFramebuffers_NVGLZ is null) assert(0, `OpenGL function 'glGenFramebuffers' not found!`);
glCheckFramebufferStatus_NVGLZ = cast(glbfn_glCheckFramebufferStatus)glbindGetProcAddress(`glCheckFramebufferStatus`);
if (glCheckFramebufferStatus_NVGLZ is null) assert(0, `OpenGL function 'glCheckFramebufferStatus' not found!`);
glBindFramebuffer_NVGLZ = cast(glbfn_glBindFramebuffer)glbindGetProcAddress(`glBindFramebuffer`);
if (glBindFramebuffer_NVGLZ is null) assert(0, `OpenGL function 'glBindFramebuffer' not found!`);
glGetIntegerv_NVGLZ = cast(glbfn_glGetIntegerv)glbindGetProcAddress(`glGetIntegerv`);
if (glGetIntegerv_NVGLZ is null) assert(0, `OpenGL function 'glGetIntegerv' not found!`);
initialized = true;
}
}
/// Context creation flags.
/// Group: context_management
public enum NVGContextFlag : int {
/// Nothing special, i.e. empty flag.
None = 0,
/// Flag indicating if geometry based anti-aliasing is used (may not be needed when using MSAA).
Antialias = 1U<<0,
/** Flag indicating if strokes should be drawn using stencil buffer. The rendering will be a little
* slower, but path overlaps (i.e. self-intersecting or sharp turns) will be drawn just once. */
StencilStrokes = 1U<<1,
/// Flag indicating that additional debug checks are done.
Debug = 1U<<2,
/// Filter (antialias) fonts
FontAA = 1U<<7,
/// Don't filter (antialias) fonts
FontNoAA = 1U<<8,
/// You can use this as a substitute for default flags, for cases like this: `nvgCreateContext(NVGContextFlag.Default, NVGContextFlag.Debug);`.
Default = 1U<<31,
}
public enum NANOVG_GL_USE_STATE_FILTER = true;
/// Returns flags for glClear().
/// Group: context_management
public uint glNVGClearFlags () pure nothrow @safe @nogc {
pragma(inline, true);
return (GL_COLOR_BUFFER_BIT|/*GL_DEPTH_BUFFER_BIT|*/GL_STENCIL_BUFFER_BIT);
}
// ////////////////////////////////////////////////////////////////////////// //
private:
version = nanovega_shared_stencil;
//version = nanovega_debug_clipping;
enum GLNVGuniformLoc {
ViewSize,
Tex,
Frag,
TMat,
TTr,
ClipTex,
}
alias GLNVGshaderType = int;
enum /*GLNVGshaderType*/ {
NSVG_SHADER_FILLCOLOR,
NSVG_SHADER_FILLGRAD,
NSVG_SHADER_FILLIMG,
NSVG_SHADER_SIMPLE, // also used for clipfill
NSVG_SHADER_IMG,
}
struct GLNVGshader {
GLuint prog;
GLuint frag;
GLuint vert;
GLint[GLNVGuniformLoc.max+1] loc;
}
struct GLNVGtexture {
int id;
GLuint tex;
int width, height;
NVGtexture type;
int flags;
shared int rc; // this can be 0 with tex != 0 -- postponed deletion
int nextfree;
}
struct GLNVGblend {
bool simple;
GLenum srcRGB;
GLenum dstRGB;
GLenum srcAlpha;
GLenum dstAlpha;
}
alias GLNVGcallType = int;
enum /*GLNVGcallType*/ {
GLNVG_NONE = 0,
GLNVG_FILL,
GLNVG_CONVEXFILL,
GLNVG_STROKE,
GLNVG_TRIANGLES,
GLNVG_AFFINE, // change affine transformation matrix
GLNVG_PUSHCLIP,
GLNVG_POPCLIP,
GLNVG_RESETCLIP,
GLNVG_CLIP_DDUMP_ON,
GLNVG_CLIP_DDUMP_OFF,
}
struct GLNVGcall {
int type;
int evenOdd; // for fill
int image;
int pathOffset;
int pathCount;
int triangleOffset;
int triangleCount;
int uniformOffset;
NVGMatrix affine;
GLNVGblend blendFunc;
NVGClipMode clipmode;
}
struct GLNVGpath {
int fillOffset;
int fillCount;
int strokeOffset;
int strokeCount;
}
align(1) struct GLNVGfragUniforms {
align(1):
enum UNIFORM_ARRAY_SIZE = 13;
// note: after modifying layout or size of uniform array,
// don't forget to also update the fragment shader source!
align(1) union {
align(1):
align(1) struct {
align(1):
float[12] scissorMat; // matrices are actually 3 vec4s
float[12] paintMat;
NVGColor innerCol;
NVGColor middleCol;
NVGColor outerCol;
float[2] scissorExt;
float[2] scissorScale;
float[2] extent;
float radius;
float feather;
float strokeMult;
float strokeThr;
float texType;
float type;
float doclip;
float midp; // for gradients
float unused2, unused3;
}
float[4][UNIFORM_ARRAY_SIZE] uniformArray;
}
}
enum GLMaskState {
DontMask = -1,
Uninitialized = 0,
Initialized = 1,
JustCleared = 2,
}
final class GLNVGTextureLocker {}
struct GLNVGcontext {
private import core.thread : ThreadID;
GLNVGshader shader;
GLNVGtexture* textures;
float[2] view;
int freetexid; // -1: none
int ntextures;
int ctextures;
GLuint vertBuf;
int fragSize;
int flags;
// FBOs for masks
GLuint[NVG_MAX_STATES] fbo;
GLuint[2][NVG_MAX_STATES] fboTex; // FBO textures: [0] is color, [1] is stencil
int fboWidth, fboHeight;
GLMaskState[NVG_MAX_STATES] maskStack;
int msp; // mask stack pointer; starts from `0`; points to next free item; see below for logic description
int lastClipFBO; // -666: cache invalidated; -1: don't mask
int lastClipUniOfs;
bool doClipUnion; // specal mode
GLNVGshader shaderFillFBO;
GLNVGshader shaderCopyFBO;
bool inFrame; // will be `true` if we can perform OpenGL operations (used in texture deletion)
shared bool mustCleanTextures; // will be `true` if we should delete some textures
ThreadID mainTID;
uint mainFBO;
// Per frame buffers
GLNVGcall* calls;
int ccalls;
int ncalls;
GLNVGpath* paths;
int cpaths;
int npaths;
NVGVertex* verts;
int cverts;
int nverts;
ubyte* uniforms;
int cuniforms;
int nuniforms;
NVGMatrix lastAffine;
// cached state
static if (NANOVG_GL_USE_STATE_FILTER) {
GLuint boundTexture;
GLuint stencilMask;
GLenum stencilFunc;
GLint stencilFuncRef;
GLuint stencilFuncMask;
GLNVGblend blendFunc;
}
}
int glnvg__maxi() (int a, int b) { pragma(inline, true); return (a > b ? a : b); }
void glnvg__bindTexture (GLNVGcontext* gl, GLuint tex) nothrow @trusted @nogc {
static if (NANOVG_GL_USE_STATE_FILTER) {
if (gl.boundTexture != tex) {
gl.boundTexture = tex;
glBindTexture(GL_TEXTURE_2D, tex);
}
} else {
glBindTexture(GL_TEXTURE_2D, tex);
}
}
void glnvg__stencilMask (GLNVGcontext* gl, GLuint mask) nothrow @trusted @nogc {
static if (NANOVG_GL_USE_STATE_FILTER) {
if (gl.stencilMask != mask) {
gl.stencilMask = mask;
glStencilMask(mask);
}
} else {
glStencilMask(mask);
}
}
void glnvg__stencilFunc (GLNVGcontext* gl, GLenum func, GLint ref_, GLuint mask) nothrow @trusted @nogc {
static if (NANOVG_GL_USE_STATE_FILTER) {
if (gl.stencilFunc != func || gl.stencilFuncRef != ref_ || gl.stencilFuncMask != mask) {
gl.stencilFunc = func;
gl.stencilFuncRef = ref_;
gl.stencilFuncMask = mask;
glStencilFunc(func, ref_, mask);
}
} else {
glStencilFunc(func, ref_, mask);
}
}
// texture id is never zero
// sets refcount to one
GLNVGtexture* glnvg__allocTexture (GLNVGcontext* gl) nothrow @trusted @nogc {
GLNVGtexture* tex = null;
int tid = gl.freetexid;
if (tid == -1) {
if (gl.ntextures >= gl.ctextures) {
assert(gl.ntextures == gl.ctextures);
//pragma(msg, GLNVGtexture.sizeof*32);
int ctextures = (gl.ctextures == 0 ? 32 : gl.ctextures+gl.ctextures/2); // 1.5x overallocate
GLNVGtexture* textures = cast(GLNVGtexture*)realloc(gl.textures, GLNVGtexture.sizeof*ctextures);
if (textures is null) assert(0, "NanoVega: out of memory for textures");
memset(&textures[gl.ctextures], 0, (ctextures-gl.ctextures)*GLNVGtexture.sizeof);
version(nanovega_debug_textures) {{ import core.stdc.stdio; printf("allocated more textures (n=%d; c=%d; nc=%d)\n", gl.ntextures, gl.ctextures, ctextures); }}
gl.textures = textures;
gl.ctextures = ctextures;
}
assert(gl.ntextures+1 <= gl.ctextures);
tid = gl.ntextures++;
version(nanovega_debug_textures) {{ import core.stdc.stdio; printf(" got next free texture id %d, ntextures=%d\n", tid+1, gl.ntextures); }}
} else {
gl.freetexid = gl.textures[tid].nextfree;
}
assert(tid <= gl.ntextures);
assert(gl.textures[tid].id == 0);
tex = &gl.textures[tid];
memset(tex, 0, (*tex).sizeof);
tex.id = tid+1;
tex.rc = 1;
tex.nextfree = -1;
version(nanovega_debug_textures) {{ import core.stdc.stdio; printf("allocated texture with id %d (%d)\n", tex.id, tid+1); }}
return tex;
}
GLNVGtexture* glnvg__findTexture (GLNVGcontext* gl, int id) nothrow @trusted @nogc {
if (id <= 0 || id > gl.ntextures) return null;
if (gl.textures[id-1].id == 0) return null; // free one
assert(gl.textures[id-1].id == id);
return &gl.textures[id-1];
}
bool glnvg__deleteTexture (GLNVGcontext* gl, ref int id) nothrow @trusted @nogc {
if (id <= 0 || id > gl.ntextures) return false;
auto tx = &gl.textures[id-1];
if (tx.id == 0) { id = 0; return false; } // free one
assert(tx.id == id);
assert(tx.tex != 0);
version(nanovega_debug_textures) {{ import core.stdc.stdio; printf("decrefing texture with id %d (%d)\n", tx.id, id); }}
import core.atomic : atomicOp;
if (atomicOp!"-="(tx.rc, 1) == 0) {
import core.thread : ThreadID;
ThreadID mytid;
static if (__VERSION__ < 2076) {
DGNoThrowNoGC(() {
import core.thread; mytid = Thread.getThis.id;
})();
} else {
try { import core.thread; mytid = Thread.getThis.id; } catch (Exception e) {}
}
if (gl.mainTID == mytid && gl.inFrame) {
// can delete it right now
if ((tx.flags&NVGImageFlag.NoDelete) == 0) glDeleteTextures(1, &tx.tex);
version(nanovega_debug_textures) {{ import core.stdc.stdio; printf("*** deleted texture with id %d (%d); glid=%u\n", tx.id, id, tx.tex); }}
memset(tx, 0, (*tx).sizeof);
//{ import core.stdc.stdio; printf("deleting texture with id %d\n", id); }
tx.nextfree = gl.freetexid;
gl.freetexid = id-1;
} else {
// alas, we aren't doing frame business, so we should postpone deletion
version(nanovega_debug_textures) {{ import core.stdc.stdio; printf("*** POSTPONED texture deletion with id %d (%d); glid=%u\n", tx.id, id, tx.tex); }}
version(aliced) {
synchronized(GLNVGTextureLocker.classinfo) {
tx.id = 0; // mark it as dead
gl.mustCleanTextures = true; // set "need cleanup" flag
}
} else {
try {
synchronized(GLNVGTextureLocker.classinfo) {
tx.id = 0; // mark it as dead
gl.mustCleanTextures = true; // set "need cleanup" flag
}
} catch (Exception e) {}
}
}
}
id = 0;
return true;
}
void glnvg__dumpShaderError (GLuint shader, const(char)* name, const(char)* type) nothrow @trusted @nogc {
import core.stdc.stdio : fprintf, stderr;
GLchar[512+1] str = 0;
GLsizei len = 0;
glGetShaderInfoLog(shader, 512, &len, str.ptr);
if (len > 512) len = 512;
str[len] = '\0';
fprintf(stderr, "Shader %s/%s error:\n%s\n", name, type, str.ptr);
}
void glnvg__dumpProgramError (GLuint prog, const(char)* name) nothrow @trusted @nogc {
import core.stdc.stdio : fprintf, stderr;
GLchar[512+1] str = 0;
GLsizei len = 0;
glGetProgramInfoLog(prog, 512, &len, str.ptr);
if (len > 512) len = 512;
str[len] = '\0';
fprintf(stderr, "Program %s error:\n%s\n", name, str.ptr);
}
void glnvg__resetError(bool force=false) (GLNVGcontext* gl) nothrow @trusted @nogc {
static if (!force) {
if ((gl.flags&NVGContextFlag.Debug) == 0) return;
}
glGetError();
}
void glnvg__checkError(bool force=false) (GLNVGcontext* gl, const(char)* str) nothrow @trusted @nogc {
GLenum err;
static if (!force) {
if ((gl.flags&NVGContextFlag.Debug) == 0) return;
}
err = glGetError();
if (err != GL_NO_ERROR) {
import core.stdc.stdio : fprintf, stderr;
fprintf(stderr, "Error %08x after %s\n", err, str);
return;
}
}
bool glnvg__createShader (GLNVGshader* shader, const(char)* name, const(char)* header, const(char)* opts, const(char)* vshader, const(char)* fshader) nothrow @trusted @nogc {
GLint status;
GLuint prog, vert, frag;
const(char)*[3] str;
memset(shader, 0, (*shader).sizeof);
prog = glCreateProgram();
vert = glCreateShader(GL_VERTEX_SHADER);
frag = glCreateShader(GL_FRAGMENT_SHADER);
str[0] = header;
str[1] = (opts !is null ? opts : "");
str[2] = vshader;
glShaderSource(vert, 3, cast(const(char)**)str.ptr, null);
glCompileShader(vert);
glGetShaderiv(vert, GL_COMPILE_STATUS, &status);
if (status != GL_TRUE) {
glnvg__dumpShaderError(vert, name, "vert");
return false;
}
str[0] = header;
str[1] = (opts !is null ? opts : "");
str[2] = fshader;
glShaderSource(frag, 3, cast(const(char)**)str.ptr, null);
glCompileShader(frag);
glGetShaderiv(frag, GL_COMPILE_STATUS, &status);
if (status != GL_TRUE) {
glnvg__dumpShaderError(frag, name, "frag");
return false;
}
glAttachShader(prog, vert);
glAttachShader(prog, frag);
glBindAttribLocation(prog, 0, "vertex");
glBindAttribLocation(prog, 1, "tcoord");
glLinkProgram(prog);
glGetProgramiv(prog, GL_LINK_STATUS, &status);
if (status != GL_TRUE) {
glnvg__dumpProgramError(prog, name);
return false;
}
shader.prog = prog;
shader.vert = vert;
shader.frag = frag;
return true;
}
void glnvg__deleteShader (GLNVGshader* shader) nothrow @trusted @nogc {
if (shader.prog != 0) glDeleteProgram(shader.prog);
if (shader.vert != 0) glDeleteShader(shader.vert);
if (shader.frag != 0) glDeleteShader(shader.frag);
}
void glnvg__getUniforms (GLNVGshader* shader) nothrow @trusted @nogc {
shader.loc[GLNVGuniformLoc.ViewSize] = glGetUniformLocation(shader.prog, "viewSize");
shader.loc[GLNVGuniformLoc.Tex] = glGetUniformLocation(shader.prog, "tex");
shader.loc[GLNVGuniformLoc.Frag] = glGetUniformLocation(shader.prog, "frag");
shader.loc[GLNVGuniformLoc.TMat] = glGetUniformLocation(shader.prog, "tmat");
shader.loc[GLNVGuniformLoc.TTr] = glGetUniformLocation(shader.prog, "ttr");
shader.loc[GLNVGuniformLoc.ClipTex] = glGetUniformLocation(shader.prog, "clipTex");
}
void glnvg__killFBOs (GLNVGcontext* gl) nothrow @trusted @nogc {
foreach (immutable fidx, ref GLuint fbo; gl.fbo[]) {
if (fbo != 0) {
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, 0, 0);
foreach (ref GLuint tid; gl.fboTex.ptr[fidx][]) if (tid != 0) { glDeleteTextures(1, &tid); tid = 0; }
glDeleteFramebuffers(1, &fbo);
fbo = 0;
}
}
gl.fboWidth = gl.fboHeight = 0;
}
// returns `true` is new FBO was created
// will not unbind buffer, if it was created
bool glnvg__allocFBO (GLNVGcontext* gl, int fidx, bool doclear=true) nothrow @trusted @nogc {
assert(fidx >= 0 && fidx < gl.fbo.length);
assert(gl.fboWidth > 0);
assert(gl.fboHeight > 0);
if (gl.fbo.ptr[fidx] != 0) return false; // nothing to do, this FBO is already initialized
glnvg__resetError(gl);
// allocate FBO object
GLuint fbo = 0;
glGenFramebuffers(1, &fbo);
if (fbo == 0) assert(0, "NanoVega: cannot create FBO");
glnvg__checkError(gl, "glnvg__allocFBO: glGenFramebuffers");
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
//scope(exit) glBindFramebuffer(GL_FRAMEBUFFER, 0);
// attach 2D texture to this FBO
GLuint tidColor = 0;
glGenTextures(1, &tidColor);
if (tidColor == 0) assert(0, "NanoVega: cannot create RGBA texture for FBO");
glBindTexture(GL_TEXTURE_2D, tidColor);
//scope(exit) glBindTexture(GL_TEXTURE_2D, 0);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glnvg__checkError(gl, "glnvg__allocFBO: glTexParameterf: GL_TEXTURE_WRAP_S");
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glnvg__checkError(gl, "glnvg__allocFBO: glTexParameterf: GL_TEXTURE_WRAP_T");
//FIXME: linear or nearest?
//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glnvg__checkError(gl, "glnvg__allocFBO: glTexParameterf: GL_TEXTURE_MIN_FILTER");
//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glnvg__checkError(gl, "glnvg__allocFBO: glTexParameterf: GL_TEXTURE_MAG_FILTER");
// empty texture
//glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, gl.fboWidth, gl.fboHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, null);
// create texture with only one color channel
glTexImage2D(GL_TEXTURE_2D, 0, GL_RED, gl.fboWidth, gl.fboHeight, 0, GL_RED, GL_UNSIGNED_BYTE, null);
//glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, gl.fboWidth, gl.fboHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, null);
glnvg__checkError(gl, "glnvg__allocFBO: glTexImage2D (color)");
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tidColor, 0);
glnvg__checkError(gl, "glnvg__allocFBO: glFramebufferTexture2D (color)");
// attach stencil texture to this FBO
GLuint tidStencil = 0;
version(nanovega_shared_stencil) {
if (gl.fboTex.ptr[0].ptr[0] == 0) {
glGenTextures(1, &tidStencil);
if (tidStencil == 0) assert(0, "NanoVega: cannot create stencil texture for FBO");
gl.fboTex.ptr[0].ptr[0] = tidStencil;
} else {
tidStencil = gl.fboTex.ptr[0].ptr[0];
}
if (fidx != 0) gl.fboTex.ptr[fidx].ptr[1] = 0; // stencil texture is shared among FBOs
} else {
glGenTextures(1, &tidStencil);
if (tidStencil == 0) assert(0, "NanoVega: cannot create stencil texture for FBO");
gl.fboTex.ptr[0].ptr[0] = tidStencil;
}
glBindTexture(GL_TEXTURE_2D, tidStencil);
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_STENCIL, gl.fboWidth, gl.fboHeight, 0, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, null);
glnvg__checkError(gl, "glnvg__allocFBO: glTexImage2D (stencil)");
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, tidStencil, 0);
glnvg__checkError(gl, "glnvg__allocFBO: glFramebufferTexture2D (stencil)");
{
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
if (status != GL_FRAMEBUFFER_COMPLETE) {
version(all) {
import core.stdc.stdio;
if (status == GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT) printf("fucked attachement\n");
if (status == GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS) printf("fucked dimensions\n");
if (status == GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT) printf("missing attachement\n");
if (status == GL_FRAMEBUFFER_UNSUPPORTED) printf("unsupported\n");
}
assert(0, "NanoVega: framebuffer creation failed");
}
}
// clear 'em all
if (doclear) {
glClearColor(0, 0, 0, 0);
glClear(GL_COLOR_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
}
// save texture ids
gl.fbo.ptr[fidx] = fbo;
gl.fboTex.ptr[fidx].ptr[0] = tidColor;
version(nanovega_shared_stencil) {} else {
gl.fboTex.ptr[fidx].ptr[1] = tidStencil;
}
static if (NANOVG_GL_USE_STATE_FILTER) glBindTexture(GL_TEXTURE_2D, gl.boundTexture);
version(nanovega_debug_clipping) if (nanovegaClipDebugDump) { import core.stdc.stdio; printf("FBO(%d): created with index %d\n", gl.msp-1, fidx); }
return true;
}
// will not unbind buffer
void glnvg__clearFBO (GLNVGcontext* gl, int fidx) nothrow @trusted @nogc {
assert(fidx >= 0 && fidx < gl.fbo.length);
assert(gl.fboWidth > 0);
assert(gl.fboHeight > 0);
assert(gl.fbo.ptr[fidx] != 0);
glBindFramebuffer(GL_FRAMEBUFFER, gl.fbo.ptr[fidx]);
glClearColor(0, 0, 0, 0);
glClear(GL_COLOR_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
version(nanovega_debug_clipping) if (nanovegaClipDebugDump) { import core.stdc.stdio; printf("FBO(%d): cleared with index %d\n", gl.msp-1, fidx); }
}
// will not unbind buffer
void glnvg__copyFBOToFrom (GLNVGcontext* gl, int didx, int sidx) nothrow @trusted @nogc {
import core.stdc.string : memset;
assert(didx >= 0 && didx < gl.fbo.length);
assert(sidx >= 0 && sidx < gl.fbo.length);
assert(gl.fboWidth > 0);
assert(gl.fboHeight > 0);
assert(gl.fbo.ptr[didx] != 0);
assert(gl.fbo.ptr[sidx] != 0);
if (didx == sidx) return;
version(nanovega_debug_clipping) if (nanovegaClipDebugDump) { import core.stdc.stdio; printf("FBO(%d): copy FBO: %d -> %d\n", gl.msp-1, sidx, didx); }
glUseProgram(gl.shaderCopyFBO.prog);
glBindFramebuffer(GL_FRAMEBUFFER, gl.fbo.ptr[didx]);
glDisable(GL_CULL_FACE);
glDisable(GL_BLEND);
glDisable(GL_SCISSOR_TEST);
glBindTexture(GL_TEXTURE_2D, gl.fboTex.ptr[sidx].ptr[0]);
// copy texture by drawing full quad
enum x = 0;
enum y = 0;
immutable int w = gl.fboWidth;
immutable int h = gl.fboHeight;
glBegin(GL_QUADS);
glVertex2i(x, y); // top-left
glVertex2i(w, y); // top-right
glVertex2i(w, h); // bottom-right
glVertex2i(x, h); // bottom-left
glEnd();
// restore state (but don't unbind FBO)
static if (NANOVG_GL_USE_STATE_FILTER) glBindTexture(GL_TEXTURE_2D, gl.boundTexture);
glEnable(GL_CULL_FACE);
glEnable(GL_BLEND);
glUseProgram(gl.shader.prog);
}
void glnvg__resetFBOClipTextureCache (GLNVGcontext* gl) nothrow @trusted @nogc {
version(nanovega_debug_clipping) if (nanovegaClipDebugDump) { import core.stdc.stdio; printf("FBO(%d): texture cache invalidated (%d)\n", gl.msp-1, gl.lastClipFBO); }
/*
if (gl.lastClipFBO >= 0) {
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, 0);
glActiveTexture(GL_TEXTURE0);
}
*/
gl.lastClipFBO = -666;
}
void glnvg__setFBOClipTexture (GLNVGcontext* gl, GLNVGfragUniforms* frag) nothrow @trusted @nogc {
//assert(gl.msp > 0 && gl.msp <= gl.maskStack.length);
if (gl.lastClipFBO != -666) {
// cached
version(nanovega_debug_clipping) if (nanovegaClipDebugDump) { import core.stdc.stdio; printf("FBO(%d): cached (%d)\n", gl.msp-1, gl.lastClipFBO); }
frag.doclip = (gl.lastClipFBO >= 0 ? 1 : 0);
return;
}
// no cache
int fboidx = -1;
mainloop: foreach_reverse (immutable sp, GLMaskState mst; gl.maskStack.ptr[0..gl.msp]/*; reverse*/) {
final switch (mst) {
case GLMaskState.DontMask: fboidx = -1; break mainloop;
case GLMaskState.Uninitialized: break;
case GLMaskState.Initialized: fboidx = cast(int)sp; break mainloop;
case GLMaskState.JustCleared: assert(0, "NanoVega: `glnvg__setFBOClipTexture()` internal error");
}
}
if (fboidx < 0) {
// don't mask
gl.lastClipFBO = -1;
frag.doclip = 0;
} else {
// do masking
assert(gl.fbo.ptr[fboidx] != 0);
gl.lastClipFBO = fboidx;
frag.doclip = 1;
}
version(nanovega_debug_clipping) if (nanovegaClipDebugDump) { import core.stdc.stdio; printf("FBO(%d): new cache (new:%d)\n", gl.msp-1, gl.lastClipFBO); }
if (gl.lastClipFBO >= 0) {
assert(gl.fboTex.ptr[gl.lastClipFBO].ptr[0]);
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, gl.fboTex.ptr[gl.lastClipFBO].ptr[0]);
glActiveTexture(GL_TEXTURE0);
}
}
// returns index in `gl.fbo`, or -1 for "don't mask"
int glnvg__generateFBOClipTexture (GLNVGcontext* gl) nothrow @trusted @nogc {
assert(gl.msp > 0 && gl.msp <= gl.maskStack.length);
// we need initialized FBO, even for "don't mask" case
// for this, look back in stack, and either copy initialized FBO,
// or stop at first uninitialized one, and clear it
if (gl.maskStack.ptr[gl.msp-1] == GLMaskState.Initialized) {
// shortcut
version(nanovega_debug_clipping) if (nanovegaClipDebugDump) { import core.stdc.stdio; printf("FBO(%d): generation of new texture is skipped (already initialized)\n", gl.msp-1); }
glBindFramebuffer(GL_FRAMEBUFFER, gl.fbo.ptr[gl.msp-1]);
return gl.msp-1;
}
foreach_reverse (immutable sp; 0..gl.msp/*; reverse*/) {
final switch (gl.maskStack.ptr[sp]) {
case GLMaskState.DontMask:
// clear it
version(nanovega_debug_clipping) if (nanovegaClipDebugDump) { import core.stdc.stdio; printf("FBO(%d): generating new clean texture\n", gl.msp-1); }
if (!glnvg__allocFBO(gl, gl.msp-1)) glnvg__clearFBO(gl, gl.msp-1);
gl.maskStack.ptr[gl.msp-1] = GLMaskState.JustCleared;
return gl.msp-1;
case GLMaskState.Uninitialized: break; // do nothing
case GLMaskState.Initialized:
// i found her! copy to TOS
version(nanovega_debug_clipping) if (nanovegaClipDebugDump) { import core.stdc.stdio; printf("FBO(%d): copying texture from %d\n", gl.msp-1, cast(int)sp); }
glnvg__allocFBO(gl, gl.msp-1, false);
glnvg__copyFBOToFrom(gl, gl.msp-1, sp);
gl.maskStack.ptr[gl.msp-1] = GLMaskState.Initialized;
return gl.msp-1;
case GLMaskState.JustCleared: assert(0, "NanoVega: `glnvg__generateFBOClipTexture()` internal error");
}
}
// nothing was initialized, lol
version(nanovega_debug_clipping) if (nanovegaClipDebugDump) { import core.stdc.stdio; printf("FBO(%d): generating new clean texture (first one)\n", gl.msp-1); }
if (!glnvg__allocFBO(gl, gl.msp-1)) glnvg__clearFBO(gl, gl.msp-1);
gl.maskStack.ptr[gl.msp-1] = GLMaskState.JustCleared;
return gl.msp-1;
}
void glnvg__renderPushClip (void* uptr) nothrow @trusted @nogc {
GLNVGcontext* gl = cast(GLNVGcontext*)uptr;
GLNVGcall* call = glnvg__allocCall(gl);
if (call is null) return;
call.type = GLNVG_PUSHCLIP;
}
void glnvg__renderPopClip (void* uptr) nothrow @trusted @nogc {
GLNVGcontext* gl = cast(GLNVGcontext*)uptr;
GLNVGcall* call = glnvg__allocCall(gl);
if (call is null) return;
call.type = GLNVG_POPCLIP;
}
void glnvg__renderResetClip (void* uptr) nothrow @trusted @nogc {
GLNVGcontext* gl = cast(GLNVGcontext*)uptr;
GLNVGcall* call = glnvg__allocCall(gl);
if (call is null) return;
call.type = GLNVG_RESETCLIP;
}
void glnvg__clipDebugDump (void* uptr, bool doit) nothrow @trusted @nogc {
version(nanovega_debug_clipping) {
GLNVGcontext* gl = cast(GLNVGcontext*)uptr;
GLNVGcall* call = glnvg__allocCall(gl);
call.type = (doit ? GLNVG_CLIP_DDUMP_ON : GLNVG_CLIP_DDUMP_OFF);
}
}
bool glnvg__renderCreate (void* uptr) nothrow @trusted @nogc {
import core.stdc.stdio : snprintf;
GLNVGcontext* gl = cast(GLNVGcontext*)uptr;
enum align_ = 4;
char[64] shaderHeader = void;
//enum shaderHeader = "#define UNIFORM_ARRAY_SIZE 12\n";
snprintf(shaderHeader.ptr, shaderHeader.length, "#define UNIFORM_ARRAY_SIZE %u\n", cast(uint)GLNVGfragUniforms.UNIFORM_ARRAY_SIZE);
enum fillVertShader = q{
uniform vec2 viewSize;
attribute vec2 vertex;
attribute vec2 tcoord;
varying vec2 ftcoord;
varying vec2 fpos;
uniform vec4 tmat; /* abcd of affine matrix: xyzw */
uniform vec2 ttr; /* tx and ty of affine matrix */
void main (void) {
/* affine transformation */
float nx = vertex.x*tmat.x+vertex.y*tmat.z+ttr.x;
float ny = vertex.x*tmat.y+vertex.y*tmat.w+ttr.y;
ftcoord = tcoord;
fpos = vec2(nx, ny);
gl_Position = vec4(2.0*nx/viewSize.x-1.0, 1.0-2.0*ny/viewSize.y, 0, 1);
}
};
enum fillFragShader = `
uniform vec4 frag[UNIFORM_ARRAY_SIZE];
uniform sampler2D tex;
uniform sampler2D clipTex;
uniform vec2 viewSize;
varying vec2 ftcoord;
varying vec2 fpos;
#define scissorMat mat3(frag[0].xyz, frag[1].xyz, frag[2].xyz)
#define paintMat mat3(frag[3].xyz, frag[4].xyz, frag[5].xyz)
#define innerCol frag[6]
#define middleCol frag[7]
#define outerCol frag[7+1]
#define scissorExt frag[8+1].xy
#define scissorScale frag[8+1].zw
#define extent frag[9+1].xy
#define radius frag[9+1].z
#define feather frag[9+1].w
#define strokeMult frag[10+1].x
#define strokeThr frag[10+1].y
#define texType int(frag[10+1].z)
#define type int(frag[10+1].w)
#define doclip int(frag[11+1].x)
#define midp frag[11+1].y
float sdroundrect (in vec2 pt, in vec2 ext, in float rad) {
vec2 ext2 = ext-vec2(rad, rad);
vec2 d = abs(pt)-ext2;
return min(max(d.x, d.y), 0.0)+length(max(d, 0.0))-rad;
}
// Scissoring
float scissorMask (in vec2 p) {
vec2 sc = (abs((scissorMat*vec3(p, 1.0)).xy)-scissorExt);
sc = vec2(0.5, 0.5)-sc*scissorScale;
return clamp(sc.x, 0.0, 1.0)*clamp(sc.y, 0.0, 1.0);
}
#ifdef EDGE_AA
// Stroke - from [0..1] to clipped pyramid, where the slope is 1px.
float strokeMask () {
return min(1.0, (1.0-abs(ftcoord.x*2.0-1.0))*strokeMult)*min(1.0, ftcoord.y);
}
#endif
void main (void) {
// clipping
if (doclip != 0) {
/*vec4 clr = texelFetch(clipTex, ivec2(int(gl_FragCoord.x), int(gl_FragCoord.y)), 0);*/
vec4 clr = texture2D(clipTex, vec2(gl_FragCoord.x/viewSize.x, gl_FragCoord.y/viewSize.y));
if (clr.r == 0.0) discard;
}
float scissor = scissorMask(fpos);
if (scissor <= 0.0) discard; //k8: is it really faster?
#ifdef EDGE_AA
float strokeAlpha = strokeMask();
if (strokeAlpha < strokeThr) discard;
#else
float strokeAlpha = 1.0;
#endif
// rendering
vec4 color;
if (type == 0) { /* NSVG_SHADER_FILLCOLOR */
color = innerCol;
// Combine alpha
color *= strokeAlpha*scissor;
} else if (type == 1) { /* NSVG_SHADER_FILLGRAD */
// Gradient
// Calculate gradient color using box gradient
vec2 pt = (paintMat*vec3(fpos, 1.0)).xy;
float d = clamp((sdroundrect(pt, extent, radius)+feather*0.5)/feather, 0.0, 1.0);
if (midp <= 0.0) {
color = mix(innerCol, outerCol, d);
} else {
float gdst = min(midp, 1.0);
if (d < gdst) {
color = mix(innerCol, middleCol, d/gdst);
} else {
color = mix(middleCol, outerCol, (d-gdst)/gdst);
}
}
// Combine alpha
color *= strokeAlpha*scissor;
} else if (type == 2) { /* NSVG_SHADER_FILLIMG */
// Image
// Calculate color from texture
vec2 pt = (paintMat*vec3(fpos, 1.0)).xy/extent;
color = texture2D(tex, pt);
if (texType == 1) color = vec4(color.xyz*color.w, color.w);
if (texType == 2) color = vec4(color.x);
// Apply color tint and alpha
color *= innerCol;
// Combine alpha
color *= strokeAlpha*scissor;
} else if (type == 3) { /* NSVG_SHADER_SIMPLE */
// Stencil fill
color = vec4(1, 1, 1, 1);
} else if (type == 4) { /* NSVG_SHADER_IMG */
// Textured tris
color = texture2D(tex, ftcoord);
if (texType == 1) color = vec4(color.xyz*color.w, color.w);
if (texType == 2) color = vec4(color.x);
color *= scissor;
color *= innerCol; // Apply color tint
}
gl_FragColor = color;
}
`;
enum clipVertShaderFill = q{
uniform vec2 viewSize;
attribute vec2 vertex;
uniform vec4 tmat; /* abcd of affine matrix: xyzw */
uniform vec2 ttr; /* tx and ty of affine matrix */
void main (void) {
/* affine transformation */
float nx = vertex.x*tmat.x+vertex.y*tmat.z+ttr.x;
float ny = vertex.x*tmat.y+vertex.y*tmat.w+ttr.y;
gl_Position = vec4(2.0*nx/viewSize.x-1.0, 1.0-2.0*ny/viewSize.y, 0, 1);
}
};
enum clipFragShaderFill = q{
uniform vec2 viewSize;
void main (void) {
gl_FragColor = vec4(1, 1, 1, 1);
}
};
enum clipVertShaderCopy = q{
uniform vec2 viewSize;
attribute vec2 vertex;
void main (void) {
gl_Position = vec4(2.0*vertex.x/viewSize.x-1.0, 1.0-2.0*vertex.y/viewSize.y, 0, 1);
}
};
enum clipFragShaderCopy = q{
uniform sampler2D tex;
uniform vec2 viewSize;
void main (void) {
//gl_FragColor = texelFetch(tex, ivec2(int(gl_FragCoord.x), int(gl_FragCoord.y)), 0);
gl_FragColor = texture2D(tex, vec2(gl_FragCoord.x/viewSize.x, gl_FragCoord.y/viewSize.y));
}
};
glnvg__checkError(gl, "init");
string defines = (gl.flags&NVGContextFlag.Antialias ? "#define EDGE_AA 1\n" : null);
if (!glnvg__createShader(&gl.shader, "shader", shaderHeader.ptr, defines.ptr, fillVertShader, fillFragShader)) return false;
if (!glnvg__createShader(&gl.shaderFillFBO, "shaderFillFBO", shaderHeader.ptr, defines.ptr, clipVertShaderFill, clipFragShaderFill)) return false;
if (!glnvg__createShader(&gl.shaderCopyFBO, "shaderCopyFBO", shaderHeader.ptr, defines.ptr, clipVertShaderCopy, clipFragShaderCopy)) return false;
glnvg__checkError(gl, "uniform locations");
glnvg__getUniforms(&gl.shader);
glnvg__getUniforms(&gl.shaderFillFBO);
glnvg__getUniforms(&gl.shaderCopyFBO);
// Create dynamic vertex array
glGenBuffers(1, &gl.vertBuf);
gl.fragSize = GLNVGfragUniforms.sizeof+align_-GLNVGfragUniforms.sizeof%align_;
glnvg__checkError(gl, "create done");
glFinish();
return true;
}
int glnvg__renderCreateTexture (void* uptr, NVGtexture type, int w, int h, int imageFlags, const(ubyte)* data) nothrow @trusted @nogc {
GLNVGcontext* gl = cast(GLNVGcontext*)uptr;
GLNVGtexture* tex = glnvg__allocTexture(gl);
if (tex is null) return 0;
glGenTextures(1, &tex.tex);
tex.width = w;
tex.height = h;
tex.type = type;
tex.flags = imageFlags;
glnvg__bindTexture(gl, tex.tex);
version(nanovega_debug_textures) {{ import core.stdc.stdio; printf("created texture with id %d; glid=%u\n", tex.id, tex.tex); }}
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glPixelStorei(GL_UNPACK_ROW_LENGTH, tex.width);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
// GL 1.4 and later has support for generating mipmaps using a tex parameter.
if ((imageFlags&(NVGImageFlag.GenerateMipmaps|NVGImageFlag.NoFiltering)) == NVGImageFlag.GenerateMipmaps) glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
immutable ttype = (type == NVGtexture.RGBA ? GL_RGBA : GL_RED);
glTexImage2D(GL_TEXTURE_2D, 0, ttype, w, h, 0, ttype, GL_UNSIGNED_BYTE, data);
immutable tfmin =
(imageFlags&NVGImageFlag.NoFiltering ? GL_NEAREST :
imageFlags&NVGImageFlag.GenerateMipmaps ? GL_LINEAR_MIPMAP_LINEAR :
GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, tfmin);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, (imageFlags&NVGImageFlag.NoFiltering ? GL_NEAREST : GL_LINEAR));
int flag;
if (imageFlags&NVGImageFlag.RepeatX)
flag = GL_REPEAT;
else if (imageFlags&NVGImageFlag.ClampToBorderX)
flag = GL_CLAMP_TO_BORDER;
else
flag = GL_CLAMP_TO_EDGE;
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, flag);
if (imageFlags&NVGImageFlag.RepeatY)
flag = GL_REPEAT;
else if (imageFlags&NVGImageFlag.ClampToBorderY)
flag = GL_CLAMP_TO_BORDER;
else
flag = GL_CLAMP_TO_EDGE;
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, flag);
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
glnvg__checkError(gl, "create tex");
glnvg__bindTexture(gl, 0);
return tex.id;
}
bool glnvg__renderDeleteTexture (void* uptr, int image) nothrow @trusted @nogc {
GLNVGcontext* gl = cast(GLNVGcontext*)uptr;
return glnvg__deleteTexture(gl, image);
}
bool glnvg__renderTextureIncRef (void* uptr, int image) nothrow @trusted @nogc {
GLNVGcontext* gl = cast(GLNVGcontext*)uptr;
GLNVGtexture* tex = glnvg__findTexture(gl, image);
if (tex is null) {
version(nanovega_debug_textures) {{ import core.stdc.stdio; printf("CANNOT incref texture with id %d\n", image); }}
return false;
}
import core.atomic : atomicOp;
atomicOp!"+="(tex.rc, 1);
version(nanovega_debug_textures) {{ import core.stdc.stdio; printf("texture #%d: incref; newref=%d\n", image, tex.rc); }}
return true;
}
bool glnvg__renderUpdateTexture (void* uptr, int image, int x, int y, int w, int h, const(ubyte)* data) nothrow @trusted @nogc {
GLNVGcontext* gl = cast(GLNVGcontext*)uptr;
GLNVGtexture* tex = glnvg__findTexture(gl, image);
if (tex is null) {
version(nanovega_debug_textures) {{ import core.stdc.stdio; printf("CANNOT update texture with id %d\n", image); }}
return false;
}
version(nanovega_debug_textures) {{ import core.stdc.stdio; printf("updated texture with id %d; glid=%u\n", tex.id, image, tex.tex); }}
glnvg__bindTexture(gl, tex.tex);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glPixelStorei(GL_UNPACK_ROW_LENGTH, tex.width);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, x);
glPixelStorei(GL_UNPACK_SKIP_ROWS, y);
immutable ttype = (tex.type == NVGtexture.RGBA ? GL_RGBA : GL_RED);
glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, ttype, GL_UNSIGNED_BYTE, data);
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
glnvg__bindTexture(gl, 0);
return true;
}
bool glnvg__renderGetTextureSize (void* uptr, int image, int* w, int* h) nothrow @trusted @nogc {
GLNVGcontext* gl = cast(GLNVGcontext*)uptr;
GLNVGtexture* tex = glnvg__findTexture(gl, image);
if (tex is null) {
if (w !is null) *w = 0;
if (h !is null) *h = 0;
return false;
} else {
if (w !is null) *w = tex.width;
if (h !is null) *h = tex.height;
return true;
}
}
void glnvg__xformToMat3x4 (float[] m3, const(float)[] t) nothrow @trusted @nogc {
assert(t.length >= 6);
assert(m3.length >= 12);
m3.ptr[0] = t.ptr[0];
m3.ptr[1] = t.ptr[1];
m3.ptr[2] = 0.0f;
m3.ptr[3] = 0.0f;
m3.ptr[4] = t.ptr[2];
m3.ptr[5] = t.ptr[3];
m3.ptr[6] = 0.0f;
m3.ptr[7] = 0.0f;
m3.ptr[8] = t.ptr[4];
m3.ptr[9] = t.ptr[5];
m3.ptr[10] = 1.0f;
m3.ptr[11] = 0.0f;
}
NVGColor glnvg__premulColor() (in auto ref NVGColor c) nothrow @trusted @nogc {
//pragma(inline, true);
NVGColor res = void;
res.r = c.r*c.a;
res.g = c.g*c.a;
res.b = c.b*c.a;
res.a = c.a;
return res;
}
bool glnvg__convertPaint (GLNVGcontext* gl, GLNVGfragUniforms* frag, NVGPaint* paint, NVGscissor* scissor, float width, float fringe, float strokeThr) nothrow @trusted @nogc {
import core.stdc.math : sqrtf;
GLNVGtexture* tex = null;
NVGMatrix invxform = void;
memset(frag, 0, (*frag).sizeof);
frag.innerCol = glnvg__premulColor(paint.innerColor);
frag.middleCol = glnvg__premulColor(paint.middleColor);
frag.outerCol = glnvg__premulColor(paint.outerColor);
frag.midp = paint.midp;
if (scissor.extent.ptr[0] < -0.5f || scissor.extent.ptr[1] < -0.5f) {
memset(frag.scissorMat.ptr, 0, frag.scissorMat.sizeof);
frag.scissorExt.ptr[0] = 1.0f;
frag.scissorExt.ptr[1] = 1.0f;
frag.scissorScale.ptr[0] = 1.0f;
frag.scissorScale.ptr[1] = 1.0f;
} else {
//nvgTransformInverse(invxform[], scissor.xform[]);
invxform = scissor.xform.inverted;
glnvg__xformToMat3x4(frag.scissorMat[], invxform.mat[]);
frag.scissorExt.ptr[0] = scissor.extent.ptr[0];
frag.scissorExt.ptr[1] = scissor.extent.ptr[1];
frag.scissorScale.ptr[0] = sqrtf(scissor.xform.mat.ptr[0]*scissor.xform.mat.ptr[0]+scissor.xform.mat.ptr[2]*scissor.xform.mat.ptr[2])/fringe;
frag.scissorScale.ptr[1] = sqrtf(scissor.xform.mat.ptr[1]*scissor.xform.mat.ptr[1]+scissor.xform.mat.ptr[3]*scissor.xform.mat.ptr[3])/fringe;
}
memcpy(frag.extent.ptr, paint.extent.ptr, frag.extent.sizeof);
frag.strokeMult = (width*0.5f+fringe*0.5f)/fringe;
frag.strokeThr = strokeThr;
if (paint.image.valid) {
tex = glnvg__findTexture(gl, paint.image.id);
if (tex is null) return false;
if ((tex.flags&NVGImageFlag.FlipY) != 0) {
/*
NVGMatrix flipped;
nvgTransformScale(flipped[], 1.0f, -1.0f);
nvgTransformMultiply(flipped[], paint.xform[]);
nvgTransformInverse(invxform[], flipped[]);
*/
/*
NVGMatrix m1 = void, m2 = void;
nvgTransformTranslate(m1[], 0.0f, frag.extent.ptr[1]*0.5f);
nvgTransformMultiply(m1[], paint.xform[]);
nvgTransformScale(m2[], 1.0f, -1.0f);
nvgTransformMultiply(m2[], m1[]);
nvgTransformTranslate(m1[], 0.0f, -frag.extent.ptr[1]*0.5f);
nvgTransformMultiply(m1[], m2[]);
nvgTransformInverse(invxform[], m1[]);
*/
NVGMatrix m1 = NVGMatrix.Translated(0.0f, frag.extent.ptr[1]*0.5f);
m1.mul(paint.xform);
NVGMatrix m2 = NVGMatrix.Scaled(1.0f, -1.0f);
m2.mul(m1);
m1 = NVGMatrix.Translated(0.0f, -frag.extent.ptr[1]*0.5f);
m1.mul(m2);
invxform = m1.inverted;
} else {
//nvgTransformInverse(invxform[], paint.xform[]);
invxform = paint.xform.inverted;
}
frag.type = NSVG_SHADER_FILLIMG;
if (tex.type == NVGtexture.RGBA) {
frag.texType = (tex.flags&NVGImageFlag.Premultiplied ? 0 : 1);
} else {
frag.texType = 2;
}
//printf("frag.texType = %d\n", frag.texType);
} else {
frag.type = (paint.simpleColor ? NSVG_SHADER_FILLCOLOR : NSVG_SHADER_FILLGRAD);
frag.radius = paint.radius;
frag.feather = paint.feather;
//nvgTransformInverse(invxform[], paint.xform[]);
invxform = paint.xform.inverted;
}
glnvg__xformToMat3x4(frag.paintMat[], invxform.mat[]);
return true;
}
void glnvg__setUniforms (GLNVGcontext* gl, int uniformOffset, int image) nothrow @trusted @nogc {
GLNVGfragUniforms* frag = nvg__fragUniformPtr(gl, uniformOffset);
glnvg__setFBOClipTexture(gl, frag);
glUniform4fv(gl.shader.loc[GLNVGuniformLoc.Frag], frag.UNIFORM_ARRAY_SIZE, &(frag.uniformArray.ptr[0].ptr[0]));
glnvg__checkError(gl, "glnvg__setUniforms");
if (image != 0) {
GLNVGtexture* tex = glnvg__findTexture(gl, image);
glnvg__bindTexture(gl, (tex !is null ? tex.tex : 0));
glnvg__checkError(gl, "tex paint tex");
} else {
glnvg__bindTexture(gl, 0);
}
}
void glnvg__finishClip (GLNVGcontext* gl, NVGClipMode clipmode) nothrow @trusted @nogc {
assert(clipmode != NVGClipMode.None);
// fill FBO, clear stencil buffer
//TODO: optimize with bounds?
version(all) {
//glnvg__resetAffine(gl);
//glUseProgram(gl.shaderFillFBO.prog);
glDisable(GL_CULL_FACE);
glDisable(GL_BLEND);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glEnable(GL_STENCIL_TEST);
if (gl.doClipUnion) {
// for "and" we should clear everything that is NOT stencil-masked
glnvg__stencilFunc(gl, GL_EQUAL, 0x00, 0xff);
glStencilOp(GL_ZERO, GL_ZERO, GL_ZERO);
} else {
glnvg__stencilFunc(gl, GL_NOTEQUAL, 0x00, 0xff);
glStencilOp(GL_ZERO, GL_ZERO, GL_ZERO);
}
glBegin(GL_QUADS);
glVertex2i(0, 0);
glVertex2i(0, gl.fboHeight);
glVertex2i(gl.fboWidth, gl.fboHeight);
glVertex2i(gl.fboWidth, 0);
glEnd();
//glnvg__restoreAffine(gl);
}
glBindFramebuffer(GL_FRAMEBUFFER, gl.mainFBO);
glDisable(GL_COLOR_LOGIC_OP);
//glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); // done above
glEnable(GL_BLEND);
glDisable(GL_STENCIL_TEST);
glEnable(GL_CULL_FACE);
glUseProgram(gl.shader.prog);
// set current FBO as used one
assert(gl.msp > 0 && gl.fbo.ptr[gl.msp-1] > 0 && gl.fboTex.ptr[gl.msp-1].ptr[0] > 0);
if (gl.lastClipFBO != gl.msp-1) {
version(nanovega_debug_clipping) if (nanovegaClipDebugDump) { import core.stdc.stdio; printf("FBO(%d): new cache from changed mask (old:%d; new:%d)\n", gl.msp-1, gl.lastClipFBO, gl.msp-1); }
gl.lastClipFBO = gl.msp-1;
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, gl.fboTex.ptr[gl.lastClipFBO].ptr[0]);
glActiveTexture(GL_TEXTURE0);
}
}
void glnvg__setClipUniforms (GLNVGcontext* gl, int uniformOffset, NVGClipMode clipmode) nothrow @trusted @nogc {
assert(clipmode != NVGClipMode.None);
GLNVGfragUniforms* frag = nvg__fragUniformPtr(gl, uniformOffset);
// save uniform offset for `glnvg__finishClip()`
gl.lastClipUniOfs = uniformOffset;
// get FBO index, bind this FBO
immutable int clipTexId = glnvg__generateFBOClipTexture(gl);
assert(clipTexId >= 0);
glUseProgram(gl.shaderFillFBO.prog);
glnvg__checkError(gl, "use");
glBindFramebuffer(GL_FRAMEBUFFER, gl.fbo.ptr[clipTexId]);
// set logic op for clip
gl.doClipUnion = false;
if (gl.maskStack.ptr[gl.msp-1] == GLMaskState.JustCleared) {
// it is cleared to zero, we can just draw a path
glDisable(GL_COLOR_LOGIC_OP);
gl.maskStack.ptr[gl.msp-1] = GLMaskState.Initialized;
} else {
glEnable(GL_COLOR_LOGIC_OP);
final switch (clipmode) {
case NVGClipMode.None: assert(0, "wtf?!");
case NVGClipMode.Union: glLogicOp(GL_CLEAR); gl.doClipUnion = true; break; // use `GL_CLEAR` to avoid adding another shader mode
case NVGClipMode.Or: glLogicOp(GL_COPY); break; // GL_OR
case NVGClipMode.Xor: glLogicOp(GL_XOR); break;
case NVGClipMode.Sub: glLogicOp(GL_CLEAR); break;
case NVGClipMode.Replace: glLogicOp(GL_COPY); break;
}
}
// set affine matrix
glUniform4fv(gl.shaderFillFBO.loc[GLNVGuniformLoc.TMat], 1, gl.lastAffine.mat.ptr);
glnvg__checkError(gl, "affine 0");
glUniform2fv(gl.shaderFillFBO.loc[GLNVGuniformLoc.TTr], 1, gl.lastAffine.mat.ptr+4);
glnvg__checkError(gl, "affine 1");
// setup common OpenGL parameters
glDisable(GL_BLEND);
glDisable(GL_CULL_FACE);
glEnable(GL_STENCIL_TEST);
glnvg__stencilMask(gl, 0xff);
glnvg__stencilFunc(gl, GL_EQUAL, 0x00, 0xff);
glStencilOp(GL_KEEP, GL_KEEP, GL_INCR);
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
}
void glnvg__renderViewport (void* uptr, int width, int height) nothrow @trusted @nogc {
GLNVGcontext* gl = cast(GLNVGcontext*)uptr;
gl.inFrame = true;
gl.view.ptr[0] = cast(float)width;
gl.view.ptr[1] = cast(float)height;
// kill FBOs if we need to create new ones (flushing will recreate 'em if necessary)
if (width != gl.fboWidth || height != gl.fboHeight) {
glnvg__killFBOs(gl);
gl.fboWidth = width;
gl.fboHeight = height;
}
gl.msp = 1;
gl.maskStack.ptr[0] = GLMaskState.DontMask;
// texture cleanup
import core.atomic : atomicLoad;
if (atomicLoad(gl.mustCleanTextures)) {
try {
import core.thread : Thread;
static if (__VERSION__ < 2076) {
DGNoThrowNoGC(() {
if (gl.mainTID != Thread.getThis.id) assert(0, "NanoVega: cannot use context in alien thread");
})();
} else {
if (gl.mainTID != Thread.getThis.id) assert(0, "NanoVega: cannot use context in alien thread");
}
synchronized(GLNVGTextureLocker.classinfo) {
gl.mustCleanTextures = false;
foreach (immutable tidx, ref GLNVGtexture tex; gl.textures[0..gl.ntextures]) {
// no need to use atomic ops here, as we're locked
if (tex.rc == 0 && tex.tex != 0 && tex.id == 0) {
version(nanovega_debug_textures) {{ import core.stdc.stdio; printf("*** cleaned up texture with glid=%u\n", tex.tex); }}
import core.stdc.string : memset;
if ((tex.flags&NVGImageFlag.NoDelete) == 0) glDeleteTextures(1, &tex.tex);
memset(&tex, 0, tex.sizeof);
tex.nextfree = gl.freetexid;
gl.freetexid = cast(int)tidx;
}
}
}
} catch (Exception e) {}
}
}
void glnvg__fill (GLNVGcontext* gl, GLNVGcall* call) nothrow @trusted @nogc {
GLNVGpath* paths = &gl.paths[call.pathOffset];
int npaths = call.pathCount;
if (call.clipmode == NVGClipMode.None) {
// Draw shapes
glEnable(GL_STENCIL_TEST);
glnvg__stencilMask(gl, 0xffU);
glnvg__stencilFunc(gl, GL_ALWAYS, 0, 0xffU);
glnvg__setUniforms(gl, call.uniformOffset, 0);
glnvg__checkError(gl, "fill simple");
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
if (call.evenOdd) {
//glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP, GL_INVERT);
//glStencilOpSeparate(GL_BACK, GL_KEEP, GL_KEEP, GL_INVERT);
glStencilOp(GL_KEEP, GL_KEEP, GL_INVERT);
} else {
glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP, GL_INCR_WRAP);
glStencilOpSeparate(GL_BACK, GL_KEEP, GL_KEEP, GL_DECR_WRAP);
}
glDisable(GL_CULL_FACE);
foreach (int i; 0..npaths) glDrawArrays(GL_TRIANGLE_FAN, paths[i].fillOffset, paths[i].fillCount);
glEnable(GL_CULL_FACE);
// Draw anti-aliased pixels
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glnvg__setUniforms(gl, call.uniformOffset+gl.fragSize, call.image);
glnvg__checkError(gl, "fill fill");
if (gl.flags&NVGContextFlag.Antialias) {
glnvg__stencilFunc(gl, GL_EQUAL, 0x00, 0xffU);
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
// Draw fringes
foreach (int i; 0..npaths) glDrawArrays(GL_TRIANGLE_STRIP, paths[i].strokeOffset, paths[i].strokeCount);
}
// Draw fill
glnvg__stencilFunc(gl, GL_NOTEQUAL, 0x0, 0xffU);
glStencilOp(GL_ZERO, GL_ZERO, GL_ZERO);
if (call.evenOdd) {
glDisable(GL_CULL_FACE);
glDrawArrays(GL_TRIANGLE_STRIP, call.triangleOffset, call.triangleCount);
//foreach (int i; 0..npaths) glDrawArrays(GL_TRIANGLE_FAN, paths[i].fillOffset, paths[i].fillCount);
glEnable(GL_CULL_FACE);
} else {
glDrawArrays(GL_TRIANGLE_STRIP, call.triangleOffset, call.triangleCount);
}
glDisable(GL_STENCIL_TEST);
} else {
glnvg__setClipUniforms(gl, call.uniformOffset/*+gl.fragSize*/, call.clipmode); // this activates our FBO
glnvg__checkError(gl, "fillclip simple");
glnvg__stencilFunc(gl, GL_ALWAYS, 0x00, 0xffU);
if (call.evenOdd) {
//glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP, GL_INVERT);
//glStencilOpSeparate(GL_BACK, GL_KEEP, GL_KEEP, GL_INVERT);
glStencilOp(GL_KEEP, GL_KEEP, GL_INVERT);
} else {
glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP, GL_INCR_WRAP);
glStencilOpSeparate(GL_BACK, GL_KEEP, GL_KEEP, GL_DECR_WRAP);
}
foreach (int i; 0..npaths) glDrawArrays(GL_TRIANGLE_FAN, paths[i].fillOffset, paths[i].fillCount);
glnvg__finishClip(gl, call.clipmode); // deactivate FBO, restore rendering state
}
}
void glnvg__convexFill (GLNVGcontext* gl, GLNVGcall* call) nothrow @trusted @nogc {
GLNVGpath* paths = &gl.paths[call.pathOffset];
int npaths = call.pathCount;
if (call.clipmode == NVGClipMode.None) {
glnvg__setUniforms(gl, call.uniformOffset, call.image);
glnvg__checkError(gl, "convex fill");
if (call.evenOdd) glDisable(GL_CULL_FACE);
foreach (int i; 0..npaths) glDrawArrays(GL_TRIANGLE_FAN, paths[i].fillOffset, paths[i].fillCount);
if (gl.flags&NVGContextFlag.Antialias) {
// Draw fringes
foreach (int i; 0..npaths) glDrawArrays(GL_TRIANGLE_STRIP, paths[i].strokeOffset, paths[i].strokeCount);
}
if (call.evenOdd) glEnable(GL_CULL_FACE);
} else {
glnvg__setClipUniforms(gl, call.uniformOffset, call.clipmode); // this activates our FBO
glnvg__checkError(gl, "clip convex fill");
foreach (int i; 0..npaths) glDrawArrays(GL_TRIANGLE_FAN, paths[i].fillOffset, paths[i].fillCount);
if (gl.flags&NVGContextFlag.Antialias) {
// Draw fringes
foreach (int i; 0..npaths) glDrawArrays(GL_TRIANGLE_STRIP, paths[i].strokeOffset, paths[i].strokeCount);
}
glnvg__finishClip(gl, call.clipmode); // deactivate FBO, restore rendering state
}
}
void glnvg__stroke (GLNVGcontext* gl, GLNVGcall* call) nothrow @trusted @nogc {
GLNVGpath* paths = &gl.paths[call.pathOffset];
int npaths = call.pathCount;
if (call.clipmode == NVGClipMode.None) {
if (gl.flags&NVGContextFlag.StencilStrokes) {
glEnable(GL_STENCIL_TEST);
glnvg__stencilMask(gl, 0xff);
// Fill the stroke base without overlap
glnvg__stencilFunc(gl, GL_EQUAL, 0x0, 0xff);
glStencilOp(GL_KEEP, GL_KEEP, GL_INCR);
glnvg__setUniforms(gl, call.uniformOffset+gl.fragSize, call.image);
glnvg__checkError(gl, "stroke fill 0");
foreach (int i; 0..npaths) glDrawArrays(GL_TRIANGLE_STRIP, paths[i].strokeOffset, paths[i].strokeCount);
// Draw anti-aliased pixels.
glnvg__setUniforms(gl, call.uniformOffset, call.image);
glnvg__stencilFunc(gl, GL_EQUAL, 0x00, 0xff);
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
foreach (int i; 0..npaths) glDrawArrays(GL_TRIANGLE_STRIP, paths[i].strokeOffset, paths[i].strokeCount);
// Clear stencil buffer.
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
glnvg__stencilFunc(gl, GL_ALWAYS, 0x0, 0xff);
glStencilOp(GL_ZERO, GL_ZERO, GL_ZERO);
glnvg__checkError(gl, "stroke fill 1");
foreach (int i; 0..npaths) glDrawArrays(GL_TRIANGLE_STRIP, paths[i].strokeOffset, paths[i].strokeCount);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glDisable(GL_STENCIL_TEST);
//glnvg__convertPaint(gl, nvg__fragUniformPtr(gl, call.uniformOffset+gl.fragSize), paint, scissor, strokeWidth, fringe, 1.0f-0.5f/255.0f);
} else {
glnvg__setUniforms(gl, call.uniformOffset, call.image);
glnvg__checkError(gl, "stroke fill");
// Draw Strokes
foreach (int i; 0..npaths) glDrawArrays(GL_TRIANGLE_STRIP, paths[i].strokeOffset, paths[i].strokeCount);
}
} else {
glnvg__setClipUniforms(gl, call.uniformOffset/*+gl.fragSize*/, call.clipmode);
glnvg__checkError(gl, "stroke fill 0");
foreach (int i; 0..npaths) glDrawArrays(GL_TRIANGLE_STRIP, paths[i].strokeOffset, paths[i].strokeCount);
glnvg__finishClip(gl, call.clipmode); // deactivate FBO, restore rendering state
}
}
void glnvg__triangles (GLNVGcontext* gl, GLNVGcall* call) nothrow @trusted @nogc {
if (call.clipmode == NVGClipMode.None) {
glnvg__setUniforms(gl, call.uniformOffset, call.image);
glnvg__checkError(gl, "triangles fill");
glDrawArrays(GL_TRIANGLES, call.triangleOffset, call.triangleCount);
} else {
//TODO(?): use texture as mask?
}
}
void glnvg__affine (GLNVGcontext* gl, GLNVGcall* call) nothrow @trusted @nogc {
glUniform4fv(gl.shader.loc[GLNVGuniformLoc.TMat], 1, call.affine.mat.ptr);
glnvg__checkError(gl, "affine");
glUniform2fv(gl.shader.loc[GLNVGuniformLoc.TTr], 1, call.affine.mat.ptr+4);
glnvg__checkError(gl, "affine");
//glnvg__setUniforms(gl, call.uniformOffset, call.image);
}
void glnvg__renderCancelInternal (GLNVGcontext* gl, bool clearTextures) nothrow @trusted @nogc {
scope(exit) gl.inFrame = false;
if (clearTextures && gl.inFrame) {
try {
import core.thread : Thread;
static if (__VERSION__ < 2076) {
DGNoThrowNoGC(() {
if (gl.mainTID != Thread.getThis.id) assert(0, "NanoVega: cannot use context in alien thread");
})();
} else {
if (gl.mainTID != Thread.getThis.id) assert(0, "NanoVega: cannot use context in alien thread");
}
} catch (Exception e) {}
foreach (ref GLNVGcall c; gl.calls[0..gl.ncalls]) if (c.image > 0) glnvg__deleteTexture(gl, c.image);
}
gl.nverts = 0;
gl.npaths = 0;
gl.ncalls = 0;
gl.nuniforms = 0;
gl.msp = 1;
gl.maskStack.ptr[0] = GLMaskState.DontMask;
}
void glnvg__renderCancel (void* uptr) nothrow @trusted @nogc {
glnvg__renderCancelInternal(cast(GLNVGcontext*)uptr, true);
}
GLenum glnvg_convertBlendFuncFactor (NVGBlendFactor factor) pure nothrow @trusted @nogc {
if (factor == NVGBlendFactor.Zero) return GL_ZERO;
if (factor == NVGBlendFactor.One) return GL_ONE;
if (factor == NVGBlendFactor.SrcColor) return GL_SRC_COLOR;
if (factor == NVGBlendFactor.OneMinusSrcColor) return GL_ONE_MINUS_SRC_COLOR;
if (factor == NVGBlendFactor.DstColor) return GL_DST_COLOR;
if (factor == NVGBlendFactor.OneMinusDstColor) return GL_ONE_MINUS_DST_COLOR;
if (factor == NVGBlendFactor.SrcAlpha) return GL_SRC_ALPHA;
if (factor == NVGBlendFactor.OneMinusSrcAlpha) return GL_ONE_MINUS_SRC_ALPHA;
if (factor == NVGBlendFactor.DstAlpha) return GL_DST_ALPHA;
if (factor == NVGBlendFactor.OneMinusDstAlpha) return GL_ONE_MINUS_DST_ALPHA;
if (factor == NVGBlendFactor.SrcAlphaSaturate) return GL_SRC_ALPHA_SATURATE;
return GL_INVALID_ENUM;
}
GLNVGblend glnvg__buildBlendFunc (NVGCompositeOperationState op) pure nothrow @trusted @nogc {
GLNVGblend res;
res.simple = op.simple;
res.srcRGB = glnvg_convertBlendFuncFactor(op.srcRGB);
res.dstRGB = glnvg_convertBlendFuncFactor(op.dstRGB);
res.srcAlpha = glnvg_convertBlendFuncFactor(op.srcAlpha);
res.dstAlpha = glnvg_convertBlendFuncFactor(op.dstAlpha);
if (res.simple) {
if (res.srcAlpha == GL_INVALID_ENUM || res.dstAlpha == GL_INVALID_ENUM) {
res.srcRGB = res.srcAlpha = res.dstRGB = res.dstAlpha = GL_INVALID_ENUM;
}
} else {
if (res.srcRGB == GL_INVALID_ENUM || res.dstRGB == GL_INVALID_ENUM || res.srcAlpha == GL_INVALID_ENUM || res.dstAlpha == GL_INVALID_ENUM) {
res.simple = true;
res.srcRGB = res.srcAlpha = res.dstRGB = res.dstAlpha = GL_INVALID_ENUM;
}
}
return res;
}
void glnvg__blendCompositeOperation() (GLNVGcontext* gl, in auto ref GLNVGblend op) nothrow @trusted @nogc {
//glBlendFuncSeparate(glnvg_convertBlendFuncFactor(op.srcRGB), glnvg_convertBlendFuncFactor(op.dstRGB), glnvg_convertBlendFuncFactor(op.srcAlpha), glnvg_convertBlendFuncFactor(op.dstAlpha));
static if (NANOVG_GL_USE_STATE_FILTER) {
if (gl.blendFunc.simple == op.simple) {
if (op.simple) {
if (gl.blendFunc.srcAlpha == op.srcAlpha && gl.blendFunc.dstAlpha == op.dstAlpha) return;
} else {
if (gl.blendFunc.srcRGB == op.srcRGB && gl.blendFunc.dstRGB == op.dstRGB && gl.blendFunc.srcAlpha == op.srcAlpha && gl.blendFunc.dstAlpha == op.dstAlpha) return;
}
}
gl.blendFunc = op;
}
if (op.simple) {
if (op.srcAlpha == GL_INVALID_ENUM || op.dstAlpha == GL_INVALID_ENUM) {
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
} else {
glBlendFunc(op.srcAlpha, op.dstAlpha);
}
} else {
if (op.srcRGB == GL_INVALID_ENUM || op.dstRGB == GL_INVALID_ENUM || op.srcAlpha == GL_INVALID_ENUM || op.dstAlpha == GL_INVALID_ENUM) {
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
} else {
glBlendFuncSeparate(op.srcRGB, op.dstRGB, op.srcAlpha, op.dstAlpha);
}
}
}
void glnvg__renderSetAffine (void* uptr, in ref NVGMatrix mat) nothrow @trusted @nogc {
GLNVGcontext* gl = cast(GLNVGcontext*)uptr;
GLNVGcall* call;
// if last operation was GLNVG_AFFINE, simply replace the matrix
if (gl.ncalls > 0 && gl.calls[gl.ncalls-1].type == GLNVG_AFFINE) {
call = &gl.calls[gl.ncalls-1];
} else {
call = glnvg__allocCall(gl);
if (call is null) return;
call.type = GLNVG_AFFINE;
}
call.affine.mat.ptr[0..6] = mat.mat.ptr[0..6];
}
version(nanovega_debug_clipping) public __gshared bool nanovegaClipDebugDump = false;
void glnvg__renderFlush (void* uptr) nothrow @trusted @nogc {
GLNVGcontext* gl = cast(GLNVGcontext*)uptr;
if (!gl.inFrame) assert(0, "NanoVega: internal driver error");
try {
import core.thread : Thread;
static if (__VERSION__ < 2076) {
DGNoThrowNoGC(() {
if (gl.mainTID != Thread.getThis.id) assert(0, "NanoVega: cannot use context in alien thread");
})();
} else {
if (gl.mainTID != Thread.getThis.id) assert(0, "NanoVega: cannot use context in alien thread");
}
} catch (Exception e) {}
scope(exit) gl.inFrame = false;
glnvg__resetError!true(gl);
{
int vv = 0;
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &vv);
if (glGetError() || vv < 0) vv = 0;
gl.mainFBO = cast(uint)vv;
}
enum ShaderType { None, Fill, Clip }
auto lastShader = ShaderType.None;
if (gl.ncalls > 0) {
gl.msp = 1;
gl.maskStack.ptr[0] = GLMaskState.DontMask;
// Setup require GL state.
glUseProgram(gl.shader.prog);
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, 0);
glActiveTexture(GL_TEXTURE0);
glnvg__resetFBOClipTextureCache(gl);
//glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
static if (NANOVG_GL_USE_STATE_FILTER) {
gl.blendFunc.simple = true;
gl.blendFunc.srcRGB = gl.blendFunc.dstRGB = gl.blendFunc.srcAlpha = gl.blendFunc.dstAlpha = GL_INVALID_ENUM;
}
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); // just in case
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
glFrontFace(GL_CCW);
glEnable(GL_BLEND);
glDisable(GL_DEPTH_TEST);
glDisable(GL_SCISSOR_TEST);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glStencilMask(0xffffffff);
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
glStencilFunc(GL_ALWAYS, 0, 0xffffffff);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, 0);
static if (NANOVG_GL_USE_STATE_FILTER) {
gl.boundTexture = 0;
gl.stencilMask = 0xffffffff;
gl.stencilFunc = GL_ALWAYS;
gl.stencilFuncRef = 0;
gl.stencilFuncMask = 0xffffffff;
}
glnvg__checkError(gl, "OpenGL setup");
// Upload vertex data
glBindBuffer(GL_ARRAY_BUFFER, gl.vertBuf);
glBufferData(GL_ARRAY_BUFFER, gl.nverts*NVGVertex.sizeof, gl.verts, GL_STREAM_DRAW);
glEnableVertexAttribArray(0);
glEnableVertexAttribArray(1);
glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, NVGVertex.sizeof, cast(const(GLvoid)*)cast(usize)0);
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, NVGVertex.sizeof, cast(const(GLvoid)*)(0+2*float.sizeof));
glnvg__checkError(gl, "vertex data uploading");
// Set view and texture just once per frame.
glUniform1i(gl.shader.loc[GLNVGuniformLoc.Tex], 0);
if (gl.shader.loc[GLNVGuniformLoc.ClipTex] != -1) {
//{ import core.stdc.stdio; printf("%d\n", gl.shader.loc[GLNVGuniformLoc.ClipTex]); }
glUniform1i(gl.shader.loc[GLNVGuniformLoc.ClipTex], 1);
}
if (gl.shader.loc[GLNVGuniformLoc.ViewSize] != -1) glUniform2fv(gl.shader.loc[GLNVGuniformLoc.ViewSize], 1, gl.view.ptr);
glnvg__checkError(gl, "render shader setup");
// Reset affine transformations.
glUniform4fv(gl.shader.loc[GLNVGuniformLoc.TMat], 1, NVGMatrix.IdentityMat.ptr);
glUniform2fv(gl.shader.loc[GLNVGuniformLoc.TTr], 1, NVGMatrix.IdentityMat.ptr+4);
glnvg__checkError(gl, "affine setup");
// set clip shaders params
// fill
glUseProgram(gl.shaderFillFBO.prog);
glnvg__checkError(gl, "clip shaders setup (fill 0)");
if (gl.shaderFillFBO.loc[GLNVGuniformLoc.ViewSize] != -1) glUniform2fv(gl.shaderFillFBO.loc[GLNVGuniformLoc.ViewSize], 1, gl.view.ptr);
glnvg__checkError(gl, "clip shaders setup (fill 1)");
// copy
glUseProgram(gl.shaderCopyFBO.prog);
glnvg__checkError(gl, "clip shaders setup (copy 0)");
if (gl.shaderCopyFBO.loc[GLNVGuniformLoc.ViewSize] != -1) glUniform2fv(gl.shaderCopyFBO.loc[GLNVGuniformLoc.ViewSize], 1, gl.view.ptr);
glnvg__checkError(gl, "clip shaders setup (copy 1)");
//glUniform1i(gl.shaderFillFBO.loc[GLNVGuniformLoc.Tex], 0);
glUniform1i(gl.shaderCopyFBO.loc[GLNVGuniformLoc.Tex], 0);
glnvg__checkError(gl, "clip shaders setup (copy 2)");
// restore render shader
glUseProgram(gl.shader.prog);
//{ import core.stdc.stdio; printf("ViewSize=%u %u %u\n", gl.shader.loc[GLNVGuniformLoc.ViewSize], gl.shaderFillFBO.loc[GLNVGuniformLoc.ViewSize], gl.shaderCopyFBO.loc[GLNVGuniformLoc.ViewSize]); }
gl.lastAffine.identity;
foreach (int i; 0..gl.ncalls) {
GLNVGcall* call = &gl.calls[i];
switch (call.type) {
case GLNVG_FILL: glnvg__blendCompositeOperation(gl, call.blendFunc); glnvg__fill(gl, call); break;
case GLNVG_CONVEXFILL: glnvg__blendCompositeOperation(gl, call.blendFunc); glnvg__convexFill(gl, call); break;
case GLNVG_STROKE: glnvg__blendCompositeOperation(gl, call.blendFunc); glnvg__stroke(gl, call); break;
case GLNVG_TRIANGLES: glnvg__blendCompositeOperation(gl, call.blendFunc); glnvg__triangles(gl, call); break;
case GLNVG_AFFINE: gl.lastAffine = call.affine; glnvg__affine(gl, call); break;
// clip region management
case GLNVG_PUSHCLIP:
version(nanovega_debug_clipping) if (nanovegaClipDebugDump) { import core.stdc.stdio; printf("FBO(%d): push clip (cache:%d); current state is %d\n", gl.msp-1, gl.lastClipFBO, gl.maskStack.ptr[gl.msp-1]); }
if (gl.msp >= gl.maskStack.length) assert(0, "NanoVega: mask stack overflow in OpenGL backend");
if (gl.maskStack.ptr[gl.msp-1] == GLMaskState.DontMask) {
gl.maskStack.ptr[gl.msp++] = GLMaskState.DontMask;
} else {
gl.maskStack.ptr[gl.msp++] = GLMaskState.Uninitialized;
}
// no need to reset FBO cache here, as nothing was changed
break;
case GLNVG_POPCLIP:
if (gl.msp <= 1) assert(0, "NanoVega: mask stack underflow in OpenGL backend");
version(nanovega_debug_clipping) if (nanovegaClipDebugDump) { import core.stdc.stdio; printf("FBO(%d): pop clip (cache:%d); current state is %d; previous state is %d\n", gl.msp-1, gl.lastClipFBO, gl.maskStack.ptr[gl.msp-1], gl.maskStack.ptr[gl.msp-2]); }
--gl.msp;
assert(gl.msp > 0);
//{ import core.stdc.stdio; printf("popped; new msp is %d; state is %d\n", gl.msp, gl.maskStack.ptr[gl.msp]); }
// check popped item
final switch (gl.maskStack.ptr[gl.msp]) {
case GLMaskState.DontMask:
// if last FBO was "don't mask", reset cache if current is not "don't mask"
if (gl.maskStack.ptr[gl.msp-1] != GLMaskState.DontMask) {
version(nanovega_debug_clipping) if (nanovegaClipDebugDump) { import core.stdc.stdio; printf(" +++ need to reset FBO cache\n"); }
glnvg__resetFBOClipTextureCache(gl);
}
break;
case GLMaskState.Uninitialized:
// if last FBO texture was uninitialized, it means that nothing was changed,
// so we can keep using cached FBO
break;
case GLMaskState.Initialized:
// if last FBO was initialized, it means that something was definitely changed
version(nanovega_debug_clipping) if (nanovegaClipDebugDump) { import core.stdc.stdio; printf(" +++ need to reset FBO cache\n"); }
glnvg__resetFBOClipTextureCache(gl);
break;
case GLMaskState.JustCleared: assert(0, "NanoVega: internal FBO stack error");
}
break;
case GLNVG_RESETCLIP:
// mark current mask as "don't mask"
version(nanovega_debug_clipping) if (nanovegaClipDebugDump) { import core.stdc.stdio; printf("FBO(%d): reset clip (cache:%d); current state is %d\n", gl.msp-1, gl.lastClipFBO, gl.maskStack.ptr[gl.msp-1]); }
if (gl.msp > 0) {
if (gl.maskStack.ptr[gl.msp-1] != GLMaskState.DontMask) {
gl.maskStack.ptr[gl.msp-1] = GLMaskState.DontMask;
version(nanovega_debug_clipping) if (nanovegaClipDebugDump) { import core.stdc.stdio; printf(" +++ need to reset FBO cache\n"); }
glnvg__resetFBOClipTextureCache(gl);
}
}
break;
case GLNVG_CLIP_DDUMP_ON:
version(nanovega_debug_clipping) nanovegaClipDebugDump = true;
break;
case GLNVG_CLIP_DDUMP_OFF:
version(nanovega_debug_clipping) nanovegaClipDebugDump = false;
break;
case GLNVG_NONE: break;
default:
{
import core.stdc.stdio; stderr.fprintf("NanoVega FATAL: invalid command in OpenGL backend: %d\n", call.type);
}
assert(0, "NanoVega: invalid command in OpenGL backend (fatal internal error)");
}
// and free texture, why not
glnvg__deleteTexture(gl, call.image);
}
glDisableVertexAttribArray(0);
glDisableVertexAttribArray(1);
glDisable(GL_CULL_FACE);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glUseProgram(0);
glnvg__bindTexture(gl, 0);
}
// this will do all necessary cleanup
glnvg__renderCancelInternal(gl, false); // no need to clear textures
}
int glnvg__maxVertCount (const(NVGpath)* paths, int npaths) nothrow @trusted @nogc {
int count = 0;
foreach (int i; 0..npaths) {
count += paths[i].nfill;
count += paths[i].nstroke;
}
return count;
}
GLNVGcall* glnvg__allocCall (GLNVGcontext* gl) nothrow @trusted @nogc {
GLNVGcall* ret = null;
if (gl.ncalls+1 > gl.ccalls) {
GLNVGcall* calls;
int ccalls = glnvg__maxi(gl.ncalls+1, 128)+gl.ccalls/2; // 1.5x Overallocate
calls = cast(GLNVGcall*)realloc(gl.calls, GLNVGcall.sizeof*ccalls);
if (calls is null) return null;
gl.calls = calls;
gl.ccalls = ccalls;
}
ret = &gl.calls[gl.ncalls++];
memset(ret, 0, GLNVGcall.sizeof);
return ret;
}
int glnvg__allocPaths (GLNVGcontext* gl, int n) nothrow @trusted @nogc {
int ret = 0;
if (gl.npaths+n > gl.cpaths) {
GLNVGpath* paths;
int cpaths = glnvg__maxi(gl.npaths+n, 128)+gl.cpaths/2; // 1.5x Overallocate
paths = cast(GLNVGpath*)realloc(gl.paths, GLNVGpath.sizeof*cpaths);
if (paths is null) return -1;
gl.paths = paths;
gl.cpaths = cpaths;
}
ret = gl.npaths;
gl.npaths += n;
return ret;
}
int glnvg__allocVerts (GLNVGcontext* gl, int n) nothrow @trusted @nogc {
int ret = 0;
if (gl.nverts+n > gl.cverts) {
NVGVertex* verts;
int cverts = glnvg__maxi(gl.nverts+n, 4096)+gl.cverts/2; // 1.5x Overallocate
verts = cast(NVGVertex*)realloc(gl.verts, NVGVertex.sizeof*cverts);
if (verts is null) return -1;
gl.verts = verts;
gl.cverts = cverts;
}
ret = gl.nverts;
gl.nverts += n;
return ret;
}
int glnvg__allocFragUniforms (GLNVGcontext* gl, int n) nothrow @trusted @nogc {
int ret = 0, structSize = gl.fragSize;
if (gl.nuniforms+n > gl.cuniforms) {
ubyte* uniforms;
int cuniforms = glnvg__maxi(gl.nuniforms+n, 128)+gl.cuniforms/2; // 1.5x Overallocate
uniforms = cast(ubyte*)realloc(gl.uniforms, structSize*cuniforms);
if (uniforms is null) return -1;
gl.uniforms = uniforms;
gl.cuniforms = cuniforms;
}
ret = gl.nuniforms*structSize;
gl.nuniforms += n;
return ret;
}
GLNVGfragUniforms* nvg__fragUniformPtr (GLNVGcontext* gl, int i) nothrow @trusted @nogc {
return cast(GLNVGfragUniforms*)&gl.uniforms[i];
}
void glnvg__vset (NVGVertex* vtx, float x, float y, float u, float v) nothrow @trusted @nogc {
vtx.x = x;
vtx.y = y;
vtx.u = u;
vtx.v = v;
}
void glnvg__renderFill (void* uptr, NVGCompositeOperationState compositeOperation, NVGClipMode clipmode, NVGPaint* paint, NVGscissor* scissor, float fringe, const(float)* bounds, const(NVGpath)* paths, int npaths, bool evenOdd) nothrow @trusted @nogc {
if (npaths < 1) return;
GLNVGcontext* gl = cast(GLNVGcontext*)uptr;
GLNVGcall* call = glnvg__allocCall(gl);
NVGVertex* quad;
GLNVGfragUniforms* frag;
int maxverts, offset;
if (call is null) return;
call.type = GLNVG_FILL;
call.evenOdd = evenOdd;
call.clipmode = clipmode;
//if (clipmode != NVGClipMode.None) { import core.stdc.stdio; printf("CLIP!\n"); }
call.blendFunc = glnvg__buildBlendFunc(compositeOperation);
call.triangleCount = 4;
call.pathOffset = glnvg__allocPaths(gl, npaths);
if (call.pathOffset == -1) goto error;
call.pathCount = npaths;
call.image = paint.image.id;
if (call.image > 0) glnvg__renderTextureIncRef(uptr, call.image);
if (npaths == 1 && paths[0].convex) {
call.type = GLNVG_CONVEXFILL;
call.triangleCount = 0; // Bounding box fill quad not needed for convex fill
}
// Allocate vertices for all the paths.
maxverts = glnvg__maxVertCount(paths, npaths)+call.triangleCount;
offset = glnvg__allocVerts(gl, maxverts);
if (offset == -1) goto error;
foreach (int i; 0..npaths) {
GLNVGpath* copy = &gl.paths[call.pathOffset+i];
const(NVGpath)* path = &paths[i];
memset(copy, 0, GLNVGpath.sizeof);
if (path.nfill > 0) {
copy.fillOffset = offset;
copy.fillCount = path.nfill;
memcpy(&gl.verts[offset], path.fill, NVGVertex.sizeof*path.nfill);
offset += path.nfill;
}
if (path.nstroke > 0) {
copy.strokeOffset = offset;
copy.strokeCount = path.nstroke;
memcpy(&gl.verts[offset], path.stroke, NVGVertex.sizeof*path.nstroke);
offset += path.nstroke;
}
}
// Setup uniforms for draw calls
if (call.type == GLNVG_FILL) {
import core.stdc.string : memcpy;
// Quad
call.triangleOffset = offset;
quad = &gl.verts[call.triangleOffset];
glnvg__vset(&quad[0], bounds[2], bounds[3], 0.5f, 1.0f);
glnvg__vset(&quad[1], bounds[2], bounds[1], 0.5f, 1.0f);
glnvg__vset(&quad[2], bounds[0], bounds[3], 0.5f, 1.0f);
glnvg__vset(&quad[3], bounds[0], bounds[1], 0.5f, 1.0f);
// Get uniform
call.uniformOffset = glnvg__allocFragUniforms(gl, 2);
if (call.uniformOffset == -1) goto error;
// Simple shader for stencil
frag = nvg__fragUniformPtr(gl, call.uniformOffset);
memset(frag, 0, (*frag).sizeof);
glnvg__convertPaint(gl, nvg__fragUniformPtr(gl, call.uniformOffset), paint, scissor, fringe, fringe, -1.0f);
memcpy(nvg__fragUniformPtr(gl, call.uniformOffset+gl.fragSize), frag, (*frag).sizeof);
frag.strokeThr = -1.0f;
frag.type = NSVG_SHADER_SIMPLE;
// Fill shader
//glnvg__convertPaint(gl, nvg__fragUniformPtr(gl, call.uniformOffset+gl.fragSize), paint, scissor, fringe, fringe, -1.0f);
} else {
call.uniformOffset = glnvg__allocFragUniforms(gl, 1);
if (call.uniformOffset == -1) goto error;
// Fill shader
glnvg__convertPaint(gl, nvg__fragUniformPtr(gl, call.uniformOffset), paint, scissor, fringe, fringe, -1.0f);
}
return;
error:
// We get here if call alloc was ok, but something else is not.
// Roll back the last call to prevent drawing it.
if (gl.ncalls > 0) --gl.ncalls;
}
void glnvg__renderStroke (void* uptr, NVGCompositeOperationState compositeOperation, NVGClipMode clipmode, NVGPaint* paint, NVGscissor* scissor, float fringe, float strokeWidth, const(NVGpath)* paths, int npaths) nothrow @trusted @nogc {
if (npaths < 1) return;
GLNVGcontext* gl = cast(GLNVGcontext*)uptr;
GLNVGcall* call = glnvg__allocCall(gl);
int maxverts, offset;
if (call is null) return;
call.type = GLNVG_STROKE;
call.clipmode = clipmode;
call.blendFunc = glnvg__buildBlendFunc(compositeOperation);
call.pathOffset = glnvg__allocPaths(gl, npaths);
if (call.pathOffset == -1) goto error;
call.pathCount = npaths;
call.image = paint.image.id;
if (call.image > 0) glnvg__renderTextureIncRef(uptr, call.image);
// Allocate vertices for all the paths.
maxverts = glnvg__maxVertCount(paths, npaths);
offset = glnvg__allocVerts(gl, maxverts);
if (offset == -1) goto error;
foreach (int i; 0..npaths) {
GLNVGpath* copy = &gl.paths[call.pathOffset+i];
const(NVGpath)* path = &paths[i];
memset(copy, 0, GLNVGpath.sizeof);
if (path.nstroke) {
copy.strokeOffset = offset;
copy.strokeCount = path.nstroke;
memcpy(&gl.verts[offset], path.stroke, NVGVertex.sizeof*path.nstroke);
offset += path.nstroke;
}
}
if (gl.flags&NVGContextFlag.StencilStrokes) {
// Fill shader
call.uniformOffset = glnvg__allocFragUniforms(gl, 2);
if (call.uniformOffset == -1) goto error;
glnvg__convertPaint(gl, nvg__fragUniformPtr(gl, call.uniformOffset), paint, scissor, strokeWidth, fringe, -1.0f);
glnvg__convertPaint(gl, nvg__fragUniformPtr(gl, call.uniformOffset+gl.fragSize), paint, scissor, strokeWidth, fringe, 1.0f-0.5f/255.0f);
} else {
// Fill shader
call.uniformOffset = glnvg__allocFragUniforms(gl, 1);
if (call.uniformOffset == -1) goto error;
glnvg__convertPaint(gl, nvg__fragUniformPtr(gl, call.uniformOffset), paint, scissor, strokeWidth, fringe, -1.0f);
}
return;
error:
// We get here if call alloc was ok, but something else is not.
// Roll back the last call to prevent drawing it.
if (gl.ncalls > 0) --gl.ncalls;
}
void glnvg__renderTriangles (void* uptr, NVGCompositeOperationState compositeOperation, NVGClipMode clipmode, NVGPaint* paint, NVGscissor* scissor, const(NVGVertex)* verts, int nverts) nothrow @trusted @nogc {
if (nverts < 1) return;
GLNVGcontext* gl = cast(GLNVGcontext*)uptr;
GLNVGcall* call = glnvg__allocCall(gl);
GLNVGfragUniforms* frag;
if (call is null) return;
call.type = GLNVG_TRIANGLES;
call.clipmode = clipmode;
call.blendFunc = glnvg__buildBlendFunc(compositeOperation);
call.image = paint.image.id;
if (call.image > 0) glnvg__renderTextureIncRef(uptr, call.image);
// Allocate vertices for all the paths.
call.triangleOffset = glnvg__allocVerts(gl, nverts);
if (call.triangleOffset == -1) goto error;
call.triangleCount = nverts;
memcpy(&gl.verts[call.triangleOffset], verts, NVGVertex.sizeof*nverts);
// Fill shader
call.uniformOffset = glnvg__allocFragUniforms(gl, 1);
if (call.uniformOffset == -1) goto error;
frag = nvg__fragUniformPtr(gl, call.uniformOffset);
glnvg__convertPaint(gl, frag, paint, scissor, 1.0f, 1.0f, -1.0f);
frag.type = NSVG_SHADER_IMG;
return;
error:
// We get here if call alloc was ok, but something else is not.
// Roll back the last call to prevent drawing it.
if (gl.ncalls > 0) --gl.ncalls;
}
void glnvg__renderDelete (void* uptr) nothrow @trusted @nogc {
GLNVGcontext* gl = cast(GLNVGcontext*)uptr;
if (gl is null) return;
glnvg__killFBOs(gl);
glnvg__deleteShader(&gl.shader);
glnvg__deleteShader(&gl.shaderFillFBO);
glnvg__deleteShader(&gl.shaderCopyFBO);
if (gl.vertBuf != 0) glDeleteBuffers(1, &gl.vertBuf);
foreach (ref GLNVGtexture tex; gl.textures[0..gl.ntextures]) {
if (tex.id != 0 && (tex.flags&NVGImageFlag.NoDelete) == 0) {
assert(tex.tex != 0);
glDeleteTextures(1, &tex.tex);
}
}
free(gl.textures);
free(gl.paths);
free(gl.verts);
free(gl.uniforms);
free(gl.calls);
free(gl);
}
/** Creates NanoVega contexts for OpenGL2+.
*
* Specify creation flags as additional arguments, like this:
* `nvgCreateContext(NVGContextFlag.Antialias, NVGContextFlag.StencilStrokes);`
*
* If you won't specify any flags, defaults will be used:
* `[NVGContextFlag.Antialias, NVGContextFlag.StencilStrokes]`.
*
* Group: context_management
*/
public NVGContext nvgCreateContext (const(NVGContextFlag)[] flagList...) nothrow @trusted @nogc {
version(aliced) {
enum DefaultFlags = NVGContextFlag.Antialias|NVGContextFlag.StencilStrokes|NVGContextFlag.FontNoAA;
} else {
enum DefaultFlags = NVGContextFlag.Antialias|NVGContextFlag.StencilStrokes;
}
uint flags = 0;
if (flagList.length != 0) {
foreach (immutable flg; flagList) flags |= (flg != NVGContextFlag.Default ? flg : DefaultFlags);
} else {
flags = DefaultFlags;
}
NVGparams params = void;
NVGContext ctx = null;
version(nanovg_builtin_opengl_bindings) nanovgInitOpenGL(); // why not?
GLNVGcontext* gl = cast(GLNVGcontext*)malloc(GLNVGcontext.sizeof);
if (gl is null) goto error;
memset(gl, 0, GLNVGcontext.sizeof);
memset(¶ms, 0, params.sizeof);
params.renderCreate = &glnvg__renderCreate;
params.renderCreateTexture = &glnvg__renderCreateTexture;
params.renderTextureIncRef = &glnvg__renderTextureIncRef;
params.renderDeleteTexture = &glnvg__renderDeleteTexture;
params.renderUpdateTexture = &glnvg__renderUpdateTexture;
params.renderGetTextureSize = &glnvg__renderGetTextureSize;
params.renderViewport = &glnvg__renderViewport;
params.renderCancel = &glnvg__renderCancel;
params.renderFlush = &glnvg__renderFlush;
params.renderPushClip = &glnvg__renderPushClip;
params.renderPopClip = &glnvg__renderPopClip;
params.renderResetClip = &glnvg__renderResetClip;
params.renderFill = &glnvg__renderFill;
params.renderStroke = &glnvg__renderStroke;
params.renderTriangles = &glnvg__renderTriangles;
params.renderSetAffine = &glnvg__renderSetAffine;
params.renderDelete = &glnvg__renderDelete;
params.userPtr = gl;
params.edgeAntiAlias = (flags&NVGContextFlag.Antialias ? true : false);
if (flags&(NVGContextFlag.FontAA|NVGContextFlag.FontNoAA)) {
params.fontAA = (flags&NVGContextFlag.FontNoAA ? NVG_INVERT_FONT_AA : !NVG_INVERT_FONT_AA);
} else {
params.fontAA = NVG_INVERT_FONT_AA;
}
gl.flags = flags;
gl.freetexid = -1;
ctx = createInternal(¶ms);
if (ctx is null) goto error;
static if (__VERSION__ < 2076) {
DGNoThrowNoGC(() { import core.thread; gl.mainTID = Thread.getThis.id; })();
} else {
try { import core.thread; gl.mainTID = Thread.getThis.id; } catch (Exception e) {}
}
return ctx;
error:
// 'gl' is freed by nvgDeleteInternal.
if (ctx !is null) ctx.deleteInternal();
return null;
}
/// Create NanoVega OpenGL image from texture id.
/// Group: images
public int glCreateImageFromHandleGL2 (NVGContext ctx, GLuint textureId, int w, int h, int imageFlags) nothrow @trusted @nogc {
GLNVGcontext* gl = cast(GLNVGcontext*)ctx.internalParams().userPtr;
GLNVGtexture* tex = glnvg__allocTexture(gl);
if (tex is null) return 0;
tex.type = NVGtexture.RGBA;
tex.tex = textureId;
tex.flags = imageFlags;
tex.width = w;
tex.height = h;
return tex.id;
}
/// Returns OpenGL texture id for NanoVega image.
/// Group: images
public GLuint glImageHandleGL2 (NVGContext ctx, int image) nothrow @trusted @nogc {
GLNVGcontext* gl = cast(GLNVGcontext*)ctx.internalParams().userPtr;
GLNVGtexture* tex = glnvg__findTexture(gl, image);
return tex.tex;
}
// ////////////////////////////////////////////////////////////////////////// //
private:
static if (NanoVegaHasFontConfig) {
version(nanovg_builtin_fontconfig_bindings) {
pragma(lib, "fontconfig");
private extern(C) nothrow @trusted @nogc {
enum FC_FILE = "file"; /* String */
alias FcBool = int;
alias FcChar8 = char;
struct FcConfig;
struct FcPattern;
alias FcMatchKind = int;
enum : FcMatchKind {
FcMatchPattern,
FcMatchFont,
FcMatchScan
}
alias FcResult = int;
enum : FcResult {
FcResultMatch,
FcResultNoMatch,
FcResultTypeMismatch,
FcResultNoId,
FcResultOutOfMemory
}
FcBool FcInit ();
FcBool FcConfigSubstituteWithPat (FcConfig* config, FcPattern* p, FcPattern* p_pat, FcMatchKind kind);
void FcDefaultSubstitute (FcPattern* pattern);
FcBool FcConfigSubstitute (FcConfig* config, FcPattern* p, FcMatchKind kind);
FcPattern* FcFontMatch (FcConfig* config, FcPattern* p, FcResult* result);
FcPattern* FcNameParse (const(FcChar8)* name);
void FcPatternDestroy (FcPattern* p);
FcResult FcPatternGetString (const(FcPattern)* p, const(char)* object, int n, FcChar8** s);
}
}
__gshared bool fontconfigAvailable = false;
// initialize fontconfig
shared static this () {
if (FcInit()) {
fontconfigAvailable = true;
} else {
import core.stdc.stdio : stderr, fprintf;
stderr.fprintf("***NanoVega WARNING: cannot init fontconfig!\n");
}
}
}
// ////////////////////////////////////////////////////////////////////////// //
public enum BaphometDims = 512.0f; // baphomet icon is 512x512 ([0..511])
private static immutable ubyte[7641] baphometPath = [
0x01,0x04,0x06,0x30,0x89,0x7f,0x43,0x00,0x80,0xff,0x43,0x08,0xa0,0x1d,0xc6,0x43,0x00,0x80,0xff,0x43,
0x00,0x80,0xff,0x43,0xa2,0x1d,0xc6,0x43,0x00,0x80,0xff,0x43,0x30,0x89,0x7f,0x43,0x08,0x00,0x80,0xff,
0x43,0x7a,0x89,0xe5,0x42,0xa0,0x1d,0xc6,0x43,0x00,0x00,0x00,0x00,0x30,0x89,0x7f,0x43,0x00,0x00,0x00,
0x00,0x08,0x7a,0x89,0xe5,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7a,0x89,0xe5,0x42,0x00,0x00,
0x00,0x00,0x30,0x89,0x7f,0x43,0x08,0x00,0x00,0x00,0x00,0xa2,0x1d,0xc6,0x43,0x7a,0x89,0xe5,0x42,0x00,
0x80,0xff,0x43,0x30,0x89,0x7f,0x43,0x00,0x80,0xff,0x43,0x09,0x06,0x30,0x89,0x7f,0x43,0x72,0x87,0xdd,
0x43,0x08,0x16,0x68,0xb3,0x43,0x72,0x87,0xdd,0x43,0x71,0x87,0xdd,0x43,0x17,0x68,0xb3,0x43,0x71,0x87,
0xdd,0x43,0x30,0x89,0x7f,0x43,0x08,0x71,0x87,0xdd,0x43,0xd2,0x2f,0x18,0x43,0x16,0x68,0xb3,0x43,0x35,
0xe2,0x87,0x42,0x30,0x89,0x7f,0x43,0x35,0xe2,0x87,0x42,0x08,0xd1,0x2f,0x18,0x43,0x35,0xe2,0x87,0x42,
0x35,0xe2,0x87,0x42,0xd2,0x2f,0x18,0x43,0x35,0xe2,0x87,0x42,0x30,0x89,0x7f,0x43,0x08,0x35,0xe2,0x87,
0x42,0x17,0x68,0xb3,0x43,0xd1,0x2f,0x18,0x43,0x72,0x87,0xdd,0x43,0x30,0x89,0x7f,0x43,0x72,0x87,0xdd,
0x43,0x09,0x06,0x79,0xcb,0x11,0x43,0x62,0xbf,0xd7,0x42,0x07,0xa4,0x3f,0x7f,0x43,0x0b,0x86,0xdc,0x43,
0x07,0x6c,0xb9,0xb2,0x43,0xe8,0xd1,0xca,0x42,0x07,0x6e,0x4d,0xa0,0x42,0xa9,0x10,0x9c,0x43,0x07,0xb7,
0x40,0xd7,0x43,0xa9,0x10,0x9c,0x43,0x07,0x79,0xcb,0x11,0x43,0x62,0xbf,0xd7,0x42,0x09,0x06,0x98,0x42,
0x74,0x43,0xb1,0x8d,0x68,0x43,0x08,0xd7,0x24,0x79,0x43,0xba,0x83,0x6e,0x43,0xa9,0x16,0x7c,0x43,0x56,
0xa1,0x76,0x43,0x74,0x2a,0x7d,0x43,0x44,0x73,0x80,0x43,0x08,0x55,0xd1,0x7e,0x43,0xe3,0xea,0x76,0x43,
0xbc,0x18,0x81,0x43,0x7f,0xa8,0x6e,0x43,0x8f,0x0a,0x84,0x43,0x02,0xfc,0x68,0x43,0x09,0x06,0x92,0x29,
0x8d,0x43,0x73,0xc3,0x67,0x43,0x08,0xa4,0xd9,0x8e,0x43,0xf2,0xa6,0x7a,0x43,0x8f,0x22,0x88,0x43,0x75,
0x2a,0x7d,0x43,0x42,0x7f,0x82,0x43,0x08,0xc8,0x88,0x43,0x09,0x06,0xc1,0x79,0x74,0x43,0x50,0x64,0x89,
0x43,0x08,0x68,0x2d,0x72,0x43,0xee,0x21,0x81,0x43,0xcd,0x97,0x55,0x43,0xe6,0xf1,0x7b,0x43,0x91,0xec,
0x5d,0x43,0xa8,0xc7,0x6a,0x43,0x09,0x06,0xfa,0xa5,0x52,0x43,0x60,0x97,0x7c,0x43,0x08,0x19,0xff,0x50,
0x43,0xe9,0x6e,0x8a,0x43,0xb0,0xbd,0x70,0x43,0x4c,0x51,0x82,0x43,0x04,0xeb,0x69,0x43,0x66,0x0f,0x8e,
0x43,0x09,0x06,0x17,0xbf,0x71,0x43,0x2c,0x58,0x94,0x43,0x08,0x1c,0x96,0x6e,0x43,0x61,0x68,0x99,0x43,
0x2d,0x3a,0x6e,0x43,0xc8,0x81,0x9e,0x43,0xb7,0x9b,0x72,0x43,0x61,0xa4,0xa3,0x43,0x09,0x06,0x30,0xdb,
0x82,0x43,0xdb,0xe9,0x93,0x43,0x08,0x11,0x82,0x84,0x43,0x61,0x68,0x99,0x43,0xe8,0x4a,0x84,0x43,0x8e,
0xa6,0x9e,0x43,0x42,0x7f,0x82,0x43,0x61,0xa4,0xa3,0x43,0x09,0x06,0xc4,0x02,0x85,0x43,0xd1,0x0b,0x92,
0x43,0x08,0xd6,0xb2,0x86,0x43,0x34,0x1e,0x92,0x43,0x4f,0x58,0x87,0x43,0xa4,0xf1,0x92,0x43,0x03,0xd9,
0x87,0x43,0x7b,0xc6,0x94,0x43,0x09,0x06,0x87,0x3e,0x64,0x43,0x31,0x3b,0x93,0x43,0x08,0x3b,0xbf,0x64,
0x43,0x6f,0xf9,0x91,0x43,0x96,0x0b,0x67,0x43,0xc5,0x4a,0x91,0x43,0xcf,0xfe,0x6a,0x43,0x31,0x2f,0x91,
0x43,0x09,0x06,0x16,0x74,0xb5,0x43,0x08,0xec,0x8e,0x43,0x08,0x1b,0x4b,0xb2,0x43,0xee,0x5d,0x8b,0x43,
0x48,0x4d,0xad,0x43,0x12,0xa6,0x8a,0x43,0xf3,0xd7,0xa7,0x43,0x74,0xb8,0x8a,0x43,0x08,0x8c,0xb2,0xa0,
0x43,0xcd,0xf8,0x8a,0x43,0x68,0x46,0x9b,0x43,0x79,0x8f,0x87,0x43,0x49,0xc9,0x96,0x43,0xe9,0x3e,0x82,
0x43,0x08,0x60,0x5c,0x97,0x43,0xa1,0xde,0x8b,0x43,0x4e,0xa0,0x93,0x43,0x31,0x3b,0x93,0x43,0x9f,0xea,
0x8d,0x43,0x27,0x8d,0x99,0x43,0x08,0x07,0xe0,0x8c,0x43,0x06,0x34,0x9b,0x43,0x38,0xe9,0x8c,0x43,0x46,
0x0a,0x9e,0x43,0x3d,0xcc,0x8b,0x43,0xb2,0x06,0xa2,0x43,0x08,0xf1,0x40,0x8a,0x43,0xb0,0x12,0xa4,0x43,
0x39,0xd1,0x88,0x43,0x76,0x43,0xa6,0x43,0xfa,0x06,0x88,0x43,0xa4,0x75,0xa9,0x43,0x08,0x19,0x6c,0x88,
0x43,0x9f,0x9e,0xac,0x43,0x66,0xeb,0x87,0x43,0x44,0x76,0xb0,0x43,0x6b,0xce,0x86,0x43,0x3b,0xbc,0xb4,
0x43,0x08,0xa9,0x8c,0x85,0x43,0x06,0xd0,0xb5,0x43,0xfa,0xee,0x83,0x43,0x74,0xa3,0xb6,0x43,0x3d,0x90,
0x81,0x43,0x31,0xf6,0xb6,0x43,0x08,0x9d,0x61,0x7d,0x43,0xee,0x48,0xb7,0x43,0x3b,0x1f,0x75,0x43,0xcf,
0xe3,0xb6,0x43,0xee,0x6f,0x6d,0x43,0x68,0xe2,0xb5,0x43,0x08,0xd4,0xed,0x6b,0x43,0x87,0x2f,0xb2,0x43,
0x0e,0xc9,0x6b,0x43,0xa7,0x7c,0xae,0x43,0x98,0xfa,0x67,0x43,0xab,0x53,0xab,0x43,0x08,0x25,0x2c,0x64,
0x43,0x33,0xa2,0xa8,0x43,0x40,0x96,0x61,0x43,0xc3,0xc2,0xa5,0x43,0x64,0xde,0x60,0x43,0xfa,0xa2,0xa2,
0x43,0x08,0xb0,0x5d,0x60,0x43,0x06,0x4c,0x9f,0x43,0x9a,0xca,0x5f,0x43,0x38,0x3d,0x9b,0x43,0x3b,0x8f,
0x5c,0x43,0x85,0xb0,0x98,0x43,0x08,0x42,0x36,0x51,0x43,0x3d,0xf0,0x91,0x43,0xcd,0x4f,0x49,0x43,0xdb,
0xb9,0x8b,0x43,0xe0,0xdb,0x44,0x43,0x42,0x8b,0x84,0x43,0x08,0x7e,0xc9,0x44,0x43,0x8a,0x57,0x8d,0x43,
0xbc,0x6c,0x0f,0x43,0x23,0x62,0x8e,0x43,0xf5,0x17,0x07,0x43,0xc5,0x3e,0x8f,0x43,0x09,0x06,0xe0,0xea,
0x76,0x43,0xab,0xef,0xc5,0x43,0x08,0x12,0x00,0x79,0x43,0xab,0xcb,0xbf,0x43,0x79,0xb9,0x6d,0x43,0x7e,
0x8d,0xba,0x43,0xee,0x6f,0x6d,0x43,0x98,0xeb,0xb5,0x43,0x08,0xe0,0x02,0x7b,0x43,0x5f,0x1c,0xb8,0x43,
0x85,0x2c,0x82,0x43,0xe9,0x65,0xb8,0x43,0xd6,0xb2,0x86,0x43,0xc6,0x05,0xb5,0x43,0x08,0x03,0xcd,0x85,
0x43,0x5a,0x39,0xb9,0x43,0xe4,0x4f,0x81,0x43,0xdb,0xd4,0xbf,0x43,0xdf,0x6c,0x82,0x43,0xbc,0x93,0xc5,
0x43,0x09,0x06,0xf0,0xd0,0x22,0x43,0x5d,0x19,0x08,0x43,0x08,0xbc,0xab,0x49,0x43,0x4a,0x35,0x29,0x43,
0xcb,0xf7,0x65,0x43,0xce,0x37,0x45,0x43,0x0e,0x99,0x63,0x43,0x67,0xc6,0x5c,0x43,0x09,0x06,0x05,0x94,
0xab,0x43,0xc2,0x13,0x04,0x43,0x08,0x9f,0x26,0x98,0x43,0x11,0x42,0x25,0x43,0x97,0x00,0x8a,0x43,0x32,
0x32,0x41,0x43,0xf5,0x2f,0x8b,0x43,0xc7,0xc0,0x58,0x43,0x09,0x06,0x8f,0x85,0x48,0x43,0xe0,0xa8,0x8c,
0x43,0x08,0x55,0xaa,0x48,0x43,0xe0,0xa8,0x8c,0x43,0x6b,0x3d,0x49,0x43,0xc1,0x43,0x8c,0x43,0x31,0x62,
0x49,0x43,0xc1,0x43,0x8c,0x43,0x08,0x2f,0xe3,0x2f,0x43,0xad,0xe7,0x98,0x43,0xff,0x0d,0x0d,0x43,0xad,
0xf3,0x9a,0x43,0xf0,0xaf,0xcc,0x42,0x74,0x00,0x97,0x43,0x08,0xbb,0xa2,0xf7,0x42,0x93,0x4d,0x93,0x43,
0x5e,0x19,0x08,0x43,0x5a,0x2a,0x87,0x43,0x23,0x6e,0x10,0x43,0x42,0x97,0x86,0x43,0x08,0xca,0xe8,0x33,
0x43,0x1b,0x3c,0x80,0x43,0x80,0xe8,0x4d,0x43,0xda,0xf4,0x70,0x43,0xae,0x0e,0x4f,0x43,0x2b,0x1b,0x65,
0x43,0x08,0x66,0x96,0x54,0x43,0xa3,0xe1,0x3b,0x43,0x4e,0xc4,0x19,0x43,0xa0,0x1a,0x16,0x43,0x10,0xe2,
0x14,0x43,0x26,0x14,0xe0,0x42,0x08,0x5c,0x91,0x1c,0x43,0xcb,0x27,0xee,0x42,0xa9,0x40,0x24,0x43,0x71,
0x3b,0xfc,0x42,0xf3,0xef,0x2b,0x43,0x8b,0x27,0x05,0x43,0x08,0xe2,0x4b,0x2c,0x43,0x48,0x86,0x07,0x43,
0x79,0x62,0x2f,0x43,0x05,0xe5,0x09,0x43,0x55,0x32,0x34,0x43,0xa0,0xd2,0x09,0x43,0x08,0x74,0xa3,0x36,
0x43,0x3a,0xd1,0x08,0x43,0x7e,0x81,0x38,0x43,0x09,0xd4,0x0a,0x43,0x0d,0xba,0x39,0x43,0xa0,0xea,0x0d,
0x43,0x08,0x6f,0xe4,0x3d,0x43,0x43,0xc7,0x0e,0x43,0xd6,0xe5,0x3e,0x43,0xc4,0x4a,0x11,0x43,0x55,0x7a,
0x40,0x43,0x59,0x72,0x13,0x43,0x08,0x55,0x92,0x44,0x43,0xbf,0x73,0x14,0x43,0x23,0x95,0x46,0x43,0xa5,
0x09,0x17,0x43,0xe0,0xf3,0x48,0x43,0xfe,0x55,0x19,0x43,0x08,0xcd,0x4f,0x49,0x43,0xaa,0x10,0x1c,0x43,
0x61,0x77,0x4b,0x43,0xfe,0x6d,0x1d,0x43,0x80,0xe8,0x4d,0x43,0x2b,0x94,0x1e,0x43,0x08,0x58,0xc9,0x51,
0x43,0x41,0x27,0x1f,0x43,0x9b,0x82,0x53,0x43,0x35,0x72,0x20,0x43,0x53,0xf2,0x54,0x43,0x88,0xcf,0x21,
0x43,0x08,0x7b,0x29,0x55,0x43,0xe8,0x0a,0x25,0x43,0xb2,0x2d,0x58,0x43,0xef,0xe8,0x26,0x43,0x9b,0xb2,
0x5b,0x43,0xd0,0x8f,0x28,0x43,0x08,0x5f,0xef,0x5f,0x43,0xeb,0x11,0x2a,0x43,0xfd,0xdc,0x5f,0x43,0x6e,
0x95,0x2c,0x43,0x3b,0xa7,0x60,0x43,0x2b,0xf4,0x2e,0x43,0x08,0x06,0xbb,0x61,0x43,0xfd,0xe5,0x31,0x43,
0xe7,0x61,0x63,0x43,0xef,0x30,0x33,0x43,0x53,0x52,0x65,0x43,0xa3,0xb1,0x33,0x43,0x08,0x12,0xa0,0x68,
0x43,0x7f,0x69,0x34,0x43,0x40,0xc6,0x69,0x43,0x64,0xff,0x36,0x43,0x7e,0x90,0x6a,0x43,0x71,0xcc,0x39,
0x43,0x08,0xbc,0x5a,0x6b,0x43,0x51,0x73,0x3b,0x43,0xc1,0x49,0x6c,0x43,0xa5,0xd0,0x3c,0x43,0xe0,0xba,
0x6e,0x43,0xb8,0x74,0x3c,0x43,0x08,0x6b,0x1c,0x73,0x43,0x13,0xc1,0x3e,0x43,0x40,0xf6,0x71,0x43,0xce,
0x1f,0x41,0x43,0x55,0x89,0x72,0x43,0x8d,0x7e,0x43,0x43,0x08,0x68,0x2d,0x72,0x43,0x89,0xae,0x4b,0x43,
0xc1,0x79,0x74,0x43,0xcb,0x78,0x4c,0x43,0x55,0xa1,0x76,0x43,0x5b,0xb1,0x4d,0x43,0x08,0xa2,0x38,0x7a,
0x43,0xd1,0x56,0x4e,0x43,0x85,0xb6,0x78,0x43,0xb1,0x15,0x54,0x43,0x83,0xc7,0x77,0x43,0x89,0x0e,0x5c,
0x43,0x08,0xcf,0x46,0x77,0x43,0x0f,0x81,0x5f,0x43,0x1a,0xde,0x7a,0x43,0xce,0xc7,0x5d,0x43,0x42,0x73,
0x80,0x43,0x99,0xc3,0x5a,0x43,0x08,0x85,0x2c,0x82,0x43,0xf6,0xe6,0x59,0x43,0x81,0x3d,0x81,0x43,0x16,
0x10,0x50,0x43,0xd6,0x8e,0x80,0x43,0x5b,0x99,0x49,0x43,0x08,0xc4,0xea,0x80,0x43,0x22,0x95,0x46,0x43,
0xfa,0xe2,0x81,0x43,0xda,0xec,0x43,0x43,0x78,0x77,0x83,0x43,0xe4,0xb2,0x41,0x43,0x08,0x8a,0x27,0x85,
0x43,0x86,0x77,0x3e,0x43,0x0c,0x9f,0x85,0x43,0x07,0xf4,0x3b,0x43,0x8f,0x16,0x86,0x43,0xe6,0x82,0x39,
0x43,0x08,0x85,0x44,0x86,0x43,0x37,0xd9,0x35,0x43,0x1e,0x4f,0x87,0x43,0xe1,0x7b,0x34,0x43,0xdf,0x90,
0x88,0x43,0xb6,0x55,0x33,0x43,0x08,0xae,0x93,0x8a,0x43,0xfd,0xe5,0x31,0x43,0xfa,0x12,0x8a,0x43,0xbf,
0x03,0x2d,0x43,0x19,0x78,0x8a,0x43,0x45,0x5e,0x2c,0x43,0x08,0x03,0xf1,0x8b,0x43,0xac,0x47,0x29,0x43,
0x2f,0x17,0x8d,0x43,0x45,0x46,0x28,0x43,0xc8,0x21,0x8e,0x43,0x30,0xb3,0x27,0x43,0x08,0xa9,0xc8,0x8f,
0x43,0xef,0xe8,0x26,0x43,0xbf,0x5b,0x90,0x43,0x5b,0xc1,0x24,0x43,0x10,0xca,0x90,0x43,0xa0,0x62,0x22,
0x43,0x08,0x26,0x5d,0x91,0x43,0xbb,0xcc,0x1f,0x43,0xf0,0x70,0x92,0x43,0x78,0x13,0x1e,0x43,0x77,0xd7,
0x93,0x43,0x73,0x24,0x1d,0x43,0x08,0x65,0x3f,0x96,0x43,0xce,0x58,0x1b,0x43,0xbe,0x7f,0x96,0x43,0xbf,
0x8b,0x18,0x43,0x60,0x5c,0x97,0x43,0xb6,0xad,0x16,0x43,0x08,0xba,0xa8,0x99,0x43,0x78,0xcb,0x11,0x43,
0x49,0xe1,0x9a,0x43,0x78,0xcb,0x11,0x43,0x01,0x51,0x9c,0x43,0x73,0xdc,0x10,0x43,0x08,0x72,0x24,0x9d,
0x43,0xd2,0xff,0x0f,0x43,0x1c,0xd3,0x9d,0x43,0x07,0xec,0x0e,0x43,0xeb,0xc9,0x9d,0x43,0xe8,0x7a,0x0c,
0x43,0x08,0x60,0x80,0x9d,0x43,0xd7,0xbe,0x08,0x43,0x4d,0xe8,0x9f,0x43,0x86,0x50,0x08,0x43,0x25,0xbd,
0xa1,0x43,0x5b,0x2a,0x07,0x43,0x08,0x99,0x7f,0xa3,0x43,0xc9,0xf1,0x05,0x43,0x48,0x1d,0xa5,0x43,0x86,
0x38,0x04,0x43,0x6c,0x71,0xa6,0x43,0x18,0x59,0x01,0x43,0x08,0x32,0x96,0xa6,0x43,0x6e,0x64,0xff,0x42,
0x48,0x29,0xa7,0x43,0xed,0xcf,0xfd,0x42,0x5f,0xbc,0xa7,0x43,0x71,0x3b,0xfc,0x42,0x08,0xf3,0xe3,0xa9,
0x43,0xf7,0x7d,0xf7,0x42,0xd8,0x6d,0xaa,0x43,0x45,0xe5,0xf2,0x42,0x48,0x41,0xab,0x43,0xcb,0x27,0xee,
0x42,0x08,0x24,0xf9,0xab,0x43,0x52,0x6a,0xe9,0x42,0xee,0x0c,0xad,0x43,0x4c,0x8c,0xe7,0x42,0x1b,0x33,
0xae,0x43,0xcc,0xf7,0xe5,0x42,0x08,0xaa,0x6b,0xaf,0x43,0xe8,0x61,0xe3,0x42,0x90,0xf5,0xaf,0x43,0xc9,
0xf0,0xe0,0x42,0xe0,0x63,0xb0,0x43,0xe5,0x5a,0xde,0x42,0x08,0xaa,0x83,0xb3,0x43,0x29,0x2d,0x09,0x43,
0x6a,0xfe,0x8e,0x43,0xb8,0x74,0x3c,0x43,0xd5,0x06,0x95,0x43,0xe6,0x79,0x67,0x43,0x08,0x2f,0x53,0x97,
0x43,0xe9,0xb0,0x74,0x43,0xa8,0x28,0xa0,0x43,0x43,0xfd,0x76,0x43,0x83,0x28,0xad,0x43,0x17,0x59,0x81,
0x43,0x08,0x3d,0xe7,0xbf,0x43,0x4b,0x8d,0x8c,0x43,0xae,0x96,0xba,0x43,0x66,0x27,0x92,0x43,0x15,0xe0,
0xc7,0x43,0x6f,0x11,0x96,0x43,0x08,0x7e,0x5d,0xb2,0x43,0xdb,0x01,0x98,0x43,0x9e,0x56,0xa0,0x43,0x80,
0xc1,0x97,0x43,0x69,0x2e,0x97,0x43,0x31,0x17,0x8d,0x43,0x09,0x06,0xab,0xa7,0x39,0x43,0x67,0x0f,0x0e,
0x43,0x08,0xdb,0xbc,0x3b,0x43,0xe8,0x92,0x10,0x43,0xb5,0x85,0x3b,0x43,0x97,0x3c,0x14,0x43,0xab,0xa7,
0x39,0x43,0x0c,0x0b,0x18,0x43,0x09,0x06,0xca,0x30,0x40,0x43,0x30,0x3b,0x13,0x43,0x08,0x17,0xc8,0x43,
0x43,0xa5,0x09,0x17,0x43,0x7e,0xc9,0x44,0x43,0x1a,0xd8,0x1a,0x43,0x9d,0x22,0x43,0x43,0x8d,0xa6,0x1e,
0x43,0x09,0x06,0xc8,0x78,0x4c,0x43,0xed,0xc9,0x1d,0x43,0x08,0x0b,0x32,0x4e,0x43,0x22,0xce,0x20,0x43,
0x23,0xc5,0x4e,0x43,0x58,0xd2,0x23,0x43,0x0b,0x32,0x4e,0x43,0x2b,0xc4,0x26,0x43,0x09,0x06,0xec,0x08,
0x58,0x43,0xc7,0xb1,0x26,0x43,0x08,0x02,0x9c,0x58,0x43,0xef,0x00,0x2b,0x43,0xd9,0x64,0x58,0x43,0x02,
0xbd,0x2e,0x43,0x10,0x51,0x57,0x43,0x37,0xc1,0x31,0x43,0x09,0x06,0xcb,0xdf,0x61,0x43,0x4a,0x65,0x31,
0x43,0x08,0xbe,0x2a,0x63,0x43,0xbd,0x33,0x35,0x43,0x32,0xe1,0x62,0x43,0x56,0x4a,0x38,0x43,0xde,0x83,
0x61,0x43,0x3c,0xe0,0x3a,0x43,0x09,0x06,0x1c,0x7e,0x6a,0x43,0x5b,0x39,0x39,0x43,0x08,0x31,0x11,0x6b,
0x43,0x0c,0xd2,0x3d,0x43,0x1c,0x7e,0x6a,0x43,0x13,0xd9,0x42,0x43,0xd9,0xc4,0x68,0x43,0xcb,0x60,0x48,
0x43,0x09,0x06,0xe5,0xc1,0x73,0x43,0x16,0xf8,0x4b,0x43,0x08,0xa6,0xf7,0x72,0x43,0xb1,0xfd,0x4f,0x43,
0x3b,0x07,0x71,0x43,0x4a,0x14,0x53,0x43,0xa2,0xf0,0x6d,0x43,0x7c,0x29,0x55,0x43,0x09,0x06,0x00,0x8d,
0xa6,0x43,0xef,0x21,0x01,0x43,0x08,0x52,0xfb,0xa6,0x43,0xce,0xc8,0x02,0x43,0xe6,0x16,0xa7,0x43,0x51,
0x4c,0x05,0x43,0x3b,0x68,0xa6,0x43,0x4c,0x75,0x08,0x43,0x09,0x06,0xde,0x20,0xa1,0x43,0x86,0x50,0x08,
0x43,0x08,0xd4,0x4e,0xa1,0x43,0xd3,0xe7,0x0b,0x43,0xb5,0xe9,0xa0,0x43,0x59,0x5a,0x0f,0x43,0xba,0xcc,
0x9f,0x43,0x54,0x83,0x12,0x43,0x09,0x06,0x77,0xfb,0x99,0x43,0x6c,0x16,0x13,0x43,0x08,0xde,0xfc,0x9a,
0x43,0x4a,0xbd,0x14,0x43,0x06,0x34,0x9b,0x43,0xfe,0x55,0x19,0x43,0x13,0xe9,0x99,0x43,0x41,0x27,0x1f,
0x43,0x09,0x06,0x46,0xce,0x93,0x43,0x26,0xa5,0x1d,0x43,0x08,0xe7,0xaa,0x94,0x43,0xbb,0xcc,0x1f,0x43,
0x18,0xb4,0x94,0x43,0xa8,0x40,0x24,0x43,0xe2,0xbb,0x93,0x43,0x21,0xfe,0x28,0x43,0x09,0x06,0xb1,0x8e,
0x8d,0x43,0xa8,0x58,0x28,0x43,0x08,0x19,0x90,0x8e,0x43,0x54,0x13,0x2b,0x43,0xa4,0xd9,0x8e,0x43,0x84,
0x40,0x31,0x43,0x46,0xaa,0x8d,0x43,0x29,0x24,0x37,0x43,0x09,0x06,0xd6,0xbe,0x88,0x43,0xef,0x30,0x33,
0x43,0x08,0x0c,0xb7,0x89,0x43,0x0e,0xa2,0x35,0x43,0xc0,0x37,0x8a,0x43,0x7a,0xaa,0x3b,0x43,0xbb,0x48,
0x89,0x43,0xbb,0x7b,0x41,0x43,0x09,0x06,0x3a,0xad,0x82,0x43,0xc4,0x59,0x43,0x43,0x08,0xd2,0xb7,0x83,
0x43,0x2b,0x5b,0x44,0x43,0x35,0xd6,0x85,0x43,0x48,0xf5,0x49,0x43,0x42,0x97,0x86,0x43,0xc4,0xa1,0x4f,
0x43,0x09,0x06,0x9c,0xb3,0x80,0x43,0x48,0x55,0x5a,0x43,0x08,0xff,0xc5,0x80,0x43,0x09,0x73,0x55,0x43,
0x93,0xe1,0x80,0x43,0x0f,0x39,0x53,0x43,0xf1,0xbe,0x7e,0x43,0x18,0xe7,0x4c,0x43,0x09,0x06,0xe0,0x02,
0x7b,0x43,0x92,0xec,0x5d,0x43,0x08,0x09,0x3a,0x7b,0x43,0xf0,0xf7,0x58,0x43,0x09,0x3a,0x7b,0x43,0xe6,
0x31,0x5b,0x43,0xe0,0x02,0x7b,0x43,0xa8,0x4f,0x56,0x43,0x09,0x06,0x39,0x4f,0x7d,0x43,0x3e,0x8f,0x5c,
0x43,0x08,0xe9,0xe0,0x7c,0x43,0x03,0x9c,0x58,0x43,0x1e,0x2b,0x81,0x43,0x7f,0x30,0x5a,0x43,0xff,0x73,
0x7d,0x43,0xf6,0xb6,0x51,0x43,0x09,0x06,0x5c,0xb8,0x52,0x43,0x28,0x21,0x87,0x43,0x08,0xae,0x3e,0x57,
0x43,0x12,0x9a,0x88,0x43,0x23,0xf5,0x56,0x43,0x04,0xf1,0x8b,0x43,0x25,0xfc,0x5b,0x43,0x85,0x74,0x8e,
0x43,0x08,0x2f,0xf2,0x61,0x43,0x8e,0x52,0x90,0x43,0xd9,0xdc,0x6c,0x43,0x85,0x74,0x8e,0x43,0xc6,0x20,
0x69,0x43,0x3d,0xd8,0x8d,0x43,0x08,0x6d,0x8c,0x5a,0x43,0xf5,0x3b,0x8d,0x43,0x3d,0x77,0x58,0x43,0xa1,
0xc6,0x87,0x43,0xf8,0xed,0x5e,0x43,0x5e,0x0d,0x86,0x43,0x09,0x06,0xde,0xcc,0x92,0x43,0xf7,0x17,0x87,
0x43,0x08,0xb6,0x89,0x90,0x43,0xae,0x87,0x88,0x43,0x4a,0xa5,0x90,0x43,0xa1,0xde,0x8b,0x43,0xf9,0x2a,
0x8e,0x43,0x23,0x62,0x8e,0x43,0x08,0xf5,0x2f,0x8b,0x43,0x5c,0x49,0x90,0x43,0x35,0xd6,0x85,0x43,0x8e,
0x46,0x8e,0x43,0x3d,0xb4,0x87,0x43,0x47,0xaa,0x8d,0x43,0x08,0x6a,0xfe,0x8e,0x43,0xff,0x0d,0x8d,0x43,
0xbb,0x6c,0x8f,0x43,0xf7,0x17,0x87,0x43,0x5c,0x31,0x8c,0x43,0xb2,0x5e,0x85,0x43,0x09,0x06,0x60,0x38,
0x91,0x43,0x69,0x5d,0x7a,0x43,0x08,0x34,0x1e,0x92,0x43,0x1e,0x5b,0x89,0x43,0x04,0x63,0x7e,0x43,0x5e,
0x01,0x84,0x43,0x59,0x2a,0x87,0x43,0x0d,0xcf,0x8d,0x43,0x09,0x03,0x04,0x06,0x5a,0x18,0x63,0x43,0x82,
0x79,0x8b,0x43,0x08,0x25,0x2c,0x64,0x43,0x82,0x79,0x8b,0x43,0x2a,0x1b,0x65,0x43,0x9d,0xef,0x8a,0x43,
0x2a,0x1b,0x65,0x43,0xc1,0x37,0x8a,0x43,0x08,0x2a,0x1b,0x65,0x43,0x17,0x89,0x89,0x43,0x25,0x2c,0x64,
0x43,0x31,0xff,0x88,0x43,0x5a,0x18,0x63,0x43,0x31,0xff,0x88,0x43,0x08,0xf3,0x16,0x62,0x43,0x31,0xff,
0x88,0x43,0xee,0x27,0x61,0x43,0x17,0x89,0x89,0x43,0xee,0x27,0x61,0x43,0xc1,0x37,0x8a,0x43,0x08,0xee,
0x27,0x61,0x43,0x9d,0xef,0x8a,0x43,0xf3,0x16,0x62,0x43,0x82,0x79,0x8b,0x43,0x5a,0x18,0x63,0x43,0x82,
0x79,0x8b,0x43,0x09,0x06,0x4f,0x64,0x89,0x43,0x82,0x79,0x8b,0x43,0x08,0x34,0xee,0x89,0x43,0x82,0x79,
0x8b,0x43,0x85,0x5c,0x8a,0x43,0x9d,0xef,0x8a,0x43,0x85,0x5c,0x8a,0x43,0xc1,0x37,0x8a,0x43,0x08,0x85,
0x5c,0x8a,0x43,0x17,0x89,0x89,0x43,0x34,0xee,0x89,0x43,0x31,0xff,0x88,0x43,0x4f,0x64,0x89,0x43,0x31,
0xff,0x88,0x43,0x08,0x9c,0xe3,0x88,0x43,0x31,0xff,0x88,0x43,0x19,0x6c,0x88,0x43,0x17,0x89,0x89,0x43,
0x19,0x6c,0x88,0x43,0xc1,0x37,0x8a,0x43,0x08,0x19,0x6c,0x88,0x43,0x9d,0xef,0x8a,0x43,0x9c,0xe3,0x88,
0x43,0x82,0x79,0x8b,0x43,0x4f,0x64,0x89,0x43,0x82,0x79,0x8b,0x43,0x09,0x02,0x04,0x06,0x19,0x60,0x86,
0x43,0xec,0xed,0xa3,0x43,0x08,0x35,0xd6,0x85,0x43,0x76,0x43,0xa6,0x43,0x93,0xe1,0x80,0x43,0x57,0x02,
0xac,0x43,0x61,0xd8,0x80,0x43,0x87,0x17,0xae,0x43,0x08,0xa5,0x85,0x80,0x43,0xc3,0xfe,0xaf,0x43,0xce,
0xbc,0x80,0x43,0x83,0x40,0xb1,0x43,0xa5,0x91,0x82,0x43,0x79,0x6e,0xb1,0x43,0x08,0x23,0x26,0x84,0x43,
0x40,0x93,0xb1,0x43,0x30,0xe7,0x84,0x43,0xbe,0x1b,0xb1,0x43,0x11,0x82,0x84,0x43,0xab,0x6b,0xaf,0x43,
0x08,0xb7,0x41,0x84,0x43,0x3b,0x98,0xae,0x43,0xb7,0x41,0x84,0x43,0xc3,0xf2,0xad,0x43,0xa1,0xae,0x83,
0x43,0x83,0x28,0xad,0x43,0x08,0xb2,0x52,0x83,0x43,0x80,0x39,0xac,0x43,0x81,0x49,0x83,0x43,0xf0,0x00,
0xab,0x43,0xe4,0x67,0x85,0x43,0x76,0x4f,0xa8,0x43,0x08,0x9c,0xd7,0x86,0x43,0xd1,0x83,0xa6,0x43,0xec,
0x45,0x87,0x43,0x01,0x75,0xa2,0x43,0x19,0x60,0x86,0x43,0xec,0xed,0xa3,0x43,0x09,0x06,0xd9,0xdc,0x6c,
0x43,0x14,0x25,0xa4,0x43,0x08,0xa2,0xf0,0x6d,0x43,0x9f,0x7a,0xa6,0x43,0x47,0xec,0x77,0x43,0x80,0x39,
0xac,0x43,0xa9,0xfe,0x77,0x43,0xb0,0x4e,0xae,0x43,0x08,0x23,0xa4,0x78,0x43,0xea,0x35,0xb0,0x43,0xd2,
0x35,0x78,0x43,0xab,0x77,0xb1,0x43,0xc1,0x79,0x74,0x43,0xa2,0xa5,0xb1,0x43,0x08,0xc6,0x50,0x71,0x43,
0x68,0xca,0xb1,0x43,0xab,0xce,0x6f,0x43,0xe7,0x52,0xb1,0x43,0xea,0x98,0x70,0x43,0xd4,0xa2,0xaf,0x43,
0x08,0x9d,0x19,0x71,0x43,0x96,0xd8,0xae,0x43,0x9d,0x19,0x71,0x43,0xec,0x29,0xae,0x43,0xca,0x3f,0x72,
0x43,0xab,0x5f,0xad,0x43,0x08,0xa6,0xf7,0x72,0x43,0xa7,0x70,0xac,0x43,0x09,0x0a,0x73,0x43,0x17,0x38,
0xab,0x43,0x44,0xcd,0x6e,0x43,0x9f,0x86,0xa8,0x43,0x08,0xd4,0xed,0x6b,0x43,0xf8,0xba,0xa6,0x43,0x31,
0x11,0x6b,0x43,0x2a,0xac,0xa2,0x43,0xd9,0xdc,0x6c,0x43,0x14,0x25,0xa4,0x43,0x09,0x01,0x05,0x06,0x66,
0x5d,0x7a,0x43,0x74,0xeb,0xc2,0x43,0x08,0x09,0x22,0x77,0x43,0x50,0xbb,0xc7,0x43,0xe9,0xe0,0x7c,0x43,
0xf5,0x86,0xc9,0x43,0x8f,0x94,0x7a,0x43,0xc5,0x95,0xcd,0x43,0x09,0x06,0x08,0x98,0x80,0x43,0x6b,0x19,
0xc3,0x43,0x08,0xb7,0x35,0x82,0x43,0x79,0xf2,0xc7,0x43,0xf1,0xbe,0x7e,0x43,0x1e,0xbe,0xc9,0x43,0x73,
0x7c,0x80,0x43,0xec,0xcc,0xcd,0x43,0x09,0x06,0x28,0xab,0x7d,0x43,0xae,0xde,0xc6,0x43,0x08,0x1e,0xcd,
0x7b,0x43,0x8a,0xa2,0xc9,0x43,0x30,0x89,0x7f,0x43,0x5c,0x94,0xcc,0x43,0x28,0xab,0x7d,0x43,0x42,0x2a,
0xcf,0x43,0x09,0x01,0x05,0x06,0x24,0x14,0xe0,0x42,0xf5,0x77,0x97,0x43,0x08,0xf7,0x1d,0xe7,0x42,0x74,
0x00,0x97,0x43,0x4d,0x93,0xec,0x42,0xdb,0xf5,0x95,0x43,0x29,0x4b,0xed,0x42,0xcd,0x34,0x95,0x43,0x09,
0x06,0x29,0x7b,0xf5,0x42,0x6f,0x1d,0x98,0x43,0x08,0xe4,0xf1,0xfb,0x42,0x61,0x5c,0x97,0x43,0xdb,0x7d,
0x01,0x43,0xb2,0xbe,0x95,0x43,0x55,0x23,0x02,0x43,0xe7,0xaa,0x94,0x43,0x09,0x06,0x98,0xdc,0x03,0x43,
0xbe,0x8b,0x98,0x43,0x08,0x66,0xdf,0x05,0x43,0x47,0xe6,0x97,0x43,0xae,0x87,0x08,0x43,0x98,0x48,0x96,
0x43,0x61,0x08,0x09,0x43,0xd6,0x06,0x95,0x43,0x09,0x06,0x31,0x0b,0x0b,0x43,0x8e,0x82,0x98,0x43,0x08,
0xdb,0xc5,0x0d,0x43,0x80,0xc1,0x97,0x43,0xd6,0xee,0x10,0x43,0xa9,0xec,0x95,0x43,0x79,0xcb,0x11,0x43,
0x55,0x8f,0x94,0x43,0x09,0x06,0xd1,0x2f,0x18,0x43,0xdb,0x01,0x98,0x43,0x08,0xad,0xe7,0x18,0x43,0x38,
0x25,0x97,0x43,0x8a,0x9f,0x19,0x43,0x80,0xb5,0x95,0x43,0xd6,0x1e,0x19,0x43,0xe0,0xd8,0x94,0x43,0x09,
0x06,0x9a,0x5b,0x1d,0x43,0x58,0x8a,0x97,0x43,0x08,0x01,0x5d,0x1e,0x43,0xf1,0x88,0x96,0x43,0x2f,0x83,
0x1f,0x43,0x19,0xb4,0x94,0x43,0x19,0xf0,0x1e,0x43,0x6f,0x05,0x94,0x43,0x09,0x06,0x0b,0x53,0x24,0x43,
0xae,0xdb,0x96,0x43,0x08,0x25,0xd5,0x25,0x43,0x50,0xac,0x95,0x43,0x53,0xfb,0x26,0x43,0x8a,0x7b,0x93,
0x43,0x76,0x43,0x26,0x43,0xb7,0x95,0x92,0x43,0x09,0x06,0x76,0x5b,0x2a,0x43,0x47,0xda,0x95,0x43,0x08,
0xf3,0xef,0x2b,0x43,0x10,0xe2,0x94,0x43,0x6d,0x95,0x2c,0x43,0xae,0xc3,0x92,0x43,0x68,0xa6,0x2b,0x43,
0x47,0xc2,0x91,0x43,0x09,0x06,0x36,0xc1,0x31,0x43,0x2c,0x58,0x94,0x43,0x08,0x8c,0x1e,0x33,0x43,0x31,
0x3b,0x93,0x43,0x79,0x7a,0x33,0x43,0xff,0x25,0x91,0x43,0xd9,0x9d,0x32,0x43,0xc1,0x5b,0x90,0x43,0x09,
0x06,0x25,0x35,0x36,0x43,0x31,0x3b,0x93,0x43,0x08,0x3f,0xb7,0x37,0x43,0xc1,0x67,0x92,0x43,0xe0,0x93,
0x38,0x43,0xae,0xb7,0x90,0x43,0x7e,0x81,0x38,0x43,0x0d,0xdb,0x8f,0x43,0x09,0x06,0xb5,0x85,0x3b,0x43,
0xe4,0xaf,0x91,0x43,0x08,0xcf,0x07,0x3d,0x43,0x9d,0x13,0x91,0x43,0xbc,0x63,0x3d,0x43,0x47,0xb6,0x8f,
0x43,0xe5,0x9a,0x3d,0x43,0x74,0xd0,0x8e,0x43,0x09,0x06,0xae,0xc6,0x42,0x43,0xa4,0xd9,0x8e,0x43,0x08,
0xca,0x48,0x44,0x43,0xfa,0x2a,0x8e,0x43,0xa2,0x11,0x44,0x43,0x9d,0xfb,0x8c,0x43,0x55,0x92,0x44,0x43,
0x0d,0xc3,0x8b,0x43,0x09,0x06,0x39,0x10,0xc3,0x43,0x34,0x36,0x96,0x43,0x08,0x92,0x44,0xc1,0x43,0xe4,
0xc7,0x95,0x43,0x6f,0xf0,0xbf,0x43,0x4b,0xbd,0x94,0x43,0x47,0xb9,0xbf,0x43,0x0b,0xf3,0x93,0x43,0x09,
0x06,0x8f,0x49,0xbe,0x43,0xb7,0xad,0x96,0x43,0x08,0x11,0xb5,0xbc,0x43,0x77,0xe3,0x95,0x43,0x9c,0xf2,
0xba,0x43,0xfa,0x4e,0x94,0x43,0xae,0x96,0xba,0x43,0x31,0x3b,0x93,0x43,0x09,0x06,0xdb,0xb0,0xb9,0x43,
0x10,0xee,0x96,0x43,0x08,0x42,0xa6,0xb8,0x43,0xc8,0x51,0x96,0x43,0x50,0x5b,0xb7,0x43,0x19,0xb4,0x94,
0x43,0xf7,0x1a,0xb7,0x43,0x58,0x72,0x93,0x43,0x09,0x06,0xf2,0x2b,0xb6,0x43,0x10,0xee,0x96,0x43,0x08,
0x9d,0xce,0xb4,0x43,0x04,0x2d,0x96,0x43,0xed,0x30,0xb3,0x43,0x2c,0x58,0x94,0x43,0xce,0xcb,0xb2,0x43,
0xd6,0xfa,0x92,0x43,0x09,0x06,0x5a,0x09,0xb1,0x43,0x19,0xc0,0x96,0x43,0x08,0x6c,0xad,0xb0,0x43,0x77,
0xe3,0x95,0x43,0x7e,0x51,0xb0,0x43,0xc0,0x73,0x94,0x43,0xd8,0x91,0xb0,0x43,0x1e,0x97,0x93,0x43,0x09,
0x06,0x48,0x4d,0xad,0x43,0xbe,0x7f,0x96,0x43,0x08,0x95,0xcc,0xac,0x43,0x58,0x7e,0x95,0x43,0x4d,0x30,
0xac,0x43,0x80,0xa9,0x93,0x43,0xd8,0x79,0xac,0x43,0xd6,0xfa,0x92,0x43,0x09,0x06,0x90,0xd1,0xa9,0x43,
0x14,0xd1,0x95,0x43,0x08,0x83,0x10,0xa9,0x43,0xb7,0xa1,0x94,0x43,0x3b,0x74,0xa8,0x43,0xf1,0x70,0x92,
0x43,0x29,0xd0,0xa8,0x43,0x1e,0x8b,0x91,0x43,0x09,0x06,0x5a,0xcd,0xa6,0x43,0x8a,0x87,0x95,0x43,0x08,
0x1c,0x03,0xa6,0x43,0x23,0x86,0x94,0x43,0x5f,0xb0,0xa5,0x43,0xc1,0x67,0x92,0x43,0xe1,0x27,0xa6,0x43,
0x8a,0x6f,0x91,0x43,0x09,0x06,0xd4,0x5a,0xa3,0x43,0x2c,0x58,0x94,0x43,0x08,0x29,0xac,0xa2,0x43,0x31,
0x3b,0x93,0x43,0x32,0x7e,0xa2,0x43,0xff,0x25,0x91,0x43,0x83,0xec,0xa2,0x43,0x8e,0x52,0x90,0x43,0x09,
0x06,0xf8,0x96,0xa0,0x43,0x1e,0x97,0x93,0x43,0x08,0xeb,0xd5,0x9f,0x43,0x7b,0xba,0x92,0x43,0x99,0x67,
0x9f,0x43,0x9d,0x13,0x91,0x43,0x99,0x67,0x9f,0x43,0xfa,0x36,0x90,0x43,0x09,0x06,0xeb,0xc9,0x9d,0x43,
0xc8,0x39,0x92,0x43,0x08,0xde,0x08,0x9d,0x43,0xb2,0xa6,0x91,0x43,0xe6,0xda,0x9c,0x43,0x2c,0x40,0x90,
0x43,0x52,0xbf,0x9c,0x43,0x5a,0x5a,0x8f,0x43,0x09,0x06,0x37,0x3d,0x9b,0x43,0x85,0x80,0x90,0x43,0x08,
0x2a,0x7c,0x9a,0x43,0xdb,0xd1,0x8f,0x43,0xf0,0xa0,0x9a,0x43,0x7d,0xa2,0x8e,0x43,0x65,0x57,0x9a,0x43,
0xee,0x69,0x8d,0x43,0x09,0x02,0x04,0x06,0x2a,0xf4,0x2e,0x42,0x04,0x21,0x94,0x43,0x08,0x0d,0x8a,0x31,
0x42,0x9f,0x0e,0x94,0x43,0xf3,0x1f,0x34,0x42,0x3d,0xfc,0x93,0x43,0x63,0xff,0x36,0x42,0xa9,0xe0,0x93,
0x43,0x08,0xb5,0x34,0x5d,0x42,0x0b,0xf3,0x93,0x43,0x6d,0xa4,0x5e,0x42,0x03,0x39,0x98,0x43,0xe7,0x31,
0x5b,0x42,0x93,0x89,0x9d,0x43,0x08,0x02,0x9c,0x58,0x42,0xd4,0x5a,0xa3,0x43,0x38,0x70,0x53,0x42,0x14,
0x49,0xaa,0x43,0xf8,0xed,0x5e,0x42,0x83,0x28,0xad,0x43,0x08,0xea,0x68,0x68,0x42,0x20,0x22,0xaf,0x43,
0x12,0xb8,0x6c,0x42,0xb5,0x49,0xb1,0x43,0x2a,0x4b,0x6d,0x42,0x0d,0x96,0xb3,0x43,0x07,0x2a,0x4b,0x6d,
0x42,0xc6,0x05,0xb5,0x43,0x08,0x87,0x6e,0x6c,0x42,0x68,0xee,0xb7,0x43,0x1c,0x66,0x66,0x42,0x31,0x0e,
0xbb,0x43,0x57,0x11,0x5e,0x42,0x8f,0x49,0xbe,0x43,0x08,0x66,0x96,0x54,0x42,0xb9,0x5c,0xb8,0x43,0x2c,
0x2b,0x3c,0x42,0x68,0xd6,0xb3,0x43,0x2a,0xf4,0x2e,0x42,0x6d,0xad,0xb0,0x43,0x07,0x2a,0xf4,0x2e,0x42,
0x61,0xa4,0xa3,0x43,0x08,0x55,0x1a,0x30,0x42,0xf0,0xd0,0xa2,0x43,0xf8,0xf6,0x30,0x42,0xb2,0x06,0xa2,
0x43,0x98,0xd3,0x31,0x42,0xd6,0x4e,0xa1,0x43,0x08,0x1c,0x6f,0x38,0x42,0x2a,0x94,0x9e,0x43,0xc1,0x22,
0x36,0x42,0xf5,0x9b,0x9d,0x43,0x2a,0xf4,0x2e,0x42,0x6a,0x52,0x9d,0x43,0x07,0x2a,0xf4,0x2e,0x42,0x57,
0xa2,0x9b,0x43,0x08,0xab,0x8f,0x35,0x42,0x8a,0xab,0x9b,0x43,0xe9,0x71,0x3a,0x42,0xb2,0xe2,0x9b,0x43,
0xb7,0x74,0x3c,0x42,0x34,0x5a,0x9c,0x43,0x08,0x23,0x7d,0x42,0x42,0x0b,0x2f,0x9e,0x43,0xe5,0x9a,0x3d,
0x42,0x38,0x6d,0xa3,0x43,0x36,0xd9,0x35,0x42,0xf3,0xd7,0xa7,0x43,0x08,0x12,0x61,0x2e,0x42,0xb0,0x42,
0xac,0x43,0x63,0xff,0x36,0x42,0xdd,0x74,0xaf,0x43,0x1e,0xa6,0x45,0x42,0x44,0x82,0xb2,0x43,0x08,0x74,
0x1b,0x4b,0x42,0x79,0x7a,0xb3,0x43,0x10,0x21,0x4f,0x42,0x2a,0x18,0xb5,0x43,0xdb,0x4c,0x54,0x42,0x91,
0x19,0xb6,0x43,0x08,0xee,0x3f,0x65,0x42,0x5f,0x28,0xba,0x43,0xa7,0xaf,0x66,0x42,0xb9,0x50,0xb6,0x43,
0x14,0x58,0x5c,0x42,0xca,0xdc,0xb1,0x43,0x08,0x2c,0x8b,0x4c,0x42,0x4e,0x30,0xac,0x43,0x19,0xcf,0x48,
0x42,0x2a,0xd0,0xa8,0x43,0xbc,0xab,0x49,0x42,0xa9,0x4c,0xa6,0x43,0x08,0x61,0x5f,0x47,0x42,0xfa,0xa2,
0xa2,0x43,0xa7,0xaf,0x66,0x42,0x85,0x98,0x94,0x43,0x2a,0xf4,0x2e,0x42,0xc3,0x62,0x95,0x43,0x07,0x2a,
0xf4,0x2e,0x42,0x04,0x21,0x94,0x43,0x09,0x06,0xd0,0xfe,0xea,0x41,0x9f,0x0e,0x94,0x43,0x08,0xdc,0xe3,
0xf1,0x41,0xe9,0x9e,0x92,0x43,0xd2,0xe7,0x0b,0x42,0xd6,0x06,0x95,0x43,0x2a,0xf4,0x2e,0x42,0x04,0x21,
0x94,0x43,0x07,0x2a,0xf4,0x2e,0x42,0xc3,0x62,0x95,0x43,0x08,0x87,0x17,0x2e,0x42,0xc3,0x62,0x95,0x43,
0xe7,0x3a,0x2d,0x42,0xf5,0x6b,0x95,0x43,0x44,0x5e,0x2c,0x42,0xf5,0x6b,0x95,0x43,0x08,0xd1,0x47,0x1c,
0x42,0x19,0xc0,0x96,0x43,0x66,0xdf,0x05,0x42,0x38,0x19,0x95,0x43,0x12,0x6a,0x00,0x42,0xb2,0xbe,0x95,
0x43,0x08,0xbb,0x6b,0xea,0x41,0xd6,0x12,0x97,0x43,0x2d,0x82,0xfa,0x41,0x61,0x74,0x9b,0x43,0x7e,0x72,
0x06,0x42,0x8a,0xab,0x9b,0x43,0x08,0xc8,0x39,0x12,0x42,0x4e,0xd0,0x9b,0x43,0x53,0xe3,0x22,0x42,0xc3,
0x86,0x9b,0x43,0x2a,0xf4,0x2e,0x42,0x57,0xa2,0x9b,0x43,0x07,0x2a,0xf4,0x2e,0x42,0x6a,0x52,0x9d,0x43,
0x08,0x01,0xa5,0x2a,0x42,0xa4,0x2d,0x9d,0x43,0x96,0x9c,0x24,0x42,0x06,0x40,0x9d,0x43,0x8a,0xb7,0x1d,
0x42,0x9a,0x5b,0x9d,0x43,0x08,0x6b,0x16,0x13,0x42,0xcd,0x64,0x9d,0x43,0x42,0xc7,0x0e,0x42,0x9a,0x5b,
0x9d,0x43,0x23,0x26,0x04,0x42,0xcd,0x64,0x9d,0x43,0x08,0xe6,0x91,0xeb,0x41,0x38,0x49,0x9d,0x43,0x73,
0x7b,0xdb,0x41,0xf5,0x83,0x99,0x43,0x7f,0x60,0xe2,0x41,0x0b,0x0b,0x98,0x43,0x08,0x7f,0x60,0xe2,0x41,
0xec,0x99,0x95,0x43,0xe3,0x5a,0xde,0x41,0xbe,0x7f,0x96,0x43,0xd0,0xfe,0xea,0x41,0x9f,0x0e,0x94,0x43,
0x07,0xd0,0xfe,0xea,0x41,0x9f,0x0e,0x94,0x43,0x09,0x06,0x2a,0xf4,0x2e,0x42,0x6d,0xad,0xb0,0x43,0x08,
0xd4,0x7e,0x29,0x42,0xab,0x6b,0xaf,0x43,0x4e,0x0c,0x26,0x42,0x44,0x6a,0xae,0x43,0x38,0x79,0x25,0x42,
0xd4,0x96,0xad,0x43,0x08,0x25,0xbd,0x21,0x42,0xe2,0x4b,0xac,0x43,0x49,0x35,0x29,0x42,0x9a,0x97,0xa7,
0x43,0x2a,0xf4,0x2e,0x42,0x61,0xa4,0xa3,0x43,0x07,0x2a,0xf4,0x2e,0x42,0x6d,0xad,0xb0,0x43,0x09,0x06,
0x1d,0xe5,0x7f,0x43,0x87,0x4a,0xe6,0x43,0x08,0x86,0x20,0x80,0x43,0x57,0x41,0xe6,0x43,0x7d,0x4e,0x80,
0x43,0x25,0x38,0xe6,0x43,0xa5,0x85,0x80,0x43,0xf3,0x2e,0xe6,0x43,0x08,0x35,0xca,0x83,0x43,0xd4,0xc9,
0xe5,0x43,0x9c,0xd7,0x86,0x43,0x44,0x91,0xe4,0x43,0xd5,0xca,0x8a,0x43,0x91,0x1c,0xe6,0x43,0x08,0x53,
0x5f,0x8c,0x43,0xf8,0x1d,0xe7,0x43,0x2f,0x17,0x8d,0x43,0x4e,0x7b,0xe8,0x43,0x92,0x29,0x8d,0x43,0x2f,
0x22,0xea,0x43,0x07,0x92,0x29,0x8d,0x43,0x44,0xb5,0xea,0x43,0x08,0xfe,0x0d,0x8d,0x43,0x2a,0x4b,0xed,
0x43,0xe3,0x8b,0x8b,0x43,0x55,0x7d,0xf0,0x43,0xec,0x51,0x89,0x43,0x72,0x0b,0xf4,0x43,0x08,0xcd,0xd4,
0x84,0x43,0x9d,0x55,0xfb,0x43,0xc9,0xe5,0x83,0x43,0x74,0x1e,0xfb,0x43,0x73,0x94,0x84,0x43,0x5a,0x90,
0xf7,0x43,0x08,0xe8,0x62,0x88,0x43,0xfd,0x30,0xee,0x43,0x39,0xc5,0x86,0x43,0xdd,0xbf,0xeb,0x43,0x35,
0xbe,0x81,0x43,0x40,0xde,0xed,0x43,0x08,0x4f,0x34,0x81,0x43,0x36,0x0c,0xee,0x43,0x08,0x98,0x80,0x43,
0xfd,0x30,0xee,0x43,0x1d,0xe5,0x7f,0x43,0x91,0x4c,0xee,0x43,0x07,0x1d,0xe5,0x7f,0x43,0x91,0x40,0xec,
0x43,0x08,0x35,0xbe,0x81,0x43,0x06,0xf7,0xeb,0x43,0x15,0x65,0x83,0x43,0x49,0xa4,0xeb,0x43,0x1e,0x43,
0x85,0x43,0xbe,0x5a,0xeb,0x43,0x08,0xae,0x93,0x8a,0x43,0xfd,0x18,0xea,0x43,0x42,0x97,0x86,0x43,0x5f,
0x67,0xf4,0x43,0xa9,0x98,0x87,0x43,0xd4,0x1d,0xf4,0x43,0x08,0x5c,0x25,0x8a,0x43,0xcf,0x16,0xef,0x43,
0x46,0xaa,0x8d,0x43,0x5a,0x3c,0xe9,0x43,0x19,0x6c,0x88,0x43,0x53,0x5e,0xe7,0x43,0x08,0xc4,0x02,0x85,
0x43,0x96,0x0b,0xe7,0x43,0x85,0x2c,0x82,0x43,0x83,0x67,0xe7,0x43,0x1d,0xe5,0x7f,0x43,0x72,0xc3,0xe7,
0x43,0x07,0x1d,0xe5,0x7f,0x43,0x87,0x4a,0xe6,0x43,0x09,0x06,0xfd,0x24,0x6c,0x43,0xd9,0x94,0xe0,0x43,
0x08,0xfa,0x6c,0x78,0x43,0xd1,0xc2,0xe0,0x43,0x25,0x5c,0x6c,0x43,0x25,0x44,0xe8,0x43,0x1d,0xe5,0x7f,
0x43,0x87,0x4a,0xe6,0x43,0x07,0x1d,0xe5,0x7f,0x43,0x72,0xc3,0xe7,0x43,0x08,0xa6,0x27,0x7b,0x43,0x91,
0x28,0xe8,0x43,0xbc,0xa2,0x77,0x43,0xb0,0x8d,0xe8,0x43,0xc6,0x68,0x75,0x43,0x57,0x4d,0xe8,0x43,0x08,
0xe0,0xd2,0x72,0x43,0xab,0x9e,0xe7,0x43,0x50,0x9a,0x71,0x43,0x2a,0x27,0xe7,0x43,0xea,0x98,0x70,0x43,
0x57,0x35,0xe4,0x43,0x08,0x94,0x3b,0x6f,0x43,0x14,0x7c,0xe2,0x43,0xff,0x13,0x6d,0x43,0x06,0xbb,0xe1,
0x43,0xcf,0xfe,0x6a,0x43,0x06,0xbb,0xe1,0x43,0x08,0x44,0x9d,0x66,0x43,0x77,0x8e,0xe2,0x43,0x3b,0xef,
0x6c,0x43,0x91,0x10,0xe4,0x43,0xfd,0x24,0x6c,0x43,0xb0,0x81,0xe6,0x43,0x08,0x96,0x23,0x6b,0x43,0xee,
0x57,0xe9,0x43,0xca,0x0f,0x6a,0x43,0x5f,0x37,0xec,0x43,0x55,0x71,0x6e,0x43,0x9f,0x01,0xed,0x43,0x08,
0xdb,0xfb,0x75,0x43,0x3b,0xef,0xec,0x43,0x09,0x3a,0x7b,0x43,0xb0,0xa5,0xec,0x43,0x1d,0xe5,0x7f,0x43,
0x91,0x40,0xec,0x43,0x07,0x1d,0xe5,0x7f,0x43,0x91,0x4c,0xee,0x43,0x08,0xa9,0x16,0x7c,0x43,0xb0,0xb1,
0xee,0x43,0x47,0xec,0x77,0x43,0xd9,0xe8,0xee,0x43,0x1e,0x9d,0x73,0x43,0xcf,0x16,0xef,0x43,0x08,0x0e,
0xc9,0x6b,0x43,0xee,0x7b,0xef,0x43,0x7e,0x90,0x6a,0x43,0xfd,0x30,0xee,0x43,0x01,0xfc,0x68,0x43,0x4e,
0x93,0xec,0x43,0x08,0x31,0xf9,0x66,0x43,0x4e,0x87,0xea,0x43,0x31,0x11,0x6b,0x43,0xd4,0xd5,0xe7,0x43,
0xd9,0xc4,0x68,0x43,0xd4,0xc9,0xe5,0x43,0x08,0xe5,0x79,0x67,0x43,0x77,0x9a,0xe4,0x43,0x44,0x9d,0x66,
0x43,0xab,0x86,0xe3,0x43,0x7e,0x78,0x66,0x43,0x0b,0xaa,0xe2,0x43,0x07,0x7e,0x78,0x66,0x43,0x57,0x29,
0xe2,0x43,0x08,0xa7,0xaf,0x66,0x43,0xbe,0x1e,0xe1,0x43,0x87,0x56,0x68,0x43,0x77,0x82,0xe0,0x43,0xfd,
0x24,0x6c,0x43,0xd9,0x94,0xe0,0x43,0x09,0x06,0xc4,0x41,0xbf,0x43,0x85,0xc0,0x72,0x42,0x08,0x73,0xdf,
0xc0,0x43,0xf4,0x76,0x72,0x42,0x97,0x33,0xc2,0x43,0x85,0xc0,0x72,0x42,0xb2,0xb5,0xc3,0x43,0x64,0x56,
0x75,0x42,0x08,0x03,0x24,0xc4,0x43,0x5e,0x7f,0x78,0x42,0xfa,0x51,0xc4,0x43,0x01,0x85,0x7c,0x42,0x5c,
0x64,0xc4,0x43,0xa0,0xb3,0x80,0x42,0x07,0x5c,0x64,0xc4,0x43,0x10,0x93,0x83,0x42,0x08,0xc8,0x48,0xc4,
0x43,0x1c,0x78,0x8a,0x42,0x27,0x6c,0xc3,0x43,0xaf,0xcf,0x94,0x42,0x23,0x7d,0xc2,0x43,0x99,0x9c,0xa4,
0x42,0x08,0x3d,0xe7,0xbf,0x43,0xfb,0xfd,0xb5,0x42,0xb3,0x9d,0xbf,0x43,0x88,0x17,0xae,0x42,0xc4,0x41,
0xbf,0x43,0x69,0x76,0xa3,0x42,0x07,0xc4,0x41,0xbf,0x43,0xac,0xc8,0x8f,0x42,0x08,0x4f,0x8b,0xbf,0x43,
0xed,0x81,0x91,0x42,0xe4,0xa6,0xbf,0x43,0x5d,0x61,0x94,0x42,0xfa,0x39,0xc0,0x43,0x3b,0x49,0x9d,0x42,
0x08,0x2b,0x43,0xc0,0x43,0x28,0xed,0xa9,0x42,0x61,0x3b,0xc1,0x43,0x00,0x9e,0xa5,0x42,0xe4,0xb2,0xc1,
0x43,0x5d,0x91,0x9c,0x42,0x08,0x78,0xce,0xc1,0x43,0xfd,0x36,0x90,0x42,0x22,0x89,0xc4,0x43,0x81,0x72,
0x86,0x42,0xae,0xc6,0xc2,0x43,0xa0,0xb3,0x80,0x42,0x08,0x54,0x86,0xc2,0x43,0x58,0xd1,0x7e,0x42,0x30,
0x32,0xc1,0x43,0xce,0x5e,0x7b,0x42,0xc4,0x41,0xbf,0x43,0xe8,0xf1,0x7b,0x42,0x07,0xc4,0x41,0xbf,0x43,
0x85,0xc0,0x72,0x42,0x09,0x06,0xf6,0x32,0xbb,0x43,0x40,0xa7,0x60,0x42,0x08,0x35,0xfd,0xbb,0x43,0xa4,
0xa1,0x5c,0x42,0x5e,0x34,0xbc,0x43,0x9d,0x2a,0x70,0x42,0x5e,0x40,0xbe,0x43,0x0e,0x0a,0x73,0x42,0x08,
0x4c,0x9c,0xbe,0x43,0x0e,0x0a,0x73,0x42,0x08,0xef,0xbe,0x43,0x0e,0x0a,0x73,0x42,0xc4,0x41,0xbf,0x43,
0x85,0xc0,0x72,0x42,0x07,0xc4,0x41,0xbf,0x43,0xe8,0xf1,0x7b,0x42,0x08,0xcd,0x13,0xbf,0x43,0xe8,0xf1,
0x7b,0x42,0xd6,0xe5,0xbe,0x43,0x71,0x3b,0x7c,0x42,0xdf,0xb7,0xbe,0x43,0x71,0x3b,0x7c,0x42,0x08,0x08,
0xe3,0xbc,0x43,0xa4,0x61,0x7d,0x42,0x28,0x3c,0xbb,0x43,0x91,0x45,0x69,0x42,0x28,0x3c,0xbb,0x43,0x58,
0x71,0x6e,0x42,0x08,0xce,0xfb,0xba,0x43,0xd5,0x35,0x78,0x42,0x59,0x45,0xbb,0x43,0x58,0x23,0x82,0x42,
0xa1,0xe1,0xbb,0x43,0xd7,0xbe,0x88,0x42,0x08,0xc9,0x18,0xbc,0x43,0xaf,0x9f,0x8c,0x42,0x1e,0x76,0xbd,
0x43,0x51,0x7c,0x8d,0x42,0xd6,0xe5,0xbe,0x43,0xf4,0x58,0x8e,0x42,0x08,0x9c,0x0a,0xbf,0x43,0x45,0xc7,
0x8e,0x42,0x30,0x26,0xbf,0x43,0x96,0x35,0x8f,0x42,0xc4,0x41,0xbf,0x43,0xac,0xc8,0x8f,0x42,0x07,0xc4,
0x41,0xbf,0x43,0x69,0x76,0xa3,0x42,0x08,0x08,0xef,0xbe,0x43,0xb1,0xd6,0x99,0x42,0xe8,0x89,0xbe,0x43,
0xde,0xc5,0x8d,0x42,0xc0,0x46,0xbc,0x43,0xc2,0x5b,0x90,0x42,0x08,0x9c,0xf2,0xba,0x43,0x86,0x80,0x90,
0x42,0xf2,0x43,0xba,0x43,0xe8,0x73,0x87,0x42,0x8f,0x31,0xba,0x43,0xb6,0xf4,0x7d,0x42,0x07,0x8f,0x31,
0xba,0x43,0x21,0xc6,0x76,0x42,0x08,0xc0,0x3a,0xba,0x43,0x5f,0x48,0x6b,0x42,0xae,0x96,0xba,0x43,0xe3,
0x83,0x61,0x42,0xf6,0x32,0xbb,0x43,0x40,0xa7,0x60,0x42,0x09,0x06,0xea,0x74,0xea,0x43,0x61,0x44,0x93,
0x43,0x08,0x24,0x5c,0xec,0x43,0x31,0x3b,0x93,0x43,0xfb,0x30,0xee,0x43,0x93,0x4d,0x93,0x43,0x0d,0xe1,
0xef,0x43,0x80,0xa9,0x93,0x43,0x08,0x8f,0x58,0xf0,0x43,0xd1,0x17,0x94,0x43,0xb7,0x8f,0xf0,0x43,0x10,
0xe2,0x94,0x43,0xea,0x98,0xf0,0x43,0xa9,0xec,0x95,0x43,0x07,0xea,0x98,0xf0,0x43,0x38,0x25,0x97,0x43,
0x08,0x23,0x74,0xf0,0x43,0x9f,0x32,0x9a,0x43,0x5a,0x60,0xef,0x43,0x53,0xcb,0x9e,0x43,0x2d,0x3a,0xee,
0x43,0xfd,0x91,0xa3,0x43,0x08,0xa2,0xf0,0xed,0x43,0xdd,0x38,0xa5,0x43,0x17,0xa7,0xed,0x43,0xbe,0xdf,
0xa6,0x43,0x5a,0x54,0xed,0x43,0x9f,0x86,0xa8,0x43,0x08,0xfc,0x24,0xec,0x43,0xca,0xc4,0xad,0x43,0x48,
0xa4,0xeb,0x43,0x40,0x6f,0xab,0x43,0x28,0x3f,0xeb,0x43,0x1c,0x0f,0xa8,0x43,0x08,0x1f,0x6d,0xeb,0x43,
0x72,0x48,0xa3,0x43,0x67,0x09,0xec,0x43,0xd1,0x53,0x9e,0x43,0xea,0x74,0xea,0x43,0x1e,0xc7,0x9b,0x43,
0x07,0xea,0x74,0xea,0x43,0x8a,0x9f,0x99,0x43,0x08,0x7e,0x90,0xea,0x43,0x8a,0x9f,0x99,0x43,0x12,0xac,
0xea,0x43,0xbc,0xa8,0x99,0x43,0xa7,0xc7,0xea,0x43,0xbc,0xa8,0x99,0x43,0x08,0x51,0x76,0xeb,0x43,0x9f,
0x32,0x9a,0x43,0x5e,0x37,0xec,0x43,0x49,0xed,0x9c,0x43,0xb0,0xa5,0xec,0x43,0x2a,0xa0,0xa0,0x43,0x08,
0x09,0xe6,0xec,0x43,0xd1,0x77,0xa4,0x43,0x28,0x4b,0xed,0x43,0x61,0xa4,0xa3,0x43,0xab,0xc2,0xed,0x43,
0x8e,0xb2,0xa0,0x43,0x08,0x70,0xe7,0xed,0x43,0xde,0x08,0x9d,0x43,0x87,0x86,0xf0,0x43,0x2f,0x53,0x97,
0x43,0x87,0x7a,0xee,0x43,0xec,0x99,0x95,0x43,0x08,0xca,0x27,0xee,0x43,0xff,0x3d,0x95,0x43,0x74,0xca,
0xec,0x43,0x55,0x8f,0x94,0x43,0xea,0x74,0xea,0x43,0xe7,0xaa,0x94,0x43,0x07,0xea,0x74,0xea,0x43,0x61,
0x44,0x93,0x43,0x09,0x06,0x05,0xd3,0xe5,0x43,0x19,0x9c,0x90,0x43,0x08,0x09,0xc2,0xe6,0x43,0xd1,0xff,
0x8f,0x43,0x4d,0x6f,0xe6,0x43,0x74,0xe8,0x92,0x43,0x3b,0xd7,0xe8,0x43,0xc3,0x56,0x93,0x43,0x08,0x1f,
0x61,0xe9,0x43,0x93,0x4d,0x93,0x43,0x05,0xeb,0xe9,0x43,0x93,0x4d,0x93,0x43,0xea,0x74,0xea,0x43,0x61,
0x44,0x93,0x43,0x07,0xea,0x74,0xea,0x43,0xe7,0xaa,0x94,0x43,0x08,0x24,0x50,0xea,0x43,0xe7,0xaa,0x94,
0x43,0x2d,0x22,0xea,0x43,0xe7,0xaa,0x94,0x43,0x36,0xf4,0xe9,0x43,0xe7,0xaa,0x94,0x43,0x08,0xa2,0xcc,
0xe7,0x43,0xe0,0xd8,0x94,0x43,0xd4,0xc9,0xe5,0x43,0x19,0xa8,0x92,0x43,0xd4,0xc9,0xe5,0x43,0x27,0x69,
0x93,0x43,0x08,0x17,0x77,0xe5,0x43,0xe0,0xd8,0x94,0x43,0x67,0xe5,0xe5,0x43,0x47,0xda,0x95,0x43,0x43,
0x9d,0xe6,0x43,0xe2,0xd3,0x97,0x43,0x08,0x9d,0xdd,0xe6,0x43,0xad,0xe7,0x98,0x43,0x09,0xce,0xe8,0x43,
0xff,0x55,0x99,0x43,0xea,0x74,0xea,0x43,0x8a,0x9f,0x99,0x43,0x07,0xea,0x74,0xea,0x43,0x1e,0xc7,0x9b,
0x43,0x08,0x71,0xcf,0xe9,0x43,0x53,0xb3,0x9a,0x43,0xa7,0xbb,0xe8,0x43,0xdb,0x0d,0x9a,0x43,0xc6,0x14,
0xe7,0x43,0xdb,0x0d,0x9a,0x43,0x08,0x48,0x80,0xe5,0x43,0xdb,0x0d,0x9a,0x43,0x0a,0xb6,0xe4,0x43,0xc3,
0x6e,0x97,0x43,0x76,0x9a,0xe4,0x43,0x74,0xf4,0x94,0x43,0x07,0x76,0x9a,0xe4,0x43,0x79,0xd7,0x93,0x43,
0x08,0xd8,0xac,0xe4,0x43,0x66,0x27,0x92,0x43,0x29,0x1b,0xe5,0x43,0xe0,0xc0,0x90,0x43,0x05,0xd3,0xe5,
0x43,0x19,0x9c,0x90,0x43,0x09,0x06,0x1b,0x66,0xe6,0x42,0xe3,0xa3,0x8f,0x42,0x08,0x71,0x0b,0xf4,0x42,
0x00,0x0e,0x8d,0x42,0x8c,0x0f,0x01,0x43,0x3e,0xc0,0x89,0x42,0xf3,0x28,0x06,0x43,0x48,0x9e,0x8b,0x42,
0x08,0x15,0x89,0x09,0x43,0x00,0x0e,0x8d,0x42,0xe0,0x9c,0x0a,0x43,0xc1,0x8b,0x98,0x42,0xa6,0xc1,0x0a,
0x43,0x02,0xa5,0xaa,0x42,0x07,0xa6,0xc1,0x0a,0x43,0xf9,0xf6,0xb0,0x42,0x08,0xa6,0xc1,0x0a,0x43,0x47,
0x8e,0xb4,0x42,0x42,0xaf,0x0a,0x43,0x1f,0x6f,0xb8,0x42,0xe0,0x9c,0x0a,0x43,0xba,0x74,0xbc,0x42,0x08,
0xa1,0xd2,0x09,0x43,0x40,0x47,0xd0,0x42,0x0d,0xab,0x07,0x43,0x91,0xb5,0xd0,0x42,0x3b,0xb9,0x04,0x43,
0xec,0x71,0xba,0x42,0x08,0xe5,0x5b,0x03,0x43,0xe3,0x33,0xa8,0x42,0x63,0xd8,0x00,0x43,0xce,0x70,0x9f,
0x42,0x1b,0x66,0xe6,0x42,0xae,0x2f,0xa5,0x42,0x07,0x1b,0x66,0xe6,0x42,0xa2,0x4a,0x9e,0x42,0x08,0xed,
0x6f,0xed,0x42,0x73,0x24,0x9d,0x42,0xd8,0x0c,0xf5,0x42,0x99,0x6c,0x9c,0x42,0x27,0xab,0xfd,0x42,0xea,
0xda,0x9c,0x42,0x08,0x36,0xca,0x03,0x43,0x2b,0x94,0x9e,0x42,0x68,0xc7,0x01,0x43,0x8f,0xbe,0xa2,0x42,
0xfa,0x06,0x08,0x43,0x73,0xb4,0xb5,0x42,0x08,0x8e,0x2e,0x0a,0x43,0x1f,0x6f,0xb8,0x42,0x9d,0xe3,0x08,
0x43,0xd7,0x1e,0x99,0x42,0x28,0x15,0x05,0x43,0x32,0x3b,0x93,0x42,0x08,0x63,0xf0,0x04,0x43,0x70,0xed,
0x8f,0x42,0x71,0x0b,0xf4,0x42,0x32,0x3b,0x93,0x42,0x1b,0x66,0xe6,0x42,0x73,0xf4,0x94,0x42,0x07,0x1b,
0x66,0xe6,0x42,0xe3,0xa3,0x8f,0x42,0x09,0x06,0x5e,0x28,0xba,0x42,0x35,0xe2,0x87,0x42,0x08,0x8e,0x55,
0xc0,0x42,0xb8,0x4d,0x86,0x42,0x60,0xbf,0xd7,0x42,0x3e,0xf0,0x91,0x42,0x63,0xf6,0xe4,0x42,0x70,0xed,
0x8f,0x42,0x08,0x7a,0x89,0xe5,0x42,0xac,0xc8,0x8f,0x42,0xcc,0xf7,0xe5,0x42,0xac,0xc8,0x8f,0x42,0x1b,
0x66,0xe6,0x42,0xe3,0xa3,0x8f,0x42,0x07,0x1b,0x66,0xe6,0x42,0x73,0xf4,0x94,0x42,0x08,0x63,0xf6,0xe4,
0x42,0x3b,0x19,0x95,0x42,0xe6,0x61,0xe3,0x42,0x00,0x3e,0x95,0x42,0xf4,0x16,0xe2,0x42,0xc4,0x62,0x95,
0x42,0x08,0x6e,0x74,0xd6,0x42,0x15,0xd1,0x95,0x42,0x97,0x63,0xca,0x42,0xaf,0xcf,0x94,0x42,0xfb,0x2d,
0xbe,0x42,0x86,0x80,0x90,0x42,0x08,0x97,0x03,0xba,0x42,0xce,0x10,0x8f,0x42,0x5e,0x28,0xba,0x42,0x3e,
0xf0,0x91,0x42,0xf2,0x4f,0xbc,0x42,0x45,0xf7,0x96,0x42,0x08,0x27,0x54,0xbf,0x42,0x73,0x24,0x9d,0x42,
0xa5,0xe8,0xc0,0x42,0x86,0xe0,0xa0,0x42,0xe4,0xca,0xc5,0x42,0xed,0x11,0xaa,0x42,0x08,0x54,0xaa,0xc8,
0x42,0x86,0x40,0xb1,0x42,0x59,0x81,0xc5,0x42,0xa1,0x11,0xc4,0x42,0x3e,0xe7,0xbf,0x42,0xfb,0x8d,0xce,
0x42,0x08,0xb4,0x6d,0xb7,0x42,0x30,0xc2,0xd9,0x42,0x46,0xf5,0xc9,0x42,0xdf,0x53,0xd9,0x42,0x38,0x40,
0xcb,0x42,0x62,0x8f,0xcf,0x42,0x08,0x7d,0xf9,0xcc,0x42,0xec,0xa1,0xc2,0x42,0x07,0x43,0xcd,0x42,0x6c,
0xdd,0xb8,0x42,0x2b,0x8b,0xcc,0x42,0x92,0xf5,0xaf,0x42,0x08,0xf9,0x8d,0xce,0x42,0x41,0x57,0xa7,0x42,
0x5b,0xb8,0xd2,0x42,0xae,0x2f,0xa5,0x42,0x18,0x2f,0xd9,0x42,0x13,0x2a,0xa1,0x42,0x08,0x41,0x7e,0xdd,
0x42,0xe3,0x03,0xa0,0x42,0x2e,0xf2,0xe1,0x42,0x7c,0x02,0x9f,0x42,0x1b,0x66,0xe6,0x42,0xa2,0x4a,0x9e,
0x42,0x07,0x1b,0x66,0xe6,0x42,0xae,0x2f,0xa5,0x42,0x08,0x4d,0x63,0xe4,0x42,0x00,0x9e,0xa5,0x42,0xf4,
0x16,0xe2,0x42,0x15,0x31,0xa6,0x42,0x99,0xca,0xdf,0x42,0x2b,0xc4,0xa6,0x42,0x08,0xc0,0x82,0xc6,0x42,
0xc4,0xc2,0xa5,0x42,0x57,0xe1,0xd5,0x42,0x91,0xb5,0xd0,0x42,0x54,0xda,0xd0,0x42,0x97,0x93,0xd2,0x42,
0x08,0x9c,0x3a,0xc7,0x42,0x17,0x58,0xdc,0x42,0x9c,0x0a,0xbf,0x42,0x6e,0xa4,0xde,0x42,0x90,0x25,0xb8,
0x42,0xdf,0x53,0xd9,0x42,0x08,0x59,0x21,0xb5,0x42,0xf2,0xdf,0xd4,0x42,0x51,0x43,0xb3,0x42,0x91,0xb5,
0xd0,0x42,0xc5,0x29,0xbb,0x42,0x0e,0x1a,0xca,0x42,0x08,0x65,0x36,0xc4,0x42,0xd0,0x07,0xbd,0x42,0x3e,
0xe7,0xbf,0x42,0x37,0x09,0xbe,0x42,0x0c,0xea,0xc1,0x42,0xcd,0xd0,0xaf,0x42,0x08,0x2b,0x5b,0xc4,0x42,
0x18,0x08,0xa3,0x42,0x67,0xa6,0xab,0x42,0x99,0x3c,0x94,0x42,0x5e,0x28,0xba,0x42,0x35,0xe2,0x87,0x42,
0x09,];
private struct ThePath {
public:
enum Command {
Bounds, // always first, has 4 args (x0, y0, x1, y1)
StrokeMode,
FillMode,
StrokeFillMode,
NormalStroke,
ThinStroke,
MoveTo,
LineTo,
CubicTo, // cubic bezier
EndPath,
}
public:
const(ubyte)[] path;
uint ppos;
public:
this (const(void)[] apath) pure nothrow @trusted @nogc {
path = cast(const(ubyte)[])apath;
}
@property bool empty () const pure nothrow @safe @nogc { pragma(inline, true); return (ppos >= path.length); }
Command getCommand () nothrow @trusted @nogc {
pragma(inline, true);
if (ppos >= cast(uint)path.length) assert(0, "invalid path");
return cast(Command)(path.ptr[ppos++]);
}
// number of (x,y) pairs for this command
static int argCount (in Command cmd) nothrow @safe @nogc {
version(aliced) pragma(inline, true);
if (cmd == Command.Bounds) return 2;
else if (cmd == Command.MoveTo || cmd == Command.LineTo) return 1;
else if (cmd == Command.CubicTo) return 3;
else return 0;
}
void skipArgs (int argc) nothrow @trusted @nogc {
pragma(inline, true);
ppos += cast(uint)(float.sizeof*2*argc);
}
float getFloat () nothrow @trusted @nogc {
pragma(inline, true);
if (ppos >= cast(uint)path.length || cast(uint)path.length-ppos < float.sizeof) assert(0, "invalid path");
version(LittleEndian) {
float res = *cast(const(float)*)(&path.ptr[ppos]);
ppos += cast(uint)float.sizeof;
return res;
} else {
static assert(float.sizeof == 4);
uint xp = path.ptr[ppos]|(path.ptr[ppos+1]<<8)|(path.ptr[ppos+2]<<16)|(path.ptr[ppos+3]<<24);
ppos += cast(uint)float.sizeof;
return *cast(const(float)*)(&xp);
}
}
}
// this will add baphomet's background path to the current NanoVega path, so you can fill it.
public void addBaphometBack (NVGContext nvg, float ofsx=0, float ofsy=0, float scalex=1, float scaley=1) nothrow @trusted @nogc {
if (nvg is null) return;
auto path = ThePath(baphometPath);
float getScaledX () nothrow @trusted @nogc { pragma(inline, true); return (ofsx+path.getFloat()*scalex); }
float getScaledY () nothrow @trusted @nogc { pragma(inline, true); return (ofsy+path.getFloat()*scaley); }
bool inPath = false;
while (!path.empty) {
auto cmd = path.getCommand();
switch (cmd) {
case ThePath.Command.MoveTo:
inPath = true;
immutable float ex = getScaledX();
immutable float ey = getScaledY();
nvg.moveTo(ex, ey);
break;
case ThePath.Command.LineTo:
inPath = true;
immutable float ex = getScaledX();
immutable float ey = getScaledY();
nvg.lineTo(ex, ey);
break;
case ThePath.Command.CubicTo: // cubic bezier
inPath = true;
immutable float x1 = getScaledX();
immutable float y1 = getScaledY();
immutable float x2 = getScaledX();
immutable float y2 = getScaledY();
immutable float ex = getScaledX();
immutable float ey = getScaledY();
nvg.bezierTo(x1, y1, x2, y2, ex, ey);
break;
case ThePath.Command.EndPath:
if (inPath) return;
break;
default:
path.skipArgs(path.argCount(cmd));
break;
}
}
}
// this will add baphomet's pupil paths to the current NanoVega path, so you can fill it.
public void addBaphometPupils(bool left=true, bool right=true) (NVGContext nvg, float ofsx=0, float ofsy=0, float scalex=1, float scaley=1) nothrow @trusted @nogc {
// pupils starts with "fill-and-stroke" mode
if (nvg is null) return;
auto path = ThePath(baphometPath);
float getScaledX () nothrow @trusted @nogc { pragma(inline, true); return (ofsx+path.getFloat()*scalex); }
float getScaledY () nothrow @trusted @nogc { pragma(inline, true); return (ofsy+path.getFloat()*scaley); }
bool inPath = false;
bool pupLeft = true;
while (!path.empty) {
auto cmd = path.getCommand();
switch (cmd) {
case ThePath.Command.StrokeFillMode: inPath = true; break;
case ThePath.Command.MoveTo:
if (!inPath) goto default;
static if (!left) { if (pupLeft) goto default; }
static if (!right) { if (!pupLeft) goto default; }
immutable float ex = getScaledX();
immutable float ey = getScaledY();
nvg.moveTo(ex, ey);
break;
case ThePath.Command.LineTo:
if (!inPath) goto default;
static if (!left) { if (pupLeft) goto default; }
static if (!right) { if (!pupLeft) goto default; }
immutable float ex = getScaledX();
immutable float ey = getScaledY();
nvg.lineTo(ex, ey);
break;
case ThePath.Command.CubicTo: // cubic bezier
if (!inPath) goto default;
static if (!left) { if (pupLeft) goto default; }
static if (!right) { if (!pupLeft) goto default; }
immutable float x1 = getScaledX();
immutable float y1 = getScaledY();
immutable float x2 = getScaledX();
immutable float y2 = getScaledY();
immutable float ex = getScaledX();
immutable float ey = getScaledY();
nvg.bezierTo(x1, y1, x2, y2, ex, ey);
break;
case ThePath.Command.EndPath:
if (inPath) {
if (pupLeft) pupLeft = false; else return;
}
break;
default:
path.skipArgs(path.argCount(cmd));
break;
}
}
}
// mode: 'f' to allow fills; 's' to allow strokes; 'w' to allow stroke widths; 'c' to replace fills with strokes
public void renderBaphomet(string mode="fs") (NVGContext nvg, float ofsx=0, float ofsy=0, float scalex=1, float scaley=1) nothrow @trusted @nogc {
template hasChar(char ch, string s) {
static if (s.length == 0) enum hasChar = false;
else static if (s[0] == ch) enum hasChar = true;
else enum hasChar = hasChar!(ch, s[1..$]);
}
enum AllowStroke = hasChar!('s', mode);
enum AllowFill = hasChar!('f', mode);
enum AllowWidth = hasChar!('w', mode);
enum Contour = hasChar!('c', mode);
//static assert(AllowWidth || AllowFill);
if (nvg is null) return;
auto path = ThePath(baphometPath);
float getScaledX () nothrow @trusted @nogc { pragma(inline, true); return (ofsx+path.getFloat()*scalex); }
float getScaledY () nothrow @trusted @nogc { pragma(inline, true); return (ofsy+path.getFloat()*scaley); }
int mode = 0;
int sw = ThePath.Command.NormalStroke;
nvg.beginPath();
while (!path.empty) {
auto cmd = path.getCommand();
switch (cmd) {
case ThePath.Command.StrokeMode: mode = ThePath.Command.StrokeMode; break;
case ThePath.Command.FillMode: mode = ThePath.Command.FillMode; break;
case ThePath.Command.StrokeFillMode: mode = ThePath.Command.StrokeFillMode; break;
case ThePath.Command.NormalStroke: sw = ThePath.Command.NormalStroke; break;
case ThePath.Command.ThinStroke: sw = ThePath.Command.ThinStroke; break;
case ThePath.Command.MoveTo:
immutable float ex = getScaledX();
immutable float ey = getScaledY();
nvg.moveTo(ex, ey);
break;
case ThePath.Command.LineTo:
immutable float ex = getScaledX();
immutable float ey = getScaledY();
nvg.lineTo(ex, ey);
break;
case ThePath.Command.CubicTo: // cubic bezier
immutable float x1 = getScaledX();
immutable float y1 = getScaledY();
immutable float x2 = getScaledX();
immutable float y2 = getScaledY();
immutable float ex = getScaledX();
immutable float ey = getScaledY();
nvg.bezierTo(x1, y1, x2, y2, ex, ey);
break;
case ThePath.Command.EndPath:
if (mode == ThePath.Command.FillMode || mode == ThePath.Command.StrokeFillMode) {
static if (AllowFill || Contour) {
static if (Contour) {
if (mode == ThePath.Command.FillMode) { nvg.strokeWidth = 1; nvg.stroke(); }
} else {
nvg.fill();
}
}
}
if (mode == ThePath.Command.StrokeMode || mode == ThePath.Command.StrokeFillMode) {
static if (AllowStroke || Contour) {
static if (AllowWidth) {
if (sw == ThePath.Command.NormalStroke) nvg.strokeWidth = 1;
else if (sw == ThePath.Command.ThinStroke) nvg.strokeWidth = 0.5;
else assert(0, "wtf?!");
}
nvg.stroke();
}
}
nvg.newPath();
break;
default:
path.skipArgs(path.argCount(cmd));
break;
}
}
nvg.newPath();
}
|
D
|
module ui.parse.css.padding_left;
import std.stdio : writeln;
import ui.parse.t.tokenize : Tok;
import ui.parse.css.types : Length;
import ui.parse.css.types : Percentage;
import ui.parse.css.length : parse_length;
import ui.parse.css.percentage : parse_percentage;
import ui.parse.css.stringiterator : StringIterator;
import std.format : format;
import std.conv : to;
import log : Log;
import ui.parse.css.padding : parse_padding_arg;
import ui.parse.css.padding : ParseResult;
// https://developer.mozilla.org/en-US/docs/Web/CSS/padding-left
//
// <length> | <percentage>
//
// <length> values
// padding-left: 0.5em;
// padding-left: 0;
// padding-left: 2cm;
//
// <percentage> value
// padding-left: 10%;
//
// Global values
// padding-left: inherit;
// padding-left: initial;
// padding-left: unset;
bool parse_padding_left( Tok[] tokenized, ref string[] setters )
{
import std.range : front;
import std.range : drop;
import std.range : empty;
auto args = tokenized[ 2 .. $ ]; // skip ["padding-tpp", ":"]
ParseResult parseResult;
// padding-left: arg
if ( !args.empty )
{
auto word = args[0].s;
if ( parse_padding_arg( tokenized, word, &parseResult ) )
{
parseResult.setterCallback( parseResult, "paddingLeft", setters );
return true;
}
else
{
Log.error( format!"padding arg uncorrect: %s. Tokens: %s"( word, tokenized ) );
return false;
}
}
else
// padding: <empty>
{
Log.error( format!"padding arg expected. Tokens: %s"( tokenized ) );
return false;
}
//return false;
}
|
D
|
/++
+ Copyright: Copyright 2016, Christian Koestlin
+ Authors: Christian Koestlin
+ License: MIT
+/
module worker;
import argparse;
import androidlogger : AndroidLogger;
import profiled : Profiler, theProfiler;
import std.experimental.logger : LogLevel;
import std.experimental.logger.core : sharedLog;
import std.sumtype : SumType, match;
import std.stdio : stderr;
import std.algorithm : sort, fold;
import std.conv : to;
import worker.common;
import worker.traversal;
import worker.review;
import worker.history;
import worker.upload;
import worker.execute;
import worker.arguments;
int worker_(Arguments arguments)
{
theProfiler = new Profiler;
scope (exit)
theProfiler.dumpJson("trace.json");
sharedLog = new AndroidLogger(stderr, arguments.withColors == Config.StylingMode.on, arguments.logLevel);
auto projects = arguments.traversalMode == TraversalMode.WALK ?
findGitsByWalking(arguments.baseDirectory)
: findGitsFromManifest(arguments.baseDirectory);
// dfmt off
arguments.subcommand.match!(
(Review r)
{
projects.reviewChanges(r.command);
},
(Upload u)
{
projects.upload(arguments.dryRun, u.topic, u.hashtag, u.changeSetType);
},
(Execute e)
{
projects.executeCommand(e.command);
},
(Log l)
{
projects.history(l);
},
);
// dfmt on
return 0;
}
|
D
|
instance NASZ_218_Ammann (Npc_Default)
{
// ------ NPC ------
name = "Ammann";
guild = GIL_OUT;
id = 218;
voice = 14;
flags = 0; //NPC_FLAG_IMMORTAL oder 0
npctype = NPCTYPE_MAIN;
aivar[AIV_IgnoresArmor] = TRUE;
// ------ Atrybuty ------
B_SetAttributesToChapter (self, 5); //setzt Attribute und LEVEL entsprechend dem angegebenen Kapitel (1-6)
attribute [ATR_HITPOINTS_MAX] = 2000;
attribute [ATR_HITPOINTS] = 2000;
// ------ Taktyka Walki ------
fight_tactic = FAI_HUMAN_MASTER; // MASTER / STRONG / NORMAL / COWARD
// ------ Nałożona broń ------ //Munition wird automatisch generiert, darf aber angegeben werden
EquipItem (self, ItNa_Out_Weapon_H);
EquipItem (self, ItRw_Bow_H_02);
// ------ Inwentarz ------
B_CreateAmbientInv (self);
CreateInvItems (self, ItRw_Arrow,25);
// ------ Wygląd ------ //Muss NACH Attributen kommen, weil in B_SetNpcVisual die Breite abh. v. STR skaliert wird
B_SetNpcVisual (self, MALE, "Hum_Head_Bald", Face_N_Corristo, BodyTex_N, ITNA_OUT_H );
Mdl_SetModelFatness (self, 0);
Mdl_ApplyOverlayMds (self, "Humans_Militia.mds"); // Mage / Militia / Tired
// Relaxed / Arrogance
// --Istotne talenty NPCa
B_GiveNpcTalents (self);
// ------ Talent walki ------ //Der enthaltene B_AddFightSkill setzt Talent-Ani abhängig von TrefferChance% - alle Kampftalente werden gleichhoch gesetzt
B_SetFightSkills (self, 80);
// ------ Rutyna ------
daily_routine = Rtn_Start_218;
};
FUNC VOID Rtn_Start_218 ()
{
TA_Stand_ArmsCrossed (08,00,22,00,"PLATEAU_ROUND01");
TA_Stand_ArmsCrossed (22,00,08,00,"PLATEAU_ROUND01");
};
FUNC VOID Rtn_Forteca_218 ()
{
TA_Guide_Player (08,00,22,00,"LOCATION_19_03_PATH_RUIN7");
TA_Guide_Player (22,00,08,00,"LOCATION_19_03_PATH_RUIN7");
};
FUNC VOID Rtn_After_218 ()
{
TA_Stand_WP (08,00,22,00,"LOCATION_19_03_PATH_RUIN10");
TA_Stand_WP (22,00,08,00,"LOCATION_19_03_PATH_RUIN10");
};
FUNC VOID Rtn_Twierdza_218 ()
{
TA_Stand_WP (08,00,22,00,"NASZ_TWIERDZA_9");
TA_Stand_WP (22,00,08,00,"NASZ_TWIERDZA_9");
};
FUNC VOID Rtn_FollowZamek_218()
{
TA_RunToWp (08,00,23,00,"OC_PATH_01");
TA_RunToWp (23,00,08,00,"OC_PATH_01");
};
FUNC VOID Rtn_GoToScout_218()
{
TA_RunToWP (08,00,23,00,"OC_KNECHTCAMP_01");
TA_RunToWP (23,00,08,00,"OC_KNECHTCAMP_01");
};
FUNC VOID Rtn_GoToShaman_218()
{
TA_RunToWP (08,00,23,00,"OC_TRAIN_04");
TA_RunToWP (23,00,08,00,"OC_TRAIN_04");
};
FUNC VOID Rtn_GoToDowodca_218()
{
TA_Stand_WP (08,00,23,00,"OC_TRAIN_04");
TA_Stand_WP (23,00,08,00,"OC_TRAIN_04");
};
FUNC VOID Rtn_InCastle_218()
{
TA_Sit_Chair (08,00,20,00,"NASZ_INCASTLE_CHAIR_1");
TA_Sit_Chair (20,00,08,00,"NASZ_INCASTLE_CHAIR_1");
};
FUNC VOID Rtn_Odpoczynek_218 ()
{
TA_FleeToWP (08,00,23,00,"OC_ROUND_1");
TA_FleeToWP (23,00,08,00,"OC_ROUND_1");
};
FUNC VOID Rtn_UltraFinal_218 ()
{
TA_Stand_WP (08,00,22,00,"NASZ_ULTRAFINAL_11");
TA_Stand_WP (22,00,08,00,"NASZ_ULTRAFINAL_11");
};
FUNC VOID Rtn_Scena5_218 ()
{
TA_Stand_WP (08,00,22,00,"NASZ_ORCCITY_MAIN_16");
TA_Stand_WP (22,00,08,00,"NASZ_ORCCITY_MAIN_16");
};
FUNC VOID Rtn_Scena5Goal_218 ()
{
TA_RunToWP (08,00,22,00,"NASZ_ORCCITY_PORTAL_05");
TA_RunToWP (22,00,08,00,"NASZ_ORCCITY_PORTAL_05");
};
|
D
|
// Copyright © 2013, Bernard Helyer. All rights reserved.
// See copyright notice in src/volt/license.d (BOOST ver. 1.0).
module volt.errors;
import watt.conv : toLower;
import watt.text.format : format;
import watt.io.std : writefln;
import ir = volt.ir.ir;
import volt.exceptions;
import volt.token.token : tokenToString, TokenType;
import volt.token.location;
// Not sure of the best home for this guy.
void warning(Location loc, string message)
{
writefln(format("%s: warning: %s", loc.toString(), message));
}
void hackTypeWarning(ir.Node n, ir.Type nt, ir.Type ot)
{
auto str = format("%s: warning: types differ (new) %s vs (old) %s",
n.location.toString(), typeString(nt), typeString(ot));
writefln(str);
}
/*
*
* Specific Errors
*
*/
CompilerException makeStructValueCall(Location l, string aggName, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(l, format("expected aggregate type '%s' directly, not an instance.", aggName), file, line);
}
CompilerException makeStructDefaultCtor(Location l, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(l, "structs or unions may not define default constructors.", file, line);
}
CompilerException makeStructDestructor(Location l, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(l, "structs or unions may not define a destructor.", file, line);
}
CompilerException makeExpectedOneArgument(Location l, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(l, "expected only one argument.", file, line);
}
CompilerException makeClassAsAAKey(Location l, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(l, "classes cannot be associative array key types.", file, line);
}
CompilerException makeExpectedCall(ir.RunExp runexp, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(runexp.location, "expression following #run must be a function call.", file, line);
}
CompilerException makeNonNestedAccess(Location l, ir.Variable var, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(l, format("cannot access variable '%s' from non-nested function.", var.name), file, line);
}
CompilerException makeMultipleMatches(Location l, string name, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(l, format("multiple imports contain a symbol '%s'.", name), file, line);
}
CompilerException makeNoStringImportPaths(Location l, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(l, "no string import file paths defined (use -J).", file, line);
}
CompilerException makeImportFileOpenFailure(Location l, string filename, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(l, format("couldn't open '%s' for reading.", filename), file, line);
}
CompilerException makeStringImportWrongConstant(Location l, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(l, "expected non empty string literal as argument to string import.", file, line);
}
CompilerException makeNoSuperCall(Location l, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(l, "expected explicit super call.", file, line);
}
CompilerException makeInvalidIndexValue(ir.Node n, ir.Type type, string file = __FILE__, const int line = __LINE__)
{
auto str = format("can not index %s.", typeString(type));
return new CompilerError(n.location, str, file, line);
}
CompilerException makeUnknownArch(string a, string file = __FILE__, const int line = __LINE__)
{
auto str = format("unknown arch \"%s\"", a);
return new CompilerError(str, file, line);
}
CompilerException makeUnknownPlatform(string p, string file = __FILE__, const int line = __LINE__)
{
auto str = format("unknown platform \"%s\"", p);
return new CompilerError(str, file, line);
}
CompilerException makeExpectedTypeMatch(Location loc, ir.Type type, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(loc, format("expected type %s for slice operation.", typeString(type)), file, line);
}
CompilerException makeIndexVarTooSmall(Location loc, string name, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(loc, format("index variable '%s' is too small to hold a size_t.", name), file, line);
}
CompilerException makeNestedNested(Location loc, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(loc, "nested functions may not have nested functions.", file, line);
}
CompilerException makeNonConstantStructLiteral(Location loc, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(loc, "non-constant expression in global struct literal.", file, line);
}
CompilerException makeWrongNumberOfArgumentsToStructLiteral(Location loc, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(loc, "wrong number of arguments to struct literal.", file, line);
}
CompilerException makeCannotDeduceStructLiteralType(Location loc, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(loc, "cannot deduce struct literal's type.", file, line);
}
CompilerException makeArrayNonArrayNotCat(Location loc, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(loc, "binary operations involving array and non array must be use concatenation (~).", file, line);
}
CompilerException makeCannotPickStaticFunction(Location loc, string name, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(loc, format("cannot select static function '%s'.", name), file, line);
}
CompilerException makeCannotPickStaticFunctionVia(Location loc, string name, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(loc, format("cannot select static function '%s' through instance.", name), file, line);
}
CompilerException makeCannotPickMemberFunction(Location loc, string name, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(loc, format("cannot select member function '%s'.", name), file, line);
}
CompilerException makeStaticViaInstance(Location loc, string name, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(loc, format("looking up '%s' static function via instance.", name), file, line);
}
CompilerException makeMixingStaticMember(Location loc, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(loc, "mixing static and member functions.", file, line);
}
CompilerException makeNoZeroProperties(Location loc, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(loc, "no zero argument properties found.", file, line);
}
CompilerException makeMultipleZeroProperties(Location loc, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(loc, "multiple zero argument properties found.", file, line);
}
CompilerException makeUFCSAsProperty(Location loc, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(loc, "an @property function may not be used for UFCS.", file, line);
}
CompilerException makeUFCSAndProperty(Location loc, string name, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(loc, format("functions for lookup '%s' match UFCS *and* @property functions.", name), file, line);
}
CompilerException makeCallingUncallable(Location loc, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(loc, "calling uncallable expression.", file, line);
}
CompilerException makeForeachIndexRef(Location loc, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(loc, "may not mark a foreach index as ref.", file, line);
}
CompilerException makeDoNotSpecifyForeachType(Location loc, string varname, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(loc, format("foreach variables like '%s' may not have explicit type declarations.", varname), file, line);
}
CompilerException makeNoFieldOrPropOrUFCS(ir.Postfix postfix, string file = __FILE__, const int line=__LINE__)
{
assert(postfix.identifier !is null);
return new CompilerError(postfix.location, format("postfix lookups like '%s' must be field, property, or UFCS function.", postfix.identifier.value), file, line);
}
CompilerException makeAccessThroughWrongType(Location loc, string field, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(loc, format("accessing field '%s' through incorrect type.", field), file, line);
}
CompilerException makeNoFieldOrPropertyOrIsUFCSWithoutCall(Location loc, string value, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(loc, format("postfix lookups like '%s' that are not fields, properties, or UFCS functions must be a call.", value), file, line);
}
CompilerException makeNoFieldOrPropertyOrUFCS(Location loc, string value, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(loc, format("'%s' is neither field, nor property, nor a UFCS function.", value), file, line);
}
CompilerException makeUsedBindFromPrivateImport(Location loc, string bind, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(loc, format("may not bind from private import, as '%s' does.", bind), file, line);
}
CompilerException makeOverriddenNeedsProperty(ir.Function f, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(f.location, format("functions like '%s' that override @property functions must be marked @property themselves.", f.name), file, line);
}
CompilerException makeBadBuiltin(Location l, ir.Type t, string field, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(l, format("type '%s' doesn't have built-in field '%s'.", typeString(t), field), file, line);
}
CompilerException makeBadMerge(ir.Alias a, ir.Store s, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(a.location, "cannot merge alias as it is not a function.", file, line);
}
CompilerException makeScopeOutsideFunction(Location l, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(l, "scopes must be inside a function.", file, line);
}
CompilerException makeCannotDup(Location l, ir.Type type, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(l, format("cannot duplicate type '%s'.", type.errorString()), file, line);
}
CompilerException makeCannotSlice(Location l, ir.Type type, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(l, format("cannot slice type '%s'.", type.errorString()), file, line);
}
CompilerException makeCallClass(Location loc, ir.Class _class, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(loc, format("attempted to call class '%s'. Did you forget a new?", _class.name), file, line);
}
CompilerException makeMixedSignedness(Location loc, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(loc, format("expressions cannot mix signed and unsigned values."), file, line);
}
CompilerException makeStaticArrayLengthMismatch(Location loc, size_t expectedLength, size_t gotLength, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(loc, format("expected static array literal of length %s, got a length of %s.", expectedLength, gotLength), file, line);
}
CompilerException makeDoesNotImplement(Location loc, ir.Class _class, ir._Interface iface, ir.Function func, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(loc, format("'%s' does not implement the '%s' method of interface '%s'.", _class.name, func.name, iface.name), file, line);
}
CompilerException makeCaseFallsThrough(Location loc, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(loc, "non-empty switch cases may not fall through.", file, line);
}
CompilerException makeNoNextCase(Location loc, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(loc, "case falls through, but there are no subsequent cases.", file, line);
}
CompilerException makeGotoOutsideOfSwitch(Location loc, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(loc, "goto must be inside a switch statement.", file, line);
}
CompilerException makeStrayDocComment(Location loc, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(loc, "documentation comment has nothing to document.", file, line);
}
CompilerException makeCallingWithoutInstance(Location loc, string file = __FILE__, const int line = __LINE__)
{
auto wi = new CompilerError(loc, "instanced functions must be called with an instance.", file, line);
return wi;
}
CompilerException makeForceLabel(Location loc, ir.Function fun, string file = __FILE__, const int line = __LINE__)
{
auto fl = new CompilerError(loc, format("calls to @label functions like '%s' must label their arguments.", fun.name), file, line);
return fl;
}
CompilerException makeNoEscapeScope(Location loc, string file = __FILE__, const int line = __LINE__)
{
auto es = new CompilerError(loc, "types marked scope may not remove their scope through assignment.", file, line);
return es;
}
CompilerException makeNoReturnScope(Location loc, string file = __FILE__, const int line = __LINE__)
{
auto nrs = new CompilerError(loc, "types marked scope may not be returned.", file, line);
return nrs;
}
CompilerException makeReturnValueExpected(Location loc, ir.Type type, string file = __FILE__, const int line = __LINE__)
{
string emsg = format("return value of type '%s' expected.", type.errorString());
return new CompilerError(loc, emsg, file, line);
}
CompilerException makeNoLoadBitcodeFile(string filename, string msg, string file = __FILE__, const int line = __LINE__)
{
string err;
if (msg !is null) {
err = format("failed to read bitcode file '%s'.\n%s", filename, msg);
} else {
err = format("failed to read bitcode file '%s'.", filename);
}
return new CompilerError(err, file, line);
}
CompilerException makeNoWriteBitcodeFile(string filename, string msg, string file = __FILE__, const int line = __LINE__)
{
string err;
if (msg !is null) {
err = format("failed to write object bitcode '%s'.\n%s", filename, msg);
} else {
err = format("failed to write object bitcode '%s'.", filename);
}
return new CompilerError(err, file, line);
}
CompilerException makeNoWriteObjectFile(string filename, string msg, string file = __FILE__, const int line = __LINE__)
{
string err;
if (msg !is null) {
err = format("failed to write object file '%s'.\n%s", filename, msg);
} else {
err = format("failed to write object file '%s'.", filename);
}
return new CompilerError(err, file, line);
}
CompilerException makeNoLinkModule(string filename, string msg, string file = __FILE__, const int line = __LINE__)
{
string err;
if (msg !is null) {
err = format("failed to link in module '%s'.\n%s", filename, msg);
} else {
err = format("failed to link in module '%s'.", filename);
}
return new CompilerError(err, file, line);
}
CompilerException makeUnmatchedLabel(Location loc, string label, string file = __FILE__, const int line = __LINE__)
{
auto emsg = format("no parameter matches argument label '%s'.", label);
auto unl = new CompilerError(loc, emsg, file, line);
return unl;
}
CompilerException makeDollarOutsideOfIndex(ir.Constant constant, string file = __FILE__, const int line = __LINE__)
{
auto doi = new CompilerError(constant.location, "'$' may only appear in an index expression.", file, line);
return doi;
}
CompilerException makeBreakOutOfLoop(Location loc, string file = __FILE__, const int line = __LINE__)
{
auto e = new CompilerError(loc, "break may only appear in a loop or switch.", file, line);
return e;
}
CompilerException makeAggregateDoesNotDefineOverload(Location loc, ir.Aggregate agg, string func, string file = __FILE__, const int line = __LINE__)
{
auto e = new CompilerError(loc, format("type '%s' does not define operator function '%s'.", agg.name, func), file, line);
return e;
}
CompilerException makeBadWithType(Location loc, string file = __FILE__, const int line = __LINE__)
{
auto e = new CompilerError(loc, "with statement cannot use given expression.", file, line);
return e;
}
CompilerException makeForeachReverseOverAA(ir.ForeachStatement fes, string file = __FILE__, const int line = __LINE__)
{
auto e = new CompilerError(fes.location, "foreach_reverse cannot be used with an associative array.", file, line);
return e;
}
CompilerException makeAnonymousAggregateRedefines(ir.Aggregate agg, string name, string file = __FILE__, const int line = __LINE__)
{
auto msg = format("anonymous aggregate redefines '%s'.", name);
auto e = new CompilerError(agg.location, msg, file, line);
return e;
}
CompilerException makeAnonymousAggregateAtTopLevel(ir.Aggregate agg, string file = __FILE__, const int line = __LINE__)
{
auto e = new CompilerError(agg.location, "anonymous struct or union not inside aggregate.", file, line);
return e;
}
CompilerException makeInvalidMainSignature(ir.Function func, string file = __FILE__, const int line = __LINE__)
{
auto e = new CompilerError(func.location, "invalid main signature.", file, line);
return e;
}
CompilerException makeNoValidFunction(Location loc, string fname, ir.Type[] args, string file = __FILE__, const int line = __LINE__)
{
auto msg = format("no function named '%s' matches arguments %s.", fname, typesString(args));
auto e = new CompilerError(loc, msg, file, line);
return e;
}
CompilerException makeCVaArgsOnlyOperateOnSimpleTypes(Location loc, string file = __FILE__, const int line = __LINE__)
{
auto e = new CompilerError(loc, "C varargs only support retrieving simple types, due to an LLVM limitation.", file, line);
return e;
}
CompilerException makeVaFooMustBeLValue(Location loc, string foo, string file = __FILE__, const int line = __LINE__)
{
auto e = new CompilerError(loc, format("argument to %s is not an lvalue.", foo), file, line);
return e;
}
CompilerException makeNonLastVariadic(ir.Variable var, string file = __FILE__, const int line = __LINE__)
{
auto e = new CompilerError(var.location, "variadic parameter must be last.", file, line);
return e;
}
CompilerException makeStaticAssert(ir.AssertStatement as, string msg, string file = __FILE__, const int line = __LINE__)
{
string emsg = format("static assert: %s", msg);
auto e = new CompilerError(as.location, emsg, file, line);
return e;
}
CompilerException makeConstField(ir.Variable v, string file = __FILE__, const int line = __LINE__)
{
string emsg = format("const or immutable non local/global field '%s' is forbidden.", v.name);
auto e = new CompilerError(v.location, emsg, file, line);
return e;
}
CompilerException makeAssignToNonStaticField(ir.Variable v, string file = __FILE__, const int line = __LINE__)
{
string emsg = format("attempted to assign to non local/global field %s.", v.name);
auto e = new CompilerError(v.location, emsg, file, line);
return e;
}
CompilerException makeSwitchBadType(ir.Node node, ir.Type type, string file = __FILE__, const int line = __LINE__)
{
string emsg = format("bad switch type '%s'.", type.errorString());
auto e = new CompilerError(node.location, emsg, file, line);
return e;
}
CompilerException makeSwitchDuplicateCase(ir.Node node, string file = __FILE__, const int line = __LINE__)
{
auto e = new CompilerError(node.location, "duplicate case in switch statement.", file, line);
return e;
}
CompilerException makeFinalSwitchBadCoverage(ir.Node node, string file = __FILE__, const int line = __LINE__)
{
auto e = new CompilerError(node.location, "final switch statement must cover all enum members.", file, line);
return e;
}
CompilerException makeArchNotSupported(string file = __FILE__, const int line = __LINE__)
{
return new CompilerError("architecture not supported on current platform.", file, line);
}
CompilerException makeNotTaggedOut(ir.Exp exp, size_t i, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(exp.location, format("arguments to out parameters (like no. %s) must be tagged as out.", i+1), file, line);
}
CompilerException makeNotTaggedRef(ir.Exp exp, size_t i, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(exp.location, format("arguments to ref parameters (like no. %s) must be tagged as ref.", i+1), file, line);
}
CompilerException makeFunctionNameOutsideOfFunction(ir.TokenExp fexp, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(fexp.location, format("%s occurring outside of function.", fexp.type == ir.TokenExp.Type.PrettyFunction ? "__PRETTY_FUNCTION__" : "__FUNCTION__"), file, line);
}
CompilerException makeMultipleValidModules(ir.Node node, string[] paths, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(node.location, format("multiple modules are valid: %s.", paths), file, line);
}
CompilerException makeAlreadyLoaded(ir.Module m, string filename, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(m.location, format("module %s already loaded '%s'.", m.name.toString(), filename), file, line);
}
CompilerException makeCannotOverloadNested(ir.Node node, ir.Function func, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(node.location, format("cannot overload nested function '%s'.", func.name), file, line);
}
CompilerException makeUsedBeforeDeclared(ir.Node node, ir.Variable var, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(node.location, format("variable '%s' used before declaration.", var.name), file, line);
}
CompilerException makeStructConstructorsUnsupported(ir.Node node, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(node.location, "struct constructors are currently unsupported.", file, line);
}
CompilerException makeCallingStaticThroughInstance(ir.Node node, ir.Function func, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(node.location, format("calling local or global function '%s' through instance variable.", func.name), file, line);
}
CompilerException makeMarkedOverrideDoesNotOverride(ir.Node node, ir.Function func, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(node.location, format("override functions like '%s' must override a function.", func.name), file, line);
}
CompilerException makeAbstractHasToBeMember(ir.Node node, ir.Function func, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(node.location, format("abstract functions like '%s' must be a member of an abstract class.", func.name), file, line);
}
CompilerException makeAbstractBodyNotEmpty(ir.Node node, ir.Function func, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(node.location, format("abstract functions like '%s' may not have an implementation.", func.name), file, line);
}
CompilerException makeNewAbstract(ir.Node node, ir.Class _class, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(node.location, format("abstract classes like '%s' may not be instantiated.", _class.name), file, line);
}
CompilerException makeBadAbstract(ir.Node node, ir.Attribute attr, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(node.location, "only classes and functions may be marked as abstract.", file, line);
}
CompilerException makeCannotImport(ir.Node node, ir.Import _import, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(node.location, format("can't find module '%s'.", _import.name), file, line);
}
CompilerException makeNotAvailableInCTFE(ir.Node node, string s, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(node.location, format("currently unevaluatable at compile time: '%s'.", s), file, line);
}
CompilerException makeNotAvailableInCTFE(ir.Node node, ir.Node feature, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(node.location, format("%s is currently unevaluatable at compile time.", ir.nodeToString(feature)), file, line);
}
CompilerException makeShadowsDeclaration(ir.Node a, ir.Node b, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(a.location, format("shadows declaration at %s.", b.location.toString()), file, line);
}
CompilerException makeMultipleDefaults(Location location, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(location, "switches may not have multiple default cases.", file, line);
}
CompilerException makeFinalSwitchWithDefault(Location location, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(location, "final switches may not define a default case.", file, line);
}
CompilerException makeNoDefaultCase(Location location, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(location, "switches must have a default case.", file, line);
}
CompilerException makeTryWithoutCatch(Location location, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(location, "try statement must have a catch block and/or a finally block.", file, line);
}
CompilerException makeMultipleOutBlocks(Location location, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(location, "a function may only have one in block defined.", file, line);
}
CompilerException makeNeedOverride(ir.Function overrider, ir.Function overridee, string file = __FILE__, const int line = __LINE__)
{
string emsg = format("function '%s' overrides function at %s but is not marked with 'override'.", overrider.name, overridee.location.toString());
return new CompilerError(overrider.location, emsg, file, line);
}
CompilerException makeThrowOnlyThrowable(ir.Exp exp, ir.Type type, string file = __FILE__, const int line = __LINE__)
{
string emsg = format("only types that inherit from object.Throwable may be thrown, not '%s'.", type.errorString());
return new CompilerError(exp.location, emsg, file, line);
}
CompilerException makeThrowNoInherits(ir.Exp exp, ir.Class clazz, string file = __FILE__, const int line = __LINE__)
{
string emsg = format("only types that inherit from object.Throwable may be thrown, not class '%s'.", clazz.errorString());
return new CompilerError(exp.location, emsg, file, line);
}
CompilerException makeInvalidAAKey(ir.AAType aa, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(aa.location, format("'%s' is an invalid AA key.", aa.key.errorString()), file, line);
}
CompilerException makeBadAAAssign(Location location, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(location, "may not assign associate arrays to prevent semantic inconsistencies.", file, line);
}
CompilerException makeBadAANullAssign(Location location, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(location, "cannot set AA to null, use [] instead.", file, line);
}
/*
*
* General Util
*
*/
CompilerException makeError(ir.Node n, string s, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(n.location, s, file, line);
}
CompilerException makeError(Location location, string s, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(location, s, file, line);
}
CompilerException makeUnsupported(Location location, string feature, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(location, format("unsupported feature '%s'.", feature), file, line);
}
CompilerException makeExpected(ir.Node node, string s, string file = __FILE__, const int line = __LINE__)
{
return makeExpected(node.location, s, false, file, line);
}
CompilerException makeExpected(Location location, string s, bool b = false, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(location, format("expected %s.", s), b, file, line);
}
CompilerException makeExpected(Location location, string expected, string got, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(location, format("expected '%s', got '%s'.", expected, got), file, line);
}
CompilerException makeUnexpected(ir.Location location, string s, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(location, format("unexpected %s.", s), file, line);
}
CompilerException makeBadOperation(ir.Node node, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(node.location, "bad operation.", file, line);
}
CompilerException makeExpectedContext(ir.Node node, ir.Node node2, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(node.location, "expected context pointer.", file, line);
}
/*
*
* Type Conversions
*
*/
CompilerException makeBadImplicitCast(ir.Node node, ir.Type from, ir.Type to, string file = __FILE__, const int line = __LINE__)
{
string emsg = format("cannot implicitly convert %s to %s.", typeString(from), typeString(to));
return new CompilerError(node.location, emsg, file, line);
}
CompilerException makeCannotModify(ir.Node node, ir.Type type, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(node.location, format("cannot modify '%s'.", type.errorString()), file, line);
}
CompilerException makeNotLValue(ir.Node node, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(node.location, "expected lvalue.", file, line);
}
CompilerException makeTypeIsNot(ir.Node node, ir.Type from, ir.Type to, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(node.location, format("type '%s' is not '%s' as expected.", from.errorString(), to.errorString()), file, line);
}
CompilerException makeInvalidType(ir.Node node, ir.Type type, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(node.location, format("bad type '%s'.", type.errorString()), file, line);
}
CompilerException makeInvalidUseOfStore(ir.Node node, ir.Store store, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(node.location, format("invalid use of store '%s'.", store.name), file, line);
}
/*
*
* Lookups
*
*/
CompilerException makeWithCreatesAmbiguity(Location loc, string file = __FILE__, const int line = __LINE__)
{
auto e = new CompilerError(loc, "ambiguous lookup due to with block(s).", file, line);
return e;
}
CompilerException makeInvalidThis(ir.Node node, ir.Type was, ir.Type expected, string member, string file = __FILE__, const int line = __LINE__)
{
string emsg = format("'this' is of type '%s' expected '%s' to access member '%s'.", was.errorString(), expected.errorString(), member);
return new CompilerError(node.location, emsg, file, line);
}
CompilerException makeNotMember(ir.Node node, ir.Type aggregate, string member, string file = __FILE__, const int line = __LINE__)
{
auto pfix = cast(ir.Postfix) node;
string emsg = format("'%s' has no member '%s'.", aggregate.errorString(), member);
if (pfix !is null && pfix.child.nodeType == ir.NodeType.ExpReference) {
auto eref = cast(ir.ExpReference) pfix.child;
auto var = cast(ir.Variable)eref.decl;
string name;
foreach (i, id; eref.idents) {
name ~= id;
if (i < eref.idents.length - 1) {
name ~= ".";
}
}
emsg = format("instance '%s' (of type '%s') has no member '%s'.", name, aggregate.errorString(), member);
}
return new CompilerError(node.location, emsg, file, line);
}
CompilerException makeNotMember(Location location, string aggregate, string member, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(location, format("'%s' has no member '%s'.", aggregate, member), file, line);
}
CompilerException makeFailedLookup(ir.Node node, string lookup, string file = __FILE__, const int line = __LINE__)
{
return makeFailedLookup(node.location, lookup, file, line);
}
CompilerException makeFailedLookup(Location location, string lookup, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(location, format("unidentified identifier '%s'.", lookup), file, line);
}
CompilerException makeNonTopLevelImport(Location location, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(location, "imports must occur in the top scope.", file, line);
}
/*
*
* Functions
*
*/
CompilerException makeWrongNumberOfArguments(ir.Node node, size_t got, size_t expected, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(node.location, format("wrong number of arguments; got %s, expected %s.", got, expected), file, line);
}
CompilerException makeBadCall(ir.Node node, ir.Type type, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(node.location, format("cannot call '%s'.", type.errorString()), file, line);
}
CompilerException makeCannotDisambiguate(ir.Node node, ir.Function[] functions, ir.Type[] args, string file = __FILE__, const int line = __LINE__)
{
return makeCannotDisambiguate(node.location, functions, args, file, line);
}
CompilerException makeCannotDisambiguate(Location location, ir.Function[] functions, ir.Type[] args, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(location, format("no '%s' function (of %s possible) matches arguments '%s'.", functions[0].name, functions.length, typesString(args)), file, line);
}
CompilerException makeCannotInfer(ir.Location location, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(location, "not enough information to infer type.", true, file, line);
}
CompilerException makeCannotLoadDynamic(ir.Node node, ir.Function func, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(node.location, "@loadDynamic function cannot have body.", file, line);
}
CompilerException makeMultipleFunctionsMatch(ir.Location location, ir.Function[] functions, string file = __FILE__, const int line = __LINE__)
{
return new CompilerError(location, format("%s overloaded functions match call.", functions.length), file, line);
}
/*
*
* Panics
*
*/
CompilerException panicOhGod(ir.Node node, string file = __FILE__, const int line = __LINE__)
{
return panic(node.location, "oh god.", file, line);
}
CompilerException panic(ir.Node node, string msg, string file = __FILE__, const int line = __LINE__)
{
return panic(node.location, msg, file, line);
}
CompilerException panic(Location location, string msg, string file = __FILE__, const int line = __LINE__)
{
return new CompilerPanic(location, msg, file, line);
}
CompilerException panic(string msg, string file = __FILE__, const int line = __LINE__)
{
return new CompilerPanic(msg, file, line);
}
CompilerException panicRuntimeObjectNotFound(string name, string file = __FILE__, const int line = __LINE__)
{
return panic(format("can't find runtime object '%s'.", name), file, line);
}
CompilerException panicUnhandled(ir.Node node, string unhandled, string file = __FILE__, const int line = __LINE__)
{
return panicUnhandled(node.location, unhandled, file, line);
}
CompilerException panicUnhandled(Location location, string unhandled, string file = __FILE__, const int line = __LINE__)
{
return new CompilerPanic(location, format("unhandled case '%s'.", unhandled), file, line);
}
CompilerException panicNotMember(ir.Node node, string aggregate, string field, string file = __FILE__, const int line = __LINE__)
{
auto str = format("no field name '%s' in aggregate '%s' '%s'.",
field, aggregate, ir.nodeToString(node));
return new CompilerPanic(node.location, str, file, line);
}
CompilerException panicExpected(ir.Location location, string msg, string file = __FILE__, const int line = __LINE__)
{
return new CompilerPanic(location, format("expected %s.", msg), file, line);
}
void panicAssert(ir.Node node, bool condition, string file = __FILE__, const int line = __LINE__)
{
if (!condition) {
throw panic(node.location, "assertion failure.", file, line);
}
}
private:
string typesString(ir.Type[] types)
{
char[] buf;
buf ~= "(";
foreach (i, type; types) {
buf ~= errorString(type, true);
if (i < types.length - 1) {
buf ~= ", ";
}
}
buf ~= ")";
version (Volt) {
return cast(string)new buf[0 .. $];
} else {
return buf.idup;
}
}
string errorString(ir.Type type, bool alwaysGlossed = false)
{
if (type.glossedName.length > 0 && alwaysGlossed) {
return type.glossedName;
}
string outString;
string suffix;
if (type.isConst) {
outString ~= "const(";
suffix ~= ")";
}
if (type.isImmutable) {
outString ~= "immutable(";
suffix ~= ")";
}
if (type.isScope) {
outString ~= "scope (";
suffix ~= ")";
}
assert(type !is null);
switch(type.nodeType) with(ir.NodeType) {
case PrimitiveType:
ir.PrimitiveType prim = cast(ir.PrimitiveType)type;
if (prim.originalToken !is null) {
outString ~= toLower(tokenToString(prim.originalToken.type));
} else {
outString ~= toLower(tokenToString(cast(TokenType)prim.type));
}
break;
case TypeReference:
ir.TypeReference tr = cast(ir.TypeReference)type;
outString ~= tr.type.errorString(alwaysGlossed);
break;
case PointerType:
ir.PointerType pt = cast(ir.PointerType)type;
outString ~= format("%s*", pt.base.errorString(alwaysGlossed));
break;
case NullType:
outString = "null";
break;
case ArrayType:
ir.ArrayType at = cast(ir.ArrayType)type;
outString ~= format("%s[]", at.base.errorString(alwaysGlossed));
break;
case StaticArrayType:
ir.StaticArrayType sat = cast(ir.StaticArrayType)type;
outString ~= format("%s[%d]", sat.base.errorString(alwaysGlossed), sat.length);
break;
case AAType:
ir.AAType aat = cast(ir.AAType)type;
outString ~= format("%s[%s]", aat.value.errorString(alwaysGlossed), aat.key.errorString(alwaysGlossed));
break;
case FunctionType:
case DelegateType:
ir.CallableType c = cast(ir.CallableType)type;
string ctype = type.nodeType == FunctionType ? "function" : "delegate";
string params;
if (c.params.length > 0) {
params = c.params[0].errorString(alwaysGlossed);
foreach (param; c.params[1 .. $]) {
params ~= ", " ~ param.errorString(alwaysGlossed);
}
}
outString ~= format("%s %s(%s)", c.ret.errorString(alwaysGlossed), ctype, params);
break;
case StorageType:
ir.StorageType st = cast(ir.StorageType)type;
outString ~= format("%s(%s)", toLower(format("%s", st.type)), st.base.errorString(alwaysGlossed));
break;
case Class:
case Struct:
auto agg = cast(ir.Aggregate)type;
assert(agg !is null);
outString ~= agg.name;
break;
default:
outString ~= type.toString();
break;
}
return outString ~ suffix;
}
string typeString(ir.Type t)
{
string s = t.glossedName;
if (s.length == 0) {
s = t.errorString();
}
s = format("'%s'", s);
if (t.glossedName.length != 0) {
s = format("%s (aka '%s')", s, t.errorString());
}
return s;
}
|
D
|
module godot.acceptdialog.all;
public import
godot.acceptdialog,
godot.confirmationdialog,
godot.filedialog,
godot.editorfiledialog;
|
D
|
instance BAU_918_Bauer(Npc_Default)
{
name[0] = NAME_Bauer;
guild = GIL_BAU;
id = 918;
voice = 7;
flags = 0;
npcType = NPCTYPE_AMBIENT;
B_SetAttributesToChapter(self,1);
B_GiveNpcTalents(self);
B_SetFightSkills(self,15);
fight_tactic = FAI_HUMAN_COWARD;
EquipItem(self,ItMw_1h_Bau_Axe);
B_CreateAmbientInv(self);
B_SetNpcVisual(self,MALE,"Hum_Head_Fighter",Face_N_Normal17,BodyTex_N,ITAR_Bau_L);
Mdl_SetModelFatness(self,1);
Mdl_ApplyOverlayMds(self,"Humans_Relaxed.mds");
daily_routine = Rtn_Start_918;
};
func void Rtn_Start_918()
{
TA_Smalltalk(8,5,22,5,"NW_BIGFARM_KITCHEN_09");
TA_Smalltalk(22,5,8,5,"NW_BIGFARM_KITCHEN_09");
};
|
D
|
/**
* Part of the D programming language runtime library.
*/
/*
* Copyright (C) 2004-2007 by Digital Mars, www.digitalmars.com
* Written by Walter Bright
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, in both source and binary form, subject to the following
* restrictions:
*
* o The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* o Altered source versions must be plainly marked as such, and must not
* be misrepresented as being the original software.
* o This notice may not be removed or altered from any source
* distribution.
*/
/* NOTE: This file has been patched from the original DMD distribution to
work with the GDC compiler.
Modified by David Friedman, November 2006
*/
module arraycat;
import object;
import std.memory;
import std.string;
//import std.c.string;
//import std.c.stdio;
//import std.c.stdarg;
extern (C)
byte[] _d_arraycopy(uint size, byte[] from, byte[] to)
{
//printf("f = %p,%d, t = %p,%d, size = %d\n", (void*)from, from.length, (void*)to, to.length, size);
if (to.length != from.length)
{
//throw new Error(std.string.format("lengths don't match for array copy, %s = %s", to.length, from.length));
throw new Error("lengths don't match for array copy," ~
toString(to.length) ~ " = " ~ toString(from.length));
}
else if (cast(byte *)to + to.length * size <= cast(byte *)from ||
cast(byte *)from + from.length * size <= cast(byte *)to)
{
memcpy(cast(byte *)to, cast(byte *)from, to.length * size);
}
else
{
throw new Error("overlapping array copy");
}
return to;
}
|
D
|
/**
* Compiler implementation of the
* $(LINK2 http://www.dlang.org, D programming language).
*
* Copyright: Copyright (C) 1999-2019 by The D Language Foundation, All Rights Reserved
* Authors: $(LINK2 http://www.digitalmars.com, Walter Bright)
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/typesem.d, _typesem.d)
* Documentation: https://dlang.org/phobos/dmd_typesem.html
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/typesem.d
*/
module dmd.typesem;
import core.checkedint;
import core.stdc.string;
import core.stdc.stdio;
import dmd.access;
import dmd.aggregate;
import dmd.aliasthis;
import dmd.arrayop;
import dmd.arraytypes;
import dmd.complex;
import dmd.dcast;
import dmd.dclass;
import dmd.declaration;
import dmd.denum;
import dmd.dimport;
import dmd.dmangle;
import dmd.dscope;
import dmd.dstruct;
import dmd.dsymbol;
import dmd.dsymbolsem;
import dmd.dtemplate;
import dmd.errors;
import dmd.expression;
import dmd.expressionsem;
import dmd.func;
import dmd.globals;
import dmd.hdrgen;
import dmd.id;
import dmd.identifier;
import dmd.imphint;
import dmd.init;
import dmd.initsem;
import dmd.visitor;
import dmd.mtype;
import dmd.objc;
import dmd.opover;
import dmd.root.ctfloat;
import dmd.root.rmem;
import dmd.root.outbuffer;
import dmd.root.rootobject;
import dmd.root.stringtable;
import dmd.semantic3;
import dmd.sideeffect;
import dmd.target;
import dmd.tokens;
import dmd.typesem;
/**************************
* This evaluates exp while setting length to be the number
* of elements in the tuple t.
*/
private Expression semanticLength(Scope* sc, Type t, Expression exp)
{
if (auto tt = t.isTypeTuple())
{
ScopeDsymbol sym = new ArrayScopeSymbol(sc, tt);
sym.parent = sc.scopesym;
sc = sc.push(sym);
sc = sc.startCTFE();
exp = exp.expressionSemantic(sc);
sc = sc.endCTFE();
sc.pop();
}
else
{
sc = sc.startCTFE();
exp = exp.expressionSemantic(sc);
sc = sc.endCTFE();
}
return exp;
}
private Expression semanticLength(Scope* sc, TupleDeclaration tup, Expression exp)
{
ScopeDsymbol sym = new ArrayScopeSymbol(sc, tup);
sym.parent = sc.scopesym;
sc = sc.push(sym);
sc = sc.startCTFE();
exp = exp.expressionSemantic(sc);
sc = sc.endCTFE();
sc.pop();
return exp;
}
/*************************************
* Resolve a tuple index.
*/
private void resolveTupleIndex(const ref Loc loc, Scope* sc, Dsymbol s, Expression* pe, Type* pt, Dsymbol* ps, RootObject oindex)
{
*pt = null;
*ps = null;
*pe = null;
auto tup = s.isTupleDeclaration();
auto eindex = isExpression(oindex);
auto tindex = isType(oindex);
auto sindex = isDsymbol(oindex);
if (!tup)
{
// It's really an index expression
if (tindex)
eindex = new TypeExp(loc, tindex);
else if (sindex)
eindex = symbolToExp(sindex, loc, sc, false);
Expression e = new IndexExp(loc, symbolToExp(s, loc, sc, false), eindex);
e = e.expressionSemantic(sc);
resolveExp(e, pt, pe, ps);
return;
}
// Convert oindex to Expression, then try to resolve to constant.
if (tindex)
tindex.resolve(loc, sc, &eindex, &tindex, &sindex);
if (sindex)
eindex = symbolToExp(sindex, loc, sc, false);
if (!eindex)
{
.error(loc, "index `%s` is not an expression", oindex.toChars());
*pt = Type.terror;
return;
}
eindex = semanticLength(sc, tup, eindex);
eindex = eindex.ctfeInterpret();
if (eindex.op == TOK.error)
{
*pt = Type.terror;
return;
}
const(uinteger_t) d = eindex.toUInteger();
if (d >= tup.objects.dim)
{
.error(loc, "tuple index `%llu` exceeds length %u", d, tup.objects.dim);
*pt = Type.terror;
return;
}
RootObject o = (*tup.objects)[cast(size_t)d];
*pt = isType(o);
*ps = isDsymbol(o);
*pe = isExpression(o);
if (*pt)
*pt = (*pt).typeSemantic(loc, sc);
if (*pe)
resolveExp(*pe, pt, pe, ps);
}
/*************************************
* Takes an array of Identifiers and figures out if
* it represents a Type, Expression, or Dsymbol.
* Params:
* mt = array of identifiers
* loc = location for error messages
* sc = context
* s = symbol to start search at
* scopesym = unused
* pe = set if expression
* pt = set if type
* ps = set if symbol
* typeid = set if in TypeidExpression https://dlang.org/spec/expression.html#TypeidExpression
*/
private void resolveHelper(TypeQualified mt, const ref Loc loc, Scope* sc, Dsymbol s, Dsymbol scopesym,
Expression* pe, Type* pt, Dsymbol* ps, bool intypeid = false)
{
version (none)
{
printf("TypeQualified::resolveHelper(sc = %p, idents = '%s')\n", sc, mt.toChars());
if (scopesym)
printf("\tscopesym = '%s'\n", scopesym.toChars());
}
*pe = null;
*pt = null;
*ps = null;
if (s)
{
//printf("\t1: s = '%s' %p, kind = '%s'\n",s.toChars(), s, s.kind());
Declaration d = s.isDeclaration();
if (d && (d.storage_class & STC.templateparameter))
s = s.toAlias();
else
{
// check for deprecated or disabled aliases
s.checkDeprecated(loc, sc);
if (d)
d.checkDisabled(loc, sc, true);
}
s = s.toAlias();
//printf("\t2: s = '%s' %p, kind = '%s'\n",s.toChars(), s, s.kind());
for (size_t i = 0; i < mt.idents.dim; i++)
{
RootObject id = mt.idents[i];
if (id.dyncast() == DYNCAST.expression ||
id.dyncast() == DYNCAST.type)
{
Type tx;
Expression ex;
Dsymbol sx;
resolveTupleIndex(loc, sc, s, &ex, &tx, &sx, id);
if (sx)
{
s = sx.toAlias();
continue;
}
if (tx)
ex = new TypeExp(loc, tx);
assert(ex);
ex = typeToExpressionHelper(mt, ex, i + 1);
ex = ex.expressionSemantic(sc);
resolveExp(ex, pt, pe, ps);
return;
}
Type t = s.getType(); // type symbol, type alias, or type tuple?
uint errorsave = global.errors;
int flags = t is null ? SearchLocalsOnly : IgnorePrivateImports;
Dsymbol sm = s.searchX(loc, sc, id, flags);
if (sm && !(sc.flags & SCOPE.ignoresymbolvisibility) && !symbolIsVisible(sc, sm))
{
.error(loc, "`%s` is not visible from module `%s`", sm.toPrettyChars(), sc._module.toChars());
sm = null;
}
if (global.errors != errorsave)
{
*pt = Type.terror;
return;
}
void helper3()
{
Expression e;
VarDeclaration v = s.isVarDeclaration();
FuncDeclaration f = s.isFuncDeclaration();
if (intypeid || !v && !f)
e = symbolToExp(s, loc, sc, true);
else
e = new VarExp(loc, s.isDeclaration(), true);
e = typeToExpressionHelper(mt, e, i);
e = e.expressionSemantic(sc);
resolveExp(e, pt, pe, ps);
}
//printf("\t3: s = %p %s %s, sm = %p\n", s, s.kind(), s.toChars(), sm);
if (intypeid && !t && sm && sm.needThis())
return helper3();
if (VarDeclaration v = s.isVarDeclaration())
{
if (v.storage_class & (STC.const_ | STC.immutable_ | STC.manifest) ||
v.type.isConst() || v.type.isImmutable())
{
// https://issues.dlang.org/show_bug.cgi?id=13087
// this.field is not constant always
if (!v.isThisDeclaration())
return helper3();
}
}
if (!sm)
{
if (!t)
{
if (s.isDeclaration()) // var, func, or tuple declaration?
{
t = s.isDeclaration().type;
if (!t && s.isTupleDeclaration()) // expression tuple?
return helper3();
}
else if (s.isTemplateInstance() ||
s.isImport() || s.isPackage() || s.isModule())
{
return helper3();
}
}
if (t)
{
sm = t.toDsymbol(sc);
if (sm && id.dyncast() == DYNCAST.identifier)
{
sm = sm.search(loc, cast(Identifier)id, IgnorePrivateImports);
if (!sm)
return helper3();
}
else
return helper3();
}
else
{
if (id.dyncast() == DYNCAST.dsymbol)
{
// searchX already handles errors for template instances
assert(global.errors);
}
else
{
assert(id.dyncast() == DYNCAST.identifier);
sm = s.search_correct(cast(Identifier)id);
if (sm)
error(loc, "identifier `%s` of `%s` is not defined, did you mean %s `%s`?", id.toChars(), mt.toChars(), sm.kind(), sm.toChars());
else
error(loc, "identifier `%s` of `%s` is not defined", id.toChars(), mt.toChars());
}
*pe = new ErrorExp();
return;
}
}
s = sm.toAlias();
}
if (auto em = s.isEnumMember())
{
// It's not a type, it's an expression
*pe = em.getVarExp(loc, sc);
return;
}
if (auto v = s.isVarDeclaration())
{
/* This is mostly same with DsymbolExp::semantic(), but we cannot use it
* because some variables used in type context need to prevent lowering
* to a literal or contextful expression. For example:
*
* enum a = 1; alias b = a;
* template X(alias e){ alias v = e; } alias x = X!(1);
* struct S { int v; alias w = v; }
* // TypeIdentifier 'a', 'e', and 'v' should be TOK.variable,
* // because getDsymbol() need to work in AliasDeclaration::semantic().
*/
if (!v.type ||
!v.type.deco && v.inuse)
{
if (v.inuse) // https://issues.dlang.org/show_bug.cgi?id=9494
error(loc, "circular reference to %s `%s`", v.kind(), v.toPrettyChars());
else
error(loc, "forward reference to %s `%s`", v.kind(), v.toPrettyChars());
*pt = Type.terror;
return;
}
if (v.type.ty == Terror)
*pt = Type.terror;
else
*pe = new VarExp(loc, v);
return;
}
if (auto fld = s.isFuncLiteralDeclaration())
{
//printf("'%s' is a function literal\n", fld.toChars());
*pe = new FuncExp(loc, fld);
*pe = (*pe).expressionSemantic(sc);
return;
}
version (none)
{
if (FuncDeclaration fd = s.isFuncDeclaration())
{
*pe = new DsymbolExp(loc, fd);
return;
}
}
Type t;
while (1)
{
t = s.getType();
if (t)
break;
// If the symbol is an import, try looking inside the import
if (Import si = s.isImport())
{
s = si.search(loc, s.ident);
if (s && s != si)
continue;
s = si;
}
*ps = s;
return;
}
if (auto ti = t.isTypeInstance())
if (ti != mt && !ti.deco)
{
if (!ti.tempinst.errors)
error(loc, "forward reference to `%s`", ti.toChars());
*pt = Type.terror;
return;
}
if (t.ty == Ttuple)
*pt = t;
else
*pt = t.merge();
}
if (!s)
{
/* Look for what user might have intended
*/
const p = mt.mutableOf().unSharedOf().toChars();
auto id = Identifier.idPool(p, cast(uint)strlen(p));
if (const n = importHint(id.toString()))
error(loc, "`%s` is not defined, perhaps `import %.*s;` ?", p, cast(int)n.length, n.ptr);
else if (auto s2 = sc.search_correct(id))
error(loc, "undefined identifier `%s`, did you mean %s `%s`?", p, s2.kind(), s2.toChars());
else if (const q = Scope.search_correct_C(id))
error(loc, "undefined identifier `%s`, did you mean `%s`?", p, q);
else
error(loc, "undefined identifier `%s`", p);
*pt = Type.terror;
}
}
/************************************
* Transitively search a type for all function types.
* If any function types with parameters are found that have parameter identifiers
* or default arguments, remove those and create a new type stripped of those.
* This is used to determine the "canonical" version of a type which is useful for
* comparisons.
* Params:
* t = type to scan
* Returns:
* `t` if no parameter identifiers or default arguments found, otherwise a new type that is
* the same as t but with no parameter identifiers or default arguments.
*/
private Type stripDefaultArgs(Type t)
{
static Parameters* stripParams(Parameters* parameters)
{
static Parameter stripParameter(Parameter p)
{
Type t = stripDefaultArgs(p.type);
return (t != p.type || p.defaultArg || p.ident || p.userAttribDecl)
? new Parameter(p.storageClass, t, null, null, null)
: null;
}
if (parameters)
{
foreach (i, p; *parameters)
{
Parameter ps = stripParameter(p);
if (ps)
{
// Replace params with a copy we can modify
Parameters* nparams = new Parameters(parameters.dim);
foreach (j, ref np; *nparams)
{
Parameter pj = (*parameters)[j];
if (j < i)
np = pj;
else if (j == i)
np = ps;
else
{
Parameter nps = stripParameter(pj);
np = nps ? nps : pj;
}
}
return nparams;
}
}
}
return parameters;
}
if (t is null)
return t;
if (auto tf = t.isTypeFunction())
{
Type tret = stripDefaultArgs(tf.next);
Parameters* params = stripParams(tf.parameterList.parameters);
if (tret == tf.next && params == tf.parameterList.parameters)
return t;
TypeFunction tr = cast(TypeFunction)tf.copy();
tr.parameterList.parameters = params;
tr.next = tret;
//printf("strip %s\n <- %s\n", tr.toChars(), t.toChars());
return tr;
}
else if (auto tt = t.isTypeTuple())
{
Parameters* args = stripParams(tt.arguments);
if (args == tt.arguments)
return t;
TypeTuple tr = cast(TypeTuple)t.copy();
tr.arguments = args;
return tr;
}
else if (t.ty == Tenum)
{
// TypeEnum::nextOf() may be != NULL, but it's not necessary here.
return t;
}
else
{
Type tn = t.nextOf();
Type n = stripDefaultArgs(tn);
if (n == tn)
return t;
TypeNext tr = cast(TypeNext)t.copy();
tr.next = n;
return tr;
}
}
/******************************************
* We've mistakenly parsed `t` as a type.
* Redo `t` as an Expression.
* Params:
* t = mistaken type
* Returns:
* t redone as Expression, null if cannot
*/
Expression typeToExpression(Type t)
{
static Expression visitSArray(TypeSArray t)
{
if (auto e = t.next.typeToExpression())
return new ArrayExp(t.dim.loc, e, t.dim);
return null;
}
static Expression visitAArray(TypeAArray t)
{
if (auto e = t.next.typeToExpression())
{
if (auto ei = t.index.typeToExpression())
return new ArrayExp(t.loc, e, ei);
}
return null;
}
static Expression visitIdentifier(TypeIdentifier t)
{
return typeToExpressionHelper(t, new IdentifierExp(t.loc, t.ident));
}
static Expression visitInstance(TypeInstance t)
{
return typeToExpressionHelper(t, new ScopeExp(t.loc, t.tempinst));
}
switch (t.ty)
{
case Tsarray: return visitSArray(cast(TypeSArray) t);
case Taarray: return visitAArray(cast(TypeAArray) t);
case Tident: return visitIdentifier(cast(TypeIdentifier) t);
case Tinstance: return visitInstance(cast(TypeInstance) t);
default: return null;
}
}
/* Helper function for `typeToExpression`. Contains common code
* for TypeQualified derived classes.
*/
Expression typeToExpressionHelper(TypeQualified t, Expression e, size_t i = 0)
{
//printf("toExpressionHelper(e = %s %s)\n", Token.toChars(e.op), e.toChars());
foreach (id; t.idents[i .. t.idents.dim])
{
//printf("\t[%d] e: '%s', id: '%s'\n", i, e.toChars(), id.toChars());
final switch (id.dyncast())
{
// ... '. ident'
case DYNCAST.identifier:
e = new DotIdExp(e.loc, e, cast(Identifier)id);
break;
// ... '. name!(tiargs)'
case DYNCAST.dsymbol:
auto ti = (cast(Dsymbol)id).isTemplateInstance();
assert(ti);
e = new DotTemplateInstanceExp(e.loc, e, ti.name, ti.tiargs);
break;
// ... '[type]'
case DYNCAST.type: // https://issues.dlang.org/show_bug.cgi?id=1215
e = new ArrayExp(t.loc, e, new TypeExp(t.loc, cast(Type)id));
break;
// ... '[expr]'
case DYNCAST.expression: // https://issues.dlang.org/show_bug.cgi?id=1215
e = new ArrayExp(t.loc, e, cast(Expression)id);
break;
case DYNCAST.object:
case DYNCAST.tuple:
case DYNCAST.parameter:
case DYNCAST.statement:
case DYNCAST.condition:
case DYNCAST.templateparameter:
assert(0);
}
}
return e;
}
/******************************************
* Perform semantic analysis on a type.
* Params:
* t = Type AST node
* loc = the location of the type
* sc = context
* Returns:
* `Type` with completed semantic analysis, `Terror` if errors
* were encountered
*/
extern(C++) Type typeSemantic(Type t, Loc loc, Scope* sc)
{
static Type error()
{
return Type.terror;
}
Type visitType(Type t)
{
if (t.ty == Tint128 || t.ty == Tuns128)
{
.error(loc, "`cent` and `ucent` types not implemented");
return error();
}
return t.merge();
}
Type visitVector(TypeVector mtype)
{
const errors = global.errors;
mtype.basetype = mtype.basetype.typeSemantic(loc, sc);
if (errors != global.errors)
return error();
mtype.basetype = mtype.basetype.toBasetype().mutableOf();
if (mtype.basetype.ty != Tsarray)
{
.error(loc, "T in __vector(T) must be a static array, not `%s`", mtype.basetype.toChars());
return error();
}
TypeSArray t = cast(TypeSArray)mtype.basetype;
const sz = cast(int)t.size(loc);
final switch (target.isVectorTypeSupported(sz, t.nextOf()))
{
case 0:
// valid
break;
case 1:
// no support at all
.error(loc, "SIMD vector types not supported on this platform");
return error();
case 2:
// invalid base type
.error(loc, "vector type `%s` is not supported on this platform", mtype.toChars());
return error();
case 3:
// invalid size
.error(loc, "%d byte vector type `%s` is not supported on this platform", sz, mtype.toChars());
return error();
}
return merge(mtype);
}
Type visitSArray(TypeSArray mtype)
{
//printf("TypeSArray::semantic() %s\n", toChars());
Type t;
Expression e;
Dsymbol s;
mtype.next.resolve(loc, sc, &e, &t, &s);
if (auto tup = s ? s.isTupleDeclaration() : null)
{
mtype.dim = semanticLength(sc, tup, mtype.dim);
mtype.dim = mtype.dim.ctfeInterpret();
if (mtype.dim.op == TOK.error)
return error();
uinteger_t d = mtype.dim.toUInteger();
if (d >= tup.objects.dim)
{
.error(loc, "tuple index %llu exceeds %llu", cast(ulong)d, cast(ulong)tup.objects.dim);
return error();
}
RootObject o = (*tup.objects)[cast(size_t)d];
if (o.dyncast() != DYNCAST.type)
{
.error(loc, "`%s` is not a type", mtype.toChars());
return error();
}
return (cast(Type)o).addMod(mtype.mod);
}
Type tn = mtype.next.typeSemantic(loc, sc);
if (tn.ty == Terror)
return error();
Type tbn = tn.toBasetype();
if (mtype.dim)
{
auto errors = global.errors;
mtype.dim = semanticLength(sc, tbn, mtype.dim);
if (errors != global.errors)
return error();
mtype.dim = mtype.dim.optimize(WANTvalue);
mtype.dim = mtype.dim.ctfeInterpret();
if (mtype.dim.op == TOK.error)
return error();
errors = global.errors;
dinteger_t d1 = mtype.dim.toInteger();
if (errors != global.errors)
return error();
mtype.dim = mtype.dim.implicitCastTo(sc, Type.tsize_t);
mtype.dim = mtype.dim.optimize(WANTvalue);
if (mtype.dim.op == TOK.error)
return error();
errors = global.errors;
dinteger_t d2 = mtype.dim.toInteger();
if (errors != global.errors)
return error();
if (mtype.dim.op == TOK.error)
return error();
Type overflowError()
{
.error(loc, "`%s` size %llu * %llu exceeds 0x%llx size limit for static array",
mtype.toChars(), cast(ulong)tbn.size(loc), cast(ulong)d1, target.maxStaticDataSize);
return error();
}
if (d1 != d2)
return overflowError();
Type tbx = tbn.baseElemOf();
if (tbx.ty == Tstruct && !(cast(TypeStruct)tbx).sym.members ||
tbx.ty == Tenum && !(cast(TypeEnum)tbx).sym.members)
{
/* To avoid meaningless error message, skip the total size limit check
* when the bottom of element type is opaque.
*/
}
else if (tbn.isTypeBasic() ||
tbn.ty == Tpointer ||
tbn.ty == Tarray ||
tbn.ty == Tsarray ||
tbn.ty == Taarray ||
(tbn.ty == Tstruct && ((cast(TypeStruct)tbn).sym.sizeok == Sizeok.done)) ||
tbn.ty == Tclass)
{
/* Only do this for types that don't need to have semantic()
* run on them for the size, since they may be forward referenced.
*/
bool overflow = false;
if (mulu(tbn.size(loc), d2, overflow) >= target.maxStaticDataSize || overflow)
return overflowError();
}
}
switch (tbn.ty)
{
case Ttuple:
{
// Index the tuple to get the type
assert(mtype.dim);
TypeTuple tt = cast(TypeTuple)tbn;
uinteger_t d = mtype.dim.toUInteger();
if (d >= tt.arguments.dim)
{
.error(loc, "tuple index %llu exceeds %llu", cast(ulong)d, cast(ulong)tt.arguments.dim);
return error();
}
Type telem = (*tt.arguments)[cast(size_t)d].type;
return telem.addMod(mtype.mod);
}
case Tfunction:
case Tnone:
.error(loc, "cannot have array of `%s`", tbn.toChars());
return error();
default:
break;
}
if (tbn.isscope())
{
.error(loc, "cannot have array of scope `%s`", tbn.toChars());
return error();
}
/* Ensure things like const(immutable(T)[3]) become immutable(T[3])
* and const(T)[3] become const(T[3])
*/
mtype.next = tn;
mtype.transitive();
return mtype.addMod(tn.mod).merge();
}
Type visitDArray(TypeDArray mtype)
{
Type tn = mtype.next.typeSemantic(loc, sc);
Type tbn = tn.toBasetype();
switch (tbn.ty)
{
case Ttuple:
return tbn;
case Tfunction:
case Tnone:
.error(loc, "cannot have array of `%s`", tbn.toChars());
return error();
case Terror:
return error();
default:
break;
}
if (tn.isscope())
{
.error(loc, "cannot have array of scope `%s`", tn.toChars());
return error();
}
mtype.next = tn;
mtype.transitive();
return merge(mtype);
}
Type visitAArray(TypeAArray mtype)
{
//printf("TypeAArray::semantic() %s index.ty = %d\n", mtype.toChars(), mtype.index.ty);
if (mtype.deco)
{
return mtype;
}
mtype.loc = loc;
mtype.sc = sc;
if (sc)
sc.setNoFree();
// Deal with the case where we thought the index was a type, but
// in reality it was an expression.
if (mtype.index.ty == Tident || mtype.index.ty == Tinstance || mtype.index.ty == Tsarray || mtype.index.ty == Ttypeof || mtype.index.ty == Treturn)
{
Expression e;
Type t;
Dsymbol s;
mtype.index.resolve(loc, sc, &e, &t, &s);
if (e)
{
// It was an expression -
// Rewrite as a static array
auto tsa = new TypeSArray(mtype.next, e);
return tsa.typeSemantic(loc, sc);
}
else if (t)
mtype.index = t.typeSemantic(loc, sc);
else
{
.error(loc, "index is not a type or an expression");
return error();
}
}
else
mtype.index = mtype.index.typeSemantic(loc, sc);
mtype.index = mtype.index.merge2();
if (mtype.index.nextOf() && !mtype.index.nextOf().isImmutable())
{
mtype.index = mtype.index.constOf().mutableOf();
version (none)
{
printf("index is %p %s\n", mtype.index, mtype.index.toChars());
mtype.index.check();
printf("index.mod = x%x\n", mtype.index.mod);
printf("index.ito = x%x\n", mtype.index.ito);
if (mtype.index.ito)
{
printf("index.ito.mod = x%x\n", mtype.index.ito.mod);
printf("index.ito.ito = x%x\n", mtype.index.ito.ito);
}
}
}
switch (mtype.index.toBasetype().ty)
{
case Tfunction:
case Tvoid:
case Tnone:
case Ttuple:
.error(loc, "cannot have associative array key of `%s`", mtype.index.toBasetype().toChars());
goto case Terror;
case Terror:
return error();
default:
break;
}
Type tbase = mtype.index.baseElemOf();
while (tbase.ty == Tarray)
tbase = tbase.nextOf().baseElemOf();
if (auto ts = tbase.isTypeStruct())
{
/* AA's need typeid(index).equals() and getHash(). Issue error if not correctly set up.
*/
StructDeclaration sd = ts.sym;
if (sd.semanticRun < PASS.semanticdone)
sd.dsymbolSemantic(null);
// duplicate a part of StructDeclaration::semanticTypeInfoMembers
//printf("AA = %s, key: xeq = %p, xerreq = %p xhash = %p\n", toChars(), sd.xeq, sd.xerreq, sd.xhash);
if (sd.xeq && sd.xeq._scope && sd.xeq.semanticRun < PASS.semantic3done)
{
uint errors = global.startGagging();
sd.xeq.semantic3(sd.xeq._scope);
if (global.endGagging(errors))
sd.xeq = sd.xerreq;
}
//printf("AA = %s, key: xeq = %p, xhash = %p\n", toChars(), sd.xeq, sd.xhash);
const(char)* s = (mtype.index.toBasetype().ty != Tstruct) ? "bottom of " : "";
if (!sd.xeq)
{
// If sd.xhash != NULL:
// sd or its fields have user-defined toHash.
// AA assumes that its result is consistent with bitwise equality.
// else:
// bitwise equality & hashing
}
else if (sd.xeq == sd.xerreq)
{
if (search_function(sd, Id.eq))
{
.error(loc, "%sAA key type `%s` does not have `bool opEquals(ref const %s) const`", s, sd.toChars(), sd.toChars());
}
else
{
.error(loc, "%sAA key type `%s` does not support const equality", s, sd.toChars());
}
return error();
}
else if (!sd.xhash)
{
if (search_function(sd, Id.eq))
{
.error(loc, "%sAA key type `%s` should have `size_t toHash() const nothrow @safe` if `opEquals` defined", s, sd.toChars());
}
else
{
.error(loc, "%sAA key type `%s` supports const equality but doesn't support const hashing", s, sd.toChars());
}
return error();
}
else
{
// defined equality & hashing
assert(sd.xeq && sd.xhash);
/* xeq and xhash may be implicitly defined by compiler. For example:
* struct S { int[] arr; }
* With 'arr' field equality and hashing, compiler will implicitly
* generate functions for xopEquals and xtoHash in TypeInfo_Struct.
*/
}
}
else if (tbase.ty == Tclass && !(cast(TypeClass)tbase).sym.isInterfaceDeclaration())
{
ClassDeclaration cd = (cast(TypeClass)tbase).sym;
if (cd.semanticRun < PASS.semanticdone)
cd.dsymbolSemantic(null);
if (!ClassDeclaration.object)
{
.error(Loc.initial, "missing or corrupt object.d");
fatal();
}
__gshared FuncDeclaration feq = null;
__gshared FuncDeclaration fcmp = null;
__gshared FuncDeclaration fhash = null;
if (!feq)
feq = search_function(ClassDeclaration.object, Id.eq).isFuncDeclaration();
if (!fcmp)
fcmp = search_function(ClassDeclaration.object, Id.cmp).isFuncDeclaration();
if (!fhash)
fhash = search_function(ClassDeclaration.object, Id.tohash).isFuncDeclaration();
assert(fcmp && feq && fhash);
if (feq.vtblIndex < cd.vtbl.dim && cd.vtbl[feq.vtblIndex] == feq)
{
version (all)
{
if (fcmp.vtblIndex < cd.vtbl.dim && cd.vtbl[fcmp.vtblIndex] != fcmp)
{
const(char)* s = (mtype.index.toBasetype().ty != Tclass) ? "bottom of " : "";
.error(loc, "%sAA key type `%s` now requires equality rather than comparison", s, cd.toChars());
errorSupplemental(loc, "Please override `Object.opEquals` and `Object.toHash`.");
}
}
}
}
mtype.next = mtype.next.typeSemantic(loc, sc).merge2();
mtype.transitive();
switch (mtype.next.toBasetype().ty)
{
case Tfunction:
case Tvoid:
case Tnone:
case Ttuple:
.error(loc, "cannot have associative array of `%s`", mtype.next.toChars());
goto case Terror;
case Terror:
return error();
default:
break;
}
if (mtype.next.isscope())
{
.error(loc, "cannot have array of scope `%s`", mtype.next.toChars());
return error();
}
return merge(mtype);
}
Type visitPointer(TypePointer mtype)
{
//printf("TypePointer::semantic() %s\n", toChars());
if (mtype.deco)
{
return mtype;
}
Type n = mtype.next.typeSemantic(loc, sc);
switch (n.toBasetype().ty)
{
case Ttuple:
.error(loc, "cannot have pointer to `%s`", n.toChars());
goto case Terror;
case Terror:
return error();
default:
break;
}
if (n != mtype.next)
{
mtype.deco = null;
}
mtype.next = n;
if (mtype.next.ty != Tfunction)
{
mtype.transitive();
return merge(mtype);
}
version (none)
{
return merge(mtype);
}
else
{
mtype.deco = merge(mtype).deco;
/* Don't return merge(), because arg identifiers and default args
* can be different
* even though the types match
*/
return mtype;
}
}
Type visitReference(TypeReference mtype)
{
//printf("TypeReference::semantic()\n");
Type n = mtype.next.typeSemantic(loc, sc);
if (n != mtype.next)
mtype.deco = null;
mtype.next = n;
mtype.transitive();
return merge(mtype);
}
Type visitFunction(TypeFunction mtype)
{
if (mtype.deco) // if semantic() already run
{
//printf("already done\n");
return mtype;
}
//printf("TypeFunction::semantic() this = %p\n", this);
//printf("TypeFunction::semantic() %s, sc.stc = %llx, fargs = %p\n", toChars(), sc.stc, fargs);
bool errors = false;
if (mtype.inuse > 500)
{
mtype.inuse = 0;
.error(loc, "recursive type");
return error();
}
/* Copy in order to not mess up original.
* This can produce redundant copies if inferring return type,
* as semantic() will get called again on this.
*/
TypeFunction tf = mtype.copy().toTypeFunction();
if (mtype.parameterList.parameters)
{
tf.parameterList.parameters = mtype.parameterList.parameters.copy();
for (size_t i = 0; i < mtype.parameterList.parameters.dim; i++)
{
Parameter p = cast(Parameter)mem.xmalloc(__traits(classInstanceSize, Parameter));
memcpy(cast(void*)p, cast(void*)(*mtype.parameterList.parameters)[i], __traits(classInstanceSize, Parameter));
(*tf.parameterList.parameters)[i] = p;
}
}
if (sc.stc & STC.pure_)
tf.purity = PURE.fwdref;
if (sc.stc & STC.nothrow_)
tf.isnothrow = true;
if (sc.stc & STC.nogc)
tf.isnogc = true;
if (sc.stc & STC.ref_)
tf.isref = true;
if (sc.stc & STC.return_)
tf.isreturn = true;
if (sc.stc & STC.returninferred)
tf.isreturninferred = true;
if (sc.stc & STC.scope_)
tf.isscope = true;
if (sc.stc & STC.scopeinferred)
tf.isscopeinferred = true;
// if (tf.isreturn && !tf.isref)
// tf.isscope = true; // return by itself means 'return scope'
if (tf.trust == TRUST.default_)
{
if (sc.stc & STC.safe)
tf.trust = TRUST.safe;
else if (sc.stc & STC.system)
tf.trust = TRUST.system;
else if (sc.stc & STC.trusted)
tf.trust = TRUST.trusted;
}
if (sc.stc & STC.property)
tf.isproperty = true;
tf.linkage = sc.linkage;
version (none)
{
/* If the parent is @safe, then this function defaults to safe
* too.
* If the parent's @safe-ty is inferred, then this function's @safe-ty needs
* to be inferred first.
*/
if (tf.trust == TRUST.default_)
for (Dsymbol p = sc.func; p; p = p.toParent2())
{
FuncDeclaration fd = p.isFuncDeclaration();
if (fd)
{
if (fd.isSafeBypassingInference())
tf.trust = TRUST.safe; // default to @safe
break;
}
}
}
bool wildreturn = false;
if (tf.next)
{
sc = sc.push();
sc.stc &= ~(STC.TYPECTOR | STC.FUNCATTR);
tf.next = tf.next.typeSemantic(loc, sc);
sc = sc.pop();
errors |= tf.checkRetType(loc);
if (tf.next.isscope() && !(sc.flags & SCOPE.ctor))
{
.error(loc, "functions cannot return `scope %s`", tf.next.toChars());
errors = true;
}
if (tf.next.hasWild())
wildreturn = true;
if (tf.isreturn && !tf.isref && !tf.next.hasPointers())
{
tf.isreturn = false;
}
}
ubyte wildparams = 0;
if (tf.parameterList.parameters)
{
/* Create a scope for evaluating the default arguments for the parameters
*/
Scope* argsc = sc.push();
argsc.stc = 0; // don't inherit storage class
argsc.protection = Prot(Prot.Kind.public_);
argsc.func = null;
size_t dim = tf.parameterList.length;
for (size_t i = 0; i < dim; i++)
{
Parameter fparam = tf.parameterList[i];
mtype.inuse++;
fparam.type = fparam.type.typeSemantic(loc, argsc);
mtype.inuse--;
if (fparam.type.ty == Terror)
{
errors = true;
continue;
}
fparam.type = fparam.type.addStorageClass(fparam.storageClass);
if (fparam.storageClass & (STC.auto_ | STC.alias_ | STC.static_))
{
if (!fparam.type)
continue;
}
Type t = fparam.type.toBasetype();
if (t.ty == Tfunction)
{
.error(loc, "cannot have parameter of function type `%s`", fparam.type.toChars());
errors = true;
}
else if (!(fparam.storageClass & (STC.ref_ | STC.out_)) &&
(t.ty == Tstruct || t.ty == Tsarray || t.ty == Tenum))
{
Type tb2 = t.baseElemOf();
if (tb2.ty == Tstruct && !(cast(TypeStruct)tb2).sym.members ||
tb2.ty == Tenum && !(cast(TypeEnum)tb2).sym.memtype)
{
.error(loc, "cannot have parameter of opaque type `%s` by value", fparam.type.toChars());
errors = true;
}
}
else if (!(fparam.storageClass & STC.lazy_) && t.ty == Tvoid)
{
.error(loc, "cannot have parameter of type `%s`", fparam.type.toChars());
errors = true;
}
if ((fparam.storageClass & (STC.ref_ | STC.wild)) == (STC.ref_ | STC.wild))
{
// 'ref inout' implies 'return'
fparam.storageClass |= STC.return_;
}
if (fparam.storageClass & STC.return_)
{
if (fparam.storageClass & (STC.ref_ | STC.out_))
{
// Disabled for the moment awaiting improvement to allow return by ref
// to be transformed into return by scope.
if (0 && !tf.isref)
{
auto stc = fparam.storageClass & (STC.ref_ | STC.out_);
.error(loc, "parameter `%s` is `return %s` but function does not return by `ref`",
fparam.ident ? fparam.ident.toChars() : "",
stcToChars(stc));
errors = true;
}
}
else
{
if (!(fparam.storageClass & STC.scope_))
fparam.storageClass |= STC.scope_ | STC.scopeinferred; // 'return' implies 'scope'
if (tf.isref)
{
}
else if (tf.next && !tf.next.hasPointers() && tf.next.toBasetype().ty != Tvoid)
{
fparam.storageClass &= ~STC.return_; // https://issues.dlang.org/show_bug.cgi?id=18963
}
}
}
if (fparam.storageClass & (STC.ref_ | STC.lazy_))
{
}
else if (fparam.storageClass & STC.out_)
{
if (ubyte m = fparam.type.mod & (MODFlags.immutable_ | MODFlags.const_ | MODFlags.wild))
{
.error(loc, "cannot have `%s out` parameter of type `%s`", MODtoChars(m), t.toChars());
errors = true;
}
else
{
Type tv = t.baseElemOf();
if (tv.ty == Tstruct && (cast(TypeStruct)tv).sym.noDefaultCtor)
{
.error(loc, "cannot have `out` parameter of type `%s` because the default construction is disabled", fparam.type.toChars());
errors = true;
}
}
}
if (fparam.storageClass & STC.scope_ && !fparam.type.hasPointers() && fparam.type.ty != Ttuple)
{
/* X foo(ref return scope X) => Ref-ReturnScope
* ref X foo(ref return scope X) => ReturnRef-Scope
* But X has no pointers, we don't need the scope part, so:
* X foo(ref return scope X) => Ref
* ref X foo(ref return scope X) => ReturnRef
* Constructors are treated as if they are being returned through the hidden parameter,
* which is by ref, and the ref there is ignored.
*/
fparam.storageClass &= ~STC.scope_;
if (!tf.isref || (sc.flags & SCOPE.ctor))
fparam.storageClass &= ~STC.return_;
}
if (t.hasWild())
{
wildparams |= 1;
//if (tf.next && !wildreturn)
// error(loc, "inout on parameter means inout must be on return type as well (if from D1 code, replace with `ref`)");
}
if (fparam.defaultArg)
{
Expression e = fparam.defaultArg;
auto isRefOrOut = fparam.storageClass & (STC.ref_ | STC.out_);
if (isRefOrOut)
{
e = e.expressionSemantic(argsc);
e = resolveProperties(argsc, e);
}
else
{
e = inferType(e, fparam.type);
Initializer iz = new ExpInitializer(e.loc, e);
iz = iz.initializerSemantic(argsc, fparam.type, INITnointerpret);
e = iz.initializerToExpression();
}
if (e.op == TOK.function_) // https://issues.dlang.org/show_bug.cgi?id=4820
{
FuncExp fe = cast(FuncExp)e;
// Replace function literal with a function symbol,
// since default arg expression must be copied when used
// and copying the literal itself is wrong.
e = new VarExp(e.loc, fe.fd, false);
e = new AddrExp(e.loc, e);
e = e.expressionSemantic(argsc);
}
if (isRefOrOut && !MODimplicitConv(e.type.mod, fparam.type.mod))
{
const(char)* errTxt = fparam.storageClass & STC.ref_ ? "ref" : "out";
.error(e.loc, "expression `%s` of type `%s` is not implicitly convertible to type `%s %s` of parameter `%s`",
e.toChars(), e.type.toChars(), errTxt, fparam.type.toChars(), fparam.toChars());
}
e = e.implicitCastTo(argsc, fparam.type);
// default arg must be an lvalue
if (fparam.storageClass & (STC.out_ | STC.ref_))
e = e.toLvalue(argsc, e);
fparam.defaultArg = e;
if (e.op == TOK.error)
errors = true;
}
/* If fparam after semantic() turns out to be a tuple, the number of parameters may
* change.
*/
if (auto tt = t.isTypeTuple())
{
/* TypeFunction::parameter also is used as the storage of
* Parameter objects for FuncDeclaration. So we should copy
* the elements of TypeTuple::arguments to avoid unintended
* sharing of Parameter object among other functions.
*/
if (tt.arguments && tt.arguments.dim)
{
/* Propagate additional storage class from tuple parameters to their
* element-parameters.
* Make a copy, as original may be referenced elsewhere.
*/
size_t tdim = tt.arguments.dim;
auto newparams = new Parameters(tdim);
for (size_t j = 0; j < tdim; j++)
{
Parameter narg = (*tt.arguments)[j];
// https://issues.dlang.org/show_bug.cgi?id=12744
// If the storage classes of narg
// conflict with the ones in fparam, it's ignored.
StorageClass stc = fparam.storageClass | narg.storageClass;
StorageClass stc1 = fparam.storageClass & (STC.ref_ | STC.out_ | STC.lazy_);
StorageClass stc2 = narg.storageClass & (STC.ref_ | STC.out_ | STC.lazy_);
if (stc1 && stc2 && stc1 != stc2)
{
OutBuffer buf1; stcToBuffer(&buf1, stc1 | ((stc1 & STC.ref_) ? (fparam.storageClass & STC.auto_) : 0));
OutBuffer buf2; stcToBuffer(&buf2, stc2);
.error(loc, "incompatible parameter storage classes `%s` and `%s`",
buf1.peekChars(), buf2.peekChars());
errors = true;
stc = stc1 | (stc & ~(STC.ref_ | STC.out_ | STC.lazy_));
}
/* https://issues.dlang.org/show_bug.cgi?id=18572
*
* If a tuple parameter has a default argument, when expanding the parameter
* tuple the default argument tuple must also be expanded.
*/
Expression paramDefaultArg = narg.defaultArg;
if (fparam.defaultArg)
{
auto te = cast(TupleExp)(fparam.defaultArg);
paramDefaultArg = (*te.exps)[j];
}
(*newparams)[j] = new Parameter(
stc, narg.type, narg.ident, paramDefaultArg, narg.userAttribDecl);
}
fparam.type = new TypeTuple(newparams);
}
fparam.storageClass = 0;
/* Reset number of parameters, and back up one to do this fparam again,
* now that it is a tuple
*/
dim = tf.parameterList.length;
i--;
continue;
}
/* Resolve "auto ref" storage class to be either ref or value,
* based on the argument matching the parameter
*/
if (fparam.storageClass & STC.auto_)
{
if (mtype.fargs && i < mtype.fargs.dim && (fparam.storageClass & STC.ref_))
{
Expression farg = (*mtype.fargs)[i];
if (farg.isLvalue())
{
// ref parameter
}
else
fparam.storageClass &= ~STC.ref_; // value parameter
fparam.storageClass &= ~STC.auto_; // https://issues.dlang.org/show_bug.cgi?id=14656
fparam.storageClass |= STC.autoref;
}
else
{
.error(loc, "`auto` can only be used as part of `auto ref` for template function parameters");
errors = true;
}
}
// Remove redundant storage classes for type, they are already applied
fparam.storageClass &= ~(STC.TYPECTOR | STC.in_);
}
argsc.pop();
}
if (tf.isWild())
wildparams |= 2;
if (wildreturn && !wildparams)
{
.error(loc, "`inout` on `return` means `inout` must be on a parameter as well for `%s`", mtype.toChars());
errors = true;
}
tf.iswild = wildparams;
if (tf.isproperty && (tf.parameterList.varargs != VarArg.none || tf.parameterList.length > 2))
{
.error(loc, "properties can only have zero, one, or two parameter");
errors = true;
}
if (tf.parameterList.varargs == VarArg.variadic && tf.linkage != LINK.d && tf.parameterList.length == 0)
{
.error(loc, "variadic functions with non-D linkage must have at least one parameter");
errors = true;
}
if (errors)
return error();
if (tf.next)
tf.deco = tf.merge().deco;
/* Don't return merge(), because arg identifiers and default args
* can be different
* even though the types match
*/
return tf;
}
Type visitDelegate(TypeDelegate mtype)
{
//printf("TypeDelegate::semantic() %s\n", toChars());
if (mtype.deco) // if semantic() already run
{
//printf("already done\n");
return mtype;
}
mtype.next = mtype.next.typeSemantic(loc, sc);
if (mtype.next.ty != Tfunction)
return error();
/* In order to deal with https://issues.dlang.org/show_bug.cgi?id=4028
* perhaps default arguments should
* be removed from next before the merge.
*/
version (none)
{
return mtype.merge();
}
else
{
/* Don't return merge(), because arg identifiers and default args
* can be different
* even though the types match
*/
mtype.deco = mtype.merge().deco;
return mtype;
}
}
Type visitIdentifier(TypeIdentifier mtype)
{
Type t;
Expression e;
Dsymbol s;
//printf("TypeIdentifier::semantic(%s)\n", toChars());
mtype.resolve(loc, sc, &e, &t, &s);
if (t)
{
//printf("\tit's a type %d, %s, %s\n", t.ty, t.toChars(), t.deco);
return t.addMod(mtype.mod);
}
else
{
if (s)
{
auto td = s.isTemplateDeclaration;
if (td && td.onemember && td.onemember.isAggregateDeclaration)
.error(loc, "template %s `%s` is used as a type without instantiation"
~ "; to instantiate it use `%s!(arguments)`",
s.kind, s.toPrettyChars, s.ident.toChars);
else
.error(loc, "%s `%s` is used as a type", s.kind, s.toPrettyChars);
//assert(0);
}
else
.error(loc, "`%s` is used as a type", mtype.toChars());
return error();
}
}
Type visitInstance(TypeInstance mtype)
{
Type t;
Expression e;
Dsymbol s;
//printf("TypeInstance::semantic(%p, %s)\n", this, toChars());
{
const errors = global.errors;
mtype.resolve(loc, sc, &e, &t, &s);
// if we had an error evaluating the symbol, suppress further errors
if (!t && errors != global.errors)
return error();
}
if (!t)
{
if (!e && s && s.errors)
{
// if there was an error evaluating the symbol, it might actually
// be a type. Avoid misleading error messages.
.error(loc, "`%s` had previous errors", mtype.toChars());
}
else
.error(loc, "`%s` is used as a type", mtype.toChars());
return error();
}
return t;
}
Type visitTypeof(TypeTypeof mtype)
{
//printf("TypeTypeof::semantic() %s\n", toChars());
Expression e;
Type t;
Dsymbol s;
mtype.resolve(loc, sc, &e, &t, &s);
if (s && (t = s.getType()) !is null)
t = t.addMod(mtype.mod);
if (!t)
{
.error(loc, "`%s` is used as a type", mtype.toChars());
return error();
}
return t;
}
Type visitTraits(TypeTraits mtype)
{
if (mtype.ty == Terror)
return mtype;
if (mtype.exp.ident != Id.allMembers &&
mtype.exp.ident != Id.derivedMembers &&
mtype.exp.ident != Id.getMember &&
mtype.exp.ident != Id.parent &&
mtype.exp.ident != Id.getOverloads &&
mtype.exp.ident != Id.getVirtualFunctions &&
mtype.exp.ident != Id.getVirtualMethods &&
mtype.exp.ident != Id.getAttributes &&
mtype.exp.ident != Id.getUnitTests &&
mtype.exp.ident != Id.getAliasThis)
{
static immutable (const(char)*)[2] ctxt = ["as type", "in alias"];
.error(mtype.loc, "trait `%s` is either invalid or not supported %s",
mtype.exp.ident.toChars, ctxt[mtype.inAliasDeclaration]);
mtype.ty = Terror;
return mtype;
}
import dmd.traits : semanticTraits;
Type result;
if (Expression e = semanticTraits(mtype.exp, sc))
{
switch (e.op)
{
case TOK.dotVariable:
mtype.sym = (cast(DotVarExp)e).var;
break;
case TOK.variable:
mtype.sym = (cast(VarExp)e).var;
break;
case TOK.function_:
auto fe = cast(FuncExp)e;
mtype.sym = fe.td ? fe.td : fe.fd;
break;
case TOK.dotTemplateDeclaration:
mtype.sym = (cast(DotTemplateExp)e).td;
break;
case TOK.dSymbol:
mtype.sym = (cast(DsymbolExp)e).s;
break;
case TOK.template_:
mtype.sym = (cast(TemplateExp)e).td;
break;
case TOK.scope_:
mtype.sym = (cast(ScopeExp)e).sds;
break;
case TOK.tuple:
mtype.sym = new TupleDeclaration(e.loc,
Identifier.generateId("__aliastup"), cast(Objects*) e.toTupleExp.exps);
break;
case TOK.dotType:
result = (cast(DotTypeExp)e).sym.isType();
break;
case TOK.type:
result = (cast(TypeExp)e).type;
break;
case TOK.overloadSet:
result = (cast(OverExp)e).type;
break;
default:
break;
}
}
if (result)
result = result.addMod(mtype.mod);
if (!mtype.inAliasDeclaration && !result)
{
if (!global.errors)
.error(mtype.loc, "`%s` does not give a valid type", mtype.toChars);
return error();
}
return result;
}
Type visitReturn(TypeReturn mtype)
{
//printf("TypeReturn::semantic() %s\n", toChars());
Expression e;
Type t;
Dsymbol s;
mtype.resolve(loc, sc, &e, &t, &s);
if (s && (t = s.getType()) !is null)
t = t.addMod(mtype.mod);
if (!t)
{
.error(loc, "`%s` is used as a type", mtype.toChars());
return error();
}
return t;
}
Type visitStruct(TypeStruct mtype)
{
//printf("TypeStruct::semantic('%s')\n", mtype.toChars());
if (mtype.deco)
{
if (sc && sc.cppmangle != CPPMANGLE.def)
{
if (mtype.cppmangle == CPPMANGLE.def)
mtype.cppmangle = sc.cppmangle;
}
return mtype;
}
/* Don't semantic for sym because it should be deferred until
* sizeof needed or its members accessed.
*/
// instead, parent should be set correctly
assert(mtype.sym.parent);
if (mtype.sym.type.ty == Terror)
return error();
if (sc && sc.cppmangle != CPPMANGLE.def)
mtype.cppmangle = sc.cppmangle;
else
mtype.cppmangle = CPPMANGLE.asStruct;
return merge(mtype);
}
Type visitEnum(TypeEnum mtype)
{
//printf("TypeEnum::semantic() %s\n", toChars());
return mtype.deco ? mtype : merge(mtype);
}
Type visitClass(TypeClass mtype)
{
//printf("TypeClass::semantic(%s)\n", mtype.toChars());
if (mtype.deco)
{
if (sc && sc.cppmangle != CPPMANGLE.def)
{
if (mtype.cppmangle == CPPMANGLE.def)
mtype.cppmangle = sc.cppmangle;
}
return mtype;
}
/* Don't semantic for sym because it should be deferred until
* sizeof needed or its members accessed.
*/
// instead, parent should be set correctly
assert(mtype.sym.parent);
if (mtype.sym.type.ty == Terror)
return error();
if (sc && sc.cppmangle != CPPMANGLE.def)
mtype.cppmangle = sc.cppmangle;
else
mtype.cppmangle = CPPMANGLE.asClass;
return merge(mtype);
}
Type visitTuple(TypeTuple mtype)
{
//printf("TypeTuple::semantic(this = %p)\n", this);
//printf("TypeTuple::semantic() %p, %s\n", this, toChars());
if (!mtype.deco)
mtype.deco = merge(mtype).deco;
/* Don't return merge(), because a tuple with one type has the
* same deco as that type.
*/
return mtype;
}
Type visitSlice(TypeSlice mtype)
{
//printf("TypeSlice::semantic() %s\n", toChars());
Type tn = mtype.next.typeSemantic(loc, sc);
//printf("next: %s\n", tn.toChars());
Type tbn = tn.toBasetype();
if (tbn.ty != Ttuple)
{
.error(loc, "can only slice tuple types, not `%s`", tbn.toChars());
return error();
}
TypeTuple tt = cast(TypeTuple)tbn;
mtype.lwr = semanticLength(sc, tbn, mtype.lwr);
mtype.upr = semanticLength(sc, tbn, mtype.upr);
mtype.lwr = mtype.lwr.ctfeInterpret();
mtype.upr = mtype.upr.ctfeInterpret();
if (mtype.lwr.op == TOK.error || mtype.upr.op == TOK.error)
return error();
uinteger_t i1 = mtype.lwr.toUInteger();
uinteger_t i2 = mtype.upr.toUInteger();
if (!(i1 <= i2 && i2 <= tt.arguments.dim))
{
.error(loc, "slice `[%llu..%llu]` is out of range of `[0..%llu]`",
cast(ulong)i1, cast(ulong)i2, cast(ulong)tt.arguments.dim);
return error();
}
mtype.next = tn;
mtype.transitive();
auto args = new Parameters();
args.reserve(cast(size_t)(i2 - i1));
foreach (arg; (*tt.arguments)[cast(size_t)i1 .. cast(size_t)i2])
{
args.push(arg);
}
Type t = new TypeTuple(args);
return t.typeSemantic(loc, sc);
}
switch (t.ty)
{
default: return visitType(t);
case Tvector: return visitVector(cast(TypeVector)t);
case Tsarray: return visitSArray(cast(TypeSArray)t);
case Tarray: return visitDArray(cast(TypeDArray)t);
case Taarray: return visitAArray(cast(TypeAArray)t);
case Tpointer: return visitPointer(cast(TypePointer)t);
case Treference: return visitReference(cast(TypeReference)t);
case Tfunction: return visitFunction(cast(TypeFunction)t);
case Tdelegate: return visitDelegate(cast(TypeDelegate)t);
case Tident: return visitIdentifier(cast(TypeIdentifier)t);
case Tinstance: return visitInstance(cast(TypeInstance)t);
case Ttypeof: return visitTypeof(cast(TypeTypeof)t);
case Ttraits: return visitTraits(cast(TypeTraits)t);
case Treturn: return visitReturn(cast(TypeReturn)t);
case Tstruct: return visitStruct(cast(TypeStruct)t);
case Tenum: return visitEnum(cast(TypeEnum)t);
case Tclass: return visitClass(cast(TypeClass)t);
case Ttuple: return visitTuple (cast(TypeTuple)t);
case Tslice: return visitSlice(cast(TypeSlice)t);
}
}
/************************************
* If an identical type to `type` is in `type.stringtable`, return
* the latter one. Otherwise, add it to `type.stringtable`.
* Some types don't get merged and are returned as-is.
* Params:
* type = Type to check against existing types
* Returns:
* the type that was merged
*/
Type merge(Type type)
{
switch (type.ty)
{
case Terror:
case Ttypeof:
case Tident:
case Tinstance:
return type;
case Tenum:
break;
case Taarray:
if (!(cast(TypeAArray)type).index.merge().deco)
return type;
goto default;
default:
if (type.nextOf() && !type.nextOf().deco)
return type;
break;
}
//printf("merge(%s)\n", toChars());
if (!type.deco)
{
OutBuffer buf;
buf.reserve(32);
mangleToBuffer(type, &buf);
StringValue* sv = type.stringtable.update(buf.extractSlice());
if (sv.ptrvalue)
{
Type t = cast(Type)sv.ptrvalue;
debug
{
import core.stdc.stdio;
if (!t.deco)
printf("t = %s\n", t.toChars());
}
assert(t.deco);
//printf("old value, deco = '%s' %p\n", t.deco, t.deco);
return t;
}
else
{
Type t = stripDefaultArgs(type);
sv.ptrvalue = cast(char*)t;
type.deco = t.deco = cast(char*)sv.toDchars();
//printf("new value, deco = '%s' %p\n", t.deco, t.deco);
return t;
}
}
return type;
}
/***************************************
* Calculate built-in properties which just the type is necessary.
*
* Params:
* t = the type for which the property is calculated
* loc = the location where the property is encountered
* ident = the identifier of the property
* flag = if flag & 1, don't report "not a property" error and just return NULL.
* Returns:
* expression representing the property, or null if not a property and (flag & 1)
*/
Expression getProperty(Type t, const ref Loc loc, Identifier ident, int flag)
{
Expression visitType(Type mt)
{
Expression e;
static if (LOGDOTEXP)
{
printf("Type::getProperty(type = '%s', ident = '%s')\n", mt.toChars(), ident.toChars());
}
if (ident == Id.__sizeof)
{
d_uns64 sz = mt.size(loc);
if (sz == SIZE_INVALID)
return new ErrorExp();
e = new IntegerExp(loc, sz, Type.tsize_t);
}
else if (ident == Id.__xalignof)
{
const explicitAlignment = mt.alignment();
const naturalAlignment = mt.alignsize();
const actualAlignment = (explicitAlignment == STRUCTALIGN_DEFAULT ? naturalAlignment : explicitAlignment);
e = new IntegerExp(loc, actualAlignment, Type.tsize_t);
}
else if (ident == Id._init)
{
Type tb = mt.toBasetype();
e = mt.defaultInitLiteral(loc);
if (tb.ty == Tstruct && tb.needsNested())
{
e.isStructLiteralExp().useStaticInit = true;
}
}
else if (ident == Id._mangleof)
{
if (!mt.deco)
{
error(loc, "forward reference of type `%s.mangleof`", mt.toChars());
e = new ErrorExp();
}
else
{
e = new StringExp(loc, mt.deco);
Scope sc;
e = e.expressionSemantic(&sc);
}
}
else if (ident == Id.stringof)
{
const s = mt.toChars();
e = new StringExp(loc, cast(char*)s);
Scope sc;
e = e.expressionSemantic(&sc);
}
else if (flag && mt != Type.terror)
{
return null;
}
else
{
Dsymbol s = null;
if (mt.ty == Tstruct || mt.ty == Tclass || mt.ty == Tenum)
s = mt.toDsymbol(null);
if (s)
s = s.search_correct(ident);
if (mt != Type.terror)
{
if (s)
error(loc, "no property `%s` for type `%s`, did you mean `%s`?", ident.toChars(), mt.toChars(), s.toPrettyChars());
else
{
if (ident == Id.call && mt.ty == Tclass)
error(loc, "no property `%s` for type `%s`, did you mean `new %s`?", ident.toChars(), mt.toChars(), mt.toPrettyChars());
else
error(loc, "no property `%s` for type `%s`", ident.toChars(), mt.toChars());
}
}
e = new ErrorExp();
}
return e;
}
Expression visitError(TypeError)
{
return new ErrorExp();
}
Expression visitBasic(TypeBasic mt)
{
Expression integerValue(dinteger_t i)
{
return new IntegerExp(loc, i, mt);
}
Expression intValue(dinteger_t i)
{
return new IntegerExp(loc, i, Type.tint32);
}
Expression floatValue(real_t r)
{
if (mt.isreal() || mt.isimaginary())
return new RealExp(loc, r, mt);
else
{
return new ComplexExp(loc, complex_t(r, r), mt);
}
}
//printf("TypeBasic::getProperty('%s')\n", ident.toChars());
if (ident == Id.max)
{
switch (mt.ty)
{
case Tint8: return integerValue(byte.max);
case Tuns8: return integerValue(ubyte.max);
case Tint16: return integerValue(short.max);
case Tuns16: return integerValue(ushort.max);
case Tint32: return integerValue(int.max);
case Tuns32: return integerValue(uint.max);
case Tint64: return integerValue(long.max);
case Tuns64: return integerValue(ulong.max);
case Tbool: return integerValue(bool.max);
case Tchar: return integerValue(char.max);
case Twchar: return integerValue(wchar.max);
case Tdchar: return integerValue(dchar.max);
case Tcomplex32:
case Timaginary32:
case Tfloat32: return floatValue(target.FloatProperties.max);
case Tcomplex64:
case Timaginary64:
case Tfloat64: return floatValue(target.DoubleProperties.max);
case Tcomplex80:
case Timaginary80:
case Tfloat80: return floatValue(target.RealProperties.max);
default: break;
}
}
else if (ident == Id.min)
{
switch (mt.ty)
{
case Tint8: return integerValue(byte.min);
case Tuns8:
case Tuns16:
case Tuns32:
case Tuns64:
case Tbool:
case Tchar:
case Twchar:
case Tdchar: return integerValue(0);
case Tint16: return integerValue(short.min);
case Tint32: return integerValue(int.min);
case Tint64: return integerValue(long.min);
default: break;
}
}
else if (ident == Id.min_normal)
{
Lmin_normal:
switch (mt.ty)
{
case Tcomplex32:
case Timaginary32:
case Tfloat32: return floatValue(target.FloatProperties.min_normal);
case Tcomplex64:
case Timaginary64:
case Tfloat64: return floatValue(target.DoubleProperties.min_normal);
case Tcomplex80:
case Timaginary80:
case Tfloat80: return floatValue(target.RealProperties.min_normal);
default: break;
}
}
else if (ident == Id.nan)
{
switch (mt.ty)
{
case Tcomplex32:
case Tcomplex64:
case Tcomplex80:
case Timaginary32:
case Timaginary64:
case Timaginary80:
case Tfloat32:
case Tfloat64:
case Tfloat80: return floatValue(target.RealProperties.nan);
default: break;
}
}
else if (ident == Id.infinity)
{
switch (mt.ty)
{
case Tcomplex32:
case Tcomplex64:
case Tcomplex80:
case Timaginary32:
case Timaginary64:
case Timaginary80:
case Tfloat32:
case Tfloat64:
case Tfloat80: return floatValue(target.RealProperties.infinity);
default: break;
}
}
else if (ident == Id.dig)
{
switch (mt.ty)
{
case Tcomplex32:
case Timaginary32:
case Tfloat32: return intValue(target.FloatProperties.dig);
case Tcomplex64:
case Timaginary64:
case Tfloat64: return intValue(target.DoubleProperties.dig);
case Tcomplex80:
case Timaginary80:
case Tfloat80: return intValue(target.RealProperties.dig);
default: break;
}
}
else if (ident == Id.epsilon)
{
switch (mt.ty)
{
case Tcomplex32:
case Timaginary32:
case Tfloat32: return floatValue(target.FloatProperties.epsilon);
case Tcomplex64:
case Timaginary64:
case Tfloat64: return floatValue(target.DoubleProperties.epsilon);
case Tcomplex80:
case Timaginary80:
case Tfloat80: return floatValue(target.RealProperties.epsilon);
default: break;
}
}
else if (ident == Id.mant_dig)
{
switch (mt.ty)
{
case Tcomplex32:
case Timaginary32:
case Tfloat32: return intValue(target.FloatProperties.mant_dig);
case Tcomplex64:
case Timaginary64:
case Tfloat64: return intValue(target.DoubleProperties.mant_dig);
case Tcomplex80:
case Timaginary80:
case Tfloat80: return intValue(target.RealProperties.mant_dig);
default: break;
}
}
else if (ident == Id.max_10_exp)
{
switch (mt.ty)
{
case Tcomplex32:
case Timaginary32:
case Tfloat32: return intValue(target.FloatProperties.max_10_exp);
case Tcomplex64:
case Timaginary64:
case Tfloat64: return intValue(target.DoubleProperties.max_10_exp);
case Tcomplex80:
case Timaginary80:
case Tfloat80: return intValue(target.RealProperties.max_10_exp);
default: break;
}
}
else if (ident == Id.max_exp)
{
switch (mt.ty)
{
case Tcomplex32:
case Timaginary32:
case Tfloat32: return intValue(target.FloatProperties.max_exp);
case Tcomplex64:
case Timaginary64:
case Tfloat64: return intValue(target.DoubleProperties.max_exp);
case Tcomplex80:
case Timaginary80:
case Tfloat80: return intValue(target.RealProperties.max_exp);
default: break;
}
}
else if (ident == Id.min_10_exp)
{
switch (mt.ty)
{
case Tcomplex32:
case Timaginary32:
case Tfloat32: return intValue(target.FloatProperties.min_10_exp);
case Tcomplex64:
case Timaginary64:
case Tfloat64: return intValue(target.DoubleProperties.min_10_exp);
case Tcomplex80:
case Timaginary80:
case Tfloat80: return intValue(target.RealProperties.min_10_exp);
default: break;
}
}
else if (ident == Id.min_exp)
{
switch (mt.ty)
{
case Tcomplex32:
case Timaginary32:
case Tfloat32: return intValue(target.FloatProperties.min_exp);
case Tcomplex64:
case Timaginary64:
case Tfloat64: return intValue(target.DoubleProperties.min_exp);
case Tcomplex80:
case Timaginary80:
case Tfloat80: return intValue(target.RealProperties.min_exp);
default: break;
}
}
return visitType(mt);
}
Expression visitVector(TypeVector mt)
{
return visitType(mt);
}
Expression visitEnum(TypeEnum mt)
{
Expression e;
if (ident == Id.max || ident == Id.min)
{
return mt.sym.getMaxMinValue(loc, ident);
}
else if (ident == Id._init)
{
e = mt.defaultInitLiteral(loc);
}
else if (ident == Id.stringof)
{
const s = mt.toChars();
e = new StringExp(loc, cast(char*)s);
Scope sc;
e = e.expressionSemantic(&sc);
}
else if (ident == Id._mangleof)
{
e = visitType(mt);
}
else
{
e = mt.toBasetype().getProperty(loc, ident, flag);
}
return e;
}
Expression visitTuple(TypeTuple mt)
{
Expression e;
static if (LOGDOTEXP)
{
printf("TypeTuple::getProperty(type = '%s', ident = '%s')\n", mt.toChars(), ident.toChars());
}
if (ident == Id.length)
{
e = new IntegerExp(loc, mt.arguments.dim, Type.tsize_t);
}
else if (ident == Id._init)
{
e = mt.defaultInitLiteral(loc);
}
else if (flag)
{
e = null;
}
else
{
error(loc, "no property `%s` for tuple `%s`", ident.toChars(), mt.toChars());
e = new ErrorExp();
}
return e;
}
switch (t.ty)
{
default: return t.isTypeBasic() ?
visitBasic(cast(TypeBasic)t) :
visitType(t);
case Terror: return visitError (cast(TypeError)t);
case Tvector: return visitVector(cast(TypeVector)t);
case Tenum: return visitEnum (cast(TypeEnum)t);
case Ttuple: return visitTuple (cast(TypeTuple)t);
}
}
/***************************************
* Normalize `e` as the result of resolve() process.
*/
private void resolveExp(Expression e, Type *pt, Expression *pe, Dsymbol* ps)
{
*pt = null;
*pe = null;
*ps = null;
Dsymbol s;
switch (e.op)
{
case TOK.error:
*pt = Type.terror;
return;
case TOK.type:
*pt = e.type;
return;
case TOK.variable:
s = (cast(VarExp)e).var;
if (s.isVarDeclaration())
goto default;
//if (s.isOverDeclaration())
// todo;
break;
case TOK.template_:
// TemplateDeclaration
s = (cast(TemplateExp)e).td;
break;
case TOK.scope_:
s = (cast(ScopeExp)e).sds;
// TemplateDeclaration, TemplateInstance, Import, Package, Module
break;
case TOK.function_:
s = getDsymbol(e);
break;
case TOK.dotTemplateDeclaration:
s = (cast(DotTemplateExp)e).td;
break;
//case TOK.this_:
//case TOK.super_:
//case TOK.tuple:
//case TOK.overloadSet:
//case TOK.dotVariable:
//case TOK.dotTemplateInstance:
//case TOK.dotType:
//case TOK.dotIdentifier:
default:
*pe = e;
return;
}
*ps = s;
}
/************************************
* Resolve type 'mt' to either type, symbol, or expression.
* If errors happened, resolved to Type.terror.
*
* Params:
* mt = type to be resolved
* loc = the location where the type is encountered
* sc = the scope of the type
* pe = is set if t is an expression
* pt = is set if t is a type
* ps = is set if t is a symbol
* intypeid = true if in type id
*/
void resolve(Type mt, const ref Loc loc, Scope* sc, Expression* pe, Type* pt, Dsymbol* ps, bool intypeid = false)
{
void returnExp(Expression e)
{
*pt = null;
*pe = e;
*ps = null;
}
void returnType(Type t)
{
*pt = t;
*pe = null;
*ps = null;
}
void returnSymbol(Dsymbol s)
{
*pt = null;
*pe = null;
*ps = s;
}
void returnError()
{
returnType(Type.terror);
}
void visitType(Type mt)
{
//printf("Type::resolve() %s, %d\n", mt.toChars(), mt.ty);
Type t = typeSemantic(mt, loc, sc);
assert(t);
returnType(t);
}
void visitSArray(TypeSArray mt)
{
//printf("TypeSArray::resolve() %s\n", mt.toChars());
mt.next.resolve(loc, sc, pe, pt, ps, intypeid);
//printf("s = %p, e = %p, t = %p\n", *ps, *pe, *pt);
if (*pe)
{
// It's really an index expression
if (Dsymbol s = getDsymbol(*pe))
*pe = new DsymbolExp(loc, s);
returnExp(new ArrayExp(loc, *pe, mt.dim));
}
else if (*ps)
{
Dsymbol s = *ps;
if (auto tup = s.isTupleDeclaration())
{
mt.dim = semanticLength(sc, tup, mt.dim);
mt.dim = mt.dim.ctfeInterpret();
if (mt.dim.op == TOK.error)
return returnError();
const d = mt.dim.toUInteger();
if (d >= tup.objects.dim)
{
error(loc, "tuple index `%llu` exceeds length %u", d, tup.objects.dim);
return returnError();
}
RootObject o = (*tup.objects)[cast(size_t)d];
if (o.dyncast() == DYNCAST.dsymbol)
{
return returnSymbol(cast(Dsymbol)o);
}
if (o.dyncast() == DYNCAST.expression)
{
Expression e = cast(Expression)o;
if (e.op == TOK.dSymbol)
return returnSymbol((cast(DsymbolExp)e).s);
else
return returnExp(e);
}
if (o.dyncast() == DYNCAST.type)
{
return returnType((cast(Type)o).addMod(mt.mod));
}
/* Create a new TupleDeclaration which
* is a slice [d..d+1] out of the old one.
* Do it this way because TemplateInstance::semanticTiargs()
* can handle unresolved Objects this way.
*/
auto objects = new Objects(1);
(*objects)[0] = o;
return returnSymbol(new TupleDeclaration(loc, tup.ident, objects));
}
else
return visitType(mt);
}
else
{
if ((*pt).ty != Terror)
mt.next = *pt; // prevent re-running semantic() on 'next'
visitType(mt);
}
}
void visitDArray(TypeDArray mt)
{
//printf("TypeDArray::resolve() %s\n", mt.toChars());
mt.next.resolve(loc, sc, pe, pt, ps, intypeid);
//printf("s = %p, e = %p, t = %p\n", *ps, *pe, *pt);
if (*pe)
{
// It's really a slice expression
if (Dsymbol s = getDsymbol(*pe))
*pe = new DsymbolExp(loc, s);
returnExp(new ArrayExp(loc, *pe));
}
else if (*ps)
{
if (auto tup = (*ps).isTupleDeclaration())
{
// keep *ps
}
else
visitType(mt);
}
else
{
if ((*pt).ty != Terror)
mt.next = *pt; // prevent re-running semantic() on 'next'
visitType(mt);
}
}
void visitAArray(TypeAArray mt)
{
//printf("TypeAArray::resolve() %s\n", mt.toChars());
// Deal with the case where we thought the index was a type, but
// in reality it was an expression.
if (mt.index.ty == Tident || mt.index.ty == Tinstance || mt.index.ty == Tsarray)
{
Expression e;
Type t;
Dsymbol s;
mt.index.resolve(loc, sc, &e, &t, &s, intypeid);
if (e)
{
// It was an expression -
// Rewrite as a static array
auto tsa = new TypeSArray(mt.next, e);
tsa.mod = mt.mod; // just copy mod field so tsa's semantic is not yet done
return tsa.resolve(loc, sc, pe, pt, ps, intypeid);
}
else if (t)
mt.index = t;
else
.error(loc, "index is not a type or an expression");
}
visitType(mt);
}
/*************************************
* Takes an array of Identifiers and figures out if
* it represents a Type or an Expression.
* Output:
* if expression, *pe is set
* if type, *pt is set
*/
void visitIdentifier(TypeIdentifier mt)
{
//printf("TypeIdentifier::resolve(sc = %p, idents = '%s')\n", sc, mt.toChars());
if ((mt.ident.equals(Id._super) || mt.ident.equals(Id.This)) && !hasThis(sc))
{
// @@@DEPRECATED_v2.091@@@.
// Made an error in 2.086.
// Eligible for removal in 2.091.
if (mt.ident.equals(Id._super))
{
error(mt.loc, "Using `super` as a type is obsolete. Use `typeof(super)` instead");
}
// @@@DEPRECATED_v2.091@@@.
// Made an error in 2.086.
// Eligible for removal in 2.091.
if (mt.ident.equals(Id.This))
{
error(mt.loc, "Using `this` as a type is obsolete. Use `typeof(this)` instead");
}
if (AggregateDeclaration ad = sc.getStructClassScope())
{
if (ClassDeclaration cd = ad.isClassDeclaration())
{
if (mt.ident.equals(Id.This))
mt.ident = cd.ident;
else if (cd.baseClass && mt.ident.equals(Id._super))
mt.ident = cd.baseClass.ident;
}
else
{
StructDeclaration sd = ad.isStructDeclaration();
if (sd && mt.ident.equals(Id.This))
mt.ident = sd.ident;
}
}
}
if (mt.ident == Id.ctfe)
{
error(loc, "variable `__ctfe` cannot be read at compile time");
return returnError();
}
Dsymbol scopesym;
Dsymbol s = sc.search(loc, mt.ident, &scopesym);
if (s)
{
// https://issues.dlang.org/show_bug.cgi?id=16042
// If `f` is really a function template, then replace `f`
// with the function template declaration.
if (auto f = s.isFuncDeclaration())
{
if (auto td = getFuncTemplateDecl(f))
{
// If not at the beginning of the overloaded list of
// `TemplateDeclaration`s, then get the beginning
if (td.overroot)
td = td.overroot;
s = td;
}
}
}
mt.resolveHelper(loc, sc, s, scopesym, pe, pt, ps, intypeid);
if (*pt)
(*pt) = (*pt).addMod(mt.mod);
}
void visitInstance(TypeInstance mt)
{
// Note close similarity to TypeIdentifier::resolve()
//printf("TypeInstance::resolve(sc = %p, tempinst = '%s')\n", sc, mt.tempinst.toChars());
mt.tempinst.dsymbolSemantic(sc);
if (!global.gag && mt.tempinst.errors)
return returnError();
mt.resolveHelper(loc, sc, mt.tempinst, null, pe, pt, ps, intypeid);
if (*pt)
*pt = (*pt).addMod(mt.mod);
//if (*pt) printf("*pt = %d '%s'\n", (*pt).ty, (*pt).toChars());
}
void visitTypeof(TypeTypeof mt)
{
//printf("TypeTypeof::resolve(this = %p, sc = %p, idents = '%s')\n", mt, sc, mt.toChars());
//static int nest; if (++nest == 50) *(char*)0=0;
if (sc is null)
{
error(loc, "Invalid scope.");
return returnError();
}
if (mt.inuse)
{
mt.inuse = 2;
error(loc, "circular `typeof` definition");
Lerr:
mt.inuse--;
return returnError();
}
mt.inuse++;
/* Currently we cannot evaluate 'exp' in speculative context, because
* the type implementation may leak to the final execution. Consider:
*
* struct S(T) {
* string toString() const { return "x"; }
* }
* void main() {
* alias X = typeof(S!int());
* assert(typeid(X).toString() == "x");
* }
*/
Scope* sc2 = sc.push();
sc2.intypeof = 1;
auto exp2 = mt.exp.expressionSemantic(sc2);
exp2 = resolvePropertiesOnly(sc2, exp2);
sc2.pop();
if (exp2.op == TOK.error)
{
if (!global.gag)
mt.exp = exp2;
goto Lerr;
}
mt.exp = exp2;
if (mt.exp.op == TOK.type ||
mt.exp.op == TOK.scope_)
{
if (mt.exp.checkType())
goto Lerr;
/* Today, 'typeof(func)' returns void if func is a
* function template (TemplateExp), or
* template lambda (FuncExp).
* It's actually used in Phobos as an idiom, to branch code for
* template functions.
*/
}
if (auto f = mt.exp.op == TOK.variable ? (cast( VarExp)mt.exp).var.isFuncDeclaration()
: mt.exp.op == TOK.dotVariable ? (cast(DotVarExp)mt.exp).var.isFuncDeclaration() : null)
{
if (f.checkForwardRef(loc))
goto Lerr;
}
if (auto f = isFuncAddress(mt.exp))
{
if (f.checkForwardRef(loc))
goto Lerr;
}
Type t = mt.exp.type;
if (!t)
{
error(loc, "expression `%s` has no type", mt.exp.toChars());
goto Lerr;
}
if (t.ty == Ttypeof)
{
error(loc, "forward reference to `%s`", mt.toChars());
goto Lerr;
}
if (mt.idents.dim == 0)
{
returnType(t.addMod(mt.mod));
}
else
{
if (Dsymbol s = t.toDsymbol(sc))
mt.resolveHelper(loc, sc, s, null, pe, pt, ps, intypeid);
else
{
auto e = typeToExpressionHelper(mt, new TypeExp(loc, t));
e = e.expressionSemantic(sc);
resolveExp(e, pt, pe, ps);
}
if (*pt)
(*pt) = (*pt).addMod(mt.mod);
}
mt.inuse--;
}
void visitReturn(TypeReturn mt)
{
//printf("TypeReturn::resolve(sc = %p, idents = '%s')\n", sc, mt.toChars());
Type t;
{
FuncDeclaration func = sc.func;
if (!func)
{
error(loc, "`typeof(return)` must be inside function");
return returnError();
}
if (func.fes)
func = func.fes.func;
t = func.type.nextOf();
if (!t)
{
error(loc, "cannot use `typeof(return)` inside function `%s` with inferred return type", sc.func.toChars());
return returnError();
}
}
if (mt.idents.dim == 0)
{
return returnType(t.addMod(mt.mod));
}
else
{
if (Dsymbol s = t.toDsymbol(sc))
mt.resolveHelper(loc, sc, s, null, pe, pt, ps, intypeid);
else
{
auto e = typeToExpressionHelper(mt, new TypeExp(loc, t));
e = e.expressionSemantic(sc);
resolveExp(e, pt, pe, ps);
}
if (*pt)
(*pt) = (*pt).addMod(mt.mod);
}
}
void visitSlice(TypeSlice mt)
{
mt.next.resolve(loc, sc, pe, pt, ps, intypeid);
if (*pe)
{
// It's really a slice expression
if (Dsymbol s = getDsymbol(*pe))
*pe = new DsymbolExp(loc, s);
return returnExp(new ArrayExp(loc, *pe, new IntervalExp(loc, mt.lwr, mt.upr)));
}
else if (*ps)
{
Dsymbol s = *ps;
TupleDeclaration td = s.isTupleDeclaration();
if (td)
{
/* It's a slice of a TupleDeclaration
*/
ScopeDsymbol sym = new ArrayScopeSymbol(sc, td);
sym.parent = sc.scopesym;
sc = sc.push(sym);
sc = sc.startCTFE();
mt.lwr = mt.lwr.expressionSemantic(sc);
mt.upr = mt.upr.expressionSemantic(sc);
sc = sc.endCTFE();
sc = sc.pop();
mt.lwr = mt.lwr.ctfeInterpret();
mt.upr = mt.upr.ctfeInterpret();
const i1 = mt.lwr.toUInteger();
const i2 = mt.upr.toUInteger();
if (!(i1 <= i2 && i2 <= td.objects.dim))
{
error(loc, "slice `[%llu..%llu]` is out of range of [0..%u]", i1, i2, td.objects.dim);
return returnError();
}
if (i1 == 0 && i2 == td.objects.dim)
{
return returnSymbol(td);
}
/* Create a new TupleDeclaration which
* is a slice [i1..i2] out of the old one.
*/
auto objects = new Objects(cast(size_t)(i2 - i1));
for (size_t i = 0; i < objects.dim; i++)
{
(*objects)[i] = (*td.objects)[cast(size_t)i1 + i];
}
return returnSymbol(new TupleDeclaration(loc, td.ident, objects));
}
else
visitType(mt);
}
else
{
if ((*pt).ty != Terror)
mt.next = *pt; // prevent re-running semantic() on 'next'
visitType(mt);
}
}
switch (mt.ty)
{
default: visitType (mt); break;
case Tsarray: visitSArray (cast(TypeSArray)mt); break;
case Tarray: visitDArray (cast(TypeDArray)mt); break;
case Taarray: visitAArray (cast(TypeAArray)mt); break;
case Tident: visitIdentifier(cast(TypeIdentifier)mt); break;
case Tinstance: visitInstance (cast(TypeInstance)mt); break;
case Ttypeof: visitTypeof (cast(TypeTypeof)mt); break;
case Treturn: visitReturn (cast(TypeReturn)mt); break;
case Tslice: visitSlice (cast(TypeSlice)mt); break;
}
}
/************************
* Access the members of the object e. This type is same as e.type.
* Params:
* mt = type for which the dot expression is used
* sc = instantiating scope
* e = expression to convert
* ident = identifier being used
* flag = DotExpFlag bit flags
*
* Returns:
* resulting expression with e.ident resolved
*/
Expression dotExp(Type mt, Scope* sc, Expression e, Identifier ident, int flag)
{
Expression visitType(Type mt)
{
VarDeclaration v = null;
static if (LOGDOTEXP)
{
printf("Type::dotExp(e = '%s', ident = '%s')\n", e.toChars(), ident.toChars());
}
Expression ex = e;
while (ex.op == TOK.comma)
ex = (cast(CommaExp)ex).e2;
if (ex.op == TOK.dotVariable)
{
DotVarExp dv = cast(DotVarExp)ex;
v = dv.var.isVarDeclaration();
}
else if (ex.op == TOK.variable)
{
VarExp ve = cast(VarExp)ex;
v = ve.var.isVarDeclaration();
}
if (v)
{
if (ident == Id.offsetof)
{
if (v.isField())
{
auto ad = v.toParent().isAggregateDeclaration();
objc.checkOffsetof(e, ad);
ad.size(e.loc);
if (ad.sizeok != Sizeok.done)
return new ErrorExp();
return new IntegerExp(e.loc, v.offset, Type.tsize_t);
}
}
else if (ident == Id._init)
{
Type tb = mt.toBasetype();
e = mt.defaultInitLiteral(e.loc);
if (tb.ty == Tstruct && tb.needsNested())
{
e.isStructLiteralExp().useStaticInit = true;
}
goto Lreturn;
}
}
if (ident == Id.stringof)
{
/* https://issues.dlang.org/show_bug.cgi?id=3796
* this should demangle e.type.deco rather than
* pretty-printing the type.
*/
const s = e.toChars();
e = new StringExp(e.loc, cast(char*)s);
}
else
e = mt.getProperty(e.loc, ident, flag & DotExpFlag.gag);
Lreturn:
if (e)
e = e.expressionSemantic(sc);
return e;
}
Expression visitError(TypeError)
{
return new ErrorExp();
}
Expression visitBasic(TypeBasic mt)
{
static if (LOGDOTEXP)
{
printf("TypeBasic::dotExp(e = '%s', ident = '%s')\n", e.toChars(), ident.toChars());
}
Type t;
if (ident == Id.re)
{
switch (mt.ty)
{
case Tcomplex32:
t = mt.tfloat32;
goto L1;
case Tcomplex64:
t = mt.tfloat64;
goto L1;
case Tcomplex80:
t = mt.tfloat80;
goto L1;
L1:
e = e.castTo(sc, t);
break;
case Tfloat32:
case Tfloat64:
case Tfloat80:
break;
case Timaginary32:
t = mt.tfloat32;
goto L2;
case Timaginary64:
t = mt.tfloat64;
goto L2;
case Timaginary80:
t = mt.tfloat80;
goto L2;
L2:
e = new RealExp(e.loc, CTFloat.zero, t);
break;
default:
e = mt.Type.getProperty(e.loc, ident, flag);
break;
}
}
else if (ident == Id.im)
{
Type t2;
switch (mt.ty)
{
case Tcomplex32:
t = mt.timaginary32;
t2 = mt.tfloat32;
goto L3;
case Tcomplex64:
t = mt.timaginary64;
t2 = mt.tfloat64;
goto L3;
case Tcomplex80:
t = mt.timaginary80;
t2 = mt.tfloat80;
goto L3;
L3:
e = e.castTo(sc, t);
e.type = t2;
break;
case Timaginary32:
t = mt.tfloat32;
goto L4;
case Timaginary64:
t = mt.tfloat64;
goto L4;
case Timaginary80:
t = mt.tfloat80;
goto L4;
L4:
e = e.copy();
e.type = t;
break;
case Tfloat32:
case Tfloat64:
case Tfloat80:
e = new RealExp(e.loc, CTFloat.zero, mt);
break;
default:
e = mt.Type.getProperty(e.loc, ident, flag);
break;
}
}
else
{
return visitType(mt);
}
if (!(flag & 1) || e)
e = e.expressionSemantic(sc);
return e;
}
Expression visitVector(TypeVector mt)
{
static if (LOGDOTEXP)
{
printf("TypeVector::dotExp(e = '%s', ident = '%s')\n", e.toChars(), ident.toChars());
}
if (ident == Id.ptr && e.op == TOK.call)
{
/* The trouble with TOK.call is the return ABI for float[4] is different from
* __vector(float[4]), and a type paint won't do.
*/
e = new AddrExp(e.loc, e);
e = e.expressionSemantic(sc);
return e.castTo(sc, mt.basetype.nextOf().pointerTo());
}
if (ident == Id.array)
{
//e = e.castTo(sc, basetype);
// Keep lvalue-ness
e = new VectorArrayExp(e.loc, e);
e = e.expressionSemantic(sc);
return e;
}
if (ident == Id._init || ident == Id.offsetof || ident == Id.stringof || ident == Id.__xalignof)
{
// init should return a new VectorExp
// https://issues.dlang.org/show_bug.cgi?id=12776
// offsetof does not work on a cast expression, so use e directly
// stringof should not add a cast to the output
return visitType(mt);
}
return mt.basetype.dotExp(sc, e.castTo(sc, mt.basetype), ident, flag);
}
Expression visitArray(TypeArray mt)
{
static if (LOGDOTEXP)
{
printf("TypeArray::dotExp(e = '%s', ident = '%s')\n", e.toChars(), ident.toChars());
}
e = visitType(mt);
if (!(flag & 1) || e)
e = e.expressionSemantic(sc);
return e;
}
Expression visitSArray(TypeSArray mt)
{
static if (LOGDOTEXP)
{
printf("TypeSArray::dotExp(e = '%s', ident = '%s')\n", e.toChars(), ident.toChars());
}
if (ident == Id.length)
{
Loc oldLoc = e.loc;
e = mt.dim.copy();
e.loc = oldLoc;
}
else if (ident == Id.ptr)
{
if (e.op == TOK.type)
{
e.error("`%s` is not an expression", e.toChars());
return new ErrorExp();
}
else if (!(flag & DotExpFlag.noDeref) && sc.func && !sc.intypeof && sc.func.setUnsafe() && !(sc.flags & SCOPE.debug_))
{
e.error("`%s.ptr` cannot be used in `@safe` code, use `&%s[0]` instead", e.toChars(), e.toChars());
return new ErrorExp();
}
e = e.castTo(sc, e.type.nextOf().pointerTo());
}
else
{
e = visitArray(mt);
}
if (!(flag & 1) || e)
e = e.expressionSemantic(sc);
return e;
}
Expression visitDArray(TypeDArray mt)
{
static if (LOGDOTEXP)
{
printf("TypeDArray::dotExp(e = '%s', ident = '%s')\n", e.toChars(), ident.toChars());
}
if (e.op == TOK.type && (ident == Id.length || ident == Id.ptr))
{
e.error("`%s` is not an expression", e.toChars());
return new ErrorExp();
}
if (ident == Id.length)
{
if (e.op == TOK.string_)
{
StringExp se = cast(StringExp)e;
return new IntegerExp(se.loc, se.len, Type.tsize_t);
}
if (e.op == TOK.null_)
{
return new IntegerExp(e.loc, 0, Type.tsize_t);
}
if (checkNonAssignmentArrayOp(e))
{
return new ErrorExp();
}
e = new ArrayLengthExp(e.loc, e);
e.type = Type.tsize_t;
return e;
}
else if (ident == Id.ptr)
{
if (!(flag & DotExpFlag.noDeref) && sc.func && !sc.intypeof && sc.func.setUnsafe() && !(sc.flags & SCOPE.debug_))
{
e.error("`%s.ptr` cannot be used in `@safe` code, use `&%s[0]` instead", e.toChars(), e.toChars());
return new ErrorExp();
}
return e.castTo(sc, mt.next.pointerTo());
}
else
{
return visitArray(mt);
}
}
Expression visitAArray(TypeAArray mt)
{
static if (LOGDOTEXP)
{
printf("TypeAArray::dotExp(e = '%s', ident = '%s')\n", e.toChars(), ident.toChars());
}
if (ident == Id.length)
{
__gshared FuncDeclaration fd_aaLen = null;
if (fd_aaLen is null)
{
auto fparams = new Parameters();
fparams.push(new Parameter(STC.in_, mt, null, null, null));
fd_aaLen = FuncDeclaration.genCfunc(fparams, Type.tsize_t, Id.aaLen);
TypeFunction tf = fd_aaLen.type.toTypeFunction();
tf.purity = PURE.const_;
tf.isnothrow = true;
tf.isnogc = false;
}
Expression ev = new VarExp(e.loc, fd_aaLen, false);
e = new CallExp(e.loc, ev, e);
e.type = fd_aaLen.type.toTypeFunction().next;
return e;
}
else
{
return visitType(mt);
}
}
Expression visitReference(TypeReference mt)
{
static if (LOGDOTEXP)
{
printf("TypeReference::dotExp(e = '%s', ident = '%s')\n", e.toChars(), ident.toChars());
}
// References just forward things along
return mt.next.dotExp(sc, e, ident, flag);
}
Expression visitDelegate(TypeDelegate mt)
{
static if (LOGDOTEXP)
{
printf("TypeDelegate::dotExp(e = '%s', ident = '%s')\n", e.toChars(), ident.toChars());
}
if (ident == Id.ptr)
{
e = new DelegatePtrExp(e.loc, e);
e = e.expressionSemantic(sc);
}
else if (ident == Id.funcptr)
{
if (!(flag & DotExpFlag.noDeref) && sc.func && !sc.intypeof && sc.func.setUnsafe() && !(sc.flags & SCOPE.debug_))
{
e.error("`%s.funcptr` cannot be used in `@safe` code", e.toChars());
return new ErrorExp();
}
e = new DelegateFuncptrExp(e.loc, e);
e = e.expressionSemantic(sc);
}
else
{
return visitType(mt);
}
return e;
}
/***************************************
* Figures out what to do with an undefined member reference
* for classes and structs.
*
* If flag & 1, don't report "not a property" error and just return NULL.
*/
Expression noMember(Type mt, Scope* sc, Expression e, Identifier ident, int flag)
{
//printf("Type.noMember(e: %s ident: %s flag: %d)\n", e.toChars(), ident.toChars(), flag);
bool gagError = flag & 1;
__gshared int nest; // https://issues.dlang.org/show_bug.cgi?id=17380
static Expression returnExp(Expression e)
{
--nest;
return e;
}
if (++nest > 500)
{
.error(e.loc, "cannot resolve identifier `%s`", ident.toChars());
return returnExp(gagError ? null : new ErrorExp());
}
assert(mt.ty == Tstruct || mt.ty == Tclass);
auto sym = mt.toDsymbol(sc).isAggregateDeclaration();
assert(sym);
if (ident != Id.__sizeof &&
ident != Id.__xalignof &&
ident != Id._init &&
ident != Id._mangleof &&
ident != Id.stringof &&
ident != Id.offsetof &&
// https://issues.dlang.org/show_bug.cgi?id=15045
// Don't forward special built-in member functions.
ident != Id.ctor &&
ident != Id.dtor &&
ident != Id.__xdtor &&
ident != Id.postblit &&
ident != Id.__xpostblit)
{
/* Look for overloaded opDot() to see if we should forward request
* to it.
*/
if (auto fd = search_function(sym, Id.opDot))
{
/* Rewrite e.ident as:
* e.opDot().ident
*/
e = build_overload(e.loc, sc, e, null, fd);
// @@@DEPRECATED_2.087@@@.
e.deprecation("`opDot` is deprecated. Use `alias this`");
e = new DotIdExp(e.loc, e, ident);
return returnExp(e.expressionSemantic(sc));
}
/* Look for overloaded opDispatch to see if we should forward request
* to it.
*/
if (auto fd = search_function(sym, Id.opDispatch))
{
/* Rewrite e.ident as:
* e.opDispatch!("ident")
*/
TemplateDeclaration td = fd.isTemplateDeclaration();
if (!td)
{
fd.error("must be a template `opDispatch(string s)`, not a %s", fd.kind());
return returnExp(new ErrorExp());
}
auto se = new StringExp(e.loc, cast(char*)ident.toChars());
auto tiargs = new Objects();
tiargs.push(se);
auto dti = new DotTemplateInstanceExp(e.loc, e, Id.opDispatch, tiargs);
dti.ti.tempdecl = td;
/* opDispatch, which doesn't need IFTI, may occur instantiate error.
* e.g.
* template opDispatch(name) if (isValid!name) { ... }
*/
uint errors = gagError ? global.startGagging() : 0;
e = dti.semanticY(sc, 0);
if (gagError && global.endGagging(errors))
e = null;
return returnExp(e);
}
/* See if we should forward to the alias this.
*/
auto alias_e = resolveAliasThis(sc, e, gagError);
if (alias_e && alias_e != e)
{
/* Rewrite e.ident as:
* e.aliasthis.ident
*/
auto die = new DotIdExp(e.loc, alias_e, ident);
auto errors = gagError ? 0 : global.startGagging();
auto exp = die.semanticY(sc, gagError);
if (!gagError)
{
global.endGagging(errors);
if (exp && exp.op == TOK.error)
exp = null;
}
if (exp && gagError)
// now that we know that the alias this leads somewhere useful,
// go back and print deprecations/warnings that we skipped earlier due to the gag
resolveAliasThis(sc, e, false);
return returnExp(exp);
}
}
return returnExp(visitType(mt));
}
Expression visitStruct(TypeStruct mt)
{
Dsymbol s;
static if (LOGDOTEXP)
{
printf("TypeStruct::dotExp(e = '%s', ident = '%s')\n", e.toChars(), ident.toChars());
}
assert(e.op != TOK.dot);
// https://issues.dlang.org/show_bug.cgi?id=14010
if (ident == Id._mangleof)
{
return mt.getProperty(e.loc, ident, flag & 1);
}
/* If e.tupleof
*/
if (ident == Id._tupleof)
{
/* Create a TupleExp out of the fields of the struct e:
* (e.field0, e.field1, e.field2, ...)
*/
e = e.expressionSemantic(sc); // do this before turning on noaccesscheck
if (!mt.sym.determineFields())
{
error(e.loc, "unable to determine fields of `%s` because of forward references", mt.toChars());
}
Expression e0;
Expression ev = e.op == TOK.type ? null : e;
if (ev)
ev = extractSideEffect(sc, "__tup", e0, ev);
auto exps = new Expressions();
exps.reserve(mt.sym.fields.dim);
for (size_t i = 0; i < mt.sym.fields.dim; i++)
{
VarDeclaration v = mt.sym.fields[i];
Expression ex;
if (ev)
ex = new DotVarExp(e.loc, ev, v);
else
{
ex = new VarExp(e.loc, v);
ex.type = ex.type.addMod(e.type.mod);
}
exps.push(ex);
}
e = new TupleExp(e.loc, e0, exps);
Scope* sc2 = sc.push();
sc2.flags |= global.params.vsafe ? SCOPE.onlysafeaccess : SCOPE.noaccesscheck;
e = e.expressionSemantic(sc2);
sc2.pop();
return e;
}
immutable flags = sc.flags & SCOPE.ignoresymbolvisibility ? IgnoreSymbolVisibility : 0;
s = mt.sym.search(e.loc, ident, flags | IgnorePrivateImports);
L1:
if (!s)
{
return noMember(mt, sc, e, ident, flag);
}
if (!(sc.flags & SCOPE.ignoresymbolvisibility) && !symbolIsVisible(sc, s))
{
return noMember(mt, sc, e, ident, flag);
}
if (!s.isFuncDeclaration()) // because of overloading
{
s.checkDeprecated(e.loc, sc);
if (auto d = s.isDeclaration())
d.checkDisabled(e.loc, sc);
}
s = s.toAlias();
if (auto em = s.isEnumMember())
{
return em.getVarExp(e.loc, sc);
}
if (auto v = s.isVarDeclaration())
{
if (!v.type ||
!v.type.deco && v.inuse)
{
if (v.inuse) // https://issues.dlang.org/show_bug.cgi?id=9494
e.error("circular reference to %s `%s`", v.kind(), v.toPrettyChars());
else
e.error("forward reference to %s `%s`", v.kind(), v.toPrettyChars());
return new ErrorExp();
}
if (v.type.ty == Terror)
{
return new ErrorExp();
}
if ((v.storage_class & STC.manifest) && v._init)
{
if (v.inuse)
{
e.error("circular initialization of %s `%s`", v.kind(), v.toPrettyChars());
return new ErrorExp();
}
checkAccess(e.loc, sc, null, v);
Expression ve = new VarExp(e.loc, v);
if (!isTrivialExp(e))
{
ve = new CommaExp(e.loc, e, ve);
}
return ve.expressionSemantic(sc);
}
}
if (auto t = s.getType())
{
return (new TypeExp(e.loc, t)).expressionSemantic(sc);
}
TemplateMixin tm = s.isTemplateMixin();
if (tm)
{
Expression de = new DotExp(e.loc, e, new ScopeExp(e.loc, tm));
de.type = e.type;
return de;
}
TemplateDeclaration td = s.isTemplateDeclaration();
if (td)
{
if (e.op == TOK.type)
e = new TemplateExp(e.loc, td);
else
e = new DotTemplateExp(e.loc, e, td);
return e.expressionSemantic(sc);
}
TemplateInstance ti = s.isTemplateInstance();
if (ti)
{
if (!ti.semanticRun)
{
ti.dsymbolSemantic(sc);
if (!ti.inst || ti.errors) // if template failed to expand
{
return new ErrorExp();
}
}
s = ti.inst.toAlias();
if (!s.isTemplateInstance())
goto L1;
if (e.op == TOK.type)
e = new ScopeExp(e.loc, ti);
else
e = new DotExp(e.loc, e, new ScopeExp(e.loc, ti));
return e.expressionSemantic(sc);
}
if (s.isImport() || s.isModule() || s.isPackage())
{
return symbolToExp(s, e.loc, sc, false);
}
OverloadSet o = s.isOverloadSet();
if (o)
{
auto oe = new OverExp(e.loc, o);
if (e.op == TOK.type)
{
return oe;
}
return new DotExp(e.loc, e, oe);
}
Declaration d = s.isDeclaration();
if (!d)
{
e.error("`%s.%s` is not a declaration", e.toChars(), ident.toChars());
return new ErrorExp();
}
if (e.op == TOK.type)
{
/* It's:
* Struct.d
*/
if (TupleDeclaration tup = d.isTupleDeclaration())
{
e = new TupleExp(e.loc, tup);
return e.expressionSemantic(sc);
}
if (d.needThis() && sc.intypeof != 1)
{
/* Rewrite as:
* this.d
*/
if (hasThis(sc))
{
e = new DotVarExp(e.loc, new ThisExp(e.loc), d);
return e.expressionSemantic(sc);
}
}
if (d.semanticRun == PASS.init)
d.dsymbolSemantic(null);
checkAccess(e.loc, sc, e, d);
auto ve = new VarExp(e.loc, d);
if (d.isVarDeclaration() && d.needThis())
ve.type = d.type.addMod(e.type.mod);
return ve;
}
bool unreal = e.op == TOK.variable && (cast(VarExp)e).var.isField();
if (d.isDataseg() || unreal && d.isField())
{
// (e, d)
checkAccess(e.loc, sc, e, d);
Expression ve = new VarExp(e.loc, d);
e = unreal ? ve : new CommaExp(e.loc, e, ve);
return e.expressionSemantic(sc);
}
e = new DotVarExp(e.loc, e, d);
return e.expressionSemantic(sc);
}
Expression visitEnum(TypeEnum mt)
{
static if (LOGDOTEXP)
{
printf("TypeEnum::dotExp(e = '%s', ident = '%s') '%s'\n", e.toChars(), ident.toChars(), mt.toChars());
}
// https://issues.dlang.org/show_bug.cgi?id=14010
if (ident == Id._mangleof)
{
return mt.getProperty(e.loc, ident, flag & 1);
}
if (mt.sym.semanticRun < PASS.semanticdone)
mt.sym.dsymbolSemantic(null);
if (!mt.sym.members)
{
if (mt.sym.isSpecial())
{
/* Special enums forward to the base type
*/
e = mt.sym.memtype.dotExp(sc, e, ident, flag);
}
else if (!(flag & 1))
{
mt.sym.error("is forward referenced when looking for `%s`", ident.toChars());
e = new ErrorExp();
}
else
e = null;
return e;
}
Dsymbol s = mt.sym.search(e.loc, ident);
if (!s)
{
if (ident == Id.max || ident == Id.min || ident == Id._init)
{
return mt.getProperty(e.loc, ident, flag & 1);
}
Expression res = mt.sym.getMemtype(Loc.initial).dotExp(sc, e, ident, 1);
if (!(flag & 1) && !res)
{
if (auto ns = mt.sym.search_correct(ident))
e.error("no property `%s` for type `%s`. Did you mean `%s.%s` ?", ident.toChars(), mt.toChars(), mt.toChars(),
ns.toChars());
else
e.error("no property `%s` for type `%s`", ident.toChars(),
mt.toChars());
return new ErrorExp();
}
return res;
}
EnumMember m = s.isEnumMember();
return m.getVarExp(e.loc, sc);
}
Expression visitClass(TypeClass mt)
{
Dsymbol s;
static if (LOGDOTEXP)
{
printf("TypeClass::dotExp(e = '%s', ident = '%s')\n", e.toChars(), ident.toChars());
}
assert(e.op != TOK.dot);
// https://issues.dlang.org/show_bug.cgi?id=12543
if (ident == Id.__sizeof || ident == Id.__xalignof || ident == Id._mangleof)
{
return mt.Type.getProperty(e.loc, ident, 0);
}
/* If e.tupleof
*/
if (ident == Id._tupleof)
{
objc.checkTupleof(e, mt);
/* Create a TupleExp
*/
e = e.expressionSemantic(sc); // do this before turning on noaccesscheck
mt.sym.size(e.loc); // do semantic of type
Expression e0;
Expression ev = e.op == TOK.type ? null : e;
if (ev)
ev = extractSideEffect(sc, "__tup", e0, ev);
auto exps = new Expressions();
exps.reserve(mt.sym.fields.dim);
for (size_t i = 0; i < mt.sym.fields.dim; i++)
{
VarDeclaration v = mt.sym.fields[i];
// Don't include hidden 'this' pointer
if (v.isThisDeclaration())
continue;
Expression ex;
if (ev)
ex = new DotVarExp(e.loc, ev, v);
else
{
ex = new VarExp(e.loc, v);
ex.type = ex.type.addMod(e.type.mod);
}
exps.push(ex);
}
e = new TupleExp(e.loc, e0, exps);
Scope* sc2 = sc.push();
sc2.flags |= global.params.vsafe ? SCOPE.onlysafeaccess : SCOPE.noaccesscheck;
e = e.expressionSemantic(sc2);
sc2.pop();
return e;
}
int flags = sc.flags & SCOPE.ignoresymbolvisibility ? IgnoreSymbolVisibility : 0;
s = mt.sym.search(e.loc, ident, flags | IgnorePrivateImports);
L1:
if (!s)
{
// See if it's 'this' class or a base class
if (mt.sym.ident == ident)
{
if (e.op == TOK.type)
{
return mt.Type.getProperty(e.loc, ident, 0);
}
e = new DotTypeExp(e.loc, e, mt.sym);
e = e.expressionSemantic(sc);
return e;
}
if (auto cbase = mt.sym.searchBase(ident))
{
if (e.op == TOK.type)
{
return mt.Type.getProperty(e.loc, ident, 0);
}
if (auto ifbase = cbase.isInterfaceDeclaration())
e = new CastExp(e.loc, e, ifbase.type);
else
e = new DotTypeExp(e.loc, e, cbase);
e = e.expressionSemantic(sc);
return e;
}
if (ident == Id.classinfo)
{
assert(Type.typeinfoclass);
Type t = Type.typeinfoclass.type;
if (e.op == TOK.type || e.op == TOK.dotType)
{
/* For type.classinfo, we know the classinfo
* at compile time.
*/
if (!mt.sym.vclassinfo)
mt.sym.vclassinfo = new TypeInfoClassDeclaration(mt.sym.type);
e = new VarExp(e.loc, mt.sym.vclassinfo);
e = e.addressOf();
e.type = t; // do this so we don't get redundant dereference
}
else
{
/* For class objects, the classinfo reference is the first
* entry in the vtbl[]
*/
e = new PtrExp(e.loc, e);
e.type = t.pointerTo();
if (mt.sym.isInterfaceDeclaration())
{
if (mt.sym.isCPPinterface())
{
/* C++ interface vtbl[]s are different in that the
* first entry is always pointer to the first virtual
* function, not classinfo.
* We can't get a .classinfo for it.
*/
error(e.loc, "no `.classinfo` for C++ interface objects");
}
/* For an interface, the first entry in the vtbl[]
* is actually a pointer to an instance of struct Interface.
* The first member of Interface is the .classinfo,
* so add an extra pointer indirection.
*/
e.type = e.type.pointerTo();
e = new PtrExp(e.loc, e);
e.type = t.pointerTo();
}
e = new PtrExp(e.loc, e, t);
}
return e;
}
if (ident == Id.__vptr)
{
/* The pointer to the vtbl[]
* *cast(immutable(void*)**)e
*/
e = e.castTo(sc, mt.tvoidptr.immutableOf().pointerTo().pointerTo());
e = new PtrExp(e.loc, e);
e = e.expressionSemantic(sc);
return e;
}
if (ident == Id.__monitor && mt.sym.hasMonitor())
{
/* The handle to the monitor (call it a void*)
* *(cast(void**)e + 1)
*/
e = e.castTo(sc, mt.tvoidptr.pointerTo());
e = new AddExp(e.loc, e, IntegerExp.literal!1);
e = new PtrExp(e.loc, e);
e = e.expressionSemantic(sc);
return e;
}
if (ident == Id.outer && mt.sym.vthis)
{
if (mt.sym.vthis.semanticRun == PASS.init)
mt.sym.vthis.dsymbolSemantic(null);
if (auto cdp = mt.sym.toParentLocal().isClassDeclaration())
{
auto dve = new DotVarExp(e.loc, e, mt.sym.vthis);
dve.type = cdp.type.addMod(e.type.mod);
return dve;
}
/* https://issues.dlang.org/show_bug.cgi?id=15839
* Find closest parent class through nested functions.
*/
for (auto p = mt.sym.toParentLocal(); p; p = p.toParentLocal())
{
auto fd = p.isFuncDeclaration();
if (!fd)
break;
auto ad = fd.isThis();
if (!ad && fd.isNested())
continue;
if (!ad)
break;
if (auto cdp = ad.isClassDeclaration())
{
auto ve = new ThisExp(e.loc);
ve.var = fd.vthis;
const nestedError = fd.vthis.checkNestedReference(sc, e.loc);
assert(!nestedError);
ve.type = cdp.type.addMod(fd.vthis.type.mod).addMod(e.type.mod);
return ve;
}
break;
}
// Continue to show enclosing function's frame (stack or closure).
auto dve = new DotVarExp(e.loc, e, mt.sym.vthis);
dve.type = mt.sym.vthis.type.addMod(e.type.mod);
return dve;
}
return noMember(mt, sc, e, ident, flag & 1);
}
if (!(sc.flags & SCOPE.ignoresymbolvisibility) && !symbolIsVisible(sc, s))
{
return noMember(mt, sc, e, ident, flag);
}
if (!s.isFuncDeclaration()) // because of overloading
{
s.checkDeprecated(e.loc, sc);
if (auto d = s.isDeclaration())
d.checkDisabled(e.loc, sc);
}
s = s.toAlias();
if (auto em = s.isEnumMember())
{
return em.getVarExp(e.loc, sc);
}
if (auto v = s.isVarDeclaration())
{
if (!v.type ||
!v.type.deco && v.inuse)
{
if (v.inuse) // https://issues.dlang.org/show_bug.cgi?id=9494
e.error("circular reference to %s `%s`", v.kind(), v.toPrettyChars());
else
e.error("forward reference to %s `%s`", v.kind(), v.toPrettyChars());
return new ErrorExp();
}
if (v.type.ty == Terror)
{
return new ErrorExp();
}
if ((v.storage_class & STC.manifest) && v._init)
{
if (v.inuse)
{
e.error("circular initialization of %s `%s`", v.kind(), v.toPrettyChars());
return new ErrorExp();
}
checkAccess(e.loc, sc, null, v);
Expression ve = new VarExp(e.loc, v);
ve = ve.expressionSemantic(sc);
return ve;
}
}
if (auto t = s.getType())
{
return (new TypeExp(e.loc, t)).expressionSemantic(sc);
}
TemplateMixin tm = s.isTemplateMixin();
if (tm)
{
Expression de = new DotExp(e.loc, e, new ScopeExp(e.loc, tm));
de.type = e.type;
return de;
}
TemplateDeclaration td = s.isTemplateDeclaration();
if (td)
{
if (e.op == TOK.type)
e = new TemplateExp(e.loc, td);
else
e = new DotTemplateExp(e.loc, e, td);
e = e.expressionSemantic(sc);
return e;
}
TemplateInstance ti = s.isTemplateInstance();
if (ti)
{
if (!ti.semanticRun)
{
ti.dsymbolSemantic(sc);
if (!ti.inst || ti.errors) // if template failed to expand
{
return new ErrorExp();
}
}
s = ti.inst.toAlias();
if (!s.isTemplateInstance())
goto L1;
if (e.op == TOK.type)
e = new ScopeExp(e.loc, ti);
else
e = new DotExp(e.loc, e, new ScopeExp(e.loc, ti));
return e.expressionSemantic(sc);
}
if (s.isImport() || s.isModule() || s.isPackage())
{
e = symbolToExp(s, e.loc, sc, false);
return e;
}
OverloadSet o = s.isOverloadSet();
if (o)
{
auto oe = new OverExp(e.loc, o);
if (e.op == TOK.type)
{
return oe;
}
return new DotExp(e.loc, e, oe);
}
Declaration d = s.isDeclaration();
if (!d)
{
e.error("`%s.%s` is not a declaration", e.toChars(), ident.toChars());
return new ErrorExp();
}
if (e.op == TOK.type)
{
/* It's:
* Class.d
*/
if (TupleDeclaration tup = d.isTupleDeclaration())
{
e = new TupleExp(e.loc, tup);
e = e.expressionSemantic(sc);
return e;
}
if (mt.sym.classKind == ClassKind.objc
&& d.isFuncDeclaration()
&& d.isFuncDeclaration().isStatic
&& d.isFuncDeclaration().selector)
{
auto classRef = new ObjcClassReferenceExp(e.loc, mt.sym);
return new DotVarExp(e.loc, classRef, d).expressionSemantic(sc);
}
else if (d.needThis() && sc.intypeof != 1)
{
/* Rewrite as:
* this.d
*/
AggregateDeclaration ad = d.isMemberLocal();
if (auto f = hasThis(sc))
{
// This is almost same as getRightThis() in expressionsem.d
Expression e1;
Type t;
/* returns: true to continue, false to return */
if (f.isThis2)
{
if (followInstantiationContext(f, ad))
{
e1 = new VarExp(e.loc, f.vthis);
e1 = new PtrExp(e1.loc, e1);
e1 = new IndexExp(e1.loc, e1, IntegerExp.literal!1);
auto pd = f.toParent2().isDeclaration();
assert(pd);
t = pd.type.toBasetype();
e1 = getThisSkipNestedFuncs(e1.loc, sc, f.toParent2(), ad, e1, t, d, true);
if (!e1)
{
e = new VarExp(e.loc, d);
return e;
}
goto L2;
}
}
e1 = new ThisExp(e.loc);
e1 = e1.expressionSemantic(sc);
L2:
t = e1.type.toBasetype();
ClassDeclaration cd = e.type.isClassHandle();
ClassDeclaration tcd = t.isClassHandle();
if (cd && tcd && (tcd == cd || cd.isBaseOf(tcd, null)))
{
e = new DotTypeExp(e1.loc, e1, cd);
e = new DotVarExp(e.loc, e, d);
e = e.expressionSemantic(sc);
return e;
}
if (tcd && tcd.isNested())
{
/* e1 is the 'this' pointer for an inner class: tcd.
* Rewrite it as the 'this' pointer for the outer class.
*/
auto vthis = followInstantiationContext(tcd, ad) ? tcd.vthis2 : tcd.vthis;
e1 = new DotVarExp(e.loc, e1, vthis);
e1.type = vthis.type;
e1.type = e1.type.addMod(t.mod);
// Do not call ensureStaticLinkTo()
//e1 = e1.expressionSemantic(sc);
// Skip up over nested functions, and get the enclosing
// class type.
e1 = getThisSkipNestedFuncs(e1.loc, sc, toParentP(tcd, ad), ad, e1, t, d, true);
if (!e1)
{
e = new VarExp(e.loc, d);
return e;
}
goto L2;
}
}
}
//printf("e = %s, d = %s\n", e.toChars(), d.toChars());
if (d.semanticRun == PASS.init)
d.dsymbolSemantic(null);
// If static function, get the most visible overload.
// Later on the call is checked for correctness.
// https://issues.dlang.org/show_bug.cgi?id=12511
if (auto fd = d.isFuncDeclaration())
{
import dmd.access : mostVisibleOverload;
d = cast(Declaration)mostVisibleOverload(fd, sc._module);
}
checkAccess(e.loc, sc, e, d);
auto ve = new VarExp(e.loc, d);
if (d.isVarDeclaration() && d.needThis())
ve.type = d.type.addMod(e.type.mod);
return ve;
}
bool unreal = e.op == TOK.variable && (cast(VarExp)e).var.isField();
if (d.isDataseg() || unreal && d.isField())
{
// (e, d)
checkAccess(e.loc, sc, e, d);
Expression ve = new VarExp(e.loc, d);
e = unreal ? ve : new CommaExp(e.loc, e, ve);
e = e.expressionSemantic(sc);
return e;
}
e = new DotVarExp(e.loc, e, d);
e = e.expressionSemantic(sc);
return e;
}
switch (mt.ty)
{
case Tvector: return visitVector (cast(TypeVector)mt);
case Tsarray: return visitSArray (cast(TypeSArray)mt);
case Tstruct: return visitStruct (cast(TypeStruct)mt);
case Tenum: return visitEnum (cast(TypeEnum)mt);
case Terror: return visitError (cast(TypeError)mt);
case Tarray: return visitDArray (cast(TypeDArray)mt);
case Taarray: return visitAArray (cast(TypeAArray)mt);
case Treference: return visitReference(cast(TypeReference)mt);
case Tdelegate: return visitDelegate (cast(TypeDelegate)mt);
case Tclass: return visitClass (cast(TypeClass)mt);
default: return mt.isTypeBasic()
? visitBasic(cast(TypeBasic)mt)
: visitType(mt);
}
}
/************************
* Get the the default initialization expression for a type.
* Params:
* mt = the type for which the init expression is returned
* loc = the location where the expression needs to be evaluated
*
* Returns:
* The initialization expression for the type.
*/
Expression defaultInit(Type mt, const ref Loc loc)
{
Expression visitBasic(TypeBasic mt)
{
static if (LOGDEFAULTINIT)
{
printf("TypeBasic::defaultInit() '%s'\n", mt.toChars());
}
dinteger_t value = 0;
switch (mt.ty)
{
case Tchar:
value = 0xFF;
break;
case Twchar:
case Tdchar:
value = 0xFFFF;
break;
case Timaginary32:
case Timaginary64:
case Timaginary80:
case Tfloat32:
case Tfloat64:
case Tfloat80:
return new RealExp(loc, target.RealProperties.snan, mt);
case Tcomplex32:
case Tcomplex64:
case Tcomplex80:
{
// Can't use fvalue + I*fvalue (the im part becomes a quiet NaN).
const cvalue = complex_t(target.RealProperties.snan, target.RealProperties.snan);
return new ComplexExp(loc, cvalue, mt);
}
case Tvoid:
error(loc, "`void` does not have a default initializer");
return new ErrorExp();
default:
break;
}
return new IntegerExp(loc, value, mt);
}
Expression visitVector(TypeVector mt)
{
//printf("TypeVector::defaultInit()\n");
assert(mt.basetype.ty == Tsarray);
Expression e = mt.basetype.defaultInit(loc);
auto ve = new VectorExp(loc, e, mt);
ve.type = mt;
ve.dim = cast(int)(mt.basetype.size(loc) / mt.elementType().size(loc));
return ve;
}
Expression visitSArray(TypeSArray mt)
{
static if (LOGDEFAULTINIT)
{
printf("TypeSArray::defaultInit() '%s'\n", mt.toChars());
}
if (mt.next.ty == Tvoid)
return mt.tuns8.defaultInit(loc);
else
return mt.next.defaultInit(loc);
}
Expression visitFunction(TypeFunction mt)
{
error(loc, "`function` does not have a default initializer");
return new ErrorExp();
}
Expression visitStruct(TypeStruct mt)
{
static if (LOGDEFAULTINIT)
{
printf("TypeStruct::defaultInit() '%s'\n", mt.toChars());
}
Declaration d = new SymbolDeclaration(mt.sym.loc, mt.sym);
assert(d);
d.type = mt;
d.storage_class |= STC.rvalue; // https://issues.dlang.org/show_bug.cgi?id=14398
return new VarExp(mt.sym.loc, d);
}
Expression visitEnum(TypeEnum mt)
{
static if (LOGDEFAULTINIT)
{
printf("TypeEnum::defaultInit() '%s'\n", mt.toChars());
}
// Initialize to first member of enum
Expression e = mt.sym.getDefaultValue(loc);
e = e.copy();
e.loc = loc;
e.type = mt; // to deal with const, immutable, etc., variants
return e;
}
Expression visitTuple(TypeTuple mt)
{
static if (LOGDEFAULTINIT)
{
printf("TypeTuple::defaultInit() '%s'\n", mt.toChars());
}
auto exps = new Expressions(mt.arguments.dim);
for (size_t i = 0; i < mt.arguments.dim; i++)
{
Parameter p = (*mt.arguments)[i];
assert(p.type);
Expression e = p.type.defaultInitLiteral(loc);
if (e.op == TOK.error)
{
return e;
}
(*exps)[i] = e;
}
return new TupleExp(loc, exps);
}
switch (mt.ty)
{
case Tvector: return visitVector (cast(TypeVector)mt);
case Tsarray: return visitSArray (cast(TypeSArray)mt);
case Tfunction: return visitFunction(cast(TypeFunction)mt);
case Tstruct: return visitStruct (cast(TypeStruct)mt);
case Tenum: return visitEnum (cast(TypeEnum)mt);
case Ttuple: return visitTuple (cast(TypeTuple)mt);
case Tnull: return new NullExp(Loc.initial, Type.tnull);
case Terror: return new ErrorExp();
case Tarray:
case Taarray:
case Tpointer:
case Treference:
case Tdelegate:
case Tclass: return new NullExp(loc, mt);
default: return mt.isTypeBasic() ?
visitBasic(cast(TypeBasic)mt) :
null;
}
}
|
D
|
/*
area2048 'STAGE-02'
'stg02.d'
2004/04/27 jumpei isshiki
*/
private import util_sdl;
private import util_snd;
private import define;
private import task;
private import gctrl;
private import system;
private import effect;
private import bg;
private import stg;
private import ship;
private int[] seq_stg01 = [
SEQ_STGINIT,
SEQ_REQBGM,SND_BGM02,
SEQ_SETENESTG,12,
SEQ_SETENEMAX,4,
SEQ_SETBONUS,24*60,
SEQ_BG_SET,
SEQ_WAIT,1,
SEQ_FADE,256,256,256,256, 0,30,
SEQ_SHIPINIT,
SEQ_BGZOOM,1,-16000,
SEQ_WAIT,1,
SEQ_BG_ON,
SEQ_BGZOOM,60, -7500,
SEQ_SHIPSTART,
SEQ_MSGSTART,
SEQ_PLAYVOICE,SND_VOICE_GETREADY,
SEQ_CHKVOICE,
SEQ_WAIT,15,
SEQ_TIMESTART,
SEQ_LOOPSET,4,
SEQ_SETENEMY,ENMEY_01,
SEQ_WAIT,15,
SEQ_LOOP,
SEQ_LOOPSET,4,
SEQ_SETENEMY,ENMEY_02,
SEQ_WAIT,15,
SEQ_LOOP,
SEQ_LOOPSET,4,
SEQ_SETENEMY,ENMEY_03,
SEQ_WAIT,15,
SEQ_LOOP,
SEQ_EWAIT,0,
SEQ_TIMESTOP,
SEQ_MSGCLEAR,
SEQ_PLAYVOICE,SND_VOICE_SCENE,
SEQ_CHKVOICE,
SEQ_SHIPLOCK,
SEQ_FADE,256,256,256, 0,256,60,
SEQ_BGZOOM,60,-16000,
SEQ_WAIT,60,
SEQ_BG_OFF,
SEQ_END,
];
private int[] seq_stg02 = [
SEQ_STGINIT,
SEQ_REQBGM,SND_BGM02,
SEQ_SETENESTG,16,
SEQ_SETENEMAX,8,
SEQ_SETBONUS,32*60,
SEQ_BG_SET,
SEQ_WAIT,1,
SEQ_FADE,256,256,256,256, 0,30,
SEQ_SHIPINIT,
SEQ_BGZOOM,1,-16000,
SEQ_WAIT,1,
SEQ_BG_ON,
SEQ_BGZOOM,60, -7500,
SEQ_SHIPSTART,
SEQ_MSGSTART,
SEQ_PLAYVOICE,SND_VOICE_GETREADY,
SEQ_CHKVOICE,
SEQ_WAIT,15,
SEQ_TIMESTART,
SEQ_LOOPSET,4,
SEQ_SETENEMY,ENMEY_01,
SEQ_WAIT,15,
SEQ_LOOP,
SEQ_LOOPSET,4,
SEQ_SETENEMY,ENMEY_02,
SEQ_WAIT,15,
SEQ_LOOP,
SEQ_LOOPSET,8,
SEQ_SETENEMY,ENMEY_03,
SEQ_WAIT,15,
SEQ_LOOP,
SEQ_EWAIT,0,
SEQ_TIMESTOP,
SEQ_MSGCLEAR,
SEQ_PLAYVOICE,SND_VOICE_SCENE,
SEQ_CHKVOICE,
SEQ_SHIPLOCK,
SEQ_FADE,256,256,256, 0,256,60,
SEQ_BGZOOM,60,-16000,
SEQ_WAIT,60,
SEQ_BG_OFF,
SEQ_END,
];
private int[] seq_stg03 = [
SEQ_STGINIT,
SEQ_REQBGM,SND_BGM02,
SEQ_SETENESTG,16,
SEQ_SETENEMAX,8,
SEQ_SETBONUS,32*60,
SEQ_BG_SET,
SEQ_WAIT,1,
SEQ_FADE,256,256,256,256, 0,30,
SEQ_SHIPINIT,
SEQ_BGZOOM,1,-16000,
SEQ_WAIT,1,
SEQ_BG_ON,
SEQ_BGZOOM,60, -7500,
SEQ_SHIPSTART,
SEQ_MSGSTART,
SEQ_PLAYVOICE,SND_VOICE_GETREADY,
SEQ_CHKVOICE,
SEQ_WAIT,15,
SEQ_TIMESTART,
SEQ_LOOPSET,4,
SEQ_SETENEMY,ENMEY_01,
SEQ_WAIT,15,
SEQ_LOOP,
SEQ_LOOPSET,4,
SEQ_SETENEMY,ENMEY_03,
SEQ_WAIT,15,
SEQ_LOOP,
SEQ_LOOPSET,4,
SEQ_SETENEMY,ENMEY_02,
SEQ_WAIT,15,
SEQ_LOOP,
SEQ_LOOPSET,4,
SEQ_SETENEMY,ENMEY_03,
SEQ_WAIT,15,
SEQ_LOOP,
SEQ_EWAIT,0,
SEQ_TIMESTOP,
SEQ_MSGCLEAR,
SEQ_PLAYVOICE,SND_VOICE_SCENE,
SEQ_CHKVOICE,
SEQ_SHIPLOCK,
SEQ_FADE,256,256,256, 0,256,60,
SEQ_BGZOOM,60,-16000,
SEQ_WAIT,60,
SEQ_BG_OFF,
SEQ_END,
];
private int[] seq_stg04 = [
SEQ_STGINIT,
SEQ_REQBGM,SND_BGM02,
SEQ_SETENESTG,16,
SEQ_SETENEMAX,8,
SEQ_SETBONUS,32*60,
SEQ_BG_SET,
SEQ_WAIT,1,
SEQ_FADE,256,256,256,256, 0,30,
SEQ_SHIPINIT,
SEQ_BGZOOM,1,-16000,
SEQ_WAIT,1,
SEQ_BG_ON,
SEQ_BGZOOM,60, -7500,
SEQ_SHIPSTART,
SEQ_MSGSTART,
SEQ_PLAYVOICE,SND_VOICE_GETREADY,
SEQ_CHKVOICE,
SEQ_WAIT,15,
SEQ_TIMESTART,
SEQ_LOOPSET,16,
SEQ_SETENEMY,ENMEY_03,
SEQ_WAIT,15,
SEQ_LOOP,
SEQ_EWAIT,0,
SEQ_TIMESTOP,
SEQ_MSGCLEAR,
SEQ_PLAYVOICE,SND_VOICE_SCENE,
SEQ_CHKVOICE,
SEQ_SHIPLOCK,
SEQ_FADE,256,256,256, 0,256,60,
SEQ_BGZOOM,60,-16000,
SEQ_WAIT,60,
SEQ_BG_OFF,
SEQ_END,
];
private int[] seq_stg05 = [
SEQ_STGINIT,
SEQ_REQBGM,SND_BGM02,
SEQ_SETENESTG,2,
SEQ_SETENEMAX,2,
SEQ_SETBONUS,30*60,
SEQ_BG_SET,
SEQ_WAIT,1,
SEQ_FADE,256,256,256,256, 0,30,
SEQ_SHIPINIT,
SEQ_BGZOOM,1,-16000,
SEQ_WAIT,1,
SEQ_BG_ON,
SEQ_BGZOOM,60, -7500,
SEQ_SHIPSTART,
SEQ_MSGSTART,
SEQ_PLAYVOICE,SND_VOICE_GETREADY,
SEQ_CHKVOICE,
SEQ_WAIT,15,
SEQ_TIMESTART,
SEQ_SETENEMYID,MIDDLE_01,0,
SEQ_SETENEMYID,MIDDLE_01,1,
SEQ_EWAIT,0,
SEQ_TIMESTOP,
SEQ_MSGCLEAR,
SEQ_PLAYVOICE,SND_VOICE_SCENE,
SEQ_CHKVOICE,
SEQ_SHIPLOCK,
SEQ_FADE,256,256,256, 0,256,60,
SEQ_BGZOOM,60,-16000,
SEQ_WAIT,60,
SEQ_BG_OFF,
SEQ_END,
];
private int[] seq_stg06 = [
SEQ_STGINIT,
SEQ_REQBGM,SND_BGM02,
SEQ_SETENESTG,12,
SEQ_SETENEMAX,6,
SEQ_SETBONUS,24*60,
SEQ_BG_SET,
SEQ_WAIT,1,
SEQ_FADE,256,256,256,256, 0,30,
SEQ_SHIPINIT,
SEQ_BGZOOM,1,-16000,
SEQ_WAIT,1,
SEQ_BG_ON,
SEQ_BGZOOM,60, -7500,
SEQ_SHIPSTART,
SEQ_MSGSTART,
SEQ_PLAYVOICE,SND_VOICE_GETREADY,
SEQ_CHKVOICE,
SEQ_WAIT,15,
SEQ_TIMESTART,
SEQ_LOOPSET,8,
SEQ_SETENEMY,ENMEY_03,
SEQ_WAIT,15,
SEQ_LOOP,
SEQ_LOOPSET,4,
SEQ_SETENEMY,ENMEY_04,
SEQ_WAIT,15,
SEQ_LOOP,
SEQ_EWAIT,0,
SEQ_TIMESTOP,
SEQ_MSGCLEAR,
SEQ_PLAYVOICE,SND_VOICE_SCENE,
SEQ_CHKVOICE,
SEQ_SHIPLOCK,
SEQ_FADE,256,256,256, 0,256,60,
SEQ_BGZOOM,60,-16000,
SEQ_WAIT,60,
SEQ_BG_OFF,
SEQ_END,
];
private int[] seq_stg07 = [
SEQ_STGINIT,
SEQ_REQBGM,SND_BGM02,
SEQ_SETENESTG,16,
SEQ_SETENEMAX,8,
SEQ_SETBONUS,32*60,
SEQ_BG_SET,
SEQ_WAIT,1,
SEQ_FADE,256,256,256,256, 0,30,
SEQ_SHIPINIT,
SEQ_BGZOOM,1,-16000,
SEQ_WAIT,1,
SEQ_BG_ON,
SEQ_BGZOOM,60, -7500,
SEQ_SHIPSTART,
SEQ_MSGSTART,
SEQ_PLAYVOICE,SND_VOICE_GETREADY,
SEQ_CHKVOICE,
SEQ_WAIT,15,
SEQ_TIMESTART,
SEQ_LOOPSET,8,
SEQ_SETENEMY,ENMEY_03,
SEQ_WAIT,15,
SEQ_LOOP,
SEQ_LOOPSET,8,
SEQ_SETENEMY,ENMEY_04,
SEQ_WAIT,15,
SEQ_LOOP,
SEQ_EWAIT,0,
SEQ_TIMESTOP,
SEQ_MSGCLEAR,
SEQ_PLAYVOICE,SND_VOICE_SCENE,
SEQ_CHKVOICE,
SEQ_SHIPLOCK,
SEQ_FADE,256,256,256, 0,256,60,
SEQ_BGZOOM,60,-16000,
SEQ_WAIT,60,
SEQ_BG_OFF,
SEQ_END,
];
private int[] seq_stg08 = [
SEQ_STGINIT,
SEQ_REQBGM,SND_BGM02,
SEQ_SETENESTG,16,
SEQ_SETENEMAX,8,
SEQ_SETBONUS,32*60,
SEQ_BG_SET,
SEQ_WAIT,1,
SEQ_FADE,256,256,256,256, 0,30,
SEQ_SHIPINIT,
SEQ_BGZOOM,1,-16000,
SEQ_WAIT,1,
SEQ_BG_ON,
SEQ_BGZOOM,60, -7500,
SEQ_SHIPSTART,
SEQ_MSGSTART,
SEQ_PLAYVOICE,SND_VOICE_GETREADY,
SEQ_CHKVOICE,
SEQ_WAIT,15,
SEQ_TIMESTART,
SEQ_LOOPSET,4,
SEQ_SETENEMY,ENMEY_03,
SEQ_WAIT,15,
SEQ_LOOP,
SEQ_LOOPSET,12,
SEQ_SETENEMY,ENMEY_04,
SEQ_WAIT,15,
SEQ_LOOP,
SEQ_EWAIT,0,
SEQ_TIMESTOP,
SEQ_MSGCLEAR,
SEQ_PLAYVOICE,SND_VOICE_SCENE,
SEQ_CHKVOICE,
SEQ_SHIPLOCK,
SEQ_FADE,256,256,256, 0,256,60,
SEQ_BGZOOM,60,-16000,
SEQ_WAIT,60,
SEQ_BG_OFF,
SEQ_END,
];
private int[] seq_stg09 = [
SEQ_STGINIT,
SEQ_REQBGM,SND_BGM02,
SEQ_SETENESTG,24,
SEQ_SETENEMAX,8,
SEQ_SETBONUS,48*60,
SEQ_BG_SET,
SEQ_WAIT,1,
SEQ_FADE,256,256,256,256, 0,30,
SEQ_SHIPINIT,
SEQ_BGZOOM,1,-16000,
SEQ_WAIT,1,
SEQ_BG_ON,
SEQ_BGZOOM,60, -7500,
SEQ_SHIPSTART,
SEQ_MSGSTART,
SEQ_PLAYVOICE,SND_VOICE_GETREADY,
SEQ_CHKVOICE,
SEQ_WAIT,15,
SEQ_TIMESTART,
SEQ_LOOPSET,4,
SEQ_SETENEMY,ENMEY_01,
SEQ_WAIT,15,
SEQ_LOOP,
SEQ_LOOPSET,4,
SEQ_SETENEMY,ENMEY_02,
SEQ_WAIT,15,
SEQ_LOOP,
SEQ_LOOPSET,8,
SEQ_SETENEMY,ENMEY_03,
SEQ_WAIT,15,
SEQ_LOOP,
SEQ_LOOPSET,8,
SEQ_SETENEMY,ENMEY_04,
SEQ_WAIT,15,
SEQ_LOOP,
SEQ_EWAIT,0,
SEQ_TIMESTOP,
SEQ_MSGCLEAR,
SEQ_PLAYVOICE,SND_VOICE_SCENE,
SEQ_CHKVOICE,
SEQ_SHIPLOCK,
SEQ_FADE,256,256,256, 0,256,60,
SEQ_BGZOOM,60,-16000,
SEQ_WAIT,60,
SEQ_BG_OFF,
SEQ_END,
];
private int[] seq_stg10 = [
SEQ_STGINIT,
SEQ_STOPBGM,
SEQ_SETENESTG,1,
SEQ_SETENEMAX,1,
SEQ_SETBONUS,60*60,
SEQ_SHIPINIT,
SEQ_BOSSINIT,
SEQ_WAIT,1,
SEQ_SHIPOFF,
SEQ_BG_SET,
SEQ_WAIT,1,
SEQ_FADE,256,256,256,256, 0,30,
SEQ_BGZOOM,1,-16000,
SEQ_WAIT,1,
SEQ_BG_ON,
SEQ_BGZOOM,60, -7500,
SEQ_MSGSTART,
SEQ_PLAYVOICE,SND_VOICE_EMERGENCY,
SEQ_WAIT,90,
SEQ_SETENEMY,BOSS_02,
SEQ_BGZOOM,15, -12500,
SEQ_BGPOS,+0,-640,
SEQ_REQBGM,SND_BOSS01,
SEQ_CHKVOICE,
SEQ_WAIT,30,
SEQ_BOSSSTART,
SEQ_SHIPSTART,
SEQ_BGZOOM,60, -7500,
SEQ_WAIT,60,
SEQ_PLAYVOICE,SND_VOICE_GETREADY,
SEQ_CHKVOICE,
SEQ_WAIT,15,
SEQ_TIMESTART,
SEQ_BOSSWAIT,
SEQ_SHIPMUTEKI,
SEQ_STOPBGM,
SEQ_TIMESTOP,
SEQ_EWAIT,0,
SEQ_MSGCLEAR,
SEQ_PLAYVOICE,SND_VOICE_AREA,
SEQ_CHKVOICE,
SEQ_SHIPLOCK,
SEQ_FADE,256,256,256, 0,256,60,
SEQ_BGZOOM,60,-16000,
SEQ_WAIT,60,
SEQ_BG_OFF,
SEQ_WAIT,1,
SEQ_BG_CLR,
SEQ_END,
];
void TSKstg02(int id)
{
switch(TskBuf[id].step){
case 0:
SEQinit();
switch(scene_num){
case SCENE_01:
seq_stgexec = seq_stg01;
break;
case SCENE_02:
seq_stgexec = seq_stg02;
break;
case SCENE_03:
seq_stgexec = seq_stg03;
break;
case SCENE_04:
seq_stgexec = seq_stg04;
break;
case SCENE_05:
seq_stgexec = seq_stg05;
break;
case SCENE_06:
seq_stgexec = seq_stg06;
break;
case SCENE_07:
seq_stgexec = seq_stg07;
break;
case SCENE_08:
seq_stgexec = seq_stg08;
break;
case SCENE_09:
seq_stgexec = seq_stg09;
break;
case SCENE_10:
default:
seq_stgexec = seq_stg10;
break;
}
seq_top = 0;
TskBuf[id].step++;
break;
case 1:
if(stg_ctrl != STG_MAIN) break;
if(seq_wait){
seq_wait--;
break;
}
if((seq_stg = SEQexec(seq_stg)) == -1){
stg_ctrl = STG_CLEAR;
TskBuf[id].step = -1;
}
break;
default:
clrTSK(id);
break;
}
return;
}
|
D
|
/Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Intermediates.noindex/ChousainPlus.build/Debug-iphonesimulator/ChousainPlus.build/Objects-normal/x86_64/PlaneNode.o : /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/RecordData.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/Grid.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/node/PlaneNode.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/node/TextNode.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/node/BoxNode.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/ResearchStage.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/WhiteboardRuleLine.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/CameraLocate.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/PhotoLocate.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/AppDelegate.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/Building.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/Research.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/BuildingTableCell.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/ReserchTableCell.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/PhotoTableCell.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/Photo.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/RoomMap.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/PhotoManager.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/HttpManager.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/LoginController.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/PhotoController.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/ResearchListController.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/CameraViewController.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/SyncViewController.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/UploadViewController.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/WhiteBoardViewController.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/PhotoViewController.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/EditPhotoViewController.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/WorldMapViewController.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/CameraCloseupViewController.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/Owner.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/WhiteBoardMaster.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/PhotoNew.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/Dictionary.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/WhiteBoardDictionary.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftmodule /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/RealmSwift/RealmSwift.framework/Modules/RealmSwift.swiftmodule/x86_64.swiftmodule /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/LNZTreeView/LNZTreeView.framework/Modules/LNZTreeView.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ModelIO.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreMedia.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/simd.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/AVFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreAudio.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/GLKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ARKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SceneKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SpriteKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/RealmSwift/RealmSwift.framework/Headers/RealmSwift-umbrella.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/LNZTreeView/LNZTreeView.framework/Headers/LNZTreeView-umbrella.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSchema.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMObjectSchema.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMObjectBase_Dynamic.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMRealm_Dynamic.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMRealm+Sync.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMRealmConfiguration+Sync.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/NSError+RLMSync.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMThreadSafeReference.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Carthage/Build/iOS/Alamofire.framework/Headers/Alamofire.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMObjectStore.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMOptionalBase.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMObjectBase.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMListBase.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMSchema_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMObjectSchema_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMObjectBase_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMSyncUtil_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMRealm_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMSyncConfiguration_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMRealmConfiguration_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMCollection_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMResults_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMObject_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMArray_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMProperty_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncUtil.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/Realm.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMRealm.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMPlatform.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncSession.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncPermission.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMMigration.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncConfiguration.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMRealmConfiguration.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMCollection.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncSubscription.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncManager.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncUser.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMAccessor.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncCredentials.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMResults.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMConstants.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMObject.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Carthage/Build/iOS/Alamofire.framework/Headers/Alamofire-Swift.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/RealmSwift/RealmSwift.framework/Headers/RealmSwift-Swift.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/LNZTreeView/LNZTreeView.framework/Headers/LNZTreeView-Swift.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMArray.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMProperty.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Carthage/Build/iOS/Alamofire.framework/Modules/module.modulemap /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Modules/module.modulemap /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/RealmSwift/RealmSwift.framework/Modules/module.modulemap /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/LNZTreeView/LNZTreeView.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/ModelIO.framework/Headers/ModelIO.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/GLKit.framework/Headers/GLKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/SceneKit.framework/Headers/SceneKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/SpriteKit.framework/Headers/SpriteKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Intermediates.noindex/ChousainPlus.build/Debug-iphonesimulator/ChousainPlus.build/Objects-normal/x86_64/PlaneNode~partial.swiftmodule : /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/RecordData.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/Grid.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/node/PlaneNode.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/node/TextNode.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/node/BoxNode.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/ResearchStage.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/WhiteboardRuleLine.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/CameraLocate.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/PhotoLocate.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/AppDelegate.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/Building.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/Research.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/BuildingTableCell.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/ReserchTableCell.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/PhotoTableCell.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/Photo.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/RoomMap.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/PhotoManager.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/HttpManager.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/LoginController.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/PhotoController.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/ResearchListController.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/CameraViewController.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/SyncViewController.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/UploadViewController.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/WhiteBoardViewController.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/PhotoViewController.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/EditPhotoViewController.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/WorldMapViewController.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/CameraCloseupViewController.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/Owner.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/WhiteBoardMaster.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/PhotoNew.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/Dictionary.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/WhiteBoardDictionary.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftmodule /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/RealmSwift/RealmSwift.framework/Modules/RealmSwift.swiftmodule/x86_64.swiftmodule /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/LNZTreeView/LNZTreeView.framework/Modules/LNZTreeView.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ModelIO.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreMedia.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/simd.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/AVFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreAudio.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/GLKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ARKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SceneKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SpriteKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/RealmSwift/RealmSwift.framework/Headers/RealmSwift-umbrella.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/LNZTreeView/LNZTreeView.framework/Headers/LNZTreeView-umbrella.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSchema.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMObjectSchema.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMObjectBase_Dynamic.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMRealm_Dynamic.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMRealm+Sync.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMRealmConfiguration+Sync.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/NSError+RLMSync.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMThreadSafeReference.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Carthage/Build/iOS/Alamofire.framework/Headers/Alamofire.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMObjectStore.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMOptionalBase.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMObjectBase.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMListBase.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMSchema_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMObjectSchema_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMObjectBase_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMSyncUtil_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMRealm_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMSyncConfiguration_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMRealmConfiguration_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMCollection_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMResults_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMObject_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMArray_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMProperty_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncUtil.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/Realm.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMRealm.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMPlatform.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncSession.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncPermission.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMMigration.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncConfiguration.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMRealmConfiguration.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMCollection.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncSubscription.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncManager.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncUser.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMAccessor.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncCredentials.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMResults.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMConstants.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMObject.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Carthage/Build/iOS/Alamofire.framework/Headers/Alamofire-Swift.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/RealmSwift/RealmSwift.framework/Headers/RealmSwift-Swift.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/LNZTreeView/LNZTreeView.framework/Headers/LNZTreeView-Swift.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMArray.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMProperty.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Carthage/Build/iOS/Alamofire.framework/Modules/module.modulemap /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Modules/module.modulemap /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/RealmSwift/RealmSwift.framework/Modules/module.modulemap /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/LNZTreeView/LNZTreeView.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/ModelIO.framework/Headers/ModelIO.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/GLKit.framework/Headers/GLKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/SceneKit.framework/Headers/SceneKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/SpriteKit.framework/Headers/SpriteKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Intermediates.noindex/ChousainPlus.build/Debug-iphonesimulator/ChousainPlus.build/Objects-normal/x86_64/PlaneNode~partial.swiftdoc : /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/RecordData.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/Grid.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/node/PlaneNode.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/node/TextNode.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/node/BoxNode.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/ResearchStage.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/WhiteboardRuleLine.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/CameraLocate.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/PhotoLocate.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/AppDelegate.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/Building.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/Research.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/BuildingTableCell.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/ReserchTableCell.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/PhotoTableCell.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/Photo.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/RoomMap.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/PhotoManager.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/HttpManager.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/LoginController.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/PhotoController.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/ResearchListController.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/CameraViewController.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/SyncViewController.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/UploadViewController.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/WhiteBoardViewController.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/PhotoViewController.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/EditPhotoViewController.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/WorldMapViewController.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/CameraCloseupViewController.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/Owner.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/WhiteBoardMaster.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/PhotoNew.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/Dictionary.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/ChousainPlus/model/WhiteBoardDictionary.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftmodule /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/RealmSwift/RealmSwift.framework/Modules/RealmSwift.swiftmodule/x86_64.swiftmodule /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/LNZTreeView/LNZTreeView.framework/Modules/LNZTreeView.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ModelIO.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreMedia.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/simd.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/AVFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreAudio.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/GLKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ARKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SceneKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SpriteKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/RealmSwift/RealmSwift.framework/Headers/RealmSwift-umbrella.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/LNZTreeView/LNZTreeView.framework/Headers/LNZTreeView-umbrella.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSchema.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMObjectSchema.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMObjectBase_Dynamic.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMRealm_Dynamic.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMRealm+Sync.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMRealmConfiguration+Sync.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/NSError+RLMSync.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMThreadSafeReference.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Carthage/Build/iOS/Alamofire.framework/Headers/Alamofire.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMObjectStore.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMOptionalBase.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMObjectBase.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMListBase.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMSchema_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMObjectSchema_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMObjectBase_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMSyncUtil_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMRealm_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMSyncConfiguration_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMRealmConfiguration_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMCollection_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMResults_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMObject_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMArray_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMProperty_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncUtil.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/Realm.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMRealm.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMPlatform.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncSession.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncPermission.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMMigration.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncConfiguration.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMRealmConfiguration.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMCollection.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncSubscription.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncManager.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncUser.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMAccessor.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncCredentials.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMResults.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMConstants.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMObject.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Carthage/Build/iOS/Alamofire.framework/Headers/Alamofire-Swift.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/RealmSwift/RealmSwift.framework/Headers/RealmSwift-Swift.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/LNZTreeView/LNZTreeView.framework/Headers/LNZTreeView-Swift.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMArray.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMProperty.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Carthage/Build/iOS/Alamofire.framework/Modules/module.modulemap /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Modules/module.modulemap /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/RealmSwift/RealmSwift.framework/Modules/module.modulemap /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/LNZTreeView/LNZTreeView.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/ModelIO.framework/Headers/ModelIO.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/GLKit.framework/Headers/GLKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/SceneKit.framework/Headers/SceneKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/SpriteKit.framework/Headers/SpriteKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
indecision in speech or action
a certain degree of unwillingness
the act of pausing uncertainly
|
D
|
/Users/yuxiangtang1/Documents/30DaysOfSwift/CustomFont/build/CustomFont.build/Debug-iphoneos/CustomFont.build/Objects-normal/armv7/AppDelegate.o : /Users/yuxiangtang1/Documents/30DaysOfSwift/CustomFont/CustomFont/ViewController.swift /Users/yuxiangtang1/Documents/30DaysOfSwift/CustomFont/CustomFont/AppDelegate.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/CoreData.swiftmodule
/Users/yuxiangtang1/Documents/30DaysOfSwift/CustomFont/build/CustomFont.build/Debug-iphoneos/CustomFont.build/Objects-normal/armv7/AppDelegate~partial.swiftmodule : /Users/yuxiangtang1/Documents/30DaysOfSwift/CustomFont/CustomFont/ViewController.swift /Users/yuxiangtang1/Documents/30DaysOfSwift/CustomFont/CustomFont/AppDelegate.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/CoreData.swiftmodule
/Users/yuxiangtang1/Documents/30DaysOfSwift/CustomFont/build/CustomFont.build/Debug-iphoneos/CustomFont.build/Objects-normal/armv7/AppDelegate~partial.swiftdoc : /Users/yuxiangtang1/Documents/30DaysOfSwift/CustomFont/CustomFont/ViewController.swift /Users/yuxiangtang1/Documents/30DaysOfSwift/CustomFont/CustomFont/AppDelegate.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/CoreData.swiftmodule
|
D
|
// PERMUTE_ARGS:
module breaker;
import core.stdc.stdio, core.vararg;
/**********************************/
U foo(T, U)(U i)
{
return i + 1;
}
int foo(T)(int i)
{
return i + 2;
}
void test1()
{
auto i = foo!(int)(2L);
// assert(i == 4); // now returns 3
}
/**********************************/
U foo2(T, U)(U i)
{
return i + 1;
}
void test2()
{
auto i = foo2!(int)(2L);
assert(i == 3);
}
/**********************************/
class Foo3
{
T bar(T,U)(U u)
{
return cast(T)u;
}
}
void test3()
{
Foo3 foo = new Foo3;
int i = foo.bar!(int)(1.0);
assert(i == 1);
}
/**********************************/
T* begin4(T)(T[] a) { return a.ptr; }
void copy4(string pred = "", Ranges...)(Ranges rs)
{
alias rs[$ - 1] target;
pragma(msg, typeof(target).stringof);
auto tb = begin4(target);//, te = end(target);
}
void test4()
{
int[] a, b, c;
copy4(a, b, c);
// comment the following line to prevent compiler from crashing
copy4!("a > 1")(a, b, c);
}
/**********************************/
import std.stdio:writefln;
template foo5(T,S)
{
void foo5(T t, S s) {
writefln("typeof(T)=",typeid(T)," typeof(S)=",typeid(S));
}
}
template bar5(T,S)
{
void bar5(S s) {
writefln("typeof(T)=",typeid(T),"typeof(S)=",typeid(S));
}
}
void test5()
{
foo5(1.0,33);
bar5!(double,int)(33);
bar5!(float)(33);
}
/**********************************/
int foo6(T...)(auto ref T x)
{ int result;
foreach (i, v; x)
{
if (v == 10)
assert(__traits(isRef, x[i]));
else
assert(!__traits(isRef, x[i]));
result += v;
}
return result;
}
void test6()
{ int y = 10;
int r;
r = foo6(8);
assert(r == 8);
r = foo6(y);
assert(r == 10);
r = foo6(3, 4, y);
assert(r == 17);
r = foo6(4, 5, y);
assert(r == 19);
r = foo6(y, 6, y);
assert(r == 26);
}
/**********************************/
auto ref min(T, U)(auto ref T lhs, auto ref U rhs)
{
return lhs > rhs ? rhs : lhs;
}
void test7()
{ int x = 7, y = 8;
int i;
i = min(4, 3);
assert(i == 3);
i = min(x, y);
assert(i == 7);
min(x, y) = 10;
assert(x == 10);
static assert(!__traits(compiles, min(3, y) = 10));
static assert(!__traits(compiles, min(y, 3) = 10));
}
/**********************************/
// 5946
template TTest8()
{
int call(){ return this.g(); }
}
class CTest8
{
int f() { mixin TTest8!(); return call(); }
int g() { return 10; }
}
void test8()
{
assert((new CTest8()).f() == 10);
}
/**********************************/
// 693
template TTest9(alias sym)
{
int call(){ return sym.g(); }
}
class CTest9
{
int f1() { mixin TTest9!(this); return call(); }
int f2() { mixin TTest9!this; return call(); }
int g() { return 10; }
}
void test9()
{
assert((new CTest9()).f1() == 10);
assert((new CTest9()).f2() == 10);
}
/**********************************/
// 1780
template Tuple1780(Ts ...) { alias Ts Tuple1780; }
template Decode1780( T ) { alias Tuple1780!() Types; }
template Decode1780( T : TT!(Us), alias TT, Us... ) { alias Us Types; }
void test1780()
{
struct S1780(T1, T2) {}
// should extract tuple (bool,short) but matches the first specialisation
alias Decode1780!( S1780!(bool,short) ).Types SQ1780; // --> SQ2 is empty tuple!
static assert(is(SQ1780 == Tuple1780!(bool, short)));
}
/**********************************/
// 1659
class Foo1659 { }
class Bar1659 : Foo1659 { }
void f1659(T : Foo1659)() { }
void f1659(alias T)() { static assert(false); }
void test1659()
{
f1659!Bar1659();
}
/**********************************/
// 2025
struct S2025 {}
void f2025() {}
template Foo2025(int i) { enum Foo2025 = 1; }
template Foo2025(TL...) { enum Foo2025 = 2; }
static assert(Foo2025!1 == 1);
static assert(Foo2025!int == 2);
static assert(Foo2025!S2025 == 2);
static assert(Foo2025!f2025 == 2);
template Bar2025(T) { enum Bar2025 = 1; }
template Bar2025(A...) { enum Bar2025 = 2; }
static assert(Bar2025!1 == 2);
static assert(Bar2025!int == 1); // 2 -> 1
static assert(Bar2025!S2025 == 1); // 2 -> 1
static assert(Bar2025!f2025 == 2);
template Baz2025(T) { enum Baz2025 = 1; }
template Baz2025(alias A) { enum Baz2025 = 2; }
static assert(Baz2025!1 == 2);
static assert(Baz2025!int == 1);
static assert(Baz2025!S2025 == 1); // 2 -> 1
static assert(Baz2025!f2025 == 2);
/**********************************/
// 3608
template foo3608(T, U){}
template BaseTemplate3608(alias TTT : U!V, alias U, V...)
{
alias U BaseTemplate3608;
}
template TemplateParams3608(alias T : U!V, alias U, V...)
{
alias V TemplateParams3608;
}
template TyueTuple3608(T...) { alias T TyueTuple3608; }
void test3608()
{
alias foo3608!(int, long) Foo3608;
static assert(__traits(isSame, BaseTemplate3608!Foo3608, foo3608));
static assert(is(TemplateParams3608!Foo3608 == TyueTuple3608!(int, long)));
}
/**********************************/
// 5015
import breaker;
static if (is(ElemType!(int))){}
template ElemType(T) {
alias _ElemType!(T).type ElemType;
}
template _ElemType(T) {
alias r type;
}
/**********************************/
// 5185
class C5185(V)
{
void f()
{
C5185!(C5185!(int)) c;
}
}
void test5185()
{
C5185!(C5185!(int)) c;
}
/**********************************/
// 5893
class C5893
{
int concatAssign(C5893 other) { return 1; }
int concatAssign(int other) { return 2; } // to demonstrate overloading
template opOpAssign(string op) if (op == "~")
{ alias concatAssign opOpAssign; }
int opOpAssign(string op)(int other) if (op == "+") { return 3; }
}
void test5893()
{
auto c = new C5893;
assert(c.opOpAssign!"~"(c) == 1); // works
assert(c.opOpAssign!"~"(1) == 2); // works
assert((c ~= 1) == 2);
assert((c += 1) == 3); // overload
}
/**********************************/
// 5988
template Templ5988(alias T)
{
alias T!int Templ5988;
}
class C5988a(T) { Templ5988!C5988a foo; }
//Templ5988!C5988a foo5988a; // Commented version
void test5988a() { C5988a!int a; } // Was error, now works
class C5988b(T) { Templ5988!C5988b foo; }
Templ5988!C5988b foo5988b; // Uncomment version
void test5988b() { C5988b!int a; } // Works
/**********************************/
// 6404
// receive only rvalue
void rvalue(T)(auto ref T x) if (!__traits(isRef, x)) {}
void rvalueVargs(T...)(auto ref T x) if (!__traits(isRef, x[0])) {}
// receive only lvalue
void lvalue(T)(auto ref T x) if ( __traits(isRef, x)) {}
void lvalueVargs(T...)(auto ref T x) if ( __traits(isRef, x[0])) {}
void test6404()
{
int n;
static assert(!__traits(compiles, rvalue(n)));
static assert( __traits(compiles, rvalue(0)));
static assert( __traits(compiles, lvalue(n)));
static assert(!__traits(compiles, lvalue(0)));
static assert(!__traits(compiles, rvalueVargs(n)));
static assert( __traits(compiles, rvalueVargs(0)));
static assert( __traits(compiles, lvalueVargs(n)));
static assert(!__traits(compiles, lvalueVargs(0)));
}
/**********************************/
// 2246
class A2246(T,d){
T p;
}
class B2246(int rk){
int[rk] p;
}
class C2246(T,int rk){
T[rk] p;
}
template f2246(T:A2246!(U,d),U,d){
void f2246(){ }
}
template f2246(T:B2246!(rank),int rank){
void f2246(){ }
}
template f2246(T:C2246!(U,rank),U,int rank){
void f2246(){ }
}
void test2246(){
A2246!(int,long) a;
B2246!(2) b;
C2246!(int,2) c;
f2246!(A2246!(int,long))();
f2246!(B2246!(2))();
f2246!(C2246!(int,2))();
}
/**********************************/
// 2296
void foo2296(size_t D)(int[D] i...){}
void test2296()
{
foo2296(1, 2, 3);
}
/**********************************/
// 1684
template Test1684( uint memberOffset ){}
class MyClass1684 {
int flags2;
mixin Test1684!(cast(uint)flags2.offsetof) t1; // compiles ok
mixin Test1684!(cast(int)flags2.offsetof) t2; // compiles ok
mixin Test1684!(flags2.offsetof) t3; // Error: no property 'offsetof' for type 'int'
}
/**********************************/
void bug4984a(int n)() if (n > 0 && is(typeof(bug4984a!(n-1) ()))) {
}
void bug4984a(int n : 0)() {
}
void bug4984b(U...)(U args) if ( is(typeof( bug4984b(args[1..$]) )) ) {
}
void bug4984b(U)(U u) {
}
void bug4984() {
// Note: compiling this overflows the stack if dmd is build with DEBUG
//bug4984a!400();
bug4984a!200();
bug4984b(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19);
}
/***************************************/
// 2579
void foo2579(T)(T delegate(in Object) dlg)
{
}
void test2579()
{
foo2579( (in Object o) { return 15; } );
}
/**********************************/
// 2803
auto foo2803(T)(T t = 0) { return t; }
struct S2803 {}
S2803 s2803;
ref S2803 getS2803() { return s2803; }
auto fun2803(T, U)(T t, ref U u = getS2803)
{
static assert(is(U == S2803));
return &u;
}
// from the past version of std.conv
template to2803(T) { T to2803(S)(S src) { return T.init; } }
auto toImpl2803a(T, S)(S s, in T left, in T sep = ", ", in T right = "]") {}
auto toImpl2803b(T, S)(S s, in T left = to2803!T(S.stringof~"("), in T right = ")") {}
auto toImpl2803c(T, S)(S s, in T left = S.stringof~"(" , in T right = ")") {} // combination with enh 13944
// from std.range.package in 2.067a.
auto enumerate2803(En = size_t, R)(R r, En start = 0)
{
// The type of 'start' should be size_t, it's the defaultArg of En,
// rather than the deduced type from its defualtArg '0'.
static assert(is(typeof(start) == size_t));
return start;
}
// from std.numeric.
alias ElementType2803(R) = typeof(R.init[0].init);
void normalize2803(R)(R range, ElementType2803!R sum = 1)
{
// The type of 'sum' should be determined to ElementType!(double[]) == double
// before the type deduction from its defaultArg '1'.
static assert(is(typeof(sum) == double));
}
auto foo14468(T)(T[]...) { return 1; }
auto foo14468(bool flag, T)(T[]...) { return 2; }
void test2803()
{
assert(foo2803() == 0);
assert(foo2803(1) == 1);
S2803 s;
assert(fun2803(1) is &s2803);
assert(fun2803(1, s) is &s);
// regression cases
toImpl2803a!string(1, "[");
toImpl2803b! string(1);
toImpl2803b!wstring(1);
toImpl2803b!dstring(1);
toImpl2803c! string(1);
toImpl2803c!wstring(1); // requires enhancement 13944
toImpl2803c!dstring(1); // requires enhancement 13944
enumerate2803([1]);
double[] a = [];
normalize2803(a);
assert(foo14468!int() == 1);
}
/**********************************/
// 6613
alias Tuple6613(T...) = T;
void f6613(T...)(int x = 0, T xs = Tuple6613!())
{
assert(x == 0);
static assert(T.length == 0);
}
void test6613()
{
f6613();
}
/**********************************/
// 4953
void bug4953(T = void)(short x) {}
static assert(is(typeof(bug4953(3))));
/**********************************/
// 5886 & 5393
mixin template Foo5886(T)
{
void foo(U : T, this X)() const { static assert(is(X == const K5886)); }
}
struct K5886
{
void get1(this T)() const
{
pragma(msg, T);
}
void get2(int N=4, this T)() const
{
pragma(msg, N, " ; ", T);
}
mixin Foo5886!double;
mixin Foo5886!string;
void test() const
{
get1; // OK
get2; // OK
get2!8; // NG
foo!(int);
foo!(typeof(null));
}
}
void test5886()
{
K5886 km;
const(K5886) kc;
immutable(K5886) ki;
km.get1; // OK
kc.get1; // OK
ki.get1; // OK
km.get2; // OK
kc.get2; // OK
ki.get2; // OK
km.get2!(1, K5886); // Ugly
kc.get2!(2, const(K5886)); // Ugly
ki.get2!(3, immutable(K5886)); // Ugly
km.get2!8; // Error
kc.get2!9; // Error
ki.get2!10; // Error
}
// --------
void test5393()
{
class A
{
void opDispatch (string name, this T) () { }
}
class B : A {}
auto b = new B;
b.foobar();
}
/**********************************/
// 5896
struct X5896
{
T opCast(T)(){ return 1; }
const T opCast(T)(){ return 2; }
immutable T opCast(T)(){ return 3; }
shared T opCast(T)(){ return 4; }
const shared T opCast(T)(){ return 5; }
}
void test5896()
{
auto xm = X5896 ();
auto xc = const(X5896) ();
auto xi = immutable(X5896) ();
auto xs = shared(X5896) ();
auto xcs= const(shared(X5896))();
assert(cast(int)xm == 1);
assert(cast(int)xc == 2);
assert(cast(int)xi == 3);
assert(cast(int)xs == 4);
assert(cast(int)xcs== 5);
}
/**********************************/
// 6312
void h6312() {}
class Bla6312
{
mixin wrap6312!h6312;
}
mixin template wrap6312(alias f)
{
void blub(alias g = f)()
{
g();
}
}
void test6312()
{
Bla6312 b = new Bla6312();
b.blub();
}
/**********************************/
// 6825
void test6825()
{
struct File
{
void write(S...)(S args) {}
}
void dump(void delegate(string) d) {}
auto o = File();
dump(&o.write!string);
}
/**********************************/
// 6789
template isStaticArray6789(T)
{
static if (is(T U : U[N], size_t N)) // doesn't match
{
pragma(msg, "> U = ", U, ", N:", typeof(N), " = ", N);
enum isStaticArray6789 = true;
}
else
enum isStaticArray6789 = false;
}
void test6789()
{
alias int[3] T;
static assert(isStaticArray6789!T);
}
/**********************************/
// 2778
struct ArrayWrapper2778(T)
{
T[] data;
alias data this;
}
void doStuffFunc2778(int[] data) {}
void doStuffTempl2778(T)(T[] data) {}
int doStuffTemplOver2778(T)(void* data) { return 1; }
int doStuffTemplOver2778(T)(ArrayWrapper2778!T w) { return 2; }
void test2778()
{
ArrayWrapper2778!(int) foo;
doStuffFunc2778(foo); // Works.
doStuffTempl2778!(int)(foo); // Works.
doStuffTempl2778(foo); // Error
assert(doStuffTemplOver2778(foo) == 2);
}
// ----
void test2778aa()
{
void foo(K, V)(V[K] aa){ pragma(msg, "K=", K, ", V=", V); }
int[string] aa1;
foo(aa1); // OK
struct SubTypeOf(T)
{
T val;
alias val this;
}
SubTypeOf!(string[char]) aa2;
foo(aa2); // NG
}
// ----
void test2778get()
{
void foo(ubyte[]){}
static struct S
{
ubyte[] val = [1,2,3];
@property ref ubyte[] get(){ return val; }
alias get this;
}
S s;
foo(s);
}
/**********************************/
// 6208
int getRefNonref(T)(ref T s){ return 1; }
int getRefNonref(T)( T s){ return 2; }
int getAutoRef(T)(auto ref T s){ return __traits(isRef, s) ? 1 : 2; }
void getOut(T)(out T s){ ; }
void getLazy1(T=int)(lazy void s){ s(), s(); }
void getLazy2(T)(lazy T s){ s(), s(); }
void test6208a()
{
int lvalue;
int rvalue(){ int t; return t; }
assert(getRefNonref(lvalue ) == 1);
assert(getRefNonref(rvalue()) == 2);
assert(getAutoRef(lvalue ) == 1);
assert(getAutoRef(rvalue()) == 2);
static assert( __traits(compiles, getOut(lvalue )));
static assert(!__traits(compiles, getOut(rvalue())));
int n1; getLazy1(++n1); assert(n1 == 2);
int n2; getLazy2(++n2); assert(n2 == 2);
struct X
{
int f(T)(auto ref T t){ return 1; }
int f(T)(auto ref T t, ...){ return -1; }
}
auto xm = X ();
auto xc = const(X)();
int n;
assert(xm.f!int(n) == 1); // resolved 'auto ref'
assert(xm.f!int(0) == 1); // ditto
}
void test6208b()
{
void foo(T)(const T value) if (!is(T == int)) {}
int mn;
const int cn;
static assert(!__traits(compiles, foo(mn))); // OK -> OK
static assert(!__traits(compiles, foo(cn))); // NG -> OK
}
void test6208c()
{
struct S
{
// Original test case.
int foo(V)(in V v) { return 1; }
int foo(Args...)(auto ref const Args args) { return 2; }
// Reduced test cases
int hoo(V)(const V v) { return 1; } // typeof(10) : const V -> MATCHconst
int hoo(Args...)(const Args args) { return 2; } // typeof(10) : const Args[0] -> MATCHconst
// If deduction matching level is same, tuple parameter is less specialized than others.
int bar(V)(V v) { return 1; } // typeof(10) : V -> MATCHexact
int bar(Args...)(const Args args) { return 2; } // typeof(10) : const Args[0] -> MATCHconst
int baz(V)(const V v) { return 1; } // typeof(10) : const V -> MATCHconst
int baz(Args...)(Args args) { return 2; } // typeof(10) : Args[0] -> MATCHexact
inout(int) war(V)(inout V v) { return 1; }
inout(int) war(Args...)(inout Args args){ return 2; }
inout(int) waz(Args...)(inout Args args){ return 0; } // wild deduction test
}
S s;
int nm = 10;
assert(s.foo(nm) == 1);
assert(s.hoo(nm) == 1);
assert(s.bar(nm) == 1);
assert(s.baz(nm) == 2);
assert(s.war(nm) == 1);
static assert(is(typeof(s.waz(nm)) == int));
const int nc = 10;
assert(s.foo(nc) == 1);
assert(s.hoo(nc) == 1);
assert(s.bar(nc) == 1);
assert(s.baz(nc) == 1);
assert(s.war(nc) == 1);
static assert(is(typeof(s.waz(nc)) == const(int)));
immutable int ni = 10;
assert(s.foo(ni) == 1);
assert(s.hoo(ni) == 1);
assert(s.bar(ni) == 1);
assert(s.baz(ni) == 2);
assert(s.war(ni) == 1);
static assert(is(typeof(s.waz(ni)) == immutable(int)));
static assert(is(typeof(s.waz(nm, nm)) == int));
static assert(is(typeof(s.waz(nm, nc)) == const(int)));
static assert(is(typeof(s.waz(nm, ni)) == const(int)));
static assert(is(typeof(s.waz(nc, nm)) == const(int)));
static assert(is(typeof(s.waz(nc, nc)) == const(int)));
static assert(is(typeof(s.waz(nc, ni)) == const(int)));
static assert(is(typeof(s.waz(ni, nm)) == const(int)));
static assert(is(typeof(s.waz(ni, nc)) == const(int)));
static assert(is(typeof(s.waz(ni, ni)) == immutable(int)));
}
/**********************************/
// 6805
struct T6805
{
template opDispatch(string name)
{
alias int Type;
}
}
static assert(is(T6805.xxx.Type == int));
/**********************************/
// 6738
struct Foo6738
{
int _val = 10;
@property int val()() { return _val; }
int get() { return val; } // fail
}
void test6738()
{
Foo6738 foo;
auto x = foo.val; // ok
assert(x == 10);
assert(foo.get() == 10);
}
/**********************************/
// 7498
template IndexMixin(){
void insert(T)(T value){ }
}
class MultiIndexContainer{
mixin IndexMixin!() index0;
class Index0{
void baburk(){
this.outer.index0.insert(1);
}
}
}
/**********************************/
// 6780
@property int foo6780()(){ return 10; }
int g6780;
@property void bar6780()(int n){ g6780 = n; }
void test6780()
{
auto n = foo6780;
assert(n == 10);
bar6780 = 10;
assert(g6780 == 10);
}
/**********************************/
// 6810
int f6810(int n)(int) { return 1;}
int f6810(U...)(U) { assert(0); }
int f6810(U...)(U a) { assert(0); }
int f6810(U...)(U) if (true) { assert(0); }
int f6810(U...)(U a) if (true) { assert(0); }
void test6810()
{
assert(f6810!0(0) == 1);
}
/**********************************/
// 6891
struct S6891(int N, T)
{
void f(U)(S6891!(N, U) u) { }
}
void test6891()
{
alias S6891!(1, void) A;
A().f(A());
}
/**********************************/
// 6994
struct Foo6994
{
T get(T)(){ return T.init; }
T func1(T)()
if (__traits(compiles, get!T()))
{ return get!T; }
T func2(T)()
if (__traits(compiles, this.get!T())) // add explicit 'this'
{ return get!T; }
}
void test6994()
{
Foo6994 foo;
foo.get!int(); // OK
foo.func1!int(); // OK
foo.func2!int(); // NG
}
/**********************************/
// 6764
enum N6764 = 1; //use const for D1
alias size_t[N6764] T6764; //workaround
void f6764()(T6764 arr...) { }
void g6764()(size_t[1] arr...) { }
void h6764()(size_t[N6764] arr...) { }
void test6764()
{
f6764(0); //good
g6764(0); //good
h6764!()(0); //good
h6764(0); //Error: template main.f() does not match any function template declaration
}
/**********************************/
// 3467 & 6806
struct Foo3467( uint n )
{
Foo3467!( n ) bar( ) {
typeof( return ) result;
return result;
}
}
struct Vec3467(size_t N)
{
void opBinary(string op:"~", size_t M)(Vec3467!M) {}
}
void test3467()
{
Foo3467!( 4 ) baz;
baz = baz.bar;// FAIL
Vec3467!2 a1;
Vec3467!3 a2;
a1 ~ a2; // line 7, Error
}
struct TS6806(size_t n) { pragma(msg, typeof(n)); }
static assert(is(TS6806!(1u) == TS6806!(1)));
/**********************************/
// 4413
struct Foo4413
{
alias typeof(this) typeof_this;
void bar1(typeof_this other) {}
void bar2()(typeof_this other) {}
void bar3(typeof(this) other) {}
void bar4()(typeof(this) other) {}
}
void test4413()
{
Foo4413 f;
f.bar1(f); // OK
f.bar2(f); // OK
f.bar3(f); // OK
f.bar4(f); // ERR
}
/**********************************/
// 4675
template isNumeric(T)
{
enum bool test1 = is(T : long); // should be hidden
enum bool test2 = is(T : real); // should be hidden
enum bool isNumeric = test1 || test2;
}
void test4675()
{
static assert( isNumeric!int);
static assert(!isNumeric!string);
static assert(!__traits(compiles, isNumeric!int.test1)); // should be an error
static assert(!__traits(compiles, isNumeric!int.test2)); // should be an error
static assert(!__traits(compiles, isNumeric!int.isNumeric));
}
/**********************************/
// 5525
template foo5525(T)
{
T foo5525(T t) { return t; }
T foo5525(T t, T u) { return t + u; }
}
void test5525()
{
alias foo5525!int f;
assert(f(1) == 1);
assert(f(1, 2) == 3);
}
/**********************************/
// 5801
int a5801;
void bar5801(T = double)(typeof(a5801) i) {}
void baz5801(T)(typeof(a5801) i, T t) {}
void test5801()
{
bar5801(2); // Does not compile.
baz5801(3, "baz"); // Does not compile.
}
/**********************************/
// 5832
struct Bar5832(alias v) {}
template isBar5832a(T)
{
static if (is(T _ : Bar5832!(v), alias v))
enum isBar5832a = true;
else
enum isBar5832a = false;
}
template isBar5832b(T)
{
static if (is(T _ : Bar5832!(v), alias int v))
enum isBar5832b = true;
else
enum isBar5832b = false;
}
template isBar5832c(T)
{
static if (is(T _ : Bar5832!(v), alias string v))
enum isBar5832c = true;
else
enum isBar5832c = false;
}
static assert( isBar5832a!(Bar5832!1234));
static assert( isBar5832b!(Bar5832!1234));
static assert(!isBar5832c!(Bar5832!1234));
/**********************************/
// 2550
template pow10_2550(long n)
{
const long pow10_2550 = 0;
static if (n < 0)
const long pow10_2550 = 0;
else
const long pow10_2550 = 10 * pow10_2550!(n - 1);
}
template pow10_2550(long n:0)
{
const long pow10_2550 = 1;
}
static assert(pow10_2550!(0) == 1);
/**********************************/
// [2.057] Remove top const in IFTI, 9198
void foo10a(T )(T) { static assert(is(T == const(int)[])); }
void foo10b(T...)(T) { static assert(is(T[0] == const(int)[])); }
// ref paramter doesn't remove top const
void boo10a(T )(ref T) { static assert(is(T == const(int[]))); }
void boo10b(T...)(ref T) { static assert(is(T[0] == const(int[]))); }
// auto ref with lvalue doesn't
void goo10a(T )(auto ref T) { static assert(is(T == const(int[]))); }
void goo10b(T...)(auto ref T) { static assert(is(T[0] == const(int[]))); }
// auto ref with rvalue does
void hoo10a(T )(auto ref T) { static assert(is(T == const(int)[])); }
void hoo10b(T...)(auto ref T) { static assert(is(T[0] == const(int)[])); }
void bar10a(T )(T) { static assert(is(T == const(int)*)); }
void bar10b(T...)(T) { static assert(is(T[0] == const(int)*)); }
void test10()
{
const a = [1,2,3];
static assert(is(typeof(a) == const(int[])));
foo10a(a);
foo10b(a);
boo10a(a);
boo10b(a);
goo10a(a);
goo10b(a);
hoo10a(cast(const)[1,2,3]);
hoo10b(cast(const)[1,2,3]);
int n;
const p = &n;
static assert(is(typeof(p) == const(int*)));
bar10a(p);
bar10b(p);
}
/**********************************/
// 3092
template Foo3092(A...)
{
alias A[0] Foo3092;
}
static assert(is(Foo3092!(int, "foo") == int));
/**********************************/
// 7037
struct Foo7037 {}
struct Bar7037 { Foo7037 f; alias f this; }
void works7037( T )( T value ) if ( is( T : Foo7037 ) ) {}
void doesnotwork7037( T : Foo7037 )( T value ) {}
void test7037()
{
Bar7037 b;
works7037( b );
doesnotwork7037( b );
}
/**********************************/
// 7110
struct S7110
{
int opSlice(int, int) const { return 0; }
int opSlice() const { return 0; }
int opIndex(int, int) const { return 0; }
int opIndex(int) const { return 0; }
}
enum e7110 = S7110();
template T7110(alias a) { } // or T7110(a...)
alias T7110!( S7110 ) T71100; // passes
alias T7110!((S7110)) T71101; // passes
alias T7110!( S7110()[0..0] ) A0; // passes
alias T7110!( (e7110[0..0]) ) A1; // passes
alias T7110!( e7110[0..0] ) A2; // passes
alias T7110!( S7110()[0, 0] ) B0; // passes
alias T7110!( (e7110[0, 0]) ) B1; // passes
alias T7110!( e7110[0, 0] ) B2; // passes
alias T7110!( S7110()[] ) C0; // passes
alias T7110!( (e7110[]) ) C1; // passes
alias T7110!( e7110[] ) C2; // fails: e7110 is used as a type
alias T7110!( S7110()[0] ) D0; // passes
alias T7110!( (e7110[0]) ) D1; // passes
alias T7110!( e7110[0] ) D2; // fails: e7110 must be an array or pointer type, not S7110
/**********************************/
// 7124
template StaticArrayOf(T : E[dim], E, size_t dim)
{
pragma(msg, "T = ", T, ", E = ", E, ", dim = ", dim);
alias E[dim] StaticArrayOf;
}
template DynamicArrayOf(T : E[], E)
{
pragma(msg, "T = ", T, ", E = ", E);
alias E[] DynamicArrayOf;
}
template AssocArrayOf(T : V[K], K, V)
{
pragma(msg, "T = ", T, ", K = ", K, ", V = ", V);
alias V[K] AssocArrayOf;
}
void test7124()
{
struct SA { int[5] sa; alias sa this; }
static assert(is(StaticArrayOf!SA == int[5]));
struct DA { int[] da; alias da this; }
static assert(is(DynamicArrayOf!DA == int[]));
struct AA { int[string] aa; alias aa this; }
static assert(is(AssocArrayOf!AA == int[string]));
}
/**********************************/
// 7359
bool foo7359(T)(T[] a ...)
{
return true;
}
void test7359()
{
assert(foo7359(1,1,1,1,1,1)); // OK
assert(foo7359("abc","abc","abc","abc")); // NG
}
/**********************************/
// 7363
template t7363()
{
enum e = 0;
static if (true)
enum t7363 = 0;
}
static assert(!__traits(compiles, t7363!().t7363 == 0)); // Assertion fails
static assert(t7363!() == 0); // Error: void has no value
template u7363()
{
static if (true)
{
enum e = 0;
enum u73631 = 0;
}
alias u73631 u7363;
}
static assert(!__traits(compiles, u7363!().u7363 == 0)); // Assertion fails
static assert(u7363!() == 0); // Error: void has no value
/**********************************/
struct S4371(T ...) { }
alias S4371!("hi!") t;
static if (is(t U == S4371!(U))) { }
/**********************************/
// 7416
void t7416(alias a)() if(is(typeof(a())))
{}
void test7416() {
void f() {}
alias t7416!f x;
}
/**********************************/
// 7563
class Test7563
{
void test(T, bool a = true)(T t)
{
}
}
void test7563()
{
auto test = new Test7563;
pragma(msg, typeof(test.test!(int, true)).stringof);
pragma(msg, typeof(test.test!(int)).stringof); // Error: expression (test.test!(int)) has no type
}
/**********************************/
// 7572
class F7572
{
Tr fn7572(Tr, T...)(T t) { return 1; }
}
Tr Fn7572(Tr, T...)(T t) { return 2; }
void test7572()
{
F7572 f = new F7572();
int delegate() dg = &f.fn7572!int;
assert(dg() == 1);
int function() fn = &Fn7572!int;
assert(fn() == 2);
}
/**********************************/
// 7580
struct S7580(T)
{
void opAssign()(T value) {}
}
struct X7580(T)
{
private T val;
@property ref inout(T) get()() inout { return val; } // template
alias get this;
}
struct Y7580(T)
{
private T val;
@property ref auto get()() inout { return val; } // template + auto return
alias get this;
}
void test7580()
{
S7580!(int) s;
X7580!int x;
Y7580!int y;
s = x;
s = y;
shared(X7580!int) sx;
static assert(!__traits(compiles, s = sx));
}
/**********************************/
// 7585
extern(C) alias void function() Callback;
template W7585a(alias dg)
{
//pragma(msg, typeof(dg));
extern(C) void W7585a() { dg(); }
}
void test7585()
{
static void f7585a(){}
Callback cb1 = &W7585a!(f7585a); // OK
static assert(!__traits(compiles,
{
void f7585b(){}
Callback cb2 = &W7585a!(f7585b); // NG
}));
Callback cb3 = &W7585a!((){}); // NG -> OK
Callback cb4 = &W7585a!(function(){}); // OK
static assert(!__traits(compiles,
{
Callback cb5 = &W7585a!(delegate(){}); // NG
}));
static int global; // global data
Callback cb6 = &W7585a!((){return global;}); // NG -> OK
static assert(!__traits(compiles,
{
int n;
Callback cb7 = &W7585a!((){return n;}); // NG
}));
}
/**********************************/
// 7643
template T7643(A...){ alias A T7643; }
alias T7643!(long, "x", string, "y") Specs7643;
alias T7643!( Specs7643[] ) U7643; // Error: tuple A is used as a type
/**********************************/
// 7671
inout(int)[3] id7671n1 ( inout(int)[3] );
inout( U )[n] id7671x1(U, size_t n)( inout( U )[n] );
shared(inout int)[3] id7671n2 ( shared(inout int)[3] );
shared(inout U )[n] id7671x2(U, size_t n)( shared(inout U )[n] );
void test7671()
{
static assert(is( typeof( id7671n1( (immutable(int)[3]).init ) ) == immutable(int[3]) ));
static assert(is( typeof( id7671x1( (immutable(int)[3]).init ) ) == immutable(int[3]) ));
static assert(is( typeof( id7671n2( (immutable(int)[3]).init ) ) == immutable(int[3]) ));
static assert(is( typeof( id7671x2( (immutable(int)[3]).init ) ) == immutable(int[3]) ));
}
/************************************/
// 7672
T foo7672(T)(T a){ return a; }
void test7672(inout(int[]) a = null, inout(int*) p = null)
{
static assert(is( typeof( a ) == inout(int[]) ));
static assert(is( typeof(foo7672(a)) == inout(int)[] ));
static assert(is( typeof( p ) == inout(int*) ));
static assert(is( typeof(foo7672(p)) == inout(int)* ));
}
/**********************************/
// 7684
U[] id7684(U)( U[] );
shared(U[]) id7684(U)( shared(U[]) );
void test7684()
{
shared(int)[] x;
static assert(is( typeof(id7684(x)) == shared(int)[] ));
}
/**********************************/
// 7694
void match7694(alias m)()
{
m.foo(); //removing this line supresses ice in both cases
}
struct T7694
{
void foo(){}
void bootstrap()
{
//next line causes ice
match7694!(this)();
//while this works:
alias this p;
match7694!(p)();
}
}
/**********************************/
// 7755
template to7755(T)
{
T to7755(A...)(A args)
{
return toImpl7755!T(args);
}
}
T toImpl7755(T, S)(S value)
{
return T.init;
}
template Foo7755(T){}
struct Bar7755
{
void qux()
{
if (is(typeof(to7755!string(Foo7755!int)))){};
}
}
/**********************************/
U[] id11a(U)( U[] );
inout(U)[] id11a(U)( inout(U)[] );
inout(U[]) id11a(U)( inout(U[]) );
inout(shared(U[])) id11a(U)( inout(shared(U[])) );
void test11a(inout int _ = 0)
{
shared(const(int))[] x;
static assert(is( typeof(id11a(x)) == shared(const(int))[] ));
shared(int)[] y;
static assert(is( typeof(id11a(y)) == shared(int)[] ));
inout(U)[n] idz(U, size_t n)( inout(U)[n] );
inout(shared(bool[1])) z;
static assert(is( typeof(idz(z)) == inout(shared(bool[1])) ));
}
inout(U[]) id11b(U)( inout(U[]) );
void test11b()
{
alias const(shared(int)[]) T;
static assert(is(typeof(id11b(T.init)) == const(shared(int)[])));
}
/**********************************/
// 7769
void f7769(K)(inout(K) value){}
void test7769()
{
f7769("abc");
}
/**********************************/
// 7812
template A7812(T...) {}
template B7812(alias C) if (C) {}
template D7812()
{
alias B7812!(A7812!(NonExistent!())) D7812;
}
static assert(!__traits(compiles, D7812!()));
/**********************************/
// 7873
inout(T)* foo(T)(inout(T)* t)
{
static assert(is(T == int*));
return t;
}
inout(T)* bar(T)(inout(T)* t)
{
return foo(t);
}
void test7873()
{
int *i;
bar(&i);
}
/**********************************/
// 7933
struct Boo7933(size_t dim){int a;}
struct Baa7933(size_t dim)
{
Boo7933!dim a;
//Boo7933!1 a; //(1) This version causes no errors
}
auto foo7933()(Boo7933!1 b){return b;}
//auto fuu7933(Boo7933!1 b){return b;} //(2) This line neutralizes the error
void test7933()
{
Baa7933!1 a; //(3) This line causes the error message
auto b = foo7933(Boo7933!1(1));
}
/**********************************/
// 8094
struct Tuple8094(T...) {}
template getParameters8094(T, alias P)
{
static if (is(T t == P!U, U...))
alias U getParameters8094;
else
static assert(false);
}
void test8094()
{
alias getParameters8094!(Tuple8094!(int, string), Tuple8094) args;
}
/**********************************/
struct Tuple12(T...)
{
void foo(alias P)()
{
alias Tuple12 X;
static if (is(typeof(this) t == X!U, U...))
alias U getParameters;
else
static assert(false);
}
}
void test12()
{
Tuple12!(int, string) t;
t.foo!Tuple12();
}
/**********************************/
// 14290
struct Foo14290(int i) {}
alias Foo14290a = Foo14290!1;
static assert(!is(Foo14290!2 == Foo14290a!T, T...));
/**********************************/
// 8125
void foo8125(){}
struct X8125(alias a) {}
template Y8125a(T : A!f, alias A, alias f) {} //OK
template Y8125b(T : A!foo8125, alias A) {} //NG
void test8125()
{
alias Y8125a!(X8125!foo8125) y1;
alias Y8125b!(X8125!foo8125) y2;
}
/**********************************/
struct A13() {}
struct B13(TT...) {}
struct C13(T1) {}
struct D13(T1, TT...) {}
struct E13(T1, T2) {}
struct F13(T1, T2, TT...) {}
template Test13(alias X)
{
static if (is(X x : P!U, alias P, U...))
enum Test13 = true;
else
enum Test13 = false;
}
void test13()
{
static assert(Test13!( A13!() ));
static assert(Test13!( B13!(int) ));
static assert(Test13!( B13!(int, double) ));
static assert(Test13!( B13!(int, double, string) ));
static assert(Test13!( C13!(int) ));
static assert(Test13!( D13!(int) ));
static assert(Test13!( D13!(int, double) ));
static assert(Test13!( D13!(int, double, string) ));
static assert(Test13!( E13!(int, double) ));
static assert(Test13!( F13!(int, double) ));
static assert(Test13!( F13!(int, double, string) ));
static assert(Test13!( F13!(int, double, string, bool) ));
}
/**********************************/
struct A14(T, U, int n = 1)
{
}
template Test14(alias X)
{
static if (is(X x : P!U, alias P, U...))
alias U Test14;
else
static assert(0);
}
void test14()
{
alias A14!(int, double) Type;
alias Test14!Type Params;
static assert(Params.length == 3);
static assert(is(Params[0] == int));
static assert(is(Params[1] == double));
static assert( Params[2] == 1);
}
/**********************************/
// test for evaluateConstraint assertion
bool canSearchInCodeUnits15(C)(dchar c)
if (is(C == char))
{
return true;
}
void test15()
{
int needle = 0;
auto b = canSearchInCodeUnits15!char(needle);
}
/**********************************/
// 8129
class X8129 {}
class A8129 {}
class B8129 : A8129 {}
int foo8129(T : A8129)(X8129 x) { return 1; }
int foo8129(T : A8129)(X8129 x, void function (T) block) { return 2; }
int bar8129(T, R)(R range, T value) { return 1; }
int baz8129(T, R)(R range, T value) { return 1; }
int baz8129(T, R)(R range, Undefined value) { return 2; }
void test8129()
{
auto x = new X8129;
assert(x.foo8129!B8129() == 1);
assert(x.foo8129!B8129((a){}) == 2);
assert(foo8129!B8129(x) == 1);
assert(foo8129!B8129(x, (a){}) == 2);
assert(foo8129!B8129(x) == 1);
assert(foo8129!B8129(x, (B8129 b){}) == 2);
ubyte[] buffer = [0, 1, 2];
assert(bar8129!ushort(buffer, 915) == 1);
// While deduction, parameter type 'Undefined' shows semantic error.
static assert(!__traits(compiles, {
baz8129!ushort(buffer, 915);
}));
}
/**********************************/
// 8238
void test8238()
{
static struct S { template t(){ int t; } }
S s1, s2;
assert(cast(void*)&s1 != cast(void*)&s2 );
assert(cast(void*)&s1 != cast(void*)&s1.t!());
assert(cast(void*)&s2 != cast(void*)&s2.t!());
assert(cast(void*)&s1.t!() == cast(void*)&s2.t!());
s1.t!() = 256;
assert(s2.t!() == 256);
}
/**********************************/
// 8669
struct X8669
{
void mfoo(this T)()
{
static assert(is(typeof(this) == T));
}
void cfoo(this T)() const
{
static assert(is(typeof(this) == const(T)));
}
void sfoo(this T)() shared
{
static assert(is(typeof(this) == shared(T)));
}
void scfoo(this T)() shared const
{
static assert(is(typeof(this) == shared(const(T))));
}
void ifoo(this T)() immutable
{
static assert(is(typeof(this) == immutable(T)));
}
}
void test8669()
{
X8669 mx;
const X8669 cx;
immutable X8669 ix;
shared X8669 sx;
shared const X8669 scx;
mx.mfoo();
cx.mfoo();
ix.mfoo();
sx.mfoo();
scx.mfoo();
mx.cfoo();
cx.cfoo();
ix.cfoo();
sx.cfoo();
scx.cfoo();
static assert(!is(typeof( mx.sfoo() )));
static assert(!is(typeof( cx.sfoo() )));
ix.sfoo();
sx.sfoo();
scx.sfoo();
static assert(!is(typeof( mx.scfoo() )));
static assert(!is(typeof( cx.scfoo() )));
ix.scfoo();
sx.scfoo();
scx.scfoo();
static assert(!is(typeof( mx.ifoo() )));
static assert(!is(typeof( cx.ifoo() )));
ix.ifoo();
static assert(!is(typeof( sx.ifoo() )));
static assert(!is(typeof( scx.ifoo() )));
}
/**********************************/
// 8833
template TypeTuple8833(T...) { alias TypeTuple = T; }
void func8833(alias arg)() { }
void test8833()
{
int x, y;
alias TypeTuple8833!(
func8833!(x),
func8833!(y),
) Map;
}
/**********************************/
// 8976
void f8976(ref int) { }
void g8976()()
{
f8976(0); // line 5
}
void h8976()()
{
g8976!()();
}
static assert(! __traits(compiles, h8976!()() ) ); // causes error
static assert(!is(typeof( h8976!()() )));
void test8976()
{
static assert(! __traits(compiles, h8976!()() ) );
static assert(!is(typeof( h8976!()() )));
}
/****************************************/
// 8940
const int n8940; // or `immutable`
static this() { n8940 = 3; }
void f8940(T)(ref int val)
{
assert(val == 3);
++val;
}
static assert(!__traits(compiles, f8940!void(n8940))); // fails
void test8940()
{
assert(n8940 == 3);
static assert(!__traits(compiles, f8940!void(n8940)));
//assert(n8940 == 3); // may pass as compiler caches comparison result
//assert(n8940 != 4); // may pass but likely will fail
}
/**********************************/
// 6969 + 8990
class A6969() { alias C6969!() C1; }
class B6969 { alias A6969!() A1; }
class C6969() : B6969 {}
struct A8990(T) { T t; }
struct B8990(T) { A8990!T* a; }
struct C8990 { B8990!C8990* b; }
/**********************************/
// 9018
template Inst9018(alias Template, T)
{
alias Template!T Inst;
}
template Template9018(T)
{
enum Template9018 = T;
}
static assert(!__traits(compiles, Inst9018!(Template9018, int))); // Assert passes
static assert(!__traits(compiles, Inst9018!(Template9018, int))); // Assert fails
/**********************************/
// 9022
class C9022
{
struct X {}
alias B = X;
}
class D9022
{
struct X {}
}
void test9022()
{
auto c = new C9022();
auto d = new D9022();
auto cx = C9022.X();
auto dx = D9022.X();
void foo1(T)(T, T.X) { static assert(is(T == C9022)); }
void foo2(T)(T.X, T) { static assert(is(T == C9022)); }
foo1(c, cx);
foo2(cx, c);
void hoo1(T)(T, T.B) { static assert(is(T == C9022)); }
void hoo2(T)(T.B, T) { static assert(is(T == C9022)); }
hoo1(c, cx);
hoo1(c, cx);
void bar1(alias A)(A.C9022, A.D9022) { static assert(A.stringof == "module breaker"); }
void bar2(alias A)(A.D9022, A.C9022) { static assert(A.stringof == "module breaker"); }
bar1(c, d);
bar2(d, c);
void var1(alias A)(A.C9022, A.D9022.X) { static assert(A.stringof == "module breaker"); }
void var2(alias A)(A.D9022.X, A.C9022) { static assert(A.stringof == "module breaker"); }
var1(c, dx);
var2(dx, c);
void baz(T)(T.X t, T.X u) { }
static assert(!__traits(compiles, baz(cx, dx)));
}
/**********************************/
// 9026
mixin template node9026()
{
static if (is(this == struct))
alias typeof(this)* E;
else
alias typeof(this) E;
E prev, next;
}
struct list9026(alias N)
{
N.E head;
N.E tail;
}
class A9026
{
mixin node9026 L1;
mixin node9026 L2;
}
list9026!(A9026.L1) g9026_l1;
list9026!(A9026.L2) g9026_l2;
void test9026()
{
list9026!(A9026.L1) l9026_l1;
list9026!(A9026.L2) l9026_l2;
}
/**********************************/
// 9038
mixin template Foo9038()
{
string data = "default";
}
class Bar9038
{
string data;
mixin Foo9038 f;
}
void check_data9038(alias M, T)(T obj)
{
//writeln(M.stringof);
assert(obj.data == "Bar");
assert(obj.f.data == "F");
}
void test9038()
{
auto bar = new Bar9038;
bar.data = "Bar";
bar.f.data = "F";
assert(bar.data == "Bar");
assert(bar.f.data == "F");
check_data9038!(Bar9038)(bar);
check_data9038!(Bar9038.f)(bar);
check_data9038!(bar.f)(bar);
}
/**********************************/
// 9050
struct A9050(T) {}
struct B9050(T)
{
void f() { foo9050(A9050!int()); }
}
auto foo9050()(A9050!int base) pure
{
return B9050!int();
}
auto s9050 = foo9050(A9050!int());
/**********************************/
// 10936 (dup of 9050)
struct Vec10936(string s)
{
auto foo(string v)()
{
return Vec10936!(v)();
}
static void bar()
{
Vec10936!"" v;
auto p = v.foo!"sup";
}
}
Vec10936!"" v;
/**********************************/
// 9076
template forward9076(args...)
{
@property forward9076()(){ return args[0]; }
}
void test9076()
{
int a = 1;
int b = 1;
assert(a == forward9076!b);
}
/**********************************/
// 9083
template isFunction9083(X...) if (X.length == 1)
{
enum isFunction9083 = true;
}
struct S9083
{
static string func(alias Class)()
{
foreach (m; __traits(allMembers, Class))
{
pragma(msg, m); // prints "func"
enum x1 = isFunction9083!(mixin(m)); //NG
enum x2 = isFunction9083!(func); //OK
}
return "";
}
}
enum nothing9083 = S9083.func!S9083();
class C9083
{
int x; // some class members
void func()
{
void templateFunc(T)(const T obj)
{
enum x1 = isFunction9083!(mixin("x")); // NG
enum x2 = isFunction9083!(x); // NG
}
templateFunc(this);
}
}
/**********************************/
// 9100
template Id(alias A) { alias Id = A; }
template ErrId(alias A) { static assert(0); }
template TypeTuple9100(TL...) { alias TypeTuple9100 = TL; }
class C9100
{
int value;
int fun() { return value; }
int tfun(T)() { return value; }
TypeTuple9100!(int, long) field;
void test()
{
this.value = 1;
auto c = new C9100();
c.value = 2;
alias t1a = Id!(c.fun); // OK
alias t1b = Id!(this.fun); // Prints weird error, bad
// -> internally given TOKdotvar
assert(t1a() == this.value);
assert(t1b() == this.value);
alias t2a = Id!(c.tfun); // OK
static assert(!__traits(compiles, ErrId!(this.tfun)));
alias t2b = Id!(this.tfun); // No error occurs, why?
// -> internally given TOKdottd
assert(t2a!int() == this.value);
assert(t2b!int() == this.value);
alias t3a = Id!(foo9100); // OK
alias t3b = Id!(mixin("foo9100")); // Prints weird error, bad
// -> internally given TOKtemplate
assert(t3a() == 10);
assert(t3b() == 10);
assert(field[0] == 0);
alias t4a = TypeTuple9100!(field); // NG
alias t4b = TypeTuple9100!(GetField9100!()); // NG
t4a[0] = 1; assert(field[0] == 1);
t4b[0] = 2; assert(field[0] == 2);
}
}
int foo9100()() { return 10; }
template GetField9100() { alias GetField9100 = C9100.field[0]; }
void test9100()
{
(new C9100()).test();
}
/**********************************/
// 9101
class Node9101
{
template ForwardCtorNoId()
{
this() {} // default constructor
void foo() { 0 = 1; } // wrong code
}
}
enum x9101 = __traits(compiles, Node9101.ForwardCtorNoId!());
/**********************************/
// 9124
struct Foo9124a(N...)
{
enum SIZE = N[0];
private int _val;
public void opAssign (T) (T other)
if (is(T unused == Foo9124a!(_N), _N...))
{
_val = other._val; // compile error
this._val = other._val; // explicit this make it work
}
public auto opUnary (string op) () if (op == "~") {
Foo9124a!(SIZE) result = this;
return result;
}
}
void test9124a()
{
Foo9124a!(28) a;
Foo9124a!(28) b = ~a;
}
// --------
template Foo9124b(T, U, string OP)
{
enum N = T.SIZE;
alias Foo9124b = Foo9124b!(false, true, N);
}
struct Foo9124b(bool S, bool L, N...)
{
enum SIZE = 5;
long[1] _a = 0;
void someFunction() const {
auto data1 = _a; // Does not compile
auto data2 = this._a; // <--- Compiles
}
auto opBinary(string op, T)(T) {
Foo9124b!(typeof(this), T, op) test;
}
}
void test9124b()
{
auto p = Foo9124b!(false, false, 5)();
auto q = Foo9124b!(false, false, 5)();
p|q;
p&q;
}
/**********************************/
// 9143
struct Foo9143a(bool S, bool L)
{
auto noCall() {
Foo9143a!(S, false) x1; // compiles if this line commented
static if(S) Foo9143a!(true, false) x2;
else Foo9143a!(false, false) x2;
}
this(T)(T other) // constructor
if (is(T unused == Foo9143a!(P, Q), bool P, bool Q)) { }
}
struct Foo9143b(bool L, size_t N)
{
void baaz0() {
bar!(Foo9143b!(false, N))(); // line 7
// -> move to before the baaz semantic
}
void baaz() {
bar!(Foo9143b!(false, 2LU))(); // line 3
bar!(Foo9143b!(true, 2LU))(); // line 4
bar!(Foo9143b!(L, N))(); // line 5
bar!(Foo9143b!(true, N))(); // line 6
bar!(Foo9143b!(false, N))(); // line 7
}
void bar(T)()
if (is(T unused == Foo9143b!(_L, _N), bool _L, size_t _N))
{}
}
void test9143()
{
Foo9143a!(false, true) k = Foo9143a!(false, false)();
auto p = Foo9143b!(true, 2LU)();
}
/**********************************/
// 9266
template Foo9266(T...)
{
T Foo9266;
}
struct Bar9266()
{
alias Foo9266!int f;
}
void test9266()
{
Bar9266!() a, b;
}
/**********************************/
// 9361
struct Unit9361(A)
{
void butPleaseDontUseMe()()
if (is(unitType9361!((this)))) // !
{}
}
template isUnit9361(alias T) if ( is(T)) {}
template isUnit9361(alias T) if (!is(T)) {}
template unitType9361(alias T) if (isUnit9361!T) {}
void test9361()
{
Unit9361!int u;
static assert(!__traits(compiles, u.butPleaseDontUseMe())); // crashes
}
/**********************************/
// 9536
struct S9536
{
static A foo(A)(A a)
{
return a * 2;
}
int bar() const
{
return foo(42);
}
}
void test9536()
{
S9536 s;
assert(s.bar() == 84);
}
/**********************************/
// 9578
template t9578(alias f) { void tf()() { f(); } }
void g9578a(alias f)() { f(); } // Error -> OK
void g9578b(alias ti)() { ti.tf(); } // Error -> OK
void test9578()
{
int i = 0;
int m() { return i; }
g9578a!(t9578!m.tf)();
g9578b!(t9578!m)();
}
/**********************************/
// 9596
int foo9596a(K, V)(inout( V [K])) { return 1; }
int foo9596a(K, V)(inout(shared(V) [K])) { return 2; }
int foo9596b(K, V)(inout( V [K])) { return 1; }
int foo9596b(K, V)(inout( const(V) [K])) { return 3; }
int foo9596c(K, V)(inout(shared(V) [K])) { return 2; }
int foo9596c(K, V)(inout( const(V) [K])) { return 3; }
int foo9596d(K, V)(inout( V [K])) { return 1; }
int foo9596d(K, V)(inout(shared(V) [K])) { return 2; }
int foo9596d(K, V)(inout( const(V) [K])) { return 3; }
int foo9596e(K, V)(inout(shared(V) [K])) { return 2; }
int foo9596e(K, V)(inout( V [K])) { return 1; }
int foo9596e(K, V)(inout( const(V) [K])) { return 3; }
void test9596()
{
shared(int)[int] aa;
static assert(!__traits(compiles, foo9596a(aa)));
assert(foo9596b(aa) == 1);
assert(foo9596c(aa) == 2);
static assert(!__traits(compiles, foo9596d(aa)));
static assert(!__traits(compiles, foo9596e(aa)));
}
/******************************************/
// 9806
struct S9806a(alias x)
{
alias S9806a!0 N;
}
enum expr9806a = 0 * 0;
alias S9806a!expr9806a T9806a;
// --------
struct S9806b(alias x)
{
template Next()
{
enum expr = x + 1;
alias S9806b!expr Next;
}
}
alias S9806b!1 One9806b;
alias S9806b!0.Next!() OneAgain9806b;
// --------
struct S9806c(x...)
{
template Next()
{
enum expr = x[0] + 1;
alias S9806c!expr Next;
}
}
alias S9806c!1 One9806c;
alias S9806c!0.Next!() OneAgain9806c;
/******************************************/
// 9837
void test9837()
{
enum DA : int[] { a = [1,2,3] }
DA da;
int[] bda = da;
static assert(is(DA : int[]));
void fda1(int[] a) {}
void fda2(T)(T[] a) {}
fda1(da);
fda2(da);
enum SA : int[3] { a = [1,2,3] }
SA sa;
int[3] bsa = sa;
static assert(is(SA : int[3]));
void fsa1(int[3] a) {}
void fsa2(T)(T[3] a) {}
void fsa3(size_t d)(int[d] a) {}
void fsa4(T, size_t d)(T[d] a) {}
fsa1(sa);
fsa2(sa);
fsa3(sa);
fsa4(sa);
enum AA : int[int] { a = null }
AA aa;
int[int] baa = aa;
static assert(is(AA : int[int]));
void faa1(int[int] a) {}
void faa2(V)(V[int] a) {}
void faa3(K)(int[K] a) {}
void faa4(K, V)(V[K] a) {}
faa1(aa);
faa2(aa);
faa3(aa);
faa4(aa);
}
/******************************************/
// 9874
bool foo9874() { return true; }
void bar9874(T)(T) if (foo9874()) {} // OK
void baz9874(T)(T) if (foo9874) {} // error
void test9874()
{
foo9874; // OK
bar9874(0);
baz9874(0);
}
/******************************************/
void test9885()
{
void foo(int[1][]) {}
void boo()(int[1][]){}
struct X(T...) { static void xoo(T){} }
struct Y(T...) { static void yoo()(T){} }
struct Z(T...) { static void zoo(U...)(T, U){} }
struct V(T...) { static void voo()(T, ...){} }
struct W(T...) { static void woo()(T...){} }
struct R(T...) { static void roo(U...)(int, U, T){} }
// OK
foo([[10]]);
boo([[10]]);
// OK
X!(int[1][]).xoo([[10]]);
// NG!
Y!().yoo();
Y!(int).yoo(1);
Y!(int, int[]).yoo(1, [10]);
static assert(!__traits(compiles, Y!().yoo(1)));
static assert(!__traits(compiles, Y!(int).yoo("a")));
static assert(!__traits(compiles, Y!().yoo!(int)()));
// NG!
Z!().zoo();
Z!().zoo([1], [1:1]);
Z!(int, string).zoo(1, "a");
Z!(int, string).zoo(1, "a", [1], [1:1]);
Z!().zoo!()();
static assert(!__traits(compiles, Z!().zoo!()(1))); // (none) <- 1
static assert(!__traits(compiles, Z!(int).zoo!()())); // int <- (none)
static assert(!__traits(compiles, Z!(int).zoo!()(""))); // int <- ""
static assert(!__traits(compiles, Z!().zoo!(int)())); // int <- (none)
static assert(!__traits(compiles, Z!().zoo!(int)(""))); // int <- ""
V!().voo(1,2,3);
V!(int).voo(1,2,3);
V!(int, long).voo(1,2,3);
static assert(!__traits(compiles, V!(int).voo())); // int <- (none)
static assert(!__traits(compiles, V!(int, long).voo(1))); // long <- (none)
static assert(!__traits(compiles, V!(int, string).voo(1,2,3))); // string <- 2
W!().woo();
//W!().woo(1, 2, 3); // Access Violation
{ // this behavior is consistent with:
//alias TL = TypeTuple!();
//void foo(TL...) {}
//foo(1, 2, 3); // Access Violation
//pragma(msg, typeof(foo)); // void(...) -> D-style variadic function?
}
W!(int,int[]).woo(1,2,3);
W!(int,int[2]).woo(1,2,3);
static assert(!__traits(compiles, W!(int,int,int).woo(1,2,3))); // int... <- 2
static assert(!__traits(compiles, W!(int,int).woo(1,2))); // int... <- 2
static assert(!__traits(compiles, W!(int,int[2]).woo(1,2))); // int[2]... <- 2
R!().roo(1, "", []);
R!(int).roo(1, "", [], 1);
R!(int, string).roo(1, "", [], 1, "");
R!(int, string).roo(1, 2, "");
static assert(!__traits(compiles, R!(int).roo(1, "", []))); // int <- []
static assert(!__traits(compiles, R!(int, int).roo(1, "", []))); // int <- []
static assert(!__traits(compiles, R!(int, string).roo(1, 2, 3))); // string <- 3
// test case
struct Tuple(T...) { this()(T values) {} }
alias T = Tuple!(int[1][]);
auto t = T([[10]]);
}
/******************************************/
// 9971
void goo9971()()
{
auto g = &goo9971;
}
struct S9971
{
void goo()()
{
auto g = &goo;
static assert(is(typeof(g) == delegate));
}
}
void test9971()
{
goo9971!()();
S9971.init.goo!()();
}
/******************************************/
// 9977
void test9977()
{
struct S1(T) { T value; }
auto func1(T)(T value) { return value; }
static assert(is(S1!int == struct));
assert(func1(10) == 10);
template S2(T) { struct S2 { T value; } }
template func2(T) { auto func2(T value) { return value; } }
static assert(is(S2!int == struct));
assert(func2(10) == 10);
template X(T) { alias X = T[3]; }
static assert(is(X!int == int[3]));
int a;
template Y(T) { alias Y = T[typeof(a)]; }
static assert(is(Y!double == double[int]));
int v = 10;
template Z() { alias Z = v; }
assert(v == 10);
Z!() = 20;
assert(v == 20);
}
/******************************************/
enum T8848a(int[] a) = a;
enum T8848b(int[int] b) = b;
enum T8848c(void* c) = c;
static assert(T8848a!([1,2,3]) == [1,2,3]);
static assert(T8848b!([1:2,3:4]) == [1:2,3:4]);
static assert(T8848c!(null) == null);
/******************************************/
// 9990
auto initS9990() { return "hi"; }
class C9990(alias init) {}
alias SC9990 = C9990!(initS9990);
/******************************************/
// 10067
struct assumeSize10067(alias F) {}
template useItemAt10067(size_t idx, T)
{
void impl(){ }
alias useItemAt10067 = assumeSize10067!(impl);
}
useItemAt10067!(0, char) mapS10067;
/******************************************/
// 4072
void bug4072(T)(T x)
if (is(typeof(bug4072(x))))
{}
static assert(!is(typeof(bug4072(7))));
/******************************************/
// 10074
template foo10074(F)
{
enum foo10074 = false;
}
bool foo10074(F)(F f)
if (foo10074!F)
{
return false;
}
static assert(!is(typeof(foo10074(1))));
/******************************************/
// 10083
// [a-c] IFTI can find syntactic eponymous member
template foo10083a(T)
{
int foo10083a(double) { return 1; }
int foo10083a(T) { return 2; }
}
template foo10083b(T)
{
int foo10083b(T) { return 1; }
int foo10083b(T, T) { return 2; }
}
template foo10083c1(T)
{
int foo10083c1(T) { return 1; }
static if (true) { int x; }
}
template foo10083c2(T)
{
int foo10083c2(T) { return 1; }
static if (true) { int x; } else { int y; }
}
// [d-f] IFTI cannot find syntactic eponymous member
template foo10083d1(T)
{
static if (true)
{
int foo10083d1(T) { return 1; }
}
else
{
}
}
template foo10083d2(T)
{
static if (true)
{
}
else
{
int foo10083d2(T) { return 1; }
}
}
template foo10083e(T)
{
static if (true)
{
int foo10083e(double arg) { return 1; }
}
int foo10083e(T arg) { return 2; }
}
template foo10083f(T)
{
static if (true)
{
int foo10083f(T) { return 1; }
}
else
{
int foo10083f(T) { return 2; }
}
}
void test10083()
{
assert(foo10083a(1) == 2);
assert(foo10083a!int(1) == 2);
assert(foo10083a!int(1.0) == 1);
static assert(!__traits(compiles, foo10083a!double(1)));
static assert(!__traits(compiles, foo10083a!double(1.0)));
static assert(!__traits(compiles, foo10083a!real(1)));
assert(foo10083a!real(1.0) == 1);
assert(foo10083a!real(1.0L) == 2);
assert(foo10083b(2) == 1);
assert(foo10083b(3, 4) == 2);
static assert(!__traits(compiles, foo10083b(2, "")));
assert(foo10083c1(1) == 1);
assert(foo10083c2(1) == 1);
static assert(!__traits(compiles, foo10083d1(2)));
static assert(!__traits(compiles, foo10083d2(2)));
static assert(!__traits(compiles, foo10083e(3)));
static assert(!__traits(compiles, foo10083f(3)));
}
/******************************************/
// 10134
template ReturnType10134(alias func)
{
static if (is(typeof(func) R == return))
alias R ReturnType10134;
else
static assert(0);
}
struct Result10134(T) {}
template getResultType10134(alias func)
{
static if(is(ReturnType10134!(func.exec) _ == Result10134!(T), T))
{
alias getResultType10134 = T;
}
}
template f10134(alias func)
{
Result10134!(getResultType10134!(func)) exec(int i)
{
return typeof(return)();
}
}
template a10134()
{
Result10134!(double) exec(int i)
{
return b10134!().exec(i);
}
}
template b10134()
{
Result10134!(double) exec(int i)
{
return f10134!(a10134!()).exec(i);
}
}
pragma(msg, getResultType10134!(a10134!()));
/******************************************/
// 10313
void test10313()
{
struct Nullable(T)
{
this()(inout T value) inout {}
}
struct S { S[] array; }
S s;
auto ns = Nullable!S(s);
class C { C[] array; }
C c;
auto nc = Nullable!C(c);
}
/******************************************/
// 10498
template triggerIssue10498a()
{
enum triggerIssue10498a = __traits(compiles, { T10498a; });
}
template PackedGenericTuple10498a(Args...)
{
alias Args Tuple;
enum e = triggerIssue10498a!();
}
struct S10498a { }
template T10498a()
{
alias PackedGenericTuple10498a!S10498a T10498a;
}
void test10498a()
{
alias T10498a!() t;
static assert(is(t.Tuple[0])); // Fails -> OK
}
// --------
template triggerIssue10498b(A...)
{
enum triggerIssue10498b = __traits(compiles, { auto a = A[0]; });
}
template PackedGenericTuple10498b(Args...)
{
alias Args Tuple;
enum e = triggerIssue10498b!Args;
}
template T10498b()
{
struct S {} // The fact `S` is in `T` causes the problem
alias PackedGenericTuple10498b!S T10498b;
}
void test10498b()
{
alias T10498b!() t;
static assert(is(t.Tuple[0]));
}
/******************************************/
// 10537
struct Iota10537
{
int s,e,i;
mixin Yield10537!q{ ; };
}
auto skipStrings10537(T)(T source)
{
return "";
}
mixin template Yield10537(dstring code)
{
alias X = typeof({ enum x = rewriteCode10537(code); }());
}
dstring rewriteCode10537(dstring code)
{
skipStrings10537(code); // IFTI causes forward reference
return "";
}
/******************************************/
// 10558
template Template10558() {}
struct Struct10558(alias T){}
alias bar10558 = foo10558!(Template10558!());
template foo10558(alias T)
{
alias foobar = Struct10558!T;
void fun()
{
alias a = foo10558!T;
}
}
/******************************************/
// 10592
void test10592()
{
struct A(E)
{
int put()(const(E)[] data)
{
return 1;
}
int put()(const(dchar)[] data) if (!is(E == dchar))
{
return 2;
}
int put(C)(const(C)[] data) if (!is(C == dchar) && !is(E == C))
{
return 3;
}
}
A!char x;
assert(x.put("abcde"c) == 1); // OK: hit 1
assert(x.put("abcde"w) == 3); // NG: this should hit 3
assert(x.put("abcde"d) == 2); // OK: hit 2
}
/******************************************/
// 11242
inout(T[]) fromString11242(T)(inout(char[]) s, T[] dst)
{
return s;
}
void test11242()
{
char[] a;
fromString11242(a, a);
}
/******************************************/
// 10811
void foo10811a(R1, R2)(R1, R2) {}
template foo10811a(alias pred) { void foo10811a(R1, R2)(R1, R2) {} }
template foo10811b(alias pred) { void foo10811b(R1, R2)(R1, R2) {} }
void foo10811b(R1, R2)(R1, R2) {}
void test10811()
{
foo10811a(1, 2);
foo10811a!(a => a)(1, 2);
foo10811b(1, 2);
foo10811b!(a => a)(1, 2);
}
/******************************************/
// 10969
template A10969(T, U...) { alias A10969 = T; }
void foo10969(T, U...)(A10969!(T, U) a) {}
template B10969(T, U) { alias B10969 = T; }
void bar10969(T, U...)(B10969!(T, U[0]) a) {}
void test10969()
{
foo10969!(int, float)(3);
bar10969!(int, float)(3);
}
/******************************************/
// 11271
struct SmartPtr11271(T)
{
~this() {}
void opAssign(U)(auto ref U rh) {}
}
void test11271()
{
SmartPtr11271!Object a;
a = SmartPtr11271!Object();
}
/******************************************/
// 11533
version (none)
{
struct S11533
{
void put(alias fun)() { fun!int(); }
}
void test11533a()
{
static void foo(T)() {}
S11533 s;
s.put!foo();
}
void test11533b()
{
static void bar(alias fun)() { fun(); }
void nested() {}
bar!nested();
}
void test11533c()
{
static struct Foo(alias fun)
{
auto call() { return fun(); }
}
int var = 1;
auto getVar() { return var; }
Foo!getVar foo;
assert(foo.call() == var);
var += 1;
assert(foo.call() == var);
}
void test11533()
{
test11533a();
test11533b();
test11533c();
}
}
else
{
void test11533()
{
}
}
/******************************************/
// 11553
struct Pack11553(T ...)
{
alias Unpack = T;
enum length = T.length;
}
template isPack11553(TList ...)
{
static if (TList.length == 1 && is(Pack11553!(TList[0].Unpack) == TList[0]))
{
enum isPack11553 = true;
}
else
{
enum isPack11553 = false;
}
}
template PartialApply11553(alias T, uint argLoc, Arg ...)
if (Arg.length == 1)
{
template PartialApply11553(L ...)
{
alias PartialApply11553 = T!(L[0 .. argLoc], Arg, L[argLoc .. $]);
}
}
template _hasLength11553(size_t len, T)
{
static if (T.length == len)
{
enum _hasLength11553 = true;
}
else
{
enum _hasLength11553 = false;
}
}
alias _hasLength11553(size_t len) = PartialApply11553!(._hasLength11553, 0, len);
alias hl11553 = _hasLength11553!1;
// this segfaults
static if (!isPack11553!hl11553) { pragma(msg, "All good 1"); }
// these are fine
static if ( hl11553!(Pack11553!(5))) { pragma(msg, "All good 2"); }
static if (!hl11553!(Pack11553!( ))) { pragma(msg, "All good 3"); }
/******************************************/
// 11818
enum E11818 { e0, e1 }
struct SortedRange11818
{
void fun(E11818 e = true ? E11818.e0 : E11818.e1)()
{
}
}
void test11818()
{
SortedRange11818 s;
s.fun();
}
/******************************************/
// 11843
void test11843()
{
struct Foo
{
int x[string];
}
struct Bar(alias foo) {}
enum bar1 = Bar!(Foo(["a": 1]))();
enum bar2 = Bar!(Foo(["a": 1]))();
static assert(is(typeof(bar1) == typeof(bar2)));
enum foo1 = Foo(["a": 1]);
enum foo2 = Foo(["b": -1]);
static assert(!__traits(isSame, foo1, foo2));
enum bar3 = Bar!foo1();
enum bar4 = Bar!foo2();
static assert(!is(typeof(bar3) == typeof(bar4)));
}
/******************************************/
// 11872
class Foo11872
{
auto test(int v)() {}
auto test(int v)(string) {}
template Bar(T)
{
void test(T) {}
}
}
void test11872()
{
auto foo = new Foo11872();
with (foo)
{
// ScopeExp(ti) -> DotTemplateInstanceExp(wthis, ti)
foo.test!2(); // works
test!2(); // works <- fails
test!2; // works <- fails
// ScopeExp(ti) -> DotTemplateInstanceExp(wthis, ti) -> DotExp(wthis, ScopeExp)
foo.Bar!int.test(1); // works
Bar!int.test(1); // works <- fails
}
}
/******************************************/
// 12042
struct S12042
{
int[] t;
void m()()
{
t = null; // CTFE error -> OK
}
}
int test12042()
{
S12042 s;
with (s)
m!()();
return 1;
}
static assert(test12042());
/******************************************/
// 12077
struct S12077(A) {}
alias T12077(alias T : Base!Args, alias Base, Args...) = Base;
static assert(__traits(isSame, T12077!(S12077!int), S12077));
alias U12077(alias T : Base!Args, alias Base, Args...) = Base;
alias U12077( T : Base!Args, alias Base, Args...) = Base;
static assert(__traits(isSame, U12077!(S12077!int), S12077));
/******************************************/
// 12262
template Inst12262(T) { int x; }
enum fqnSym12262(alias a) = 1;
enum fqnSym12262(alias a : B!A, alias B, A...) = 2;
static assert(fqnSym12262!(Inst12262!(Object)) == 2);
static assert(fqnSym12262!(Inst12262!(Object).x) == 1);
/******************************************/
// 12264
struct S12264(A) {}
template AX12264(alias A1) { enum AX12264 = 1; }
template AX12264(alias A2 : B!A, alias B, A...) { enum AX12264 = 2; }
template AY12264(alias A1) { enum AY12264 = 1; }
template AY12264(alias A2 : B!int, alias B) { enum AY12264 = 2; }
template AZ12264(alias A1) { enum AZ12264 = 1; }
template AZ12264(alias A2 : S12264!T, T) { enum AZ12264 = 2; }
static assert(AX12264!(S12264!int) == 2);
static assert(AY12264!(S12264!int) == 2);
static assert(AZ12264!(S12264!int) == 2);
template TX12264(T1) { enum TX12264 = 1; }
template TX12264(T2 : B!A, alias B, A...) { enum TX12264 = 2; }
template TY12264(T1) { enum TY12264 = 1; }
template TY12264(T2 : B!int, alias B) { enum TY12264 = 2; }
template TZ12264(T1) { enum TZ12264 = 1; }
template TZ12264(T2 : S12264!T, T) { enum TZ12264 = 2; }
static assert(TX12264!(S12264!int) == 2);
static assert(TY12264!(S12264!int) == 2);
static assert(TZ12264!(S12264!int) == 2);
/******************************************/
// 12122
enum N12122 = 1;
void foo12122(T)(T[N12122]) if(is(T == int)) {}
void test12122()
{
int[N12122] data;
foo12122(data);
}
/******************************************/
// 12186
template map_front12186(fun...)
{
auto map_front12186(Range)(Range r)
{
return fun[0](r[0]);
}
}
void test12186()
{
immutable int[][] mat;
mat.map_front12186!((in r) => 0); // OK
mat.map_front12186!((const r) => 0); // OK
mat.map_front12186!((immutable int[] r) => 0); // OK
mat.map_front12186!((immutable r) => 0); // OK <- Error
}
/******************************************/
// 12207
void test12207()
{
static struct S
{
static void f(T)(T) {}
}
immutable S s;
s.f(1);
}
/******************************************/
// 12263
template A12263(alias a) { int x; }
template B12263(alias a) { int x; }
template fqnSym12263(alias T : B12263!A, alias B12263, A...)
{
enum fqnSym12263 = true;
}
static assert(fqnSym12263!(A12263!(Object)));
static assert(fqnSym12263!(B12263!(Object)));
/******************************************/
// 12290
void test12290()
{
short[] arrS;
float[] arrF;
double[] arrD;
real[] arrR;
string cstr;
wstring wstr;
dstring dstr;
short[short] aa;
auto func1a(E)(E[], E) { return E.init; }
auto func1b(E)(E, E[]) { return E.init; }
static assert(is(typeof(func1a(arrS, 1)) == short));
static assert(is(typeof(func1b(1, arrS)) == short));
static assert(is(typeof(func1a(arrF, 1.0)) == float));
static assert(is(typeof(func1b(1.0, arrF)) == float));
static assert(is(typeof(func1a(arrD, 1.0L)) == double));
static assert(is(typeof(func1b(1.0L, arrD)) == double));
static assert(is(typeof(func1a(arrR, 1)) == real));
static assert(is(typeof(func1b(1, arrR)) == real));
static assert(is(typeof(func1a("str" , 'a')) == immutable char));
static assert(is(typeof(func1b('a', "str" )) == immutable char));
static assert(is(typeof(func1a("str"c, 'a')) == immutable char));
static assert(is(typeof(func1b('a', "str"c)) == immutable char));
static assert(is(typeof(func1a("str"w, 'a')) == immutable wchar));
static assert(is(typeof(func1b('a', "str"w)) == immutable wchar));
static assert(is(typeof(func1a("str"d, 'a')) == immutable dchar));
static assert(is(typeof(func1b('a', "str"d)) == immutable dchar));
static assert(is(typeof(func1a([1,2,3], 1L)) == long));
static assert(is(typeof(func1b(1L, [1,2,3])) == long));
static assert(is(typeof(func1a([1,2,3], 1.5)) == double));
static assert(is(typeof(func1b(1.5, [1,2,3])) == double));
static assert(is(typeof(func1a(["a","b"], "s"c)) == string));
static assert(is(typeof(func1b("s"c, ["a","b"])) == string));
static assert(is(typeof(func1a(["a","b"], "s"w)) == wstring));
static assert(is(typeof(func1b("s"w, ["a","b"])) == wstring));
static assert(is(typeof(func1a(["a","b"], "s"d)) == dstring));
static assert(is(typeof(func1b("s"d, ["a","b"])) == dstring));
auto func2a(K, V)(V[K], K, V) { return V[K].init; }
auto func2b(K, V)(V, K, V[K]) { return V[K].init; }
static assert(is(typeof(func2a(aa, 1, 1)) == short[short]));
static assert(is(typeof(func2b(1, 1, aa)) == short[short]));
static assert(is(typeof(func2a([1:10,2:20,3:30], 1L, 10L)) == long[long]));
static assert(is(typeof(func2b(1L, 10L, [1:20,2:20,3:30])) == long[long]));
auto func3a(T)(T, T) { return T.init; }
auto func3b(T)(T, T) { return T.init; }
static assert(is(typeof(func3a(arrS, null)) == short[]));
static assert(is(typeof(func3b(null, arrS)) == short[]));
static assert(is(typeof(func3a(arrR, null)) == real[]));
static assert(is(typeof(func3b(null, arrR)) == real[]));
static assert(is(typeof(func3a(cstr, "str")) == string));
static assert(is(typeof(func3b("str", cstr)) == string));
static assert(is(typeof(func3a(wstr, "str")) == wstring));
static assert(is(typeof(func3b("str", wstr)) == wstring));
static assert(is(typeof(func3a(dstr, "str")) == dstring));
static assert(is(typeof(func3b("str", dstr)) == dstring));
static assert(is(typeof(func3a("str1" , "str2"c)) == string));
static assert(is(typeof(func3b("str1"c, "str2" )) == string));
static assert(is(typeof(func3a("str1" , "str2"w)) == wstring));
static assert(is(typeof(func3b("str1"w, "str2" )) == wstring));
static assert(is(typeof(func3a("str1" , "str2"d)) == dstring));
static assert(is(typeof(func3b("str1"d, "str2" )) == dstring));
inout(V) get(K, V)(inout(V[K]) aa, K key, lazy V defaultValue) { return V.init; }
short[short] hash12220;
short res12220 = get(hash12220, 1, 1);
short[short] hash12221;
enum Key12221 : short { a }
get(hash12221, Key12221.a, Key12221.a);
int[][string] mapping13026;
int[] v = get(mapping13026, "test", []);
}
/******************************************/
// 12292
void test12292()
{
void fun(T : string)(T data) {}
ubyte[3] sa;
static assert(!__traits(compiles, fun(sa)));
static assert(!__traits(compiles, { alias f = fun!(ubyte[3]); }));
}
/******************************************/
// 12376
static auto encode12376(size_t sz)(dchar ch) if (sz > 1)
{
undefined;
}
void test12376()
{
enum x = __traits(compiles, encode12376!2(x));
}
/******************************************/
// 12447
enum test12447(string str) = str; // [1]
string test12447(T...)(T args) if (T.length) { return args[0]; } // [2]
// With [1]: The template parameter str cannot be be deduced -> no match
// With [2]: T is deduced to a type tuple (string), then match to the function call.
static assert(test12447("foo") == "foo");
// With [1]: template parameter str is deduced to "bar", then match.
// With [2]: T is deduced to an expression tuple ("bar"), but it will make invalid the function signature (T args).
// The failure should be masked silently and prefer the 1st version.
static assert(test12447!("bar") == "bar");
/******************************************/
// 12651
alias TemplateArgsOf12651(alias T : Base!Args, alias Base, Args...) = Args;
struct S12651(T) { }
static assert(!__traits(compiles, TemplateArgsOf12651!(S12651!int, S, float)));
/******************************************/
// 12719
struct A12719
{
B12719!int b();
}
struct B12719(T)
{
A12719 a;
void m()
{
auto v = B12719!T.init;
}
}
// --------
enum canDoIt12719(R) = is(typeof(W12719!R));
struct W12719(R)
{
R r;
static if (canDoIt12719!R) {}
}
W12719!int a12719;
/******************************************/
// 12746
template foo12746()
{
void bar()
{
static assert(!__traits(compiles, bar(1)));
}
alias foo12746 = bar;
}
void foo12746(int)
{
assert(0);
}
void test12746()
{
foo12746(); // instantiate
}
/******************************************/
// 12748
void foo12748(S, C : typeof(S.init[0]))(S s, C c)
{
}
void test12748()
{
foo12748("abc", 'd');
}
/******************************************/
// 9708
struct S9708
{
void f()(inout(Object)) inout {}
}
void test9708()
{
S9708 s;
s.f(new Object);
}
/******************************************/
// 12880
void f12880(T)(in T value) { static assert(is(T == string)); }
void test12880() { f12880(string.init); }
/******************************************/
// 13087
struct Vec13087
{
int x;
void m() { auto n = component13087!(this, 'x'); }
void c() const { auto n = component13087!(this, 'x'); }
void w() inout { auto n = component13087!(this, 'x'); }
void wc() inout const { auto n = component13087!(this, 'x'); }
void s() shared { auto n = component13087!(this, 'x'); }
void sc() shared const { auto n = component13087!(this, 'x'); }
void sw() shared inout { auto n = component13087!(this, 'x'); }
void swc() shared inout const { auto n = component13087!(this, 'x'); }
void i() immutable { auto n = component13087!(this, 'x'); }
}
template component13087(alias vec, char c)
{
alias component13087 = vec.x;
}
/******************************************/
// 13127
/+void test13127(inout int = 0)
{
int [] ma1;
const(int)[] ca1;
const(int[]) ca2;
inout( int)[] wma1;
inout( int[]) wma2;
inout(const int)[] wca1;
inout(const int[]) wca2;
immutable(int)[] ia1;
immutable(int[]) ia2;
shared( int)[] sma1;
shared( int[]) sma2;
shared( const int)[] sca1;
shared( const int[]) sca2;
shared(inout int)[] swma1;
shared(inout int[]) swma2;
shared(inout const int)[] swca1;
shared(inout const int[]) swca2;
/* In all cases, U should be deduced to top-unqualified type.
*/
/* Parameter is (shared) mutable
*/
U f_m(U)( U) { return null; }
U fsm(U)(shared U) { return null; }
// 9 * 2 - 1
static assert(is(typeof(f_m( ma1)) == int []));
static assert(is(typeof(f_m( ca1)) == const(int)[]));
static assert(is(typeof(f_m( ca2)) == const(int)[]));
static assert(is(typeof(f_m( wma1)) == inout( int)[]));
static assert(is(typeof(f_m( wma2)) == inout( int)[]));
static assert(is(typeof(f_m( wca1)) == inout(const int)[]));
static assert(is(typeof(f_m( wca2)) == inout(const int)[]));
static assert(is(typeof(f_m( ia1)) == immutable(int)[]));
static assert(is(typeof(f_m( ia2)) == immutable(int)[]));
static assert(is(typeof(f_m( sma1)) == shared( int)[]));
static assert(is(typeof(f_m( sma2)) == shared( int)[])); // <- shared(int[])
static assert(is(typeof(f_m( sca1)) == shared( const int)[]));
static assert(is(typeof(f_m( sca2)) == shared( const int)[])); // <- shared(const(int)[])
static assert(is(typeof(f_m(swma1)) == shared(inout int)[]));
static assert(is(typeof(f_m(swma2)) == shared(inout int)[])); // <- shared(inout(int[]))
static assert(is(typeof(f_m(swca1)) == shared(inout const int)[]));
static assert(is(typeof(f_m(swca2)) == shared(inout const int)[])); // <- shared(inout(const(int))[])
// 9 * 2 - 1
static assert(is(typeof(fsm( ma1))) == false);
static assert(is(typeof(fsm( ca1))) == false);
static assert(is(typeof(fsm( ca2))) == false);
static assert(is(typeof(fsm( wma1))) == false);
static assert(is(typeof(fsm( wma2))) == false);
static assert(is(typeof(fsm( wca1))) == false);
static assert(is(typeof(fsm( wca2))) == false);
static assert(is(typeof(fsm( ia1))) == false);
static assert(is(typeof(fsm( ia2))) == false);
static assert(is(typeof(fsm( sma1)) == shared( int)[])); // <- NG
static assert(is(typeof(fsm( sma2)) == shared( int)[]));
static assert(is(typeof(fsm( sca1)) == shared( const int)[])); // <- NG
static assert(is(typeof(fsm( sca2)) == shared( const int)[]));
static assert(is(typeof(fsm(swma1)) == shared(inout int)[])); // <- NG
static assert(is(typeof(fsm(swma2)) == shared(inout int)[]));
static assert(is(typeof(fsm(swca1)) == shared(inout const int)[])); // <- NG
static assert(is(typeof(fsm(swca2)) == shared(inout const int)[]));
/* Parameter is (shared) const
*/
U f_c(U)( const U) { return null; }
U fsc(U)(shared const U) { return null; }
// 9 * 2 - 1
static assert(is(typeof(f_c( ma1)) == int []));
static assert(is(typeof(f_c( ca1)) == const(int)[]));
static assert(is(typeof(f_c( ca2)) == const(int)[]));
static assert(is(typeof(f_c( wma1)) == inout( int)[]));
static assert(is(typeof(f_c( wma2)) == inout( int)[]));
static assert(is(typeof(f_c( wca1)) == inout(const int)[]));
static assert(is(typeof(f_c( wca2)) == inout(const int)[]));
static assert(is(typeof(f_c( ia1)) == immutable(int)[]));
static assert(is(typeof(f_c( ia2)) == immutable(int)[]));
static assert(is(typeof(f_c( sma1)) == shared( int)[]));
static assert(is(typeof(f_c( sma2)) == shared( int)[])); // <- shared(int[])
static assert(is(typeof(f_c( sca1)) == shared( const int)[]));
static assert(is(typeof(f_c( sca2)) == shared( const int)[])); // <- shared(const(int)[])
static assert(is(typeof(f_c(swma1)) == shared(inout int)[]));
static assert(is(typeof(f_c(swma2)) == shared(inout int)[])); // shared(inout(int)[])
static assert(is(typeof(f_c(swca1)) == shared(inout const int)[]));
static assert(is(typeof(f_c(swca2)) == shared(inout const int)[])); // shared(inout(const(int))[])
// 9 * 2 - 1
static assert(is(typeof(fsc( ma1))) == false);
static assert(is(typeof(fsc( ca1))) == false);
static assert(is(typeof(fsc( ca2))) == false);
static assert(is(typeof(fsc( wma1))) == false);
static assert(is(typeof(fsc( wma2))) == false);
static assert(is(typeof(fsc( wca1))) == false);
static assert(is(typeof(fsc( wca2))) == false);
static assert(is(typeof(fsc( ia1)) == immutable(int)[])); // <- NG
static assert(is(typeof(fsc( ia2)) == immutable(int)[])); // <- NG
static assert(is(typeof(fsc( sma1)) == shared( int)[])); // <- NG
static assert(is(typeof(fsc( sma2)) == shared( int)[]));
static assert(is(typeof(fsc( sca1)) == shared( const int)[])); // <- NG
static assert(is(typeof(fsc( sca2)) == shared( const int)[]));
static assert(is(typeof(fsc(swma1)) == shared(inout int)[])); // <- NG
static assert(is(typeof(fsc(swma2)) == shared(inout int)[]));
static assert(is(typeof(fsc(swca1)) == shared(inout const int)[])); // <- NG
static assert(is(typeof(fsc(swca2)) == shared(inout const int)[]));
/* Parameter is immutable
*/
U fi(U)(immutable U) { return null; }
// 9 * 2 - 1
static assert(is(typeof(fi( ma1))) == false);
static assert(is(typeof(fi( ca1))) == false);
static assert(is(typeof(fi( ca2))) == false);
static assert(is(typeof(fi( wma1))) == false);
static assert(is(typeof(fi( wma2))) == false);
static assert(is(typeof(fi( wca1))) == false);
static assert(is(typeof(fi( wca2))) == false);
static assert(is(typeof(fi( ia1)) == immutable(int)[])); // <- NG
static assert(is(typeof(fi( ia2)) == immutable(int)[])); // <- NG
static assert(is(typeof(fi( sma1))) == false);
static assert(is(typeof(fi( sma2))) == false);
static assert(is(typeof(fi( sca1))) == false);
static assert(is(typeof(fi( sca2))) == false);
static assert(is(typeof(fi(swma1))) == false);
static assert(is(typeof(fi(swma2))) == false);
static assert(is(typeof(fi(swca1))) == false);
static assert(is(typeof(fi(swca2))) == false);
/* Parameter is (shared) inout
*/
U f_w(U)( inout U) { return null; }
U fsw(U)(shared inout U) { return null; }
// 9 * 2 - 1
static assert(is(typeof(f_w( ma1)) == int []));
static assert(is(typeof(f_w( ca1)) == int [])); // <- const(int)[]
static assert(is(typeof(f_w( ca2)) == int [])); // <- const(int)[]
static assert(is(typeof(f_w( wma1)) == int [])); // <- inout(int)[]
static assert(is(typeof(f_w( wma2)) == int [])); // <- inout(int)[]
static assert(is(typeof(f_w( wca1)) == const(int)[])); // <- inout(const(int))[]
static assert(is(typeof(f_w( wca2)) == const(int)[])); // <- inout(const(int))[]
static assert(is(typeof(f_w( ia1)) == int [])); // <- immutable(int)[]
static assert(is(typeof(f_w( ia2)) == int [])); // <- immutable(int)[]
static assert(is(typeof(f_w( sma1)) == shared( int)[]));
static assert(is(typeof(f_w( sma2)) == shared( int)[])); // <- shared(int[])
static assert(is(typeof(f_w( sca1)) == shared( int)[])); // <- shared(const(int))[]
static assert(is(typeof(f_w( sca2)) == shared( int)[])); // <- shared(const(int)[])
static assert(is(typeof(f_w(swma1)) == shared( int)[])); // <- shared(inout(int))[]
static assert(is(typeof(f_w(swma2)) == shared( int)[])); // <- shared(inout(int)[])
static assert(is(typeof(f_w(swca1)) == shared(const int)[])); // <- shared(inout(const(int)))[]
static assert(is(typeof(f_w(swca2)) == shared(const int)[])); // <- shared(inout(const(int))[])
// 9 * 2 - 1
static assert(is(typeof(fsw( ma1))) == false);
static assert(is(typeof(fsw( ca1))) == false);
static assert(is(typeof(fsw( ca2))) == false);
static assert(is(typeof(fsw( wma1))) == false);
static assert(is(typeof(fsw( wma2))) == false);
static assert(is(typeof(fsw( wca1))) == false);
static assert(is(typeof(fsw( wca2))) == false);
static assert(is(typeof(fsw( ia1)) == int [])); // <- NG
static assert(is(typeof(fsw( ia2)) == int [])); // <- NG
static assert(is(typeof(fsw( sma1)) == int [])); // <- NG
static assert(is(typeof(fsw( sma2)) == int []));
static assert(is(typeof(fsw( sca1)) == int [])); // <- NG
static assert(is(typeof(fsw( sca2)) == int [])); // const(int)[]
static assert(is(typeof(fsw(swma1)) == int [])); // <- NG
static assert(is(typeof(fsw(swma2)) == int [])); // inout(int)[]
static assert(is(typeof(fsw(swca1)) == const(int)[])); // <- NG
static assert(is(typeof(fsw(swca2)) == const(int)[])); // <- inout(const(int))[]
/* Parameter is (shared) inout const
*/
U f_wc(U)( inout const U) { return null; }
U fswc(U)(shared inout const U) { return null; }
// 9 * 2 - 1
static assert(is(typeof(f_wc( ma1)) == int []));
static assert(is(typeof(f_wc( ca1)) == int [])); // <- const(int)[]
static assert(is(typeof(f_wc( ca2)) == int [])); // <- const(int)[]
static assert(is(typeof(f_wc( wma1)) == int [])); // <- inout(int)[]
static assert(is(typeof(f_wc( wma2)) == int [])); // <- inout(int)[]
static assert(is(typeof(f_wc( wca1)) == int [])); // <- inout(const(int))[]
static assert(is(typeof(f_wc( wca2)) == int [])); // <- inout(const(int))[]
static assert(is(typeof(f_wc( ia1)) == int [])); // <- immutable(int)[]
static assert(is(typeof(f_wc( ia2)) == int [])); // <- immutable(int)[]
static assert(is(typeof(f_wc( sma1)) == shared(int)[]));
static assert(is(typeof(f_wc( sma2)) == shared(int)[])); // <- shared(int[])
static assert(is(typeof(f_wc( sca1)) == shared(int)[])); // <- shared(const(int))[]
static assert(is(typeof(f_wc( sca2)) == shared(int)[])); // <- shared(const(int)[])
static assert(is(typeof(f_wc(swma1)) == shared(int)[])); // <- shared(inout(int))[]
static assert(is(typeof(f_wc(swma2)) == shared(int)[])); // <- shared(inout(int)[])
static assert(is(typeof(f_wc(swca1)) == shared(int)[])); // <- shared(inout(const(int)))[]
static assert(is(typeof(f_wc(swca2)) == shared(int)[])); // <- shared(inout(const(int))[])
// 9 * 2 - 1
static assert(is(typeof(fswc( ma1))) == false);
static assert(is(typeof(fswc( ca1))) == false);
static assert(is(typeof(fswc( ca2))) == false);
static assert(is(typeof(fswc( wma1))) == false);
static assert(is(typeof(fswc( wma2))) == false);
static assert(is(typeof(fswc( wca1))) == false);
static assert(is(typeof(fswc( wca2))) == false);
static assert(is(typeof(fswc( ia1)) == int [])); // <- NG
static assert(is(typeof(fswc( ia2)) == int [])); // <- NG
static assert(is(typeof(fswc( sma1)) == int [])); // <- NG
static assert(is(typeof(fswc( sma2)) == int []));
static assert(is(typeof(fswc( sca1)) == int [])); // <- NG
static assert(is(typeof(fswc( sca2)) == int [])); // <- const(int)[]
static assert(is(typeof(fswc(swma1)) == int [])); // <- NG
static assert(is(typeof(fswc(swma2)) == int [])); // <- inout(int)[]
static assert(is(typeof(fswc(swca1)) == int [])); // <- NG
static assert(is(typeof(fswc(swca2)) == int [])); // <- inout(const(int))[]
}+/
void test13127a()
{
void foo(T)(in T[] src, T[] dst) { static assert(is(T == int[])); }
int[][] a;
foo(a, a);
}
/******************************************/
// 13159
template maxSize13159(T...)
{
static if (T.length == 1)
{
enum size_t maxSize13159 = T[0].sizeof;
}
else
{
enum size_t maxSize13159 =
T[0].sizeof >= maxSize13159!(T[1 .. $])
? T[0].sizeof
: maxSize13159!(T[1 .. $]);
}
}
struct Node13159
{
struct Pair
{
Node13159 value;
}
//alias Algebraic!(Node[], int) Value;
enum n = maxSize13159!(Node13159[], int);
}
/******************************************/
// 13180
void test13180()
{
inout(V) get1a(K, V)(inout(V[K]) aa, lazy inout(V) defaultValue)
{
static assert(is(V == string));
static assert(is(K == string));
return defaultValue;
}
inout(V) get1b(K, V)(lazy inout(V) defaultValue, inout(V[K]) aa)
{
static assert(is(V == string));
static assert(is(K == string));
return defaultValue;
}
inout(V) get2a(K, V)(inout(V)[K] aa, lazy inout(V) defaultValue)
{
static assert(is(V == string));
static assert(is(K == string));
return defaultValue;
}
inout(V) get2b(K, V)(lazy inout(V) defaultValue, inout(V)[K] aa)
{
static assert(is(V == string));
static assert(is(K == string));
return defaultValue;
}
string def;
string[string] aa;
string s1a = get1a(aa, def);
string s1b = get1b(def, aa);
string s2a = get2a(aa, def);
string s2b = get2b(def, aa);
}
/******************************************/
// 13204
struct A13204(uint v)
{
alias whatever = A13204y;
static assert(is(whatever == A13204));
}
alias A13204x = A13204!1;
alias A13204y = A13204x;
struct B13204(uint v)
{
alias whatever = B13204z;
static assert(is(whatever == B13204));
}
alias B13204x = B13204!1;
alias B13204y = B13204x;
alias B13204z = B13204y;
void test13204()
{
static assert(is(A13204x == A13204!1));
static assert(is(A13204x == A13204!1.whatever));
static assert(is(A13204x == A13204y));
static assert(is(B13204x == B13204!1));
static assert(is(B13204x == B13204!1.whatever));
static assert(is(B13204x == B13204y));
static assert(is(B13204x == B13204z));
}
/******************************************/
// 8462 (dup of 13204)
alias FP8462 = void function(C8462.Type arg);
class C8462
{
enum Type { Foo }
alias funcPtrPtr = FP8462*;
}
/******************************************/
// 13218
template isCallable13218(T...)
if (T.length == 1)
{
static assert(0);
}
template ParameterTypeTuple13218(func...)
if (func.length == 1 && isCallable13218!func)
{
static assert(0);
}
struct R13218
{
private static string mangleFuncPtr(ArgTypes...)()
{
string result = "fnp_";
foreach (T; ArgTypes)
result ~= T.mangleof;
return result;
}
void function(int) fnp_i;
double delegate(double) fnp_d;
void opAssign(FnT)(FnT func)
{
mixin(mangleFuncPtr!( ParameterTypeTuple13218!FnT) ~ " = func;"); // parsed as TypeInstance
//mixin(mangleFuncPtr!(.ParameterTypeTuple13218!FnT) ~ " = func;"); // parsed as DotTemplateInstanceExp -> works
}
}
/******************************************/
// 13219
struct Map13219(V) {}
void test13219a(alias F, VA, VB)(Map13219!VA a, Map13219!VB b)
if (is(VA : typeof(F(VA.init, VB.init))))
{}
void test13219b(alias F)()
{
test13219a!((a, b) => b)(Map13219!int.init, Map13219!int.init);
}
void test13219()
{
int x;
test13219b!x();
}
/******************************************/
// 13223
void test13223()
{
T[] f1(T)(T[] a1, T[] a2)
{
static assert(is(T == int));
return a1 ~ a2;
}
T[] f2(T)(T[] a1, T[] a2)
{
static assert(is(T == int));
return a1 ~ a2;
}
int[] a = [1, 2];
static assert(is(typeof(f1(a, [])) == int[]));
static assert(is(typeof(f2([], a)) == int[]));
static assert(is(typeof(f1(a, null)) == int[]));
static assert(is(typeof(f2(null, a)) == int[]));
T[] f3(T)(T[] a) { return a; }
static assert(is(typeof(f3([])) == void[]));
static assert(is(typeof(f3(null)) == void[]));
T f4(T)(T a) { return a; }
static assert(is(typeof(f4([])) == void[]));
static assert(is(typeof(f4(null)) == typeof(null)));
T[][] f5(T)(T[][] a) { return a; }
static assert(is(typeof(f5([])) == void[][]));
static assert(is(typeof(f5(null)) == void[][]));
void translate(C = immutable char)(const(C)[] toRemove)
{
static assert(is(C == char));
}
translate(null);
}
void test13223a()
{
T f(T)(T, T) { return T.init; }
immutable i = 0;
const c = 0;
auto m = 0;
shared s = 0;
static assert(is(typeof(f(i, i)) == immutable int));
static assert(is(typeof(f(i, c)) == const int));
static assert(is(typeof(f(c, i)) == const int));
static assert(is(typeof(f(i, m)) == int));
static assert(is(typeof(f(m, i)) == int));
static assert(is(typeof(f(c, m)) == int));
static assert(is(typeof(f(m, c)) == int));
static assert(is(typeof(f(m, m)) == int));
static assert(is(typeof(f(i, s)) == shared int));
static assert(is(typeof(f(s, i)) == shared int));
static assert(is(typeof(f(c, s)) == shared int));
static assert(is(typeof(f(s, c)) == shared int));
static assert(is(typeof(f(s, s)) == shared int));
static assert(is(typeof(f(s, m)) == int));
static assert(is(typeof(f(m, s)) == int));
}
/******************************************/
// 13235
struct Tuple13235(T...)
{
T expand;
alias expand field;
this(T values)
{
field = values;
}
}
struct Foo13235
{
Tuple13235!(int, Foo13235)* foo;
}
template Inst13235(T...)
{
struct Tuple
{
T expand;
alias expand field;
this(T values)
{
field = values;
}
}
alias Inst13235 = Tuple*;
}
struct Bar13235
{
Inst13235!(int, Bar13235) bar;
}
void test13235()
{
alias Tup1 = Tuple13235!(int, Foo13235);
assert(Tup1(1, Foo13235()).expand[0] == 1);
alias Tup2 = typeof(*Inst13235!(int, Bar13235).init);
assert(Tup2(1, Bar13235()).expand[0] == 1);
}
/******************************************/
// 13252
alias TypeTuple13252(T...) = T;
static assert(is(typeof(TypeTuple13252!(cast(int )1)[0]) == int ));
static assert(is(typeof(TypeTuple13252!(cast(long)1)[0]) == long));
static assert(is(typeof(TypeTuple13252!(cast(float )3.14)[0]) == float ));
static assert(is(typeof(TypeTuple13252!(cast(double)3.14)[0]) == double));
static assert(is(typeof(TypeTuple13252!(cast(cfloat )(1 + 2i))[0]) == cfloat ));
static assert(is(typeof(TypeTuple13252!(cast(cdouble)(1 + 2i))[0]) == cdouble));
static assert(is(typeof(TypeTuple13252!(cast(string )null)[0]) == string ));
static assert(is(typeof(TypeTuple13252!(cast(string[])null)[0]) == string[])); // OK <- NG
static assert(is(typeof(TypeTuple13252!(cast(wstring)"abc")[0]) == wstring));
static assert(is(typeof(TypeTuple13252!(cast(dstring)"abc")[0]) == dstring));
static assert(is(typeof(TypeTuple13252!(cast(int[] )[])[0]) == int[] ));
static assert(is(typeof(TypeTuple13252!(cast(long[])[])[0]) == long[])); // OK <- NG
struct S13252 { }
static assert(is(typeof(TypeTuple13252!(const S13252())[0]) == const(S13252)));
static assert(is(typeof(TypeTuple13252!(immutable S13252())[0]) == immutable(S13252))); // OK <- NG
/******************************************/
// 13294
void test13294()
{
void f(T)(const ref T src, ref T dst)
{
pragma(msg, "T = ", T);
static assert(!is(T == const));
}
{
const byte src;
byte dst;
f(src, dst);
}
{
const char src;
char dst;
f(src, dst);
}
// 13351
T add(T)(in T x, in T y)
{
T z;
z = x + y;
return z;
}
const double a = 1.0;
const double b = 2.0;
double c;
c = add(a,b);
}
/******************************************/
// 13299
struct Foo13299
{
Foo13299 opDispatch(string name)(int a, int[] b...)
if (name == "bar")
{
return Foo13299();
}
Foo13299 opDispatch(string name)()
if (name != "bar")
{
return Foo13299();
}
}
void test13299()
{
Foo13299()
.bar(0)
.bar(1)
.bar(2);
Foo13299()
.opDispatch!"bar"(0)
.opDispatch!"bar"(1)
.opDispatch!"bar"(2);
}
/******************************************/
// 13333
template AliasThisTypeOf13333(T)
{
static assert(0, T.stringof); // T.stringof is important
}
template StaticArrayTypeOf13333(T)
{
static if (is(AliasThisTypeOf13333!T AT))
alias X = StaticArrayTypeOf13333!AT;
else
alias X = T;
static if (is(X : E[n], E, size_t n))
alias StaticArrayTypeOf13333 = X;
else
static assert(0, T.stringof~" is not a static array type");
}
enum bool isStaticArray13333(T) = is(StaticArrayTypeOf13333!T);
struct VaraiantN13333(T)
{
static if (isStaticArray13333!T)
~this() { static assert(0); }
}
struct DummyScope13333
{
alias A = VaraiantN13333!C;
static class C
{
A entity;
}
}
void test13333()
{
struct DummyScope
{
alias A = VaraiantN13333!C;
static class C
{
A entity;
}
}
}
/******************************************/
// 13374
int f13374(alias a)() { return 1; }
int f13374(string s)() { return 2; }
void x13374(int i) {}
void test13374()
{
assert(f13374!x13374() == 1);
}
/******************************************/
// 14109
string f14109() { return "a"; }
string g14109()() { return "a"; }
struct S14109(string s) { static assert(s == "a"); }
alias X14109 = S14109!(f14109);
alias Y14109 = S14109!(g14109!());
static assert(is(X14109 == Y14109));
/******************************************/
// 13378
struct Vec13378(size_t n, T, string as)
{
T[n] data;
}
void doSome13378(size_t n, T, string as)(Vec13378!(n,T,as) v) {}
void test13378()
{
auto v = Vec13378!(3, float, "xyz")([1,2,3]);
doSome13378(v);
}
/******************************************/
// 13379
void test13379()
{
match13379("");
}
auto match13379(RegEx )(RegEx re)
if (is(RegEx == Regex13379!char)) // #1 Regex!char (speculative && tinst == NULL)
{}
auto match13379(String)(String re)
{}
struct Regex13379(Char)
{
ShiftOr13379!Char kickstart; // #2 ShiftOr!char (speculative && tinst == Regex!char)
}
struct ShiftOr13379(Char)
{
this(ref Regex13379!Char re) // #3 Regex!Char (speculative && tinst == ShiftOr!char)
{
uint n_length;
uint idx;
n_length = min13379(idx, n_length);
}
}
template MinType13379(T...)
{
alias MinType13379 = T[0];
}
MinType13379!T min13379(T...)(T args) // #4 MinType!uint (speculative && thist == ShiftOr!char)
{
alias a = args[0];
alias b = args[$-1];
return cast(typeof(return)) (a < b ? a : b);
}
/******************************************/
// 13417
struct V13417(size_t N, E, alias string AS)
{
}
auto f13417(E)(in V13417!(4, E, "ijka"))
{
return V13417!(3, E, "xyz")();
}
void test13417()
{
f13417(V13417!(4, float, "ijka")());
}
/******************************************/
// 13484
int foo13484()(void delegate() hi) { return 1; }
int foo13484(T)(void delegate(T) hi) { return 2; }
void test13484()
{
assert(foo13484({}) == 1); // works
assert(foo13484((float v){}) == 2); // works <- throws error
}
/******************************************/
// 13675
enum E13675;
bool foo13675(T : E13675)()
{
return false;
}
void test13675()
{
if (foo13675!E13675)
{}
}
/******************************************/
// 13694
auto foo13694(T)(string A, T[] G ...) { return 1; }
auto foo13694(T)(string A, long E, T[] G ...) { return 2; }
void test13694()
{
struct S {}
S v;
assert(foo13694("A", v) == 1); // <- OK
assert(foo13694("A", 0, v) == 2); // <- used to be OK but now fails
assert(foo13694!S("A", 0, v) == 2); // <- workaround solution
}
/******************************************/
// 13760
void test13760()
{
void func(K, V)(inout(V[K]) aa, inout(V) val) {}
class C {}
C[int] aa;
func(aa, new C);
}
/******************************************/
// 13714
struct JSONValue13714
{
this(T)(T arg)
{
}
this(T : JSONValue13714)(inout T arg) inout
{
//store = arg.store;
}
void opAssign(T)(T arg)
{
}
}
void test13714()
{
enum DummyStringEnum
{
foo = "bar"
}
JSONValue13714[string] aa;
aa["A"] = DummyStringEnum.foo;
}
/******************************************/
// 13807
T f13807(T)(inout(T)[] arr)
{
return T.init;
}
void test13807()
{
static assert(is(typeof(f13807([1, 2, 3])) == int)); // OK
static assert(is(typeof(f13807(["a", "b"])) == string)); // OK <- Error
static assert(is(typeof(f13807!string(["a", "b"])) == string)); // OK
}
/******************************************/
// 14174
struct Config14174(a, b) {}
struct N14174 {}
alias defConfig14174 = Config14174!(N14174, N14174);
void accepter14174a(Config : Config14174!(T) = defConfig14174, T...)()
{
static assert(accepter14174a.mangleof
== "_D7breaker131__T14"~
"accepter14174a"~
"HTS7breaker51__T11Config14174TS7breaker6N14174TS7breaker6N14174Z11Config14174TS7breaker6N14174TS7breaker6N14174Z14"~
"accepter14174a"~
"FZv");
}
void accepter14174b(Config : Config14174!(T) = defConfig14174, T...)()
{
static assert(accepter14174b.mangleof
== "_D7breaker131__T14"~
"accepter14174b"~
"HTS7breaker51__T11Config14174TS7breaker6N14174TS7breaker6N14174Z11Config14174TS7breaker6N14174TS7breaker6N14174Z14"~
"accepter14174b"~
"FZv");
}
void test14174()
{
accepter14174a!()(); // ok
accepter14174b(); // error
}
/******************************************/
// 14836
template a14836x(alias B, C...)
{
int a14836x(D...)() if (D.length == 0) { return 1; }
int a14836x(D...)(D d) if (D.length > 0) { return 2; }
}
template a14836y(alias B, C...)
{
int a14836y(T, D...)(T t) if (D.length == 0) { return 1; }
int a14836y(T, D...)(T t, D d) if (D.length > 0) { return 2; }
}
void test14836()
{
int v;
assert(a14836x!(v)() == 1);
assert(a14836x!(v)(1) == 2);
assert(a14836y!(v)(1) == 1);
assert(a14836y!(v)(1, 2) == 2);
}
/******************************************/
// 14357
template Qux14357(T : U*, U : V*, V)
{
pragma(msg, T); // no match <- float**
pragma(msg, U); // no match <- float*
pragma(msg, V); // no match <- int
enum Qux14357 = T.sizeof + V.sizeof;
}
static assert(!__traits(compiles, Qux14357!(float**, int*)));
/******************************************/
// 14481
template someT14481(alias e)
{
alias someT14481 = e;
}
mixin template Mix14481(alias e)
{
alias SomeAlias = someT14481!e;
}
struct Hoge14481
{
mixin Mix14481!e;
enum e = 10;
}
/******************************************/
// 14520
template M14520(alias a) { enum M14520 = 1; }
template M14520(string s) { enum M14520 = 2; }
int f14520a();
string f14520b() { assert(0); }
string f14520c() { return "a"; }
static assert(M14520!f14520a == 1);
static assert(M14520!f14520b == 1);
static assert(M14520!f14520c == 1);
/******************************************/
// 14568
struct Interval14568()
{
auto left = INVALID;
auto opAssign()(Interval14568) { left; }
}
auto interval14568(T)(T point)
{
Interval14568!();
}
alias Instantiate14568(alias symbol, Args...) = symbol!Args;
template Match14568(patterns...)
{
static if (__traits(compiles, Instantiate14568!(patterns[0])))
{
alias Match14568 = patterns[0];
}
else static if (patterns.length == 1)
{}
}
template SubOps14568(Args...)
{
auto opIndex()
{
template IntervalType(T...)
{
alias Point() = typeof(T.interval14568);
alias IntervalType = Match14568!(Point);
}
alias Subspace = IntervalType!(Args);
}
}
struct Nat14568 { mixin SubOps14568!(null); }
/******************************************/
// 14603, 14604
struct S14603
{
template opDispatch(string name)
{
void opDispatch()() {}
}
}
alias a14603 = S14603.opDispatch!"go"; // OK
alias b14603 = S14603.go; // OK <- NG
struct S14604
{
template opDispatch(string name)
{
void opDispatch()() {}
}
}
alias Id14604(alias thing) = thing;
alias c14604 = Id14604!(S14604.opDispatch!"go"); // ok
alias d14604 = Id14604!(S14604.go); // issue 14604, 'Error: template instance opDispatch!"go" cannot resolve forward reference'
/******************************************/
// 14735
enum CS14735 { yes, no }
int indexOf14735a(Range )(Range s, in dchar c) { return 1; }
int indexOf14735a(T, size_t n)(ref T[n] s, in dchar c) { return 2; }
int indexOf14735b(Range )(Range s, in dchar c, in CS14735 cs = CS14735.yes) { return 1; }
int indexOf14735b(T, size_t n)(ref T[n] s, in dchar c, in CS14735 cs = CS14735.yes) { return 2; }
void test14735()
{
char[64] buf;
// Supported from 2.063: (http://dlang.org/changelog#implicitarraycast)
assert(indexOf14735a(buf[0..32], '\0') == 2);
assert(indexOf14735b(buf[0..32], '\0') == 2);
// Have to work as same as above.
assert(indexOf14735a(buf[], '\0') == 2);
assert(indexOf14735b(buf[], '\0') == 2);
}
/******************************************/
// 14743
class A14743
{
auto func1 = (A14743 a) { a.func2!int(); };
auto func2(T)() {}
}
/******************************************/
// 14802
void test14802()
{
auto func(T)(T x, T y) { return x; }
struct S1 { double x; alias x this; }
struct S2 { double x; alias x this; }
S1 s1;
S2 s2;
enum E1 : double { a = 1.0 }
enum E2 : double { a = 1.0 }
static assert(is(typeof( func(1 , 1 ) ) == int));
static assert(is(typeof( func(1u, 1u) ) == uint));
static assert(is(typeof( func(1u, 1 ) ) == uint));
static assert(is(typeof( func(1 , 1u) ) == uint));
static assert(is(typeof( func(1.0f, 1.0f) ) == float));
static assert(is(typeof( func(1.0 , 1.0 ) ) == double));
static assert(is(typeof( func(1.0 , 1.0f) ) == double));
static assert(is(typeof( func(1.0f, 1.0 ) ) == double));
static assert(is(typeof( func(s1, s1) ) == S1));
static assert(is(typeof( func(s2, s2) ) == S2));
static assert(is(typeof( func(s1, s2) ) == double));
static assert(is(typeof( func(s2, s1) ) == double));
static assert(is(typeof( func(E1.a, E1.a) ) == E1));
static assert(is(typeof( func(E2.a, E2.a) ) == E2));
static assert(is(typeof( func(E1.a, 1.0) ) == double));
static assert(is(typeof( func(E2.a, 1.0) ) == double));
static assert(is(typeof( func(1.0, E1.a) ) == double));
static assert(is(typeof( func(1.0, E2.a) ) == double));
static assert(is(typeof( func(E1.a, E2.a) ) == double));
static assert(is(typeof( func(E2.a, E1.a) ) == double));
}
/******************************************/
// 14886
void test14886()
{
alias R = int[100_000];
auto front(T)(T[] a) {}
front(R.init);
auto bar1(T)(T, T[] a) { return T.init; }
auto bar2(T)(T[] a, T) { return T.init; }
static assert(is(typeof(bar1(1L, R.init)) == long));
static assert(is(typeof(bar2(R.init, 1L)) == long));
// <-- T should be deduced to int because R.init is rvalue...?
ubyte x;
static assert(is(typeof(bar1(x, R.init)) == int));
static assert(is(typeof(bar2(R.init, x)) == int));
}
/******************************************/
// 15156
// 15156
auto f15116a(T)(string s, string arg2) { return 1; }
auto f15116b(T)(int i, string arg2) { return 2; }
template bish15116(T)
{
alias bish15116 = f15116a!T;
alias bish15116 = f15116b!T;
}
void test15116()
{
alias func = bish15116!string;
assert(func("", "") == 1);
assert(func(12, "") == 2);
}
/******************************************/
// 15152
void test15152()
{
void func(string M)() { }
struct S
{
enum name = "a";
}
enum s = S.init;
func!(s.name);
}
/******************************************/
// 15352
struct S15352(T, T delegate(uint idx) supplier)
{
}
auto make15352a(T, T delegate(uint idx) supplier)()
{
enum local = supplier; // OK
S15352!(T, local) ret;
return ret;
}
auto make15352b(T, T delegate(uint idx) supplier)()
{
S15352!(T, supplier) ret; // OK <- Error
return ret;
}
void test15352()
{
enum dg = delegate(uint idx) => idx;
auto s1 = S15352!(uint, dg)();
auto s2 = make15352a!(uint, dg)();
auto s3 = make15352b!(uint, dg)();
assert(is(typeof(s1) == typeof(s2)));
assert(is(typeof(s1) == typeof(s3)));
}
/******************************************/
// 15623
struct WithFoo15623a { void foo() {} }
struct WithFoo15623b { void foo() {} }
struct WithFoo15623c { void foo() {} }
struct WithFoo15623d { void foo() {} }
struct WithoutFoo15623a {}
struct WithoutFoo15623b {}
struct WithoutFoo15623c {}
struct WithoutFoo15623d {}
struct CallsFoo15623(T)
{
T t;
void bar() { t.foo(); } // error occurs during TemplateInstance.semantic3
}
// Instantiations outside of function bodies
static assert( is(CallsFoo15623!WithFoo15623a));
static assert(!is(CallsFoo15623!WithoutFoo15623a)); // OK <- NG
static assert( __traits(compiles, CallsFoo15623!WithFoo15623b));
static assert(!__traits(compiles, CallsFoo15623!WithoutFoo15623b)); // OK <- NG
// Instantiations inside function bodies (OK)
static assert( is(typeof({ alias Baz = CallsFoo15623!WithFoo15623c; return Baz.init; }())));
static assert(!is(typeof({ alias Baz = CallsFoo15623!WithoutFoo15623c; return Baz.init; }())));
static assert( __traits(compiles, { alias Baz = CallsFoo15623!WithFoo15623d; return Baz.init; }()));
static assert(!__traits(compiles, { alias Baz = CallsFoo15623!WithoutFoo15623d; return Baz.init; }()));
/******************************************/
// 15781
void test15781()
{
static struct S
{
int value;
}
T foo(T)(T a, T b)
{
return T();
}
const S cs;
S ms;
static assert(is(typeof(foo(ms, ms)) == S));
static assert(is(typeof(foo(ms, cs)) == const S));
static assert(is(typeof(foo(cs, ms)) == const S));
static assert(is(typeof(foo(cs, cs)) == const S));
}
/******************************************/
int main()
{
test1();
test2();
test3();
test4();
test5();
test6();
test7();
test8();
test9();
test1780();
test3608();
test5893();
test6404();
test2246();
test2296();
bug4984();
test2579();
test2803();
test6613();
test5886();
test5393();
test5896();
test6825();
test6789();
test2778();
test2778aa();
test2778get();
test6208a();
test6208b();
test6208c();
test6738();
test6780();
test6810();
test6891();
test6994();
test6764();
test3467();
test4413();
test5525();
test5801();
test10();
test7037();
test7124();
test7359();
test7416();
test7563();
test7572();
test7580();
test7585();
test7671();
test7672();
test7684();
test11a();
test11b();
test7769();
test7873();
test7933();
test8094();
test12();
test8125();
test13();
test14();
test8129();
test8238();
test8669();
test8833();
test8976();
test8940();
test9022();
test9026();
test9038();
test9076();
test9100();
test9124a();
test9124b();
test9143();
test9266();
test9536();
test9578();
test9596();
test9837();
test9874();
test9885();
test9971();
test9977();
test10083();
test10592();
test11242();
test10811();
test10969();
test11271();
test11533();
test11818();
test11843();
test11872();
test12122();
test12207();
test12376();
test13235();
test13294();
test13299();
test13374();
test13378();
test13379();
test13484();
test13694();
test14836();
test14735();
test14802();
test15116();
printf("Success\n");
return 0;
}
|
D
|
import std.stdio, std.exception;
import game.menu;
void main(string[] args) {
try {
startGame(args);
}
catch(Exception e) {
writeln(e.msg);
foreach(trace; e.info) {
writeln("at: ", trace);
}
}
}
|
D
|
/**
Copyright: © 2013 Simon Kérouack.
License: Subject to the terms of the MIT license,
as written in the included LICENSE.txt file.
Authors: Simon Kérouack
*/
module plugin.network.transaction;
public import plugin.network.session;
|
D
|
/Users/Avinash/Documents/Code/Poochie/Poochie/DerivedData/Poochie/Build/Intermediates/Pods.build/Debug-iphonesimulator/EPDeckView.build/Objects-normal/x86_64/Extensions.o : /Users/Avinash/Documents/Code/Poochie/Poochie/Pods/EPDeckView/Pod/Classes/EPCardView.swift /Users/Avinash/Documents/Code/Poochie/Poochie/Pods/EPDeckView/Pod/Classes/EPDeckView.swift /Users/Avinash/Documents/Code/Poochie/Poochie/Pods/EPDeckView/Pod/Classes/EPDeckViewAnimationManager.swift /Users/Avinash/Documents/Code/Poochie/Poochie/Pods/EPDeckView/Pod/Classes/Extensions.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/Avinash/Documents/Code/Poochie/Poochie/Pods/Target\ Support\ Files/EPDeckView/EPDeckView-umbrella.h /Users/Avinash/Documents/Code/Poochie/Poochie/DerivedData/Poochie/Build/Intermediates/Pods.build/Debug-iphonesimulator/EPDeckView.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule
/Users/Avinash/Documents/Code/Poochie/Poochie/DerivedData/Poochie/Build/Intermediates/Pods.build/Debug-iphonesimulator/EPDeckView.build/Objects-normal/x86_64/Extensions~partial.swiftmodule : /Users/Avinash/Documents/Code/Poochie/Poochie/Pods/EPDeckView/Pod/Classes/EPCardView.swift /Users/Avinash/Documents/Code/Poochie/Poochie/Pods/EPDeckView/Pod/Classes/EPDeckView.swift /Users/Avinash/Documents/Code/Poochie/Poochie/Pods/EPDeckView/Pod/Classes/EPDeckViewAnimationManager.swift /Users/Avinash/Documents/Code/Poochie/Poochie/Pods/EPDeckView/Pod/Classes/Extensions.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/Avinash/Documents/Code/Poochie/Poochie/Pods/Target\ Support\ Files/EPDeckView/EPDeckView-umbrella.h /Users/Avinash/Documents/Code/Poochie/Poochie/DerivedData/Poochie/Build/Intermediates/Pods.build/Debug-iphonesimulator/EPDeckView.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule
/Users/Avinash/Documents/Code/Poochie/Poochie/DerivedData/Poochie/Build/Intermediates/Pods.build/Debug-iphonesimulator/EPDeckView.build/Objects-normal/x86_64/Extensions~partial.swiftdoc : /Users/Avinash/Documents/Code/Poochie/Poochie/Pods/EPDeckView/Pod/Classes/EPCardView.swift /Users/Avinash/Documents/Code/Poochie/Poochie/Pods/EPDeckView/Pod/Classes/EPDeckView.swift /Users/Avinash/Documents/Code/Poochie/Poochie/Pods/EPDeckView/Pod/Classes/EPDeckViewAnimationManager.swift /Users/Avinash/Documents/Code/Poochie/Poochie/Pods/EPDeckView/Pod/Classes/Extensions.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/Avinash/Documents/Code/Poochie/Poochie/Pods/Target\ Support\ Files/EPDeckView/EPDeckView-umbrella.h /Users/Avinash/Documents/Code/Poochie/Poochie/DerivedData/Poochie/Build/Intermediates/Pods.build/Debug-iphonesimulator/EPDeckView.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule
|
D
|
import core.runtime, core.stdc.stdio, core.thread;
version (linux) import core.sys.linux.dlfcn;
else version (FreeBSD) import core.sys.freebsd.dlfcn;
else static assert(0, "unimplemented");
void loadSym(T)(void* handle, ref T val, const char* mangle)
{
val = cast(T).dlsym(handle, mangle);
}
void* openLib(string s)
{
auto h = Runtime.loadLibrary(s);
assert(h !is null);
loadSym(h, libThrowException, "_D3lib14throwExceptionFZv");
loadSym(h, libCollectException, "_D3lib16collectExceptionFDFZvZC9Exception");
loadSym(h, libAlloc, "_D3lib5allocFZv");
loadSym(h, libTlsAlloc, "_D3lib9tls_allocFZv");
loadSym(h, libAccess, "_D3lib6accessFZv");
loadSym(h, libTlsAccess, "_D3lib10tls_accessFZv");
loadSym(h, libFree, "_D3lib4freeFZv");
loadSym(h, libTlsFree, "_D3lib8tls_freeFZv");
loadSym(h, libSharedStaticCtor, "_D3lib18shared_static_ctorOk");
loadSym(h, libSharedStaticDtor, "_D3lib18shared_static_dtorOk");
loadSym(h, libStaticCtor, "_D3lib11static_ctorOk");
loadSym(h, libStaticDtor, "_D3lib11static_dtorOk");
return h;
}
void closeLib(void* h)
{
Runtime.unloadLibrary(h);
}
__gshared
{
void function() libThrowException;
Exception function(void delegate()) libCollectException;
void function() libAlloc;
void function() libTlsAlloc;
void function() libAccess;
void function() libTlsAccess;
void function() libFree;
void function() libTlsFree;
shared uint* libSharedStaticCtor;
shared uint* libSharedStaticDtor;
shared uint* libStaticCtor;
shared uint* libStaticDtor;
}
void testEH()
{
bool passed;
try
libThrowException();
catch (Exception e)
passed = true;
assert(passed); passed = false;
assert(libCollectException({throw new Exception(null);}) !is null);
assert(libCollectException({libThrowException();}) !is null);
}
void testGC()
{
import core.memory;
libAlloc();
libTlsAlloc();
libAccess();
libTlsAccess();
GC.collect();
libTlsAccess();
libAccess();
libTlsFree();
libFree();
}
void testInit()
{
assert(*libStaticCtor == 1);
assert(*libStaticDtor == 0);
static void run()
{
assert(*libSharedStaticCtor == 1);
assert(*libSharedStaticDtor == 0);
assert(*libStaticCtor == 2);
assert(*libStaticDtor == 0);
}
auto thr = new Thread(&run);
thr.start();
thr.join();
assert(*libSharedStaticCtor == 1);
assert(*libSharedStaticDtor == 0);
assert(*libStaticCtor == 2);
assert(*libStaticDtor == 1);
}
const(ModuleInfo)* findModuleInfo(string name)
{
foreach (m; ModuleInfo)
if (m.name == name) return m;
return null;
}
void runTests(string libName)
{
assert(findModuleInfo("lib") is null);
auto handle = openLib(libName);
assert(findModuleInfo("lib") !is null);
testEH();
testGC();
testInit();
closeLib(handle);
assert(findModuleInfo("lib") is null);
}
void main(string[] args)
{
auto name = args[0];
assert(name[$-5 .. $] == "/load");
name = name[0 .. $-4] ~ "lib.so";
runTests(name);
// lib is no longer resident
name ~= '\0';
assert(.dlopen(name.ptr, RTLD_LAZY | RTLD_NOLOAD) is null);
name = name[0 .. $-1];
auto thr = new Thread({runTests(name);});
thr.start();
thr.join();
}
|
D
|
<?xml version="1.0" encoding="ASCII" standalone="no"?>
<di:SashWindowsMngr xmlns:di="http://www.eclipse.org/papyrus/0.7.0/sashdi" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmi:version="2.0">
<pageList>
<availablePage>
<emfPageIdentifier href="VAR_27_banking-1376663924.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</availablePage>
</pageList>
<sashModel currentSelection="//@sashModel/@windows.0/@children.0">
<windows>
<children xsi:type="di:TabFolder">
<children>
<emfPageIdentifier href="VAR_27_banking-1376663924.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</children>
</children>
</windows>
</sashModel>
</di:SashWindowsMngr>
|
D
|
// https://issues.dlang.org/show_bug.cgi?id=21096
/*
TEST_OUTPUT:
---
fail_compilation/test21096.d(11): Error: identifier or new keyword expected following `(...)`.
fail_compilation/test21096.d(11): Error: no identifier for declarator `char[(__error)]`
---
*/
char[(void*).];
|
D
|
void main() {
int[] nums;
nums.length = 1 + 10 + 1;
enum Gate {closed, open}
Gate[] gates; // all set to closed
gates.length = nums.length;
auto line = "";
foreach(i; 1 .. nums.length - 1) {
int rc;
do {
import std.random;
rc = cast(int)uniform(1, nums.length - 1);
} while(gates[rc] == Gate.open);
gates[rc] = Gate.open;
import std.string;
line ~= format("%s ", rc);
if (line.length + 3 > 3 * 10 || i == nums.length - 2) {
import std.stdio;
writeln(line);
line.length = 0;
}
}
}
|
D
|
module android.java.java.lang.StringBuilder_d_interface;
import arsd.jni : IJavaObjectImplementation, JavaPackageId, JavaName, IJavaObject, ImportExportImpl, JavaInterfaceMembers;
static import arsd.jni;
import import2 = android.java.java.lang.StringBuffer_d_interface;
import import5 = android.java.java.util.stream.IntStream_d_interface;
import import0 = android.java.java.lang.CharSequence_d_interface;
import import3 = android.java.java.lang.Appendable_d_interface;
import import4 = android.java.java.lang.Class_d_interface;
import import1 = android.java.java.lang.StringBuilder_d_interface;
final class StringBuilder : IJavaObject {
static immutable string[] _d_canCastTo = [
"java/lang/Appendable",
"java/lang/CharSequence",
"java/io/Serializable",
];
@Import this(arsd.jni.Default);
@Import this(int);
@Import this(string);
@Import this(import0.CharSequence);
@Import import1.StringBuilder append(IJavaObject);
@Import import1.StringBuilder append(string);
@Import import1.StringBuilder append(import2.StringBuffer);
@Import import1.StringBuilder append(import0.CharSequence);
@Import import1.StringBuilder append(import0.CharSequence, int, int);
@Import import1.StringBuilder append(wchar[]);
@Import import1.StringBuilder append(wchar, int, int[]);
@Import import1.StringBuilder append(bool);
@Import import1.StringBuilder append(wchar);
@Import import1.StringBuilder append(int);
@Import import1.StringBuilder append(long);
@Import import1.StringBuilder append(float);
@Import import1.StringBuilder append(double);
@Import import1.StringBuilder appendCodePoint(int);
@Import @JavaName("delete") import1.StringBuilder delete_(int, int);
@Import import1.StringBuilder deleteCharAt(int);
@Import import1.StringBuilder replace(int, int, string);
@Import import1.StringBuilder insert(int, wchar, int, int[]);
@Import import1.StringBuilder insert(int, IJavaObject);
@Import import1.StringBuilder insert(int, string);
@Import import1.StringBuilder insert(int, wchar[]);
@Import import1.StringBuilder insert(int, import0.CharSequence);
@Import import1.StringBuilder insert(int, import0.CharSequence, int, int);
@Import import1.StringBuilder insert(int, bool);
@Import import1.StringBuilder insert(int, wchar);
@Import import1.StringBuilder insert(int, int);
@Import import1.StringBuilder insert(int, long);
@Import import1.StringBuilder insert(int, float);
@Import import1.StringBuilder insert(int, double);
@Import int indexOf(string);
@Import int indexOf(string, int);
@Import int lastIndexOf(string);
@Import int lastIndexOf(string, int);
@Import import1.StringBuilder reverse();
@Import @JavaName("toString") string toString_();
override string toString() { return arsd.jni.javaObjectToString(this); }
@Import void trimToSize();
@Import int codePointAt(int);
@Import void getChars(int, int, wchar, int[]);
@Import int length();
@Import void setCharAt(int, wchar);
@Import import0.CharSequence subSequence(int, int);
@Import string substring(int);
@Import string substring(int, int);
@Import int capacity();
@Import void setLength(int);
@Import void ensureCapacity(int);
@Import int codePointBefore(int);
@Import wchar charAt(int);
@Import int codePointCount(int, int);
@Import int offsetByCodePoints(int, int);
@Import import4.Class getClass();
@Import int hashCode();
@Import bool equals(IJavaObject);
@Import void notify();
@Import void notifyAll();
@Import void wait(long);
@Import void wait(long, int);
@Import void wait();
@Import import5.IntStream chars();
@Import import5.IntStream codePoints();
mixin IJavaObjectImplementation!(false);
public static immutable string _javaParameterString = "Ljava/lang/StringBuilder;";
}
|
D
|
/**
* String manipulation and comparison utilities.
*
* Copyright: Copyright Sean Kelly 2005 - 2009.
* License: $(WEB www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
* Authors: Sean Kelly, Walter Bright
* Source: $(DRUNTIMESRC src/rt/util/_string.d)
*/
module core.internal.string;
pure:
nothrow:
@nogc:
alias UnsignedStringBuf = char[20];
char[] unsignedToTempString(ulong value, char[] buf, uint radix = 10) @safe
{
size_t i = buf.length;
do
{
ubyte x = cast(ubyte)(value % radix);
value = value / radix;
buf[--i] = cast(char)((x < 10) ? x + '0' : x - 10 + 'a');
} while (value);
return buf[i .. $];
}
private struct TempStringNoAlloc
{
// need to handle 65 bytes for radix of 2 with negative sign.
private char[65] _buf;
private ubyte _len;
auto get() return
{
return _buf[$-_len..$];
}
alias get this;
}
auto unsignedToTempString(ulong value, uint radix) @safe
{
TempStringNoAlloc result = void;
result._len = unsignedToTempString(value, result._buf, radix).length & 0xff;
return result;
}
unittest
{
UnsignedStringBuf buf;
assert(0.unsignedToTempString(buf, 10) == "0");
assert(1.unsignedToTempString(buf, 10) == "1");
assert(12.unsignedToTempString(buf, 10) == "12");
assert(0x12ABCF .unsignedToTempString(buf, 16) == "12abcf");
assert(long.sizeof.unsignedToTempString(buf, 10) == "8");
assert(uint.max.unsignedToTempString(buf, 10) == "4294967295");
assert(ulong.max.unsignedToTempString(buf, 10) == "18446744073709551615");
// use stack allocated struct version
assert(0.unsignedToTempString(10) == "0");
assert(1.unsignedToTempString(10) == "1");
assert(12.unsignedToTempString(10) == "12");
assert(0x12ABCF .unsignedToTempString(16) == "12abcf");
assert(long.sizeof.unsignedToTempString(10) == "8");
assert(uint.max.unsignedToTempString(10) == "4294967295");
assert(ulong.max.unsignedToTempString(10) == "18446744073709551615");
}
alias SignedStringBuf = char[20];
auto signedToTempString(long value, char[] buf, uint radix) @safe
{
bool neg = value < 0;
if(neg)
value = cast(ulong)-value;
auto r = unsignedToTempString(value, buf, radix);
if(neg)
{
// about to do a slice without a bounds check
assert(r.ptr > buf.ptr);
r = (() @trusted => (r.ptr-1)[0..r.length+1])();
r[0] = '-';
}
return r;
}
auto signedToTempString(long value, uint radix) @safe
{
bool neg = value < 0;
if(neg)
value = cast(ulong)-value;
auto r = unsignedToTempString(value, radix);
if(neg)
{
r._len++;
r.get()[0] = '-';
}
return r;
}
unittest
{
SignedStringBuf buf;
assert(0.signedToTempString(buf, 10) == "0");
assert(1.signedToTempString(buf, 10) == "1");
assert((-1).signedToTempString(buf, 10) == "-1");
assert(12.signedToTempString(buf, 10) == "12");
assert((-12).signedToTempString(buf, 10) == "-12");
assert(0x12ABCF .signedToTempString(buf, 16) == "12abcf");
assert((-0x12ABCF) .signedToTempString(buf, 16) == "-12abcf");
assert(long.sizeof.signedToTempString(buf, 10) == "8");
assert(int.max.signedToTempString(buf, 10) == "2147483647");
assert(int.min.signedToTempString(buf, 10) == "-2147483648");
assert(long.max.signedToTempString(buf, 10) == "9223372036854775807");
assert(long.min.signedToTempString(buf, 10) == "-9223372036854775808");
// use stack allocated struct version
assert(0.signedToTempString(10) == "0");
assert(1.signedToTempString(10) == "1");
assert((-1).signedToTempString(10) == "-1");
assert(12.signedToTempString(10) == "12");
assert((-12).signedToTempString(10) == "-12");
assert(0x12ABCF .signedToTempString(16) == "12abcf");
assert((-0x12ABCF) .signedToTempString(16) == "-12abcf");
assert(long.sizeof.signedToTempString(10) == "8");
assert(int.max.signedToTempString(10) == "2147483647");
assert(int.min.signedToTempString(10) == "-2147483648");
assert(long.max.signedToTempString(10) == "9223372036854775807");
assert(long.min.signedToTempString(10) == "-9223372036854775808");
assert(long.max.signedToTempString(2) == "111111111111111111111111111111111111111111111111111111111111111");
assert(long.min.signedToTempString(2) == "-1000000000000000000000000000000000000000000000000000000000000000");
}
/********************************
* Determine number of digits that will result from a
* conversion of value to a string.
* Params:
* value = number to convert
* radix = radix
* Returns:
* number of digits
*/
int numDigits(uint radix = 10)(ulong value) @safe
{
int n = 1;
while (1)
{
if (value <= uint.max)
{
uint v = cast(uint)value;
while (1)
{
if (v < radix)
return n;
if (v < radix * radix)
return n + 1;
if (v < radix * radix * radix)
return n + 2;
if (v < radix * radix * radix * radix)
return n + 3;
n += 4;
v /= radix * radix * radix * radix;
}
}
n += 4;
value /= radix * radix * radix * radix;
}
}
unittest
{
assert(0.numDigits == 1);
assert(9.numDigits == 1);
assert(10.numDigits == 2);
assert(99.numDigits == 2);
assert(100.numDigits == 3);
assert(999.numDigits == 3);
assert(1000.numDigits == 4);
assert(9999.numDigits == 4);
assert(10000.numDigits == 5);
assert(99999.numDigits == 5);
assert(uint.max.numDigits == 10);
assert(ulong.max.numDigits == 20);
assert(0.numDigits!2 == 1);
assert(1.numDigits!2 == 1);
assert(2.numDigits!2 == 2);
assert(3.numDigits!2 == 2);
}
int dstrcmp( in char[] s1, in char[] s2 ) @trusted
{
import barec : memcmp;
int ret = 0;
auto len = s1.length;
if( s2.length < len )
len = s2.length;
if( 0 != (ret = memcmp( s1.ptr, s2.ptr, len )) )
return ret;
return s1.length > s2.length ? 1 :
s1.length == s2.length ? 0 : -1;
}
|
D
|
#source: mov2.s
#as: --64
#ld: -pie -melf_x86_64
#objdump: -dw
.*: +file format .*
Disassembly of section .text:
#...
[ ]*[a-f0-9]+: 48 8b 05 ([0-9a-f]{2} ){4} * mov 0x[a-f0-9]+\(%rip\),%rax # [a-f0-9]+ <.*>
[ ]*[a-f0-9]+: 48 8b 05 ([0-9a-f]{2} ){4} * mov 0x[a-f0-9]+\(%rip\),%rax # [a-f0-9]+ <.*>
[ ]*[a-f0-9]+: 48 8b 05 ([0-9a-f]{2} ){4} * mov 0x[a-f0-9]+\(%rip\),%rax # [a-f0-9]+ <.*>
#pass
|
D
|
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
module dscanner.analysis.properly_documented_public_functions;
import dparse.lexer;
import dparse.ast;
import dparse.formatter : astFmt = format;
import dscanner.analysis.base;
import dscanner.utils : safeAccess;
import std.format : format;
import std.range.primitives;
import std.stdio;
/**
* Requires each public function to contain the following ddoc sections
- PARAMS:
- if the function has at least one parameter
- every parameter must have a ddoc params entry (applies for template paramters too)
- Ddoc params entries without a parameter trigger warnings as well
- RETURNS: (except if it's void, only functions)
*/
final class ProperlyDocumentedPublicFunctions : BaseAnalyzer
{
enum string MISSING_PARAMS_KEY = "dscanner.style.doc_missing_params";
enum string MISSING_PARAMS_MESSAGE = "Parameter %s isn't documented in the `Params` section.";
enum string MISSING_TEMPLATE_PARAMS_MESSAGE
= "Template parameters %s isn't documented in the `Params` section.";
enum string NON_EXISTENT_PARAMS_KEY = "dscanner.style.doc_non_existing_params";
enum string NON_EXISTENT_PARAMS_MESSAGE = "Documented parameter %s isn't a function parameter.";
enum string MISSING_RETURNS_KEY = "dscanner.style.doc_missing_returns";
enum string MISSING_RETURNS_MESSAGE = "A public function needs to contain a `Returns` section.";
enum string MISSING_THROW_KEY = "dscanner.style.doc_missing_throw";
enum string MISSING_THROW_MESSAGE = "An instance of `%s` is thrown but not documented in the `Throws` section";
mixin AnalyzerInfo!"properly_documented_public_functions";
///
this(string fileName, bool skipTests = false)
{
super(fileName, null, skipTests);
}
override void visit(const Module mod)
{
islastSeenVisibilityLabelPublic = true;
mod.accept(this);
postCheckSeenDdocParams();
}
override void visit(const UnaryExpression decl)
{
import std.algorithm.searching : canFind;
const IdentifierOrTemplateInstance iot = safeAccess(decl)
.functionCallExpression.unaryExpression.primaryExpression
.identifierOrTemplateInstance;
Type newNamedType(N)(N name)
{
Type t = new Type;
t.type2 = new Type2;
t.type2.typeIdentifierPart = new TypeIdentifierPart;
t.type2.typeIdentifierPart.identifierOrTemplateInstance = new IdentifierOrTemplateInstance;
t.type2.typeIdentifierPart.identifierOrTemplateInstance.identifier = name;
return t;
}
if (inThrowExpression && decl.newExpression && decl.newExpression.type &&
!thrown.canFind!(a => a == decl.newExpression.type))
{
thrown ~= decl.newExpression.type;
}
// enforce(condition);
if (iot && iot.identifier.text == "enforce")
{
thrown ~= newNamedType(Token(tok!"identifier", "Exception", 0, 0, 0));
}
else if (iot && iot.templateInstance && iot.templateInstance.identifier.text == "enforce")
{
// enforce!Type(condition);
if (const TemplateSingleArgument tsa = safeAccess(iot.templateInstance)
.templateArguments.templateSingleArgument)
{
thrown ~= newNamedType(tsa.token);
}
// enforce!(Type)(condition);
else if (const TemplateArgumentList tal = safeAccess(iot.templateInstance)
.templateArguments.templateArgumentList)
{
if (tal.items.length && tal.items[0].type)
thrown ~= tal.items[0].type;
}
}
decl.accept(this);
}
override void visit(const Declaration decl)
{
import std.algorithm.searching : any;
import std.algorithm.iteration : map;
// skip private symbols
enum tokPrivate = tok!"private",
tokProtected = tok!"protected",
tokPackage = tok!"package",
tokPublic = tok!"public";
// Nested funcs for `Throws`
bool decNestedFunc;
if (decl.functionDeclaration)
{
nestedFuncs++;
decNestedFunc = true;
}
scope(exit)
{
if (decNestedFunc)
nestedFuncs--;
}
if (nestedFuncs > 1)
{
decl.accept(this);
return;
}
if (decl.attributes.length > 0)
{
const bool isPublic = !decl.attributes.map!`a.attribute`.any!(x => x == tokPrivate ||
x == tokProtected ||
x == tokPackage);
// recognize label blocks
if (!hasDeclaration(decl))
islastSeenVisibilityLabelPublic = isPublic;
if (!isPublic)
return;
}
if (islastSeenVisibilityLabelPublic || decl.attributes.map!`a.attribute`.any!(x => x == tokPublic))
{
// Don't complain about non-documented function declarations
if ((decl.functionDeclaration !is null && decl.functionDeclaration.comment.ptr !is null) ||
(decl.templateDeclaration !is null && decl.templateDeclaration.comment.ptr !is null) ||
decl.mixinTemplateDeclaration !is null ||
(decl.classDeclaration !is null && decl.classDeclaration.comment.ptr !is null) ||
(decl.structDeclaration !is null && decl.structDeclaration.comment.ptr !is null))
decl.accept(this);
}
}
override void visit(const TemplateDeclaration decl)
{
setLastDdocParams(decl.name.line, decl.name.column, decl.comment);
checkDdocParams(decl.name.line, decl.name.column, decl.templateParameters);
withinTemplate = true;
scope(exit) withinTemplate = false;
decl.accept(this);
}
override void visit(const MixinTemplateDeclaration decl)
{
decl.accept(this);
}
override void visit(const StructDeclaration decl)
{
setLastDdocParams(decl.name.line, decl.name.column, decl.comment);
checkDdocParams(decl.name.line, decl.name.column, decl.templateParameters);
decl.accept(this);
}
override void visit(const ClassDeclaration decl)
{
setLastDdocParams(decl.name.line, decl.name.column, decl.comment);
checkDdocParams(decl.name.line, decl.name.column, decl.templateParameters);
decl.accept(this);
}
override void visit(const FunctionDeclaration decl)
{
import std.algorithm.searching : all, any;
import std.array : Appender;
// ignore header declaration for now
if (!decl.functionBody || (!decl.functionBody.specifiedFunctionBody
&& !decl.functionBody.shortenedFunctionBody))
return;
if (nestedFuncs == 1)
thrown.length = 0;
// detect ThrowExpression only if not nothrow
if (!decl.attributes.any!(a => a.attribute.text == "nothrow"))
{
decl.accept(this);
if (nestedFuncs == 1 && !hasThrowSection(decl.comment))
foreach(t; thrown)
{
Appender!(char[]) app;
astFmt(&app, t);
addErrorMessage(decl.name.line, decl.name.column, MISSING_THROW_KEY,
MISSING_THROW_MESSAGE.format(app.data));
}
}
if (nestedFuncs == 1)
{
auto comment = setLastDdocParams(decl.name.line, decl.name.column, decl.comment);
checkDdocParams(decl.name.line, decl.name.column, decl.parameters, decl.templateParameters);
enum voidType = tok!"void";
if (decl.returnType is null || decl.returnType.type2.builtinType != voidType)
if (!(comment.isDitto || withinTemplate || comment.sections.any!(s => s.name == "Returns")))
addErrorMessage(decl.name.line, decl.name.column,
MISSING_RETURNS_KEY, MISSING_RETURNS_MESSAGE);
}
}
// remove thrown Type that are caught
override void visit(const TryStatement ts)
{
import std.algorithm.iteration : filter;
import std.algorithm.searching : canFind;
import std.array : array;
ts.accept(this);
if (ts.catches)
thrown = thrown.filter!(a => !ts.catches.catches
.canFind!(b => b.type == a))
.array;
}
override void visit(const ThrowExpression ts)
{
const wasInThrowExpression = inThrowExpression;
inThrowExpression = true;
scope (exit)
inThrowExpression = wasInThrowExpression;
ts.accept(this);
inThrowExpression = false;
}
alias visit = BaseAnalyzer.visit;
private:
bool islastSeenVisibilityLabelPublic;
bool withinTemplate;
size_t nestedFuncs;
static struct Function
{
bool active;
size_t line, column;
const(string)[] ddocParams;
bool[string] params;
}
Function lastSeenFun;
bool inThrowExpression;
const(Type)[] thrown;
// find invalid ddoc parameters (i.e. they don't occur in a function declaration)
void postCheckSeenDdocParams()
{
import std.format : format;
if (lastSeenFun.active)
foreach (p; lastSeenFun.ddocParams)
if (p !in lastSeenFun.params)
addErrorMessage(lastSeenFun.line, lastSeenFun.column, NON_EXISTENT_PARAMS_KEY,
NON_EXISTENT_PARAMS_MESSAGE.format(p));
lastSeenFun.active = false;
}
bool hasThrowSection(string commentText)
{
import std.algorithm.searching : canFind;
import ddoc.comments : parseComment;
const comment = parseComment(commentText, null);
return comment.isDitto || comment.sections.canFind!(s => s.name == "Throws");
}
auto setLastDdocParams(size_t line, size_t column, string commentText)
{
import ddoc.comments : parseComment;
import std.algorithm.searching : find;
import std.algorithm.iteration : map;
import std.array : array;
const comment = parseComment(commentText, null);
if (withinTemplate)
{
const paramSection = comment.sections.find!(s => s.name == "Params");
if (!paramSection.empty)
lastSeenFun.ddocParams ~= paramSection[0].mapping.map!(a => a[0]).array;
}
else if (!comment.isDitto)
{
// check old function for invalid ddoc params
if (lastSeenFun.active)
postCheckSeenDdocParams();
const paramSection = comment.sections.find!(s => s.name == "Params");
if (paramSection.empty)
{
lastSeenFun = Function(true, line, column, null);
}
else
{
auto ddocParams = paramSection[0].mapping.map!(a => a[0]).array;
lastSeenFun = Function(true, line, column, ddocParams);
}
}
return comment;
}
void checkDdocParams(size_t line, size_t column, const Parameters params,
const TemplateParameters templateParameters = null)
{
import std.array : array;
import std.algorithm.searching : canFind, countUntil;
import std.algorithm.iteration : map;
import std.algorithm.mutation : remove;
import std.range : indexed, iota;
// convert templateParameters into a string[] for faster access
const(TemplateParameter)[] templateList;
if (const tp = templateParameters)
if (const tpl = tp.templateParameterList)
templateList = tpl.items;
string[] tlList = templateList.map!(a => templateParamName(a)).array;
// make a copy of all parameters and remove the seen ones later during the loop
size_t[] unseenTemplates = templateList.length.iota.array;
if (lastSeenFun.active && params !is null)
foreach (p; params.parameters)
{
string templateName;
if (auto iot = safeAccess(p).type.type2
.typeIdentifierPart.identifierOrTemplateInstance.unwrap)
{
templateName = iot.identifier.text;
}
else if (auto iot = safeAccess(p).type.type2.type.type2
.typeIdentifierPart.identifierOrTemplateInstance.unwrap)
{
templateName = iot.identifier.text;
}
const idx = tlList.countUntil(templateName);
if (idx >= 0)
{
unseenTemplates = unseenTemplates.remove(idx);
tlList = tlList.remove(idx);
// documenting template parameter should be allowed
lastSeenFun.params[templateName] = true;
}
if (!lastSeenFun.ddocParams.canFind(p.name.text))
addErrorMessage(line, column, MISSING_PARAMS_KEY,
format(MISSING_PARAMS_MESSAGE, p.name.text));
else
lastSeenFun.params[p.name.text] = true;
}
// now check the remaining, not used template parameters
auto unseenTemplatesArr = templateList.indexed(unseenTemplates).array;
checkDdocParams(line, column, unseenTemplatesArr);
}
void checkDdocParams(size_t line, size_t column, const TemplateParameters templateParams)
{
if (lastSeenFun.active && templateParams !is null &&
templateParams.templateParameterList !is null)
checkDdocParams(line, column, templateParams.templateParameterList.items);
}
void checkDdocParams(size_t line, size_t column, const TemplateParameter[] templateParams)
{
import std.algorithm.searching : canFind;
foreach (p; templateParams)
{
const name = templateParamName(p);
assert(name, "Invalid template parameter name."); // this shouldn't happen
if (!lastSeenFun.ddocParams.canFind(name))
addErrorMessage(line, column, MISSING_PARAMS_KEY,
format(MISSING_TEMPLATE_PARAMS_MESSAGE, name));
else
lastSeenFun.params[name] = true;
}
}
static string templateParamName(const TemplateParameter p)
{
if (p.templateTypeParameter)
return p.templateTypeParameter.identifier.text;
if (p.templateValueParameter)
return p.templateValueParameter.identifier.text;
if (p.templateAliasParameter)
return p.templateAliasParameter.identifier.text;
if (p.templateTupleParameter)
return p.templateTupleParameter.identifier.text;
if (p.templateThisParameter)
return p.templateThisParameter.templateTypeParameter.identifier.text;
return null;
}
bool hasDeclaration(const Declaration decl)
{
import std.meta : AliasSeq;
alias properties = AliasSeq!(
"aliasDeclaration",
"aliasThisDeclaration",
"anonymousEnumDeclaration",
"attributeDeclaration",
"classDeclaration",
"conditionalDeclaration",
"constructor",
"debugSpecification",
"destructor",
"enumDeclaration",
"eponymousTemplateDeclaration",
"functionDeclaration",
"importDeclaration",
"interfaceDeclaration",
"invariant_",
"mixinDeclaration",
"mixinTemplateDeclaration",
"postblit",
"pragmaDeclaration",
"sharedStaticConstructor",
"sharedStaticDestructor",
"staticAssertDeclaration",
"staticConstructor",
"staticDestructor",
"structDeclaration",
"templateDeclaration",
"unionDeclaration",
"unittest_",
"variableDeclaration",
"versionSpecification",
);
if (decl.declarations !is null)
return false;
auto isNull = true;
foreach (property; properties)
if (mixin("decl." ~ property ~ " !is null"))
isNull = false;
return !isNull;
}
}
version(unittest)
{
import std.stdio : stderr;
import std.format : format;
import dscanner.analysis.config : StaticAnalysisConfig, Check, disabledConfig;
import dscanner.analysis.helpers : assertAnalyzerWarnings;
}
// missing params
unittest
{
StaticAnalysisConfig sac = disabledConfig;
sac.properly_documented_public_functions = Check.enabled;
assertAnalyzerWarnings(q{
/**
Some text
*/
void foo(int k){} // [warn]: %s
}c.format(
ProperlyDocumentedPublicFunctions.MISSING_PARAMS_MESSAGE.format("k")
), sac);
assertAnalyzerWarnings(q{
/**
Some text
*/
void foo(int K)(){} // [warn]: %s
}c.format(
ProperlyDocumentedPublicFunctions.MISSING_TEMPLATE_PARAMS_MESSAGE.format("K")
), sac);
assertAnalyzerWarnings(q{
/**
Some text
*/
struct Foo(Bar){} // [warn]: %s
}c.format(
ProperlyDocumentedPublicFunctions.MISSING_TEMPLATE_PARAMS_MESSAGE.format("Bar")
), sac);
assertAnalyzerWarnings(q{
/**
Some text
*/
class Foo(Bar){} // [warn]: %s
}c.format(
ProperlyDocumentedPublicFunctions.MISSING_TEMPLATE_PARAMS_MESSAGE.format("Bar")
), sac);
assertAnalyzerWarnings(q{
/**
Some text
*/
template Foo(Bar){} // [warn]: %s
}c.format(
ProperlyDocumentedPublicFunctions.MISSING_TEMPLATE_PARAMS_MESSAGE.format("Bar")
), sac);
// test no parameters
assertAnalyzerWarnings(q{
/** Some text */
void foo(){}
}c, sac);
assertAnalyzerWarnings(q{
/** Some text */
struct Foo(){}
}c, sac);
assertAnalyzerWarnings(q{
/** Some text */
class Foo(){}
}c, sac);
assertAnalyzerWarnings(q{
/** Some text */
template Foo(){}
}c, sac);
}
// missing returns (only functions)
unittest
{
StaticAnalysisConfig sac = disabledConfig;
sac.properly_documented_public_functions = Check.enabled;
assertAnalyzerWarnings(q{
/**
Some text
*/
int foo(){} // [warn]: %s
}c.format(
ProperlyDocumentedPublicFunctions.MISSING_RETURNS_MESSAGE,
), sac);
assertAnalyzerWarnings(q{
/**
Some text
*/
auto foo(){} // [warn]: %s
}c.format(
ProperlyDocumentedPublicFunctions.MISSING_RETURNS_MESSAGE,
), sac);
}
// ignore private
unittest
{
StaticAnalysisConfig sac = disabledConfig;
sac.properly_documented_public_functions = Check.enabled;
assertAnalyzerWarnings(q{
/**
Some text
*/
private void foo(int k){}
}c, sac);
// with block
assertAnalyzerWarnings(q{
private:
/**
Some text
*/
private void foo(int k){}
///
public int bar(){} // [warn]: %s
public:
///
int foobar(){} // [warn]: %s
}c.format(
ProperlyDocumentedPublicFunctions.MISSING_RETURNS_MESSAGE,
ProperlyDocumentedPublicFunctions.MISSING_RETURNS_MESSAGE,
), sac);
// with block (template)
assertAnalyzerWarnings(q{
private:
/**
Some text
*/
private template foo(int k){}
///
public template bar(T){} // [warn]: %s
public:
///
template foobar(T){} // [warn]: %s
}c.format(
ProperlyDocumentedPublicFunctions.MISSING_TEMPLATE_PARAMS_MESSAGE.format("T"),
ProperlyDocumentedPublicFunctions.MISSING_TEMPLATE_PARAMS_MESSAGE.format("T"),
), sac);
// with block (struct)
assertAnalyzerWarnings(q{
private:
/**
Some text
*/
private struct foo(int k){}
///
public struct bar(T){} // [warn]: %s
public:
///
struct foobar(T){} // [warn]: %s
}c.format(
ProperlyDocumentedPublicFunctions.MISSING_TEMPLATE_PARAMS_MESSAGE.format("T"),
ProperlyDocumentedPublicFunctions.MISSING_TEMPLATE_PARAMS_MESSAGE.format("T"),
), sac);
}
// test parameter names
unittest
{
StaticAnalysisConfig sac = disabledConfig;
sac.properly_documented_public_functions = Check.enabled;
assertAnalyzerWarnings(q{
/**
* Description.
*
* Params:
*
* Returns:
* A long description.
*/
int foo(int k){} // [warn]: %s
}c.format(
ProperlyDocumentedPublicFunctions.MISSING_PARAMS_MESSAGE.format("k")
), sac);
assertAnalyzerWarnings(q{
/**
* Description.
*
* Params:
*
* Returns:
* A long description.
*/
int foo(int k) => k; // [warn]: %s
}c.format(
ProperlyDocumentedPublicFunctions.MISSING_PARAMS_MESSAGE.format("k")
), sac);
assertAnalyzerWarnings(q{
/**
Description.
Params:
val = A stupid parameter
k = A stupid parameter
Returns:
A long description.
*/
int foo(int k){} // [warn]: %s
}c.format(
ProperlyDocumentedPublicFunctions.NON_EXISTENT_PARAMS_MESSAGE.format("val")
), sac);
assertAnalyzerWarnings(q{
/**
Description.
Params:
Returns:
A long description.
*/
int foo(int k){} // [warn]: %s
}c.format(
ProperlyDocumentedPublicFunctions.MISSING_PARAMS_MESSAGE.format("k")
), sac);
assertAnalyzerWarnings(q{
/**
Description.
Params:
foo = A stupid parameter
bad = A stupid parameter (does not exist)
foobar = A stupid parameter
Returns:
A long description.
*/
int foo(int foo, int foobar){} // [warn]: %s
}c.format(
ProperlyDocumentedPublicFunctions.NON_EXISTENT_PARAMS_MESSAGE.format("bad")
), sac);
assertAnalyzerWarnings(q{
/**
Description.
Params:
foo = A stupid parameter
bad = A stupid parameter (does not exist)
foobar = A stupid parameter
Returns:
A long description.
*/
struct foo(int foo, int foobar){} // [warn]: %s
}c.format(
ProperlyDocumentedPublicFunctions.NON_EXISTENT_PARAMS_MESSAGE.format("bad")
), sac);
// properly documented
assertAnalyzerWarnings(q{
/**
Description.
Params:
foo = A stupid parameter
bar = A stupid parameter
Returns:
A long description.
*/
int foo(int foo, int bar){}
}c, sac);
assertAnalyzerWarnings(q{
/**
Description.
Params:
foo = A stupid parameter
bar = A stupid parameter
Returns:
A long description.
*/
struct foo(int foo, int bar){}
}c, sac);
}
// support ditto
unittest
{
StaticAnalysisConfig sac = disabledConfig;
sac.properly_documented_public_functions = Check.enabled;
assertAnalyzerWarnings(q{
/**
* Description.
*
* Params:
* k = A stupid parameter
*
* Returns:
* A long description.
*/
int foo(int k){}
/// ditto
int bar(int k){}
}c, sac);
assertAnalyzerWarnings(q{
/**
* Description.
*
* Params:
* k = A stupid parameter
* K = A stupid parameter
*
* Returns:
* A long description.
*/
int foo(int k){}
/// ditto
struct Bar(K){}
}c, sac);
assertAnalyzerWarnings(q{
/**
* Description.
*
* Params:
* k = A stupid parameter
* f = A stupid parameter
*
* Returns:
* A long description.
*/
int foo(int k){}
/// ditto
int bar(int f){}
}c, sac);
assertAnalyzerWarnings(q{
/**
* Description.
*
* Params:
* k = A stupid parameter
*
* Returns:
* A long description.
*/
int foo(int k){}
/// ditto
int bar(int bar){} // [warn]: %s
}c.format(
ProperlyDocumentedPublicFunctions.MISSING_PARAMS_MESSAGE.format("bar")
), sac);
assertAnalyzerWarnings(q{
/**
* Description.
*
* Params:
* k = A stupid parameter
* bar = A stupid parameter
* f = A stupid parameter
*
* Returns:
* A long description.
* See_Also:
* $(REF takeExactly, std,range)
*/
int foo(int k){} // [warn]: %s
/// ditto
int bar(int bar){}
}c.format(
ProperlyDocumentedPublicFunctions.NON_EXISTENT_PARAMS_MESSAGE.format("f")
), sac);
}
// check correct ddoc headers
unittest
{
StaticAnalysisConfig sac = disabledConfig;
sac.properly_documented_public_functions = Check.enabled;
assertAnalyzerWarnings(q{
/++
Counts elements in the given
$(REF_ALTTEXT forward range, isForwardRange, std,range,primitives)
until the given predicate is true for one of the given $(D needles).
Params:
val = A stupid parameter
Returns: Awesome values.
+/
string bar(string val){}
}c, sac);
assertAnalyzerWarnings(q{
/++
Counts elements in the given
$(REF_ALTTEXT forward range, isForwardRange, std,range,primitives)
until the given predicate is true for one of the given $(D needles).
Params:
val = A stupid parameter
Returns: Awesome values.
+/
template bar(string val){}
}c, sac);
}
unittest
{
StaticAnalysisConfig sac = disabledConfig;
sac.properly_documented_public_functions = Check.enabled;
assertAnalyzerWarnings(q{
/**
* Ddoc for the inner function appears here.
* This function is declared this way to allow for multiple variable-length
* template argument lists.
* ---
* abcde!("a", "b", "c")(100, x, y, z);
* ---
* Params:
* Args = foo
* U = bar
* T = barr
* varargs = foobar
* t = foo
* Returns: bar
*/
template abcde(Args ...) {
///
auto abcde(T, U...)(T t, U varargs) {
/// ....
}
}
}c, sac);
}
// Don't force the documentation of the template parameter if it's a used type in the parameter list
unittest
{
StaticAnalysisConfig sac = disabledConfig;
sac.properly_documented_public_functions = Check.enabled;
assertAnalyzerWarnings(q{
/++
An awesome description.
Params:
r = an input range.
Returns: Awesome values.
+/
string bar(R)(R r){}
}c, sac);
assertAnalyzerWarnings(q{
/++
An awesome description.
Params:
r = an input range.
Returns: Awesome values.
+/
string bar(P, R)(R r){}// [warn]: %s
}c.format(
ProperlyDocumentedPublicFunctions.MISSING_TEMPLATE_PARAMS_MESSAGE.format("P")
), sac);
}
// https://github.com/dlang-community/D-Scanner/issues/601
unittest
{
StaticAnalysisConfig sac = disabledConfig;
sac.properly_documented_public_functions = Check.enabled;
assertAnalyzerWarnings(q{
void put(Range)(Range items) if (canPutConstRange!Range)
{
alias p = put!(Unqual!Range);
p(items);
}
}, sac);
}
unittest
{
StaticAnalysisConfig sac = disabledConfig;
sac.properly_documented_public_functions = Check.enabled;
assertAnalyzerWarnings(q{
/++
An awesome description.
Params:
items = things to put.
Returns: Awesome values.
+/
void put(Range)(const(Range) items) if (canPutConstRange!Range)
{}
}, sac);
}
unittest
{
StaticAnalysisConfig sac = disabledConfig;
sac.properly_documented_public_functions = Check.enabled;
assertAnalyzerWarnings(q{
/++
Throw but likely catched.
+/
void bar(){
try{throw new Exception("bla");throw new Error("bla");}
catch(Exception){} catch(Error){}}
}c, sac);
}
unittest
{
StaticAnalysisConfig sac = disabledConfig;
sac.properly_documented_public_functions = Check.enabled;
assertAnalyzerWarnings(q{
/++
Simple case
+/
void bar(){throw new Exception("bla");} // [warn]: %s
}c.format(
ProperlyDocumentedPublicFunctions.MISSING_THROW_MESSAGE.format("Exception")
), sac);
}
unittest
{
StaticAnalysisConfig sac = disabledConfig;
sac.properly_documented_public_functions = Check.enabled;
assertAnalyzerWarnings(q{
/++
Supposed to be documented
Throws: Exception if...
+/
void bar(){throw new Exception("bla");}
}c.format(
), sac);
}
unittest
{
StaticAnalysisConfig sac = disabledConfig;
sac.properly_documented_public_functions = Check.enabled;
assertAnalyzerWarnings(q{
/++
rethrow
+/
void bar(){try throw new Exception("bla"); catch(Exception) throw new Error();} // [warn]: %s
}c.format(
ProperlyDocumentedPublicFunctions.MISSING_THROW_MESSAGE.format("Error")
), sac);
}
unittest
{
StaticAnalysisConfig sac = disabledConfig;
sac.properly_documented_public_functions = Check.enabled;
assertAnalyzerWarnings(q{
/++
trust nothrow before everything
+/
void bar() nothrow {try throw new Exception("bla"); catch(Exception) assert(0);}
}c, sac);
}
unittest
{
StaticAnalysisConfig sac = disabledConfig;
sac.properly_documented_public_functions = Check.enabled;
assertAnalyzerWarnings(q{
/++
case of throw in nested func
+/
void bar() // [warn]: %s
{
void foo(){throw new AssertError("bla");}
foo();
}
}c.format(
ProperlyDocumentedPublicFunctions.MISSING_THROW_MESSAGE.format("AssertError")
), sac);
}
unittest
{
StaticAnalysisConfig sac = disabledConfig;
sac.properly_documented_public_functions = Check.enabled;
assertAnalyzerWarnings(q{
/++
case of throw in nested func but caught
+/
void bar()
{
void foo(){throw new AssertError("bla");}
try foo();
catch (AssertError){}
}
}c, sac);
}
unittest
{
StaticAnalysisConfig sac = disabledConfig;
sac.properly_documented_public_functions = Check.enabled;
assertAnalyzerWarnings(q{
/++
case of double throw in nested func but only 1 caught
+/
void bar() // [warn]: %s
{
void foo(){throw new AssertError("bla");throw new Error("bla");}
try foo();
catch (Error){}
}
}c.format(
ProperlyDocumentedPublicFunctions.MISSING_THROW_MESSAGE.format("AssertError")
), sac);
}
unittest
{
StaticAnalysisConfig sac = disabledConfig;
sac.properly_documented_public_functions = Check.enabled;
assertAnalyzerWarnings(q{
/++
enforce
+/
void bar() // [warn]: %s
{
enforce(condition);
}
}c.format(
ProperlyDocumentedPublicFunctions.MISSING_THROW_MESSAGE.format("Exception")
), sac);
}
unittest
{
StaticAnalysisConfig sac = disabledConfig;
sac.properly_documented_public_functions = Check.enabled;
assertAnalyzerWarnings(q{
/++
enforce
+/
void bar() // [warn]: %s
{
enforce!AssertError(condition);
}
}c.format(
ProperlyDocumentedPublicFunctions.MISSING_THROW_MESSAGE.format("AssertError")
), sac);
}
unittest
{
StaticAnalysisConfig sac = disabledConfig;
sac.properly_documented_public_functions = Check.enabled;
assertAnalyzerWarnings(q{
/++
enforce
+/
void bar() // [warn]: %s
{
enforce!(AssertError)(condition);
}
}c.format(
ProperlyDocumentedPublicFunctions.MISSING_THROW_MESSAGE.format("AssertError")
), sac);
}
unittest
{
StaticAnalysisConfig sac = disabledConfig;
sac.properly_documented_public_functions = Check.enabled;
assertAnalyzerWarnings(q{
/++
enforce
+/
void foo() // [warn]: %s
{
void bar()
{
enforce!AssertError(condition);
}
bar();
}
}c.format(
ProperlyDocumentedPublicFunctions.MISSING_THROW_MESSAGE.format("AssertError")
), sac);
}
// https://github.com/dlang-community/D-Scanner/issues/583
unittest
{
StaticAnalysisConfig sac = disabledConfig;
sac.properly_documented_public_functions = Check.enabled;
assertAnalyzerWarnings(q{
/++
Implements the homonym function (also known as `accumulate`)
Returns:
the accumulated `result`
Params:
fun = one or more functions
+/
template reduce(fun...)
if (fun.length >= 1)
{
/++
No-seed version. The first element of `r` is used as the seed's value.
Params:
r = an iterable value as defined by `isIterable`
Returns:
the final result of the accumulator applied to the iterable
+/
auto reduce(R)(R r){}
}
}c.format(
), sac);
stderr.writeln("Unittest for ProperlyDocumentedPublicFunctions passed.");
}
|
D
|
/**
* Consoleur: a package for interaction with character-oriented terminal emulators
*
* Copyright: Maxim Freck, 2017.
* Authors: Maxim Freck <maxim@freck.pp.ru>
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
*/
module consoleur.core.posix;
version(Posix) {
///STDIN file descriptor
int STDIN_FILENO = 0;
///STDOUT file descriptor
enum STDOUT_FILENO = 1;
///STERR file descriptor
enum STDERR_FILENO = 2;
/*******
* Console point: row and column
*/
struct Point {
int row;
int col;
}
/*******
* Tests whether a STDOUT descriptor refers to a terminal
* Returns: true on success, false in case of failure
*/
bool isAttyOut() @safe
{
import core.sys.posix.unistd: isatty;
return cast(bool)isatty(STDOUT_FILENO);
}
/*******
* Tests whether a STDIN descriptor refers to a terminal
* Returns: true on success, false in case of failure
*/
bool isAttyIn() @safe
{
import core.sys.posix.unistd: isatty;
return cast(bool)isatty(STDIN_FILENO);
}
/*******
* Flushes STDOUT buffer
*/
bool flushStdout()
{
import core.stdc.stdio: fflush;
import std.stdio: stdout;
return fflush(stdout.getFP) == 0;
}
/*******
* Writes raw data to stdout without buffering
*
* Params:
* buffer = The buffer
*/
nothrow size_t rawStdout(string buffer) @trusted
{
import core.sys.posix.unistd: write;
return write(STDOUT_FILENO, buffer.ptr, buffer.length);
}
private auto buffer = new ubyte[MAX_STDIN_BUFFER_SIZE];
private ubyte[] stdinBuffer;
private size_t stdinPosition;
private enum MAX_STDIN_BUFFER_SIZE = 32;
/*******
* Reads raw ubyte from stdin
* Returns: true on success, false in case of failure
*
* Params:
* b = The variable to read byte into
*/
nothrow bool popStdin(ref ubyte b) @safe
{
if (stdinBuffer.length == stdinPosition) fillStdinBuffer();
if (stdinBuffer.length == stdinPosition) return false;
b = stdinBuffer[stdinPosition++];
return true;
}
private nothrow void fillStdinBuffer() @trusted
{
import core.sys.posix.unistd: read;
auto len = read(STDIN_FILENO, buffer.ptr, MAX_STDIN_BUFFER_SIZE);
if (stdinPosition == stdinBuffer.length) {
stdinPosition = 0;
stdinBuffer = buffer[0 .. len];
} else if (len > 0) {
stdinBuffer = buffer[0 .. len] ~ stdinBuffer;
}
}
/*******
* Returns raw ubyte from stdin
* Returns: ubyte on success, 0 in case of failure
*/
nothrow ubyte popStdin() @safe
{
if (stdinBuffer.length == stdinPosition) fillStdinBuffer();
if (stdinBuffer.length == stdinPosition) return 0;
return stdinBuffer[stdinPosition++];
}
/*******
* Puts back ubyte to STDIN buffer
* Returns: true on success, false in case of failure
*
* Params:
* b = The ubyte to write
*/
nothrow bool pushStdin(immutable ubyte b) @safe
{
if (stdinPosition == 0) {
stdinBuffer = b ~ stdinBuffer;
} else {
stdinBuffer[--stdinPosition] = b;
}
return true;
}
/*******
* Puts back string to STDIN buffer
* Returns: true on success, false in case of failure
*
* Params:
* str = The string to write
*/
nothrow bool pushStdin(string str) @safe
{
foreach_reverse(immutable ubyte b; str) if (!pushStdin(b)) return false;
return true;
}
/*******
* Flushes STDIN buffer
*/
void flushStdin() @trusted
{
import consoleur.core.termparam: setTermparam, Term;
immutable tparam = setTermparam(Term.quiet|Term.raw|Term.async, 0);
while(true) {
stdinBuffer.length = 0;
stdinPosition = 0;
fillStdinBuffer();
if (stdinBuffer.length == 0) break;
}
}
/*******
* Reads escape sequence from STDIN
* Returns: string, containing escape command without Control Sequence Introducer
*/
string readEscapeSequence() @safe
{
ubyte b;
ubyte b1;
if (!popStdin(b)) return "";
if (b != 0x1b && b != 0xc2) {
pushStdin(b);
return "";
}
if (!popStdin(b1)){
pushStdin(b);
return "";
}
if ( (b == 0x1b && b1 != 0x5b) || (b == 0xc2 && b1 != 0x9b)){
pushStdin(b1);
pushStdin(b);
return "";
}
string csi;
while (popStdin(b)) {
csi~=b;
if (b >= 0x40 && b <= 0x7e && b != 0x5b) break;
}
return csi;
}
shared static this()
{
import core.sys.posix.fcntl: open, O_RDONLY;
import core.sys.posix.unistd: isatty;
if (!isatty(STDIN_FILENO)) {
STDIN_FILENO = open("/dev/tty", O_RDONLY);
}
}
}
|
D
|
/Users/hanykaram/Desktop/MVP/DerivedData/MVP/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NVActivityIndicatorView.build/Objects-normal/x86_64/NVActivityIndicatorAnimationBallClipRotateMultiple.o : /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallPulseSync.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationLineScalePulseOutRapid.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallDoubleBounce.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationLineScale.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallScale.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallScaleMultiple.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallScaleRippleMultiple.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallClipRotateMultiple.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallScaleRipple.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/NVActivityIndicatorShape.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallRotateChase.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallPulseRise.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallGridPulse.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallClipRotatePulse.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallPulse.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/NVActivityIndicatorAnimationDelegate.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallRotate.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallClipRotate.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallZigZag.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallTrianglePath.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBlank.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationPacman.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationCircleStrokeSpin.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationSemiCircleSpin.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationSquareSpin.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationTriangleSkewSpin.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationCubeTransition.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationLineSpinFadeLoader.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallSpinFadeLoader.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationAudioEqualizer.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallGridBeat.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallBeat.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallZigZagDeflect.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationOrbit.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationLineScalePulseOut.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/NVActivityIndicatorView.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationLineScaleParty.swift /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/hanykaram/Desktop/MVP/Pods/Target\ Support\ Files/NVActivityIndicatorView/NVActivityIndicatorView-umbrella.h /Users/hanykaram/Desktop/MVP/DerivedData/MVP/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NVActivityIndicatorView.build/unextended-module.modulemap /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/objc/ObjectiveC.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/Darwin.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/hanykaram/Desktop/MVP/DerivedData/MVP/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NVActivityIndicatorView.build/Objects-normal/x86_64/NVActivityIndicatorAnimationBallClipRotateMultiple~partial.swiftmodule : /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallPulseSync.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationLineScalePulseOutRapid.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallDoubleBounce.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationLineScale.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallScale.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallScaleMultiple.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallScaleRippleMultiple.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallClipRotateMultiple.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallScaleRipple.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/NVActivityIndicatorShape.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallRotateChase.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallPulseRise.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallGridPulse.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallClipRotatePulse.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallPulse.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/NVActivityIndicatorAnimationDelegate.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallRotate.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallClipRotate.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallZigZag.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallTrianglePath.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBlank.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationPacman.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationCircleStrokeSpin.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationSemiCircleSpin.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationSquareSpin.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationTriangleSkewSpin.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationCubeTransition.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationLineSpinFadeLoader.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallSpinFadeLoader.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationAudioEqualizer.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallGridBeat.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallBeat.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallZigZagDeflect.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationOrbit.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationLineScalePulseOut.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/NVActivityIndicatorView.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationLineScaleParty.swift /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/hanykaram/Desktop/MVP/Pods/Target\ Support\ Files/NVActivityIndicatorView/NVActivityIndicatorView-umbrella.h /Users/hanykaram/Desktop/MVP/DerivedData/MVP/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NVActivityIndicatorView.build/unextended-module.modulemap /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/objc/ObjectiveC.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/Darwin.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/hanykaram/Desktop/MVP/DerivedData/MVP/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NVActivityIndicatorView.build/Objects-normal/x86_64/NVActivityIndicatorAnimationBallClipRotateMultiple~partial.swiftdoc : /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallPulseSync.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationLineScalePulseOutRapid.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallDoubleBounce.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationLineScale.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallScale.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallScaleMultiple.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallScaleRippleMultiple.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallClipRotateMultiple.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallScaleRipple.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/NVActivityIndicatorShape.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallRotateChase.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallPulseRise.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallGridPulse.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallClipRotatePulse.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallPulse.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/NVActivityIndicatorAnimationDelegate.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallRotate.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallClipRotate.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallZigZag.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallTrianglePath.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBlank.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationPacman.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationCircleStrokeSpin.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationSemiCircleSpin.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationSquareSpin.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationTriangleSkewSpin.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationCubeTransition.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationLineSpinFadeLoader.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallSpinFadeLoader.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationAudioEqualizer.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallGridBeat.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallBeat.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallZigZagDeflect.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationOrbit.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationLineScalePulseOut.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/NVActivityIndicatorView.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationLineScaleParty.swift /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/hanykaram/Desktop/MVP/Pods/Target\ Support\ Files/NVActivityIndicatorView/NVActivityIndicatorView-umbrella.h /Users/hanykaram/Desktop/MVP/DerivedData/MVP/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NVActivityIndicatorView.build/unextended-module.modulemap /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/objc/ObjectiveC.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/Darwin.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/hanykaram/Desktop/MVP/DerivedData/MVP/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NVActivityIndicatorView.build/Objects-normal/x86_64/NVActivityIndicatorAnimationBallClipRotateMultiple~partial.swiftsourceinfo : /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallPulseSync.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationLineScalePulseOutRapid.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallDoubleBounce.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationLineScale.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallScale.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallScaleMultiple.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallScaleRippleMultiple.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallClipRotateMultiple.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallScaleRipple.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/NVActivityIndicatorShape.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallRotateChase.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallPulseRise.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallGridPulse.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallClipRotatePulse.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallPulse.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/NVActivityIndicatorAnimationDelegate.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallRotate.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallClipRotate.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallZigZag.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallTrianglePath.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBlank.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationPacman.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationCircleStrokeSpin.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationSemiCircleSpin.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationSquareSpin.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationTriangleSkewSpin.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationCubeTransition.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationLineSpinFadeLoader.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallSpinFadeLoader.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationAudioEqualizer.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallGridBeat.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallBeat.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationBallZigZagDeflect.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationOrbit.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationLineScalePulseOut.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/NVActivityIndicatorView.swift /Users/hanykaram/Desktop/MVP/Pods/NVActivityIndicatorView/Sources/Base/Animations/NVActivityIndicatorAnimationLineScaleParty.swift /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/hanykaram/Desktop/MVP/Pods/Target\ Support\ Files/NVActivityIndicatorView/NVActivityIndicatorView-umbrella.h /Users/hanykaram/Desktop/MVP/DerivedData/MVP/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/NVActivityIndicatorView.build/unextended-module.modulemap /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/objc/ObjectiveC.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/Darwin.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/CMSIS/Driver/OTG_FS_STM32F4xx.c
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/MDK/Templates/Inc/stm32f4xx_hal_conf.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/Development\ Studio\ Workspace/BaseProject_2020_08_04/RTE/RTE_Components.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f407xx.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/ARM/CMSIS/5.7.0/CMSIS/Core/Include/core_cm4.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/ARM/CMSIS/5.7.0/CMSIS/Core/Include/cmsis_version.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/ARM/CMSIS/5.7.0/CMSIS/Core/Include/cmsis_compiler.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/ARM/CMSIS/5.7.0/CMSIS/Core/Include/cmsis_armcc.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/ARM/CMSIS/5.7.0/CMSIS/Core/Include/mpu_armv7.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include/system_stm32f4xx.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio_ex.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma_ex.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cortex.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ramfunc.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c_ex.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s_ex.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr_ex.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_spi.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_usart.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/ARM/CMSIS/5.7.0/CMSIS/Driver/Include/Driver_USBH.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/ARM/CMSIS/5.7.0/CMSIS/Driver/Include/Driver_USB.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/ARM/CMSIS/5.7.0/CMSIS/Driver/Include/Driver_Common.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/ARM/CMSIS/5.7.0/CMSIS/Driver/Include/Driver_USBD.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.14.0/CMSIS/Driver/OTG_FS_STM32F4xx.h
RTE/CMSIS_Driver/OTG_FS_STM32F4xx.o: C:/Users/david.waldo/Development\ Studio\ Workspace/BaseProject_2020_08_04/RTE/Device/STM32F407VGTx/RTE_Device.h
|
D
|
module UnrealScript.UnrealEd.ObjectExporterT3D;
import ScriptClasses;
import UnrealScript.Helpers;
import UnrealScript.Core.Exporter;
extern(C++) interface ObjectExporterT3D : Exporter
{
public extern(D):
private static __gshared ScriptClass mStaticClass;
@property final static ScriptClass StaticClass() { mixin(MGSCC("Class UnrealEd.ObjectExporterT3D")); }
private static __gshared ObjectExporterT3D mDefaultProperties;
@property final static ObjectExporterT3D DefaultProperties() { mixin(MGDPC("ObjectExporterT3D", "ObjectExporterT3D UnrealEd.Default__ObjectExporterT3D")); }
}
|
D
|
/Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Vapor.build/Sessions/SessionsConfig.swift.o : /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/FileIO.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/FormDataCoder+HTTP.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionData.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/Thread.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/URLEncoded.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Deprecated.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/ServeCommand.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/RoutesCommand.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/BootCommand.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Method.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionCache.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/ResponseCodable.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Request/RequestCodable.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Middleware.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/Middleware.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/CORSMiddleware.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/FileMiddleware.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/DateMiddleware.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/ErrorMiddleware.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionsMiddleware.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+LazyMiddleware.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/Response.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/AnyResponse.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/MiddlewareConfig.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/NIOServerConfig.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionsConfig.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/ContentConfig.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Request/HTTPMethod+String.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Path.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/JSONCoder+Custom.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/Request+Session.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/Session.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Application.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/RouteCollection.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Function.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Services/VaporProvider.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/Responder.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/BasicResponder.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/ApplicationResponder.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/WebSocketResponder.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/PlaintextEncoder.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/HTTPMessageContainer.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/ParametersContainer.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/ContentContainer.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/QueryContainer.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/EngineRouter.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/Server.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/NIOServer.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/RunningServer.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/WebSocketServer.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/NIOWebSocketServer.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Error/Error.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Logging/Logger+LogError.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Error/AbortError.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/Sessions.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/KeyedCacheSessions.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/MemorySessions.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/ContentCoders.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/Exports.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/HTTPStatus.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/Redirect.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/SingleValueGet.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Services/Config+Default.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/CommandConfig+Default.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Services/Services+Default.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Client/Client.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Client/FoundationClient.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/WebSocketClient.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/NIOWebSocketClient.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Content.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/Content.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Error/Abort.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Request/Request.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/View/Vapor+View.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOHTTP1.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOOpenSSL.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/HTTP.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOTLS.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Command.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Console.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Logging.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Routing.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Random.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/URLEncodedForm.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Validation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Crypto.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/WebSocket.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOWebSocket.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/DatabaseKit.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/TemplateKit.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Multipart.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOSHA1/include/c_nio_sha1.h /usr/local/Cellar/libressl/2.7.4/include/openssl/asn1.h /usr/local/Cellar/libressl/2.7.4/include/openssl/tls1.h /usr/local/Cellar/libressl/2.7.4/include/openssl/dtls1.h /usr/local/Cellar/libressl/2.7.4/include/openssl/pkcs12.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ssl2.h /usr/local/Cellar/libressl/2.7.4/include/openssl/pem2.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ssl23.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ssl3.h /usr/local/Cellar/libressl/2.7.4/include/openssl/x509v3.h /usr/local/Cellar/libressl/2.7.4/include/openssl/md5.h /usr/local/Cellar/libressl/2.7.4/include/openssl/pkcs7.h /usr/local/Cellar/libressl/2.7.4/include/openssl/x509.h /usr/local/Cellar/libressl/2.7.4/include/openssl/sha.h /usr/local/Cellar/libressl/2.7.4/include/openssl/dsa.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ecdsa.h /usr/local/Cellar/libressl/2.7.4/include/openssl/rsa.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOZlib/include/c_nio_zlib.h /usr/local/Cellar/libressl/2.7.4/include/openssl/obj_mac.h /usr/local/Cellar/libressl/2.7.4/include/openssl/hmac.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ec.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /usr/local/Cellar/libressl/2.7.4/include/openssl/rand.h /usr/local/Cellar/libressl/2.7.4/include/openssl/conf.h /usr/local/Cellar/libressl/2.7.4/include/openssl/opensslconf.h /usr/local/Cellar/libressl/2.7.4/include/openssl/dh.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ecdh.h /usr/local/Cellar/libressl/2.7.4/include/openssl/lhash.h /usr/local/Cellar/libressl/2.7.4/include/openssl/stack.h /usr/local/Cellar/libressl/2.7.4/include/openssl/safestack.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ssl.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio-ssl.git-1370587408992578247/Sources/CNIOOpenSSL/include/c_nio_openssl.h /usr/local/Cellar/libressl/2.7.4/include/openssl/pem.h /usr/local/Cellar/libressl/2.7.4/include/openssl/bn.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /usr/local/Cellar/libressl/2.7.4/include/openssl/bio.h /usr/local/Cellar/libressl/2.7.4/include/openssl/crypto.h /usr/local/Cellar/libressl/2.7.4/include/openssl/srtp.h /usr/local/Cellar/libressl/2.7.4/include/openssl/evp.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ossl_typ.h /usr/local/Cellar/libressl/2.7.4/include/openssl/buffer.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /usr/local/Cellar/libressl/2.7.4/include/openssl/err.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /usr/local/Cellar/libressl/2.7.4/include/openssl/opensslfeatures.h /usr/local/Cellar/libressl/2.7.4/include/openssl/objects.h /usr/local/Cellar/libressl/2.7.4/include/openssl/opensslv.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /usr/local/Cellar/libressl/2.7.4/include/openssl/x509_vfy.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio-ssl-support.git--2359138821295600615/module.modulemap /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/checkouts/crypto.git-7980259129511365902/Sources/libbcrypt/include/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Vapor.build/SessionsConfig~partial.swiftmodule : /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/FileIO.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/FormDataCoder+HTTP.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionData.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/Thread.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/URLEncoded.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Deprecated.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/ServeCommand.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/RoutesCommand.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/BootCommand.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Method.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionCache.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/ResponseCodable.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Request/RequestCodable.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Middleware.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/Middleware.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/CORSMiddleware.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/FileMiddleware.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/DateMiddleware.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/ErrorMiddleware.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionsMiddleware.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+LazyMiddleware.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/Response.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/AnyResponse.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/MiddlewareConfig.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/NIOServerConfig.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionsConfig.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/ContentConfig.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Request/HTTPMethod+String.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Path.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/JSONCoder+Custom.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/Request+Session.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/Session.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Application.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/RouteCollection.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Function.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Services/VaporProvider.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/Responder.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/BasicResponder.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/ApplicationResponder.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/WebSocketResponder.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/PlaintextEncoder.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/HTTPMessageContainer.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/ParametersContainer.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/ContentContainer.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/QueryContainer.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/EngineRouter.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/Server.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/NIOServer.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/RunningServer.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/WebSocketServer.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/NIOWebSocketServer.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Error/Error.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Logging/Logger+LogError.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Error/AbortError.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/Sessions.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/KeyedCacheSessions.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/MemorySessions.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/ContentCoders.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/Exports.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/HTTPStatus.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/Redirect.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/SingleValueGet.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Services/Config+Default.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/CommandConfig+Default.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Services/Services+Default.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Client/Client.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Client/FoundationClient.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/WebSocketClient.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/NIOWebSocketClient.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Content.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/Content.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Error/Abort.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Request/Request.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/View/Vapor+View.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOHTTP1.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOOpenSSL.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/HTTP.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOTLS.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Command.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Console.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Logging.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Routing.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Random.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/URLEncodedForm.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Validation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Crypto.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/WebSocket.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOWebSocket.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/DatabaseKit.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/TemplateKit.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Multipart.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOSHA1/include/c_nio_sha1.h /usr/local/Cellar/libressl/2.7.4/include/openssl/asn1.h /usr/local/Cellar/libressl/2.7.4/include/openssl/tls1.h /usr/local/Cellar/libressl/2.7.4/include/openssl/dtls1.h /usr/local/Cellar/libressl/2.7.4/include/openssl/pkcs12.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ssl2.h /usr/local/Cellar/libressl/2.7.4/include/openssl/pem2.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ssl23.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ssl3.h /usr/local/Cellar/libressl/2.7.4/include/openssl/x509v3.h /usr/local/Cellar/libressl/2.7.4/include/openssl/md5.h /usr/local/Cellar/libressl/2.7.4/include/openssl/pkcs7.h /usr/local/Cellar/libressl/2.7.4/include/openssl/x509.h /usr/local/Cellar/libressl/2.7.4/include/openssl/sha.h /usr/local/Cellar/libressl/2.7.4/include/openssl/dsa.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ecdsa.h /usr/local/Cellar/libressl/2.7.4/include/openssl/rsa.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOZlib/include/c_nio_zlib.h /usr/local/Cellar/libressl/2.7.4/include/openssl/obj_mac.h /usr/local/Cellar/libressl/2.7.4/include/openssl/hmac.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ec.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /usr/local/Cellar/libressl/2.7.4/include/openssl/rand.h /usr/local/Cellar/libressl/2.7.4/include/openssl/conf.h /usr/local/Cellar/libressl/2.7.4/include/openssl/opensslconf.h /usr/local/Cellar/libressl/2.7.4/include/openssl/dh.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ecdh.h /usr/local/Cellar/libressl/2.7.4/include/openssl/lhash.h /usr/local/Cellar/libressl/2.7.4/include/openssl/stack.h /usr/local/Cellar/libressl/2.7.4/include/openssl/safestack.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ssl.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio-ssl.git-1370587408992578247/Sources/CNIOOpenSSL/include/c_nio_openssl.h /usr/local/Cellar/libressl/2.7.4/include/openssl/pem.h /usr/local/Cellar/libressl/2.7.4/include/openssl/bn.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /usr/local/Cellar/libressl/2.7.4/include/openssl/bio.h /usr/local/Cellar/libressl/2.7.4/include/openssl/crypto.h /usr/local/Cellar/libressl/2.7.4/include/openssl/srtp.h /usr/local/Cellar/libressl/2.7.4/include/openssl/evp.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ossl_typ.h /usr/local/Cellar/libressl/2.7.4/include/openssl/buffer.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /usr/local/Cellar/libressl/2.7.4/include/openssl/err.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /usr/local/Cellar/libressl/2.7.4/include/openssl/opensslfeatures.h /usr/local/Cellar/libressl/2.7.4/include/openssl/objects.h /usr/local/Cellar/libressl/2.7.4/include/openssl/opensslv.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /usr/local/Cellar/libressl/2.7.4/include/openssl/x509_vfy.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio-ssl-support.git--2359138821295600615/module.modulemap /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/checkouts/crypto.git-7980259129511365902/Sources/libbcrypt/include/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Vapor.build/SessionsConfig~partial.swiftdoc : /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/FileIO.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/FormDataCoder+HTTP.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionData.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/Thread.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/URLEncoded.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Deprecated.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/ServeCommand.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/RoutesCommand.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/BootCommand.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Method.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionCache.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/ResponseCodable.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Request/RequestCodable.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Middleware.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/Middleware.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/CORSMiddleware.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/FileMiddleware.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/DateMiddleware.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/ErrorMiddleware.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionsMiddleware.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+LazyMiddleware.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/Response.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/AnyResponse.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/MiddlewareConfig.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/NIOServerConfig.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionsConfig.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/ContentConfig.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Request/HTTPMethod+String.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Path.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/JSONCoder+Custom.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/Request+Session.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/Session.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Application.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/RouteCollection.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Function.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Services/VaporProvider.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/Responder.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/BasicResponder.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/ApplicationResponder.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/WebSocketResponder.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/PlaintextEncoder.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/HTTPMessageContainer.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/ParametersContainer.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/ContentContainer.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/QueryContainer.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/EngineRouter.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/Server.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/NIOServer.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/RunningServer.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/WebSocketServer.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/NIOWebSocketServer.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Error/Error.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Logging/Logger+LogError.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Error/AbortError.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/Sessions.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/KeyedCacheSessions.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/MemorySessions.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/ContentCoders.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/Exports.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/HTTPStatus.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/Redirect.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/SingleValueGet.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Services/Config+Default.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/CommandConfig+Default.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Services/Services+Default.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Client/Client.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Client/FoundationClient.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/WebSocketClient.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/NIOWebSocketClient.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Content.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/Content.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Error/Abort.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Request/Request.swift /Users/Khanh/vapor/TILApp/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/View/Vapor+View.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOHTTP1.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOOpenSSL.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/HTTP.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOTLS.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Command.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Console.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Logging.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Routing.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Random.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/URLEncodedForm.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Validation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Crypto.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/WebSocket.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOWebSocket.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/DatabaseKit.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/TemplateKit.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Multipart.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOSHA1/include/c_nio_sha1.h /usr/local/Cellar/libressl/2.7.4/include/openssl/asn1.h /usr/local/Cellar/libressl/2.7.4/include/openssl/tls1.h /usr/local/Cellar/libressl/2.7.4/include/openssl/dtls1.h /usr/local/Cellar/libressl/2.7.4/include/openssl/pkcs12.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ssl2.h /usr/local/Cellar/libressl/2.7.4/include/openssl/pem2.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ssl23.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ssl3.h /usr/local/Cellar/libressl/2.7.4/include/openssl/x509v3.h /usr/local/Cellar/libressl/2.7.4/include/openssl/md5.h /usr/local/Cellar/libressl/2.7.4/include/openssl/pkcs7.h /usr/local/Cellar/libressl/2.7.4/include/openssl/x509.h /usr/local/Cellar/libressl/2.7.4/include/openssl/sha.h /usr/local/Cellar/libressl/2.7.4/include/openssl/dsa.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ecdsa.h /usr/local/Cellar/libressl/2.7.4/include/openssl/rsa.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOZlib/include/c_nio_zlib.h /usr/local/Cellar/libressl/2.7.4/include/openssl/obj_mac.h /usr/local/Cellar/libressl/2.7.4/include/openssl/hmac.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ec.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /usr/local/Cellar/libressl/2.7.4/include/openssl/rand.h /usr/local/Cellar/libressl/2.7.4/include/openssl/conf.h /usr/local/Cellar/libressl/2.7.4/include/openssl/opensslconf.h /usr/local/Cellar/libressl/2.7.4/include/openssl/dh.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ecdh.h /usr/local/Cellar/libressl/2.7.4/include/openssl/lhash.h /usr/local/Cellar/libressl/2.7.4/include/openssl/stack.h /usr/local/Cellar/libressl/2.7.4/include/openssl/safestack.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ssl.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio-ssl.git-1370587408992578247/Sources/CNIOOpenSSL/include/c_nio_openssl.h /usr/local/Cellar/libressl/2.7.4/include/openssl/pem.h /usr/local/Cellar/libressl/2.7.4/include/openssl/bn.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /usr/local/Cellar/libressl/2.7.4/include/openssl/bio.h /usr/local/Cellar/libressl/2.7.4/include/openssl/crypto.h /usr/local/Cellar/libressl/2.7.4/include/openssl/srtp.h /usr/local/Cellar/libressl/2.7.4/include/openssl/evp.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ossl_typ.h /usr/local/Cellar/libressl/2.7.4/include/openssl/buffer.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /usr/local/Cellar/libressl/2.7.4/include/openssl/err.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /usr/local/Cellar/libressl/2.7.4/include/openssl/opensslfeatures.h /usr/local/Cellar/libressl/2.7.4/include/openssl/objects.h /usr/local/Cellar/libressl/2.7.4/include/openssl/opensslv.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /usr/local/Cellar/libressl/2.7.4/include/openssl/x509_vfy.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio-ssl-support.git--2359138821295600615/module.modulemap /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/checkouts/crypto.git-7980259129511365902/Sources/libbcrypt/include/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
|
D
|
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module flow.idm.engine.impl.persistence.entity.data.PrivilegeMappingDataManager;
import hunt.collection.List;
import flow.common.persistence.entity.data.DataManager;
import flow.idm.api.PrivilegeMapping;
import flow.idm.engine.impl.persistence.entity.PrivilegeMappingEntity;
interface PrivilegeMappingDataManager : DataManager!PrivilegeMappingEntity {
void deleteByPrivilegeId(string privilegeId);
void deleteByPrivilegeIdAndUserId(string privilegeId, string userId);
void deleteByPrivilegeIdAndGroupId(string privilegeId, string groupId);
List!PrivilegeMapping getPrivilegeMappingsByPrivilegeId(string privilegeId);
}
|
D
|
// Written in the D programming language.
/**
This is a submodule of $(LINK2 std_algorithm.html, std.algorithm).
It contains generic _iteration algorithms.
$(BOOKTABLE Cheat Sheet,
$(TR $(TH Function Name) $(TH Description))
$(T2 cache,
Eagerly evaluates and caches another range's $(D front).)
$(T2 cacheBidirectional,
As above, but also provides $(D back) and $(D popBack).)
$(T2 chunkyBy,
$(D chunkyBy!((a,b) => a[1] == b[1])([[1, 1], [1, 2], [2, 2], [2, 1]]))
returns a range containing 3 subranges: the first with just
$(D [1, 1]); the second with the elements $(D [1, 2]) and $(D [2, 2]);
and the third with just $(D [2, 1]).)
$(T2 each,
$(D each!writeln([1, 2, 3])) eagerly prints the numbers $(D 1), $(D 2)
and $(D 3) on their own lines.)
$(T2 filter,
$(D filter!"a > 0"([1, -1, 2, 0, -3])) iterates over elements $(D 1)
and $(D 2).)
$(T2 filterBidirectional,
Similar to $(D filter), but also provides $(D back) and $(D popBack) at
a small increase in cost.)
$(T2 group,
$(D group([5, 2, 2, 3, 3])) returns a range containing the tuples
$(D tuple(5, 1)), $(D tuple(2, 2)), and $(D tuple(3, 2)).)
$(T2 joiner,
$(D joiner(["hello", "world!"], "; ")) returns a range that iterates
over the characters $(D "hello; world!"). No new string is created -
the existing inputs are iterated.)
$(T2 map,
$(D map!"2 * a"([1, 2, 3])) lazily returns a range with the numbers
$(D 2), $(D 4), $(D 6).)
$(T2 reduce,
$(D reduce!"a + b"([1, 2, 3, 4])) returns $(D 10).)
$(T2 splitter,
Lazily splits a range by a separator.)
$(T2 sum,
Same as $(D reduce), but specialized for accurate summation.)
$(T2 uniq,
Iterates over the unique elements in a range, which is assumed sorted.)
)
Copyright: Andrei Alexandrescu 2008-.
License: $(WEB boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors: $(WEB erdani.com, Andrei Alexandrescu)
Source: $(PHOBOSSRC std/algorithm/_iteration.d)
Macros:
T2=$(TR $(TDNW $(LREF $1)) $(TD $+))
*/
module std.algorithm.iteration;
// FIXME
import std.functional; // : unaryFun, binaryFun;
import std.range.primitives;
import std.traits;
template aggregate(fun...) if (fun.length >= 1)
{
/* --Intentionally not ddoc--
* Aggregates elements in each subrange of the given range of ranges using
* the given aggregating function(s).
* Params:
* fun = One or more aggregating functions (binary functions that return a
* single _aggregate value of their arguments).
* ror = A range of ranges to be aggregated.
*
* Returns:
* A range representing the aggregated value(s) of each subrange
* of the original range. If only one aggregating function is specified,
* each element will be the aggregated value itself; if multiple functions
* are specified, each element will be a tuple of the aggregated values of
* each respective function.
*/
auto aggregate(RoR)(RoR ror)
if (isInputRange!RoR && isIterable!(ElementType!RoR))
{
return ror.map!(reduce!fun);
}
unittest
{
import std.algorithm.comparison : equal, max, min;
auto data = [[4, 2, 1, 3], [4, 9, -1, 3, 2], [3]];
// Single aggregating function
auto agg1 = data.aggregate!max;
assert(agg1.equal([4, 9, 3]));
// Multiple aggregating functions
import std.typecons : tuple;
auto agg2 = data.aggregate!(max, min);
assert(agg2.equal([
tuple(4, 1),
tuple(9, -1),
tuple(3, 3)
]));
}
}
/++
$(D cache) eagerly evaluates $(D front) of $(D range)
on each construction or call to $(D popFront),
to store the result in a cache.
The result is then directly returned when $(D front) is called,
rather than re-evaluated.
This can be a useful function to place in a chain, after functions
that have expensive evaluation, as a lazy alternative to $(XREF array,array).
In particular, it can be placed after a call to $(D map), or before a call
to $(D filter).
$(D cache) may provide bidirectional iteration if needed, but since
this comes at an increased cost, it must be explicitly requested via the
call to $(D cacheBidirectional). Furthermore, a bidirectional cache will
evaluate the "center" element twice, when there is only one element left in
the range.
$(D cache) does not provide random access primitives,
as $(D cache) would be unable to cache the random accesses.
If $(D Range) provides slicing primitives,
then $(D cache) will provide the same slicing primitives,
but $(D hasSlicing!Cache) will not yield true (as the $(XREF range,hasSlicing)
trait also checks for random access).
+/
auto cache(Range)(Range range)
if (isInputRange!Range)
{
return _Cache!(Range, false)(range);
}
/// ditto
auto cacheBidirectional(Range)(Range range)
if (isBidirectionalRange!Range)
{
return _Cache!(Range, true)(range);
}
///
@safe unittest
{
import std.algorithm.comparison : equal;
import std.stdio, std.range;
import std.typecons : tuple;
ulong counter = 0;
double fun(int x)
{
++counter;
// http://en.wikipedia.org/wiki/Quartic_function
return ( (x + 4.0) * (x + 1.0) * (x - 1.0) * (x - 3.0) ) / 14.0 + 0.5;
}
// Without cache, with array (greedy)
auto result1 = iota(-4, 5).map!(a =>tuple(a, fun(a)))()
.filter!"a[1]<0"()
.map!"a[0]"()
.array();
// the values of x that have a negative y are:
assert(equal(result1, [-3, -2, 2]));
// Check how many times fun was evaluated.
// As many times as the number of items in both source and result.
assert(counter == iota(-4, 5).length + result1.length);
counter = 0;
// Without array, with cache (lazy)
auto result2 = iota(-4, 5).map!(a =>tuple(a, fun(a)))()
.cache()
.filter!"a[1]<0"()
.map!"a[0]"();
// the values of x that have a negative y are:
assert(equal(result2, [-3, -2, 2]));
// Check how many times fun was evaluated.
// Only as many times as the number of items in source.
assert(counter == iota(-4, 5).length);
}
/++
Tip: $(D cache) is eager when evaluating elements. If calling front on the
underlying range has a side effect, it will be observeable before calling
front on the actual cached range.
Furtermore, care should be taken composing $(D cache) with $(XREF range,take).
By placing $(D take) before $(D cache), then $(D cache) will be "aware"
of when the range ends, and correctly stop caching elements when needed.
If calling front has no side effect though, placing $(D take) after $(D cache)
may yield a faster range.
Either way, the resulting ranges will be equivalent, but maybe not at the
same cost or side effects.
+/
@safe unittest
{
import std.algorithm.comparison : equal;
import std.range;
int i = 0;
auto r = iota(0, 4).tee!((a){i = a;}, No.pipeOnPop);
auto r1 = r.take(3).cache();
auto r2 = r.cache().take(3);
assert(equal(r1, [0, 1, 2]));
assert(i == 2); //The last "seen" element was 2. The data in cache has been cleared.
assert(equal(r2, [0, 1, 2]));
assert(i == 3); //cache has accessed 3. It is still stored internally by cache.
}
@safe unittest
{
import std.algorithm.comparison : equal;
import std.range;
auto a = [1, 2, 3, 4];
assert(equal(a.map!"(a - 1)*a"().cache(), [ 0, 2, 6, 12]));
assert(equal(a.map!"(a - 1)*a"().cacheBidirectional().retro(), [12, 6, 2, 0]));
auto r1 = [1, 2, 3, 4].cache() [1 .. $];
auto r2 = [1, 2, 3, 4].cacheBidirectional()[1 .. $];
assert(equal(r1, [2, 3, 4]));
assert(equal(r2, [2, 3, 4]));
}
@safe unittest
{
import std.algorithm.comparison : equal;
//immutable test
static struct S
{
int i;
this(int i)
{
//this.i = i;
}
}
immutable(S)[] s = [S(1), S(2), S(3)];
assert(equal(s.cache(), s));
assert(equal(s.cacheBidirectional(), s));
}
@safe pure nothrow unittest
{
import std.algorithm.comparison : equal;
//safety etc
auto a = [1, 2, 3, 4];
assert(equal(a.cache(), a));
assert(equal(a.cacheBidirectional(), a));
}
@safe unittest
{
char[][] stringbufs = ["hello".dup, "world".dup];
auto strings = stringbufs.map!((a)=>a.idup)().cache();
assert(strings.front is strings.front);
}
@safe unittest
{
import std.range;
auto c = [1, 2, 3].cycle().cache();
c = c[1 .. $];
auto d = c[0 .. 1];
}
@safe unittest
{
static struct Range
{
bool initialized = false;
bool front() @property {return initialized = true;}
void popFront() {initialized = false;}
enum empty = false;
}
auto r = Range().cache();
assert(r.source.initialized == true);
}
private struct _Cache(R, bool bidir)
{
import core.exception : RangeError;
private
{
import std.algorithm.internal : algoFormat;
import std.typetuple : TypeTuple;
alias E = ElementType!R;
alias UE = Unqual!E;
R source;
static if (bidir) alias CacheTypes = TypeTuple!(UE, UE);
else alias CacheTypes = TypeTuple!UE;
CacheTypes caches;
static assert(isAssignable!(UE, E) && is(UE : E),
algoFormat("Cannot instantiate range with %s because %s elements are not assignable to %s.", R.stringof, E.stringof, UE.stringof));
}
this(R range)
{
source = range;
if (!range.empty)
{
caches[0] = source.front;
static if (bidir)
caches[1] = source.back;
}
}
static if (isInfinite!R)
enum empty = false;
else
bool empty() @property
{
return source.empty;
}
static if (hasLength!R) auto length() @property
{
return source.length;
}
E front() @property
{
version(assert) if (empty) throw new RangeError();
return caches[0];
}
static if (bidir) E back() @property
{
version(assert) if (empty) throw new RangeError();
return caches[1];
}
void popFront()
{
version(assert) if (empty) throw new RangeError();
source.popFront();
if (!source.empty)
caches[0] = source.front;
else
caches = CacheTypes.init;
}
static if (bidir) void popBack()
{
version(assert) if (empty) throw new RangeError();
source.popBack();
if (!source.empty)
caches[1] = source.back;
else
caches = CacheTypes.init;
}
static if (isForwardRange!R)
{
private this(R source, ref CacheTypes caches)
{
this.source = source;
this.caches = caches;
}
typeof(this) save() @property
{
return typeof(this)(source.save, caches);
}
}
static if (hasSlicing!R)
{
enum hasEndSlicing = is(typeof(source[size_t.max .. $]));
static if (hasEndSlicing)
{
private static struct DollarToken{}
enum opDollar = DollarToken.init;
auto opSlice(size_t low, DollarToken)
{
return typeof(this)(source[low .. $]);
}
}
static if (!isInfinite!R)
{
typeof(this) opSlice(size_t low, size_t high)
{
return typeof(this)(source[low .. high]);
}
}
else static if (hasEndSlicing)
{
auto opSlice(size_t low, size_t high)
in
{
assert(low <= high);
}
body
{
import std.range : take;
return this[low .. $].take(high - low);
}
}
}
}
/**
$(D auto map(Range)(Range r) if (isInputRange!(Unqual!Range));)
Implements the homonym function (also known as $(D transform)) present
in many languages of functional flavor. The call $(D map!(fun)(range))
returns a range of which elements are obtained by applying $(D fun(a))
left to right for all elements $(D a) in $(D range). The original ranges are
not changed. Evaluation is done lazily.
See_Also:
$(WEB en.wikipedia.org/wiki/Map_(higher-order_function), Map (higher-order function))
*/
template map(fun...) if (fun.length >= 1)
{
auto map(Range)(Range r) if (isInputRange!(Unqual!Range))
{
import std.typetuple : staticMap;
alias AppliedReturnType(alias f) = typeof(f(r.front));
static if (fun.length > 1)
{
import std.functional : adjoin;
import std.typetuple : staticIndexOf;
alias _funs = staticMap!(unaryFun, fun);
alias _fun = adjoin!_funs;
alias ReturnTypes = staticMap!(AppliedReturnType, _funs);
static assert(staticIndexOf!(void, ReturnTypes) == -1,
"All mapping functions must not return void.");
}
else
{
alias _fun = unaryFun!fun;
static assert(!is(AppliedReturnType!_fun == void),
"Mapping function must not return void.");
}
return MapResult!(_fun, Range)(r);
}
}
///
@safe unittest
{
import std.algorithm.comparison : equal;
import std.range : chain;
int[] arr1 = [ 1, 2, 3, 4 ];
int[] arr2 = [ 5, 6 ];
auto squares = map!(a => a * a)(chain(arr1, arr2));
assert(equal(squares, [ 1, 4, 9, 16, 25, 36 ]));
}
/**
Multiple functions can be passed to $(D map). In that case, the
element type of $(D map) is a tuple containing one element for each
function.
*/
@safe unittest
{
auto sums = [2, 4, 6, 8];
auto products = [1, 4, 9, 16];
size_t i = 0;
foreach (result; [ 1, 2, 3, 4 ].map!("a + a", "a * a"))
{
assert(result[0] == sums[i]);
assert(result[1] == products[i]);
++i;
}
}
/**
You may alias $(D map) with some function(s) to a symbol and use
it separately:
*/
@safe unittest
{
import std.algorithm.comparison : equal;
import std.conv : to;
alias stringize = map!(to!string);
assert(equal(stringize([ 1, 2, 3, 4 ]), [ "1", "2", "3", "4" ]));
}
private struct MapResult(alias fun, Range)
{
alias R = Unqual!Range;
R _input;
static if (isBidirectionalRange!R)
{
@property auto ref back()()
{
return fun(_input.back);
}
void popBack()()
{
_input.popBack();
}
}
this(R input)
{
_input = input;
}
static if (isInfinite!R)
{
// Propagate infinite-ness.
enum bool empty = false;
}
else
{
@property bool empty()
{
return _input.empty;
}
}
void popFront()
{
_input.popFront();
}
@property auto ref front()
{
return fun(_input.front);
}
static if (isRandomAccessRange!R)
{
static if (is(typeof(_input[ulong.max])))
private alias opIndex_t = ulong;
else
private alias opIndex_t = uint;
auto ref opIndex(opIndex_t index)
{
return fun(_input[index]);
}
}
static if (hasLength!R)
{
@property auto length()
{
return _input.length;
}
alias opDollar = length;
}
static if (hasSlicing!R)
{
static if (is(typeof(_input[ulong.max .. ulong.max])))
private alias opSlice_t = ulong;
else
private alias opSlice_t = uint;
static if (hasLength!R)
{
auto opSlice(opSlice_t low, opSlice_t high)
{
return typeof(this)(_input[low .. high]);
}
}
else static if (is(typeof(_input[opSlice_t.max .. $])))
{
struct DollarToken{}
enum opDollar = DollarToken.init;
auto opSlice(opSlice_t low, DollarToken)
{
return typeof(this)(_input[low .. $]);
}
auto opSlice(opSlice_t low, opSlice_t high)
{
import std.range : take;
return this[low .. $].take(high - low);
}
}
}
static if (isForwardRange!R)
{
@property auto save()
{
return typeof(this)(_input.save);
}
}
}
@safe unittest
{
import std.algorithm.comparison : equal;
import std.conv : to;
import std.functional : adjoin;
debug(std_algorithm) scope(success)
writeln("unittest @", __FILE__, ":", __LINE__, " done.");
alias stringize = map!(to!string);
assert(equal(stringize([ 1, 2, 3, 4 ]), [ "1", "2", "3", "4" ]));
uint counter;
alias count = map!((a) { return counter++; });
assert(equal(count([ 10, 2, 30, 4 ]), [ 0, 1, 2, 3 ]));
counter = 0;
adjoin!((a) { return counter++; }, (a) { return counter++; })(1);
alias countAndSquare = map!((a) { return counter++; }, (a) { return counter++; });
//assert(equal(countAndSquare([ 10, 2 ]), [ tuple(0u, 100), tuple(1u, 4) ]));
}
unittest
{
import std.algorithm.comparison : equal;
import std.internal.test.dummyrange;
import std.ascii : toUpper;
import std.range;
debug(std_algorithm) scope(success)
writeln("unittest @", __FILE__, ":", __LINE__, " done.");
int[] arr1 = [ 1, 2, 3, 4 ];
const int[] arr1Const = arr1;
int[] arr2 = [ 5, 6 ];
auto squares = map!("a * a")(arr1Const);
assert(squares[$ - 1] == 16);
assert(equal(squares, [ 1, 4, 9, 16 ][]));
assert(equal(map!("a * a")(chain(arr1, arr2)), [ 1, 4, 9, 16, 25, 36 ][]));
// Test the caching stuff.
assert(squares.back == 16);
auto squares2 = squares.save;
assert(squares2.back == 16);
assert(squares2.front == 1);
squares2.popFront();
assert(squares2.front == 4);
squares2.popBack();
assert(squares2.front == 4);
assert(squares2.back == 9);
assert(equal(map!("a * a")(chain(arr1, arr2)), [ 1, 4, 9, 16, 25, 36 ][]));
uint i;
foreach (e; map!("a", "a * a")(arr1))
{
assert(e[0] == ++i);
assert(e[1] == i * i);
}
// Test length.
assert(squares.length == 4);
assert(map!"a * a"(chain(arr1, arr2)).length == 6);
// Test indexing.
assert(squares[0] == 1);
assert(squares[1] == 4);
assert(squares[2] == 9);
assert(squares[3] == 16);
// Test slicing.
auto squareSlice = squares[1..squares.length - 1];
assert(equal(squareSlice, [4, 9][]));
assert(squareSlice.back == 9);
assert(squareSlice[1] == 9);
// Test on a forward range to make sure it compiles when all the fancy
// stuff is disabled.
auto fibsSquares = map!"a * a"(recurrence!("a[n-1] + a[n-2]")(1, 1));
assert(fibsSquares.front == 1);
fibsSquares.popFront();
fibsSquares.popFront();
assert(fibsSquares.front == 4);
fibsSquares.popFront();
assert(fibsSquares.front == 9);
auto repeatMap = map!"a"(repeat(1));
static assert(isInfinite!(typeof(repeatMap)));
auto intRange = map!"a"([1,2,3]);
static assert(isRandomAccessRange!(typeof(intRange)));
foreach (DummyType; AllDummyRanges)
{
DummyType d;
auto m = map!"a * a"(d);
static assert(propagatesRangeType!(typeof(m), DummyType));
assert(equal(m, [1,4,9,16,25,36,49,64,81,100]));
}
//Test string access
string s1 = "hello world!";
dstring s2 = "日本語";
dstring s3 = "hello world!"d;
auto ms1 = map!(std.ascii.toUpper)(s1);
auto ms2 = map!(std.ascii.toUpper)(s2);
auto ms3 = map!(std.ascii.toUpper)(s3);
static assert(!is(ms1[0])); //narrow strings can't be indexed
assert(ms2[0] == '日');
assert(ms3[0] == 'H');
static assert(!is(ms1[0..1])); //narrow strings can't be sliced
assert(equal(ms2[0..2], "日本"w));
assert(equal(ms3[0..2], "HE"));
// Issue 5753
static void voidFun(int) {}
static int nonvoidFun(int) { return 0; }
static assert(!__traits(compiles, map!voidFun([1])));
static assert(!__traits(compiles, map!(voidFun, voidFun)([1])));
static assert(!__traits(compiles, map!(nonvoidFun, voidFun)([1])));
static assert(!__traits(compiles, map!(voidFun, nonvoidFun)([1])));
}
@safe unittest
{
import std.algorithm.comparison : equal;
import std.range;
auto LL = iota(1L, 4L);
auto m = map!"a*a"(LL);
assert(equal(m, [1L, 4L, 9L]));
}
@safe unittest
{
import std.range : iota;
// Issue #10130 - map of iota with const step.
const step = 2;
static assert(__traits(compiles, map!(i => i)(iota(0, 10, step))));
// Need these to all by const to repro the float case, due to the
// CommonType template used in the float specialization of iota.
const floatBegin = 0.0;
const floatEnd = 1.0;
const floatStep = 0.02;
static assert(__traits(compiles, map!(i => i)(iota(floatBegin, floatEnd, floatStep))));
}
@safe unittest
{
import std.algorithm.comparison : equal;
import std.range;
//slicing infinites
auto rr = iota(0, 5).cycle().map!"a * a"();
alias RR = typeof(rr);
static assert(hasSlicing!RR);
rr = rr[6 .. $]; //Advances 1 cycle and 1 unit
assert(equal(rr[0 .. 5], [1, 4, 9, 16, 0]));
}
@safe unittest
{
import std.range;
struct S {int* p;}
auto m = immutable(S).init.repeat().map!"a".save;
}
// each
/**
Eagerly iterates over $(D r) and calls $(D pred) over _each element.
Params:
pred = predicate to apply to each element of the range
r = range or iterable over which each iterates
Example:
---
void deleteOldBackups()
{
import std.algorithm, std.datetime, std.file;
auto cutoff = Clock.currTime() - 7.days;
dirEntries("", "*~", SpanMode.depth)
.filter!(de => de.timeLastModified < cutoff)
.each!remove();
}
---
If the range supports it, the value can be mutated in place. Examples:
---
arr.each!((ref a) => a++);
arr.each!"a++";
---
If no predicate is specified, $(D each) will default to doing nothing
but consuming the entire range. $(D .front) will be evaluated, but this
can be avoided by explicitly specifying a predicate lambda with a
$(D lazy) parameter.
$(D each) also supports $(D opApply)-based iterators, so it will work
with e.g. $(XREF parallelism, parallel).
See_Also: $(XREF range,tee)
*/
template each(alias pred = "a")
{
import std.typetuple : TypeTuple;
alias BinaryArgs = TypeTuple!(pred, "i", "a");
enum isRangeUnaryIterable(R) =
is(typeof(unaryFun!pred(R.init.front)));
enum isRangeBinaryIterable(R) =
is(typeof(binaryFun!BinaryArgs(0, R.init.front)));
enum isRangeIterable(R) =
isInputRange!R &&
(isRangeUnaryIterable!R || isRangeBinaryIterable!R);
enum isForeachUnaryIterable(R) =
is(typeof((R r) {
foreach (ref a; r)
cast(void)unaryFun!pred(a);
}));
enum isForeachBinaryIterable(R) =
is(typeof((R r) {
foreach (i, ref a; r)
cast(void)binaryFun!BinaryArgs(i, a);
}));
enum isForeachIterable(R) =
(!isForwardRange!R || isDynamicArray!R) &&
(isForeachUnaryIterable!R || isForeachBinaryIterable!R);
void each(Range)(Range r)
if (isRangeIterable!Range && !isForeachIterable!Range)
{
debug(each) pragma(msg, "Using while for ", Range.stringof);
static if (isRangeUnaryIterable!Range)
{
while (!r.empty)
{
cast(void)unaryFun!pred(r.front);
r.popFront();
}
}
else // if (isRangeBinaryIterable!Range)
{
size_t i = 0;
while (!r.empty)
{
cast(void)binaryFun!BinaryArgs(i, r.front);
r.popFront();
i++;
}
}
}
void each(Iterable)(Iterable r)
if (isForeachIterable!Iterable)
{
debug(each) pragma(msg, "Using foreach for ", Iterable.stringof);
static if (isForeachUnaryIterable!Iterable)
{
foreach (ref e; r)
cast(void)unaryFun!pred(e);
}
else // if (isForeachBinaryIterable!Iterable)
{
foreach (i, ref e; r)
cast(void)binaryFun!BinaryArgs(i, e);
}
}
}
unittest
{
import std.range : iota;
long[] arr;
// Note: each over arrays should resolve to the
// foreach variant, but as this is a performance
// improvement it is not unit-testable.
iota(5).each!(n => arr ~= n);
assert(arr == [0, 1, 2, 3, 4]);
// in-place mutation
arr.each!((ref n) => n++);
assert(arr == [1, 2, 3, 4, 5]);
// by-ref lambdas should not be allowed for non-ref ranges
static assert(!is(typeof(arr.map!(n => n).each!((ref n) => n++))));
// default predicate (walk / consume)
auto m = arr.map!(n => n);
(&m).each();
assert(m.empty);
// in-place mutation with index
arr[] = 0;
arr.each!"a=i"();
assert(arr == [0, 1, 2, 3, 4]);
// opApply iterators
static assert(is(typeof({
import std.parallelism;
arr.parallel.each!"a++";
})));
}
/**
$(D auto filter(Range)(Range rs) if (isInputRange!(Unqual!Range));)
Implements the higher order _filter function.
Params:
predicate = Function to apply to each element of range
range = Input range of elements
Returns:
$(D filter!(predicate)(range)) returns a new range containing only elements $(D x) in $(D range) for
which $(D predicate(x)) returns $(D true).
See_Also:
$(WEB en.wikipedia.org/wiki/Filter_(higher-order_function), Filter (higher-order function))
*/
template filter(alias predicate) if (is(typeof(unaryFun!predicate)))
{
auto filter(Range)(Range range) if (isInputRange!(Unqual!Range))
{
return FilterResult!(unaryFun!predicate, Range)(range);
}
}
///
@safe unittest
{
import std.algorithm.comparison : equal;
import std.math : approxEqual;
import std.range;
int[] arr = [ 1, 2, 3, 4, 5 ];
// Sum all elements
auto small = filter!(a => a < 3)(arr);
assert(equal(small, [ 1, 2 ]));
// Sum again, but with Uniform Function Call Syntax (UFCS)
auto sum = arr.filter!(a => a < 3);
assert(equal(sum, [ 1, 2 ]));
// In combination with chain() to span multiple ranges
int[] a = [ 3, -2, 400 ];
int[] b = [ 100, -101, 102 ];
auto r = chain(a, b).filter!(a => a > 0);
assert(equal(r, [ 3, 400, 100, 102 ]));
// Mixing convertible types is fair game, too
double[] c = [ 2.5, 3.0 ];
auto r1 = chain(c, a, b).filter!(a => cast(int) a != a);
assert(approxEqual(r1, [ 2.5 ]));
}
private struct FilterResult(alias pred, Range)
{
alias R = Unqual!Range;
R _input;
this(R r)
{
_input = r;
while (!_input.empty && !pred(_input.front))
{
_input.popFront();
}
}
auto opSlice() { return this; }
static if (isInfinite!Range)
{
enum bool empty = false;
}
else
{
@property bool empty() { return _input.empty; }
}
void popFront()
{
do
{
_input.popFront();
} while (!_input.empty && !pred(_input.front));
}
@property auto ref front()
{
return _input.front;
}
static if (isForwardRange!R)
{
@property auto save()
{
return typeof(this)(_input.save);
}
}
}
@safe unittest
{
import std.algorithm.comparison : equal;
import std.internal.test.dummyrange;
import std.range;
debug(std_algorithm) scope(success)
writeln("unittest @", __FILE__, ":", __LINE__, " done.");
int[] a = [ 3, 4, 2 ];
auto r = filter!("a > 3")(a);
static assert(isForwardRange!(typeof(r)));
assert(equal(r, [ 4 ][]));
a = [ 1, 22, 3, 42, 5 ];
auto under10 = filter!("a < 10")(a);
assert(equal(under10, [1, 3, 5][]));
static assert(isForwardRange!(typeof(under10)));
under10.front = 4;
assert(equal(under10, [4, 3, 5][]));
under10.front = 40;
assert(equal(under10, [40, 3, 5][]));
under10.front = 1;
auto infinite = filter!"a > 2"(repeat(3));
static assert(isInfinite!(typeof(infinite)));
static assert(isForwardRange!(typeof(infinite)));
foreach (DummyType; AllDummyRanges) {
DummyType d;
auto f = filter!"a & 1"(d);
assert(equal(f, [1,3,5,7,9]));
static if (isForwardRange!DummyType) {
static assert(isForwardRange!(typeof(f)));
}
}
// With delegates
int x = 10;
int overX(int a) { return a > x; }
typeof(filter!overX(a)) getFilter()
{
return filter!overX(a);
}
auto r1 = getFilter();
assert(equal(r1, [22, 42]));
// With chain
auto nums = [0,1,2,3,4];
assert(equal(filter!overX(chain(a, nums)), [22, 42]));
// With copying of inner struct Filter to Map
auto arr = [1,2,3,4,5];
auto m = map!"a + 1"(filter!"a < 4"(arr));
}
@safe unittest
{
import std.algorithm.comparison : equal;
int[] a = [ 3, 4 ];
const aConst = a;
auto r = filter!("a > 3")(aConst);
assert(equal(r, [ 4 ][]));
a = [ 1, 22, 3, 42, 5 ];
auto under10 = filter!("a < 10")(a);
assert(equal(under10, [1, 3, 5][]));
assert(equal(under10.save, [1, 3, 5][]));
assert(equal(under10.save, under10));
// With copying of inner struct Filter to Map
auto arr = [1,2,3,4,5];
auto m = map!"a + 1"(filter!"a < 4"(arr));
}
@safe unittest
{
import std.algorithm.comparison : equal;
import std.functional : compose, pipe;
assert(equal(compose!(map!"2 * a", filter!"a & 1")([1,2,3,4,5]),
[2,6,10]));
assert(equal(pipe!(filter!"a & 1", map!"2 * a")([1,2,3,4,5]),
[2,6,10]));
}
@safe unittest
{
import std.algorithm.comparison : equal;
int x = 10;
int underX(int a) { return a < x; }
const(int)[] list = [ 1, 2, 10, 11, 3, 4 ];
assert(equal(filter!underX(list), [ 1, 2, 3, 4 ]));
}
/**
* $(D auto filterBidirectional(Range)(Range r) if (isBidirectionalRange!(Unqual!Range));)
*
* Similar to $(D filter), except it defines a bidirectional
* range. There is a speed disadvantage - the constructor spends time
* finding the last element in the range that satisfies the filtering
* condition (in addition to finding the first one). The advantage is
* that the filtered range can be spanned from both directions. Also,
* $(XREF range, retro) can be applied against the filtered range.
*
* Params:
* pred = Function to apply to each element of range
* r = Bidirectional range of elements
*/
template filterBidirectional(alias pred)
{
auto filterBidirectional(Range)(Range r) if (isBidirectionalRange!(Unqual!Range))
{
return FilterBidiResult!(unaryFun!pred, Range)(r);
}
}
///
@safe unittest
{
import std.algorithm.comparison : equal;
import std.range;
int[] arr = [ 1, 2, 3, 4, 5 ];
auto small = filterBidirectional!("a < 3")(arr);
static assert(isBidirectionalRange!(typeof(small)));
assert(small.back == 2);
assert(equal(small, [ 1, 2 ]));
assert(equal(retro(small), [ 2, 1 ]));
// In combination with chain() to span multiple ranges
int[] a = [ 3, -2, 400 ];
int[] b = [ 100, -101, 102 ];
auto r = filterBidirectional!("a > 0")(chain(a, b));
assert(r.back == 102);
}
private struct FilterBidiResult(alias pred, Range)
{
alias R = Unqual!Range;
R _input;
this(R r)
{
_input = r;
while (!_input.empty && !pred(_input.front)) _input.popFront();
while (!_input.empty && !pred(_input.back)) _input.popBack();
}
@property bool empty() { return _input.empty; }
void popFront()
{
do
{
_input.popFront();
} while (!_input.empty && !pred(_input.front));
}
@property auto ref front()
{
return _input.front;
}
void popBack()
{
do
{
_input.popBack();
} while (!_input.empty && !pred(_input.back));
}
@property auto ref back()
{
return _input.back;
}
@property auto save()
{
return typeof(this)(_input.save);
}
}
// group
struct Group(alias pred, R) if (isInputRange!R)
{
import std.typecons : Rebindable, tuple, Tuple;
private alias comp = binaryFun!pred;
private alias E = ElementType!R;
static if ((is(E == class) || is(E == interface)) &&
(is(E == const) || is(E == immutable)))
{
private alias MutableE = Rebindable!E;
}
else static if (is(E : Unqual!E))
{
private alias MutableE = Unqual!E;
}
else
{
private alias MutableE = E;
}
private R _input;
private Tuple!(MutableE, uint) _current;
this(R input)
{
_input = input;
if (!_input.empty) popFront();
}
void popFront()
{
if (_input.empty)
{
_current[1] = 0;
}
else
{
_current = tuple(_input.front, 1u);
_input.popFront();
while (!_input.empty && comp(_current[0], _input.front))
{
++_current[1];
_input.popFront();
}
}
}
static if (isInfinite!R)
{
enum bool empty = false; // Propagate infiniteness.
}
else
{
@property bool empty()
{
return _current[1] == 0;
}
}
@property auto ref front()
{
assert(!empty);
return _current;
}
static if (isForwardRange!R) {
@property typeof(this) save() {
typeof(this) ret = this;
ret._input = this._input.save;
ret._current = this._current;
return ret;
}
}
}
/**
Groups consecutively equivalent elements into a single tuple of the element and
the number of its repetitions.
Similarly to $(D uniq), $(D group) produces a range that iterates over unique
consecutive elements of the given range. Each element of this range is a tuple
of the element and the number of times it is repeated in the original range.
Equivalence of elements is assessed by using the predicate $(D pred), which
defaults to $(D "a == b").
Params:
pred = Binary predicate for determining equivalence of two elements.
r = The $(XREF2 range, isInputRange, input range) to iterate over.
Returns: A range of elements of type $(D Tuple!(ElementType!R, uint)),
representing each consecutively unique element and its respective number of
occurrences in that run. This will be an input range if $(D R) is an input
range, and a forward range in all other cases.
*/
Group!(pred, Range) group(alias pred = "a == b", Range)(Range r)
{
return typeof(return)(r);
}
///
@safe unittest
{
import std.algorithm.comparison : equal;
import std.typecons : tuple, Tuple;
int[] arr = [ 1, 2, 2, 2, 2, 3, 4, 4, 4, 5 ];
assert(equal(group(arr), [ tuple(1, 1u), tuple(2, 4u), tuple(3, 1u),
tuple(4, 3u), tuple(5, 1u) ][]));
}
@safe unittest
{
import std.algorithm.comparison : equal;
import std.internal.test.dummyrange;
import std.typecons : tuple, Tuple;
debug(std_algorithm) scope(success)
writeln("unittest @", __FILE__, ":", __LINE__, " done.");
int[] arr = [ 1, 2, 2, 2, 2, 3, 4, 4, 4, 5 ];
assert(equal(group(arr), [ tuple(1, 1u), tuple(2, 4u), tuple(3, 1u),
tuple(4, 3u), tuple(5, 1u) ][]));
static assert(isForwardRange!(typeof(group(arr))));
foreach (DummyType; AllDummyRanges) {
DummyType d;
auto g = group(d);
static assert(d.rt == RangeType.Input || isForwardRange!(typeof(g)));
assert(equal(g, [tuple(1, 1u), tuple(2, 1u), tuple(3, 1u), tuple(4, 1u),
tuple(5, 1u), tuple(6, 1u), tuple(7, 1u), tuple(8, 1u),
tuple(9, 1u), tuple(10, 1u)]));
}
}
unittest
{
// Issue 13857
immutable(int)[] a1 = [1,1,2,2,2,3,4,4,5,6,6,7,8,9,9,9];
auto g1 = group(a1);
// Issue 13162
immutable(ubyte)[] a2 = [1, 1, 1, 0, 0, 0];
auto g2 = a2.group;
// Issue 10104
const a3 = [1, 1, 2, 2];
auto g3 = a3.group;
interface I {}
class C : I {}
const C[] a4 = [new const C()];
auto g4 = a4.group!"a is b";
immutable I[] a5 = [new immutable C()];
auto g5 = a5.group!"a is b";
const(int[][]) a6 = [[1], [1]];
auto g6 = a6.group;
}
// Used by implementation of chunkBy for non-forward input ranges.
private struct ChunkByChunkImpl(alias pred, Range)
if (isInputRange!Range && !isForwardRange!Range)
{
alias fun = binaryFun!pred;
private Range r;
private ElementType!Range prev;
this(Range range, ElementType!Range _prev)
{
r = range;
prev = _prev;
}
@property bool empty()
{
return r.empty || !fun(prev, r.front);
}
@property ElementType!Range front() { return r.front; }
void popFront() { r.popFront(); }
}
private template ChunkByImplIsUnary(alias pred, Range)
{
static if (is(typeof(binaryFun!pred(ElementType!Range.init,
ElementType!Range.init)) : bool))
enum ChunkByImplIsUnary = false;
else static if (is(typeof(
unaryFun!pred(ElementType!Range.init) ==
unaryFun!pred(ElementType!Range.init))))
enum ChunkByImplIsUnary = true;
else
static assert(0, "chunkBy expects either a binary predicate or "~
"a unary predicate on range elements of type: "~
ElementType!Range.stringof);
}
// Implementation of chunkBy for non-forward input ranges.
private struct ChunkByImpl(alias pred, Range)
if (isInputRange!Range && !isForwardRange!Range)
{
enum bool isUnary = ChunkByImplIsUnary!(pred, Range);
static if (isUnary)
alias eq = binaryFun!((a, b) => unaryFun!pred(a) == unaryFun!pred(b));
else
alias eq = binaryFun!pred;
private Range r;
private ElementType!Range _prev;
this(Range _r)
{
r = _r;
if (!empty)
{
// Check reflexivity if predicate is claimed to be an equivalence
// relation.
assert(eq(r.front, r.front),
"predicate is not reflexive");
// _prev's type may be a nested struct, so must be initialized
// directly in the constructor (cannot call savePred()).
_prev = r.front;
}
else
{
// We won't use _prev, but must be initialized.
_prev = typeof(_prev).init;
}
}
@property bool empty() { return r.empty; }
@property auto front()
{
static if (isUnary)
{
import std.typecons : tuple;
return tuple(unaryFun!pred(_prev),
ChunkByChunkImpl!(eq, Range)(r, _prev));
}
else
{
return ChunkByChunkImpl!(eq, Range)(r, _prev);
}
}
void popFront()
{
while (!r.empty)
{
if (!eq(_prev, r.front))
{
_prev = r.front;
break;
}
r.popFront();
}
}
}
// Single-pass implementation of chunkBy for forward ranges.
private struct ChunkByImpl(alias pred, Range)
if (isForwardRange!Range)
{
import std.typecons : RefCounted;
enum bool isUnary = ChunkByImplIsUnary!(pred, Range);
static if (isUnary)
alias eq = binaryFun!((a, b) => unaryFun!pred(a) == unaryFun!pred(b));
else
alias eq = binaryFun!pred;
// Outer range
static struct Impl
{
size_t groupNum;
Range current;
Range next;
}
// Inner range
static struct Group
{
private size_t groupNum;
private Range start;
private Range current;
private RefCounted!Impl mothership;
this(RefCounted!Impl origin)
{
groupNum = origin.groupNum;
start = origin.current.save;
current = origin.current.save;
assert(!start.empty);
mothership = origin;
// Note: this requires reflexivity.
assert(eq(start.front, current.front),
"predicate is not reflexive");
}
@property bool empty() { return groupNum == size_t.max; }
@property auto ref front() { return current.front; }
void popFront()
{
current.popFront();
// Note: this requires transitivity.
if (current.empty || !eq(start.front, current.front))
{
if (groupNum == mothership.groupNum)
{
// If parent range hasn't moved on yet, help it along by
// saving location of start of next Group.
mothership.next = current.save;
}
groupNum = size_t.max;
}
}
@property auto save()
{
auto copy = this;
copy.current = current.save;
return copy;
}
}
static assert(isForwardRange!Group);
private RefCounted!Impl impl;
this(Range r)
{
impl = RefCounted!Impl(0, r, r.save);
}
@property bool empty() { return impl.current.empty; }
@property auto front()
{
static if (isUnary)
{
import std.typecons : tuple;
return tuple(unaryFun!pred(impl.current.front), Group(impl));
}
else
{
return Group(impl);
}
}
void popFront()
{
// Scan for next group. If we're lucky, one of our Groups would have
// already set .next to the start of the next group, in which case the
// loop is skipped.
while (!impl.next.empty && eq(impl.current.front, impl.next.front))
{
impl.next.popFront();
}
impl.current = impl.next.save;
// Indicate to any remaining Groups that we have moved on.
impl.groupNum++;
}
@property auto save()
{
// Note: the new copy of the range will be detached from any existing
// satellite Groups, and will not benefit from the .next acceleration.
return typeof(this)(impl.current.save);
}
static assert(isForwardRange!(typeof(this)));
}
unittest
{
import std.algorithm.comparison : equal;
size_t popCount = 0;
class RefFwdRange
{
int[] impl;
this(int[] data) { impl = data; }
@property bool empty() { return impl.empty; }
@property auto ref front() { return impl.front; }
void popFront()
{
impl.popFront();
popCount++;
}
@property auto save() { return new RefFwdRange(impl); }
}
static assert(isForwardRange!RefFwdRange);
auto testdata = new RefFwdRange([1, 3, 5, 2, 4, 7, 6, 8, 9]);
auto groups = testdata.chunkBy!((a,b) => (a % 2) == (b % 2));
auto outerSave1 = groups.save;
// Sanity test
assert(groups.equal!equal([[1, 3, 5], [2, 4], [7], [6, 8], [9]]));
assert(groups.empty);
// Performance test for single-traversal use case: popFront should not have
// been called more times than there are elements if we traversed the
// segmented range exactly once.
assert(popCount == 9);
// Outer range .save test
groups = outerSave1.save;
assert(!groups.empty);
// Inner range .save test
auto grp1 = groups.front.save;
auto grp1b = grp1.save;
assert(grp1b.equal([1, 3, 5]));
assert(grp1.save.equal([1, 3, 5]));
// Inner range should remain consistent after outer range has moved on.
groups.popFront();
assert(grp1.save.equal([1, 3, 5]));
// Inner range should not be affected by subsequent inner ranges.
assert(groups.front.equal([2, 4]));
assert(grp1.save.equal([1, 3, 5]));
}
/**
* Chunks an input range into subranges of equivalent adjacent elements.
*
* Equivalence is defined by the predicate $(D pred), which can be either
* binary or unary. In the binary form, two _range elements $(D a) and $(D b)
* are considered equivalent if $(D pred(a,b)) is true. In unary form, two
* elements are considered equivalent if $(D pred(a) == pred(b)) is true.
*
* This predicate must be an equivalence relation, that is, it must be
* reflexive ($(D pred(x,x)) is always true), symmetric
* ($(D pred(x,y) == pred(y,x))), and transitive ($(D pred(x,y) && pred(y,z))
* implies $(D pred(x,z))). If this is not the case, the range returned by
* chunkBy may assert at runtime or behave erratically.
*
* Params:
* pred = Predicate for determining equivalence.
* r = The range to be chunked.
*
* Returns: With a binary predicate, a range of ranges is returned in which
* all elements in a given subrange are equivalent under the given predicate.
* With a unary predicate, a range of tuples is returned, with the tuple
* consisting of the result of the unary predicate for each subrange, and the
* subrange itself.
*
* Notes:
*
* Equivalent elements separated by an intervening non-equivalent element will
* appear in separate subranges; this function only considers adjacent
* equivalence. Elements in the subranges will always appear in the same order
* they appear in the original range.
*
* See_also:
* $(XREF algorithm,group), which collapses adjacent equivalent elements into a
* single element.
*/
auto chunkBy(alias pred, Range)(Range r)
if (isInputRange!Range)
{
return ChunkByImpl!(pred, Range)(r);
}
/// Showing usage with binary predicate:
/*FIXME: @safe*/ unittest
{
import std.algorithm.comparison : equal;
// Grouping by particular attribute of each element:
auto data = [
[1, 1],
[1, 2],
[2, 2],
[2, 3]
];
auto r1 = data.chunkBy!((a,b) => a[0] == b[0]);
assert(r1.equal!equal([
[[1, 1], [1, 2]],
[[2, 2], [2, 3]]
]));
auto r2 = data.chunkBy!((a,b) => a[1] == b[1]);
assert(r2.equal!equal([
[[1, 1]],
[[1, 2], [2, 2]],
[[2, 3]]
]));
}
version(none) // this example requires support for non-equivalence relations
unittest
{
auto data = [
[1, 1],
[1, 2],
[2, 2],
[2, 3]
];
version(none)
{
// Grouping by maximum adjacent difference:
import std.math : abs;
auto r3 = [1, 3, 2, 5, 4, 9, 10].chunkBy!((a, b) => abs(a-b) < 3);
assert(r3.equal!equal([
[1, 3, 2],
[5, 4],
[9, 10]
]));
}
}
/// Showing usage with unary predicate:
/* FIXME: pure @safe nothrow*/ unittest
{
import std.algorithm.comparison : equal;
import std.typecons : tuple;
// Grouping by particular attribute of each element:
auto range =
[
[1, 1],
[1, 1],
[1, 2],
[2, 2],
[2, 3],
[2, 3],
[3, 3]
];
auto byX = chunkBy!(a => a[0])(range);
auto expected1 =
[
tuple(1, [[1, 1], [1, 1], [1, 2]]),
tuple(2, [[2, 2], [2, 3], [2, 3]]),
tuple(3, [[3, 3]])
];
foreach (e; byX)
{
assert(!expected1.empty);
assert(e[0] == expected1.front[0]);
assert(e[1].equal(expected1.front[1]));
expected1.popFront();
}
auto byY = chunkBy!(a => a[1])(range);
auto expected2 =
[
tuple(1, [[1, 1], [1, 1]]),
tuple(2, [[1, 2], [2, 2]]),
tuple(3, [[2, 3], [2, 3], [3, 3]])
];
foreach (e; byY)
{
assert(!expected2.empty);
assert(e[0] == expected2.front[0]);
assert(e[1].equal(expected2.front[1]));
expected2.popFront();
}
}
/*FIXME: pure @safe nothrow*/ unittest
{
import std.algorithm.comparison : equal;
import std.typecons : tuple;
struct Item { int x, y; }
// Force R to have only an input range API with reference semantics, so
// that we're not unknowingly making use of array semantics outside of the
// range API.
class RefInputRange(R)
{
R data;
this(R _data) pure @safe nothrow { data = _data; }
@property bool empty() pure @safe nothrow { return data.empty; }
@property auto front() pure @safe nothrow { return data.front; }
void popFront() pure @safe nothrow { data.popFront(); }
}
auto refInputRange(R)(R range) { return new RefInputRange!R(range); }
{
auto arr = [ Item(1,2), Item(1,3), Item(2,3) ];
static assert(isForwardRange!(typeof(arr)));
auto byX = chunkBy!(a => a.x)(arr);
static assert(isForwardRange!(typeof(byX)));
auto byX_subrange1 = byX.front[1].save;
auto byX_subrange2 = byX.front[1].save;
static assert(isForwardRange!(typeof(byX_subrange1)));
static assert(isForwardRange!(typeof(byX_subrange2)));
byX.popFront();
assert(byX_subrange1.equal([ Item(1,2), Item(1,3) ]));
byX_subrange1.popFront();
assert(byX_subrange1.equal([ Item(1,3) ]));
assert(byX_subrange2.equal([ Item(1,2), Item(1,3) ]));
auto byY = chunkBy!(a => a.y)(arr);
static assert(isForwardRange!(typeof(byY)));
auto byY2 = byY.save;
static assert(is(typeof(byY) == typeof(byY2)));
byY.popFront();
assert(byY.front[0] == 3);
assert(byY.front[1].equal([ Item(1,3), Item(2,3) ]));
assert(byY2.front[0] == 2);
assert(byY2.front[1].equal([ Item(1,2) ]));
}
// Test non-forward input ranges.
{
auto range = refInputRange([ Item(1,1), Item(1,2), Item(2,2) ]);
auto byX = chunkBy!(a => a.x)(range);
assert(byX.front[0] == 1);
assert(byX.front[1].equal([ Item(1,1), Item(1,2) ]));
byX.popFront();
assert(byX.front[0] == 2);
assert(byX.front[1].equal([ Item(2,2) ]));
byX.popFront();
assert(byX.empty);
assert(range.empty);
range = refInputRange([ Item(1,1), Item(1,2), Item(2,2) ]);
auto byY = chunkBy!(a => a.y)(range);
assert(byY.front[0] == 1);
assert(byY.front[1].equal([ Item(1,1) ]));
byY.popFront();
assert(byY.front[0] == 2);
assert(byY.front[1].equal([ Item(1,2), Item(2,2) ]));
byY.popFront();
assert(byY.empty);
assert(range.empty);
}
}
// Issue 13595
version(none) // This requires support for non-equivalence relations
unittest
{
import std.algorithm.comparison : equal;
auto r = [1, 2, 3, 4, 5, 6, 7, 8, 9].chunkBy!((x, y) => ((x*y) % 3) == 0);
assert(r.equal!equal([
[1],
[2, 3, 4],
[5, 6, 7],
[8, 9]
]));
}
// Issue 13805
unittest
{
[""].map!((s) => s).chunkBy!((x, y) => true);
}
// to be removed in 2.068.0
deprecated("use chunkBy instead")
alias groupBy = chunkBy;
// joiner
/**
Lazily joins a range of ranges with a separator. The separator itself
is a range. If you do not provide a separator, then the ranges are
joined directly without anything in between them.
Params:
r = An $(XREF2 range, isInputRange, input range) of input ranges to be
joined.
sep = A $(XREF2 range, isForwardRange, forward range) of element(s) to
serve as separators in the joined range.
Returns:
An input range of elements in the joined range. This will be a forward range if
both outer and inner ranges of $(D RoR) are forward ranges; otherwise it will
be only an input range.
See_also:
$(XREF range,chain), which chains a sequence of ranges with compatible elements
into a single range.
*/
auto joiner(RoR, Separator)(RoR r, Separator sep)
if (isInputRange!RoR && isInputRange!(ElementType!RoR)
&& isForwardRange!Separator
&& is(ElementType!Separator : ElementType!(ElementType!RoR)))
{
static struct Result
{
private RoR _items;
private ElementType!RoR _current;
private Separator _sep, _currentSep;
// This is a mixin instead of a function for the following reason (as
// explained by Kenji Hara): "This is necessary from 2.061. If a
// struct has a nested struct member, it must be directly initialized
// in its constructor to avoid leaving undefined state. If you change
// setItem to a function, the initialization of _current field is
// wrapped into private member function, then compiler could not detect
// that is correctly initialized while constructing. To avoid the
// compiler error check, string mixin is used."
private enum setItem =
q{
if (!_items.empty)
{
// If we're exporting .save, we must not consume any of the
// subranges, since RoR.save does not guarantee that the states
// of the subranges are also saved.
static if (isForwardRange!RoR &&
isForwardRange!(ElementType!RoR))
_current = _items.front.save;
else
_current = _items.front;
}
};
private void useSeparator()
{
// Separator must always come after an item.
assert(_currentSep.empty && !_items.empty,
"joiner: internal error");
_items.popFront();
// If there are no more items, we're done, since separators are not
// terminators.
if (_items.empty) return;
if (_sep.empty)
{
// Advance to the next range in the
// input
while (_items.front.empty)
{
_items.popFront();
if (_items.empty) return;
}
mixin(setItem);
}
else
{
_currentSep = _sep.save;
assert(!_currentSep.empty);
}
}
private enum useItem =
q{
// FIXME: this will crash if either _currentSep or _current are
// class objects, because .init is null when the ctor invokes this
// mixin.
//assert(_currentSep.empty && _current.empty,
// "joiner: internal error");
// Use the input
if (_items.empty) return;
mixin(setItem);
if (_current.empty)
{
// No data in the current item - toggle to use the separator
useSeparator();
}
};
this(RoR items, Separator sep)
{
_items = items;
_sep = sep;
//mixin(useItem); // _current should be initialized in place
if (_items.empty)
_current = _current.init; // set invalid state
else
{
// If we're exporting .save, we must not consume any of the
// subranges, since RoR.save does not guarantee that the states
// of the subranges are also saved.
static if (isForwardRange!RoR &&
isForwardRange!(ElementType!RoR))
_current = _items.front.save;
else
_current = _items.front;
if (_current.empty)
{
// No data in the current item - toggle to use the separator
useSeparator();
}
}
}
@property auto empty()
{
return _items.empty;
}
@property ElementType!(ElementType!RoR) front()
{
if (!_currentSep.empty) return _currentSep.front;
assert(!_current.empty);
return _current.front;
}
void popFront()
{
assert(!_items.empty);
// Using separator?
if (!_currentSep.empty)
{
_currentSep.popFront();
if (!_currentSep.empty) return;
mixin(useItem);
}
else
{
// we're using the range
_current.popFront();
if (!_current.empty) return;
useSeparator();
}
}
static if (isForwardRange!RoR && isForwardRange!(ElementType!RoR))
{
@property auto save()
{
Result copy = this;
copy._items = _items.save;
copy._current = _current.save;
copy._sep = _sep.save;
copy._currentSep = _currentSep.save;
return copy;
}
}
}
return Result(r, sep);
}
///
@safe unittest
{
import std.algorithm.comparison : equal;
import std.conv : text;
debug(std_algorithm) scope(success)
writeln("unittest @", __FILE__, ":", __LINE__, " done.");
static assert(isInputRange!(typeof(joiner([""], ""))));
static assert(isForwardRange!(typeof(joiner([""], ""))));
assert(equal(joiner([""], "xyz"), ""), text(joiner([""], "xyz")));
assert(equal(joiner(["", ""], "xyz"), "xyz"), text(joiner(["", ""], "xyz")));
assert(equal(joiner(["", "abc"], "xyz"), "xyzabc"));
assert(equal(joiner(["abc", ""], "xyz"), "abcxyz"));
assert(equal(joiner(["abc", "def"], "xyz"), "abcxyzdef"));
assert(equal(joiner(["Mary", "has", "a", "little", "lamb"], "..."),
"Mary...has...a...little...lamb"));
assert(equal(joiner(["abc", "def"]), "abcdef"));
}
unittest
{
import std.algorithm.comparison : equal;
import std.range.primitives;
import std.range.interfaces;
// joiner() should work for non-forward ranges too.
auto r = inputRangeObject(["abc", "def"]);
assert (equal(joiner(r, "xyz"), "abcxyzdef"));
}
unittest
{
import std.algorithm.comparison : equal;
import std.range;
// Related to issue 8061
auto r = joiner([
inputRangeObject("abc"),
inputRangeObject("def"),
], "-*-");
assert(equal(r, "abc-*-def"));
// Test case where separator is specified but is empty.
auto s = joiner([
inputRangeObject("abc"),
inputRangeObject("def"),
], "");
assert(equal(s, "abcdef"));
// Test empty separator with some empty elements
auto t = joiner([
inputRangeObject("abc"),
inputRangeObject(""),
inputRangeObject("def"),
inputRangeObject(""),
], "");
assert(equal(t, "abcdef"));
// Test empty elements with non-empty separator
auto u = joiner([
inputRangeObject(""),
inputRangeObject("abc"),
inputRangeObject(""),
inputRangeObject("def"),
inputRangeObject(""),
], "+-");
assert(equal(u, "+-abc+-+-def+-"));
// Issue 13441: only(x) as separator
string[][] lines = [null];
lines
.joiner(only("b"))
.array();
}
@safe unittest
{
import std.algorithm.comparison : equal;
// Transience correctness test
struct TransientRange
{
@safe:
int[][] src;
int[] buf;
this(int[][] _src)
{
src = _src;
buf.length = 100;
}
@property bool empty() { return src.empty; }
@property int[] front()
{
assert(src.front.length <= buf.length);
buf[0 .. src.front.length] = src.front[0..$];
return buf[0 .. src.front.length];
}
void popFront() { src.popFront(); }
}
// Test embedded empty elements
auto tr1 = TransientRange([[], [1,2,3], [], [4]]);
assert(equal(joiner(tr1, [0]), [0,1,2,3,0,0,4]));
// Test trailing empty elements
auto tr2 = TransientRange([[], [1,2,3], []]);
assert(equal(joiner(tr2, [0]), [0,1,2,3,0]));
// Test no empty elements
auto tr3 = TransientRange([[1,2], [3,4]]);
assert(equal(joiner(tr3, [0,1]), [1,2,0,1,3,4]));
// Test consecutive empty elements
auto tr4 = TransientRange([[1,2], [], [], [], [3,4]]);
assert(equal(joiner(tr4, [0,1]), [1,2,0,1,0,1,0,1,0,1,3,4]));
// Test consecutive trailing empty elements
auto tr5 = TransientRange([[1,2], [3,4], [], []]);
assert(equal(joiner(tr5, [0,1]), [1,2,0,1,3,4,0,1,0,1]));
}
/// Ditto
auto joiner(RoR)(RoR r)
if (isInputRange!RoR && isInputRange!(ElementType!RoR))
{
static struct Result
{
private:
RoR _items;
ElementType!RoR _current;
enum prepare =
q{
// Skip over empty subranges.
if (_items.empty) return;
while (_items.front.empty)
{
_items.popFront();
if (_items.empty) return;
}
// We cannot export .save method unless we ensure subranges are not
// consumed when a .save'd copy of ourselves is iterated over. So
// we need to .save each subrange we traverse.
static if (isForwardRange!RoR && isForwardRange!(ElementType!RoR))
_current = _items.front.save;
else
_current = _items.front;
};
public:
this(RoR r)
{
_items = r;
//mixin(prepare); // _current should be initialized in place
// Skip over empty subranges.
while (!_items.empty && _items.front.empty)
_items.popFront();
if (_items.empty)
_current = _current.init; // set invalid state
else
{
// We cannot export .save method unless we ensure subranges are not
// consumed when a .save'd copy of ourselves is iterated over. So
// we need to .save each subrange we traverse.
static if (isForwardRange!RoR && isForwardRange!(ElementType!RoR))
_current = _items.front.save;
else
_current = _items.front;
}
}
static if (isInfinite!RoR)
{
enum bool empty = false;
}
else
{
@property auto empty()
{
return _items.empty;
}
}
@property auto ref front()
{
assert(!empty);
return _current.front;
}
void popFront()
{
assert(!_current.empty);
_current.popFront();
if (_current.empty)
{
assert(!_items.empty);
_items.popFront();
mixin(prepare);
}
}
static if (isForwardRange!RoR && isForwardRange!(ElementType!RoR))
{
@property auto save()
{
Result copy = this;
copy._items = _items.save;
copy._current = _current.save;
return copy;
}
}
}
return Result(r);
}
unittest
{
import std.algorithm.comparison : equal;
import std.range.interfaces;
import std.range : repeat;
debug(std_algorithm) scope(success)
writeln("unittest @", __FILE__, ":", __LINE__, " done.");
static assert(isInputRange!(typeof(joiner([""]))));
static assert(isForwardRange!(typeof(joiner([""]))));
assert(equal(joiner([""]), ""));
assert(equal(joiner(["", ""]), ""));
assert(equal(joiner(["", "abc"]), "abc"));
assert(equal(joiner(["abc", ""]), "abc"));
assert(equal(joiner(["abc", "def"]), "abcdef"));
assert(equal(joiner(["Mary", "has", "a", "little", "lamb"]),
"Maryhasalittlelamb"));
assert(equal(joiner(std.range.repeat("abc", 3)), "abcabcabc"));
// joiner allows in-place mutation!
auto a = [ [1, 2, 3], [42, 43] ];
auto j = joiner(a);
j.front = 44;
assert(a == [ [44, 2, 3], [42, 43] ]);
// bugzilla 8240
assert(equal(joiner([inputRangeObject("")]), ""));
// issue 8792
auto b = [[1], [2], [3]];
auto jb = joiner(b);
auto js = jb.save;
assert(equal(jb, js));
auto js2 = jb.save;
jb.popFront();
assert(!equal(jb, js));
assert(equal(js2, js));
js.popFront();
assert(equal(jb, js));
assert(!equal(js2, js));
}
@safe unittest
{
import std.algorithm.comparison : equal;
struct TransientRange
{
@safe:
int[] _buf;
int[][] _values;
this(int[][] values)
{
_values = values;
_buf = new int[128];
}
@property bool empty()
{
return _values.length == 0;
}
@property auto front()
{
foreach (i; 0 .. _values.front.length)
{
_buf[i] = _values[0][i];
}
return _buf[0 .. _values.front.length];
}
void popFront()
{
_values = _values[1 .. $];
}
}
auto rr = TransientRange([[1,2], [3,4,5], [], [6,7]]);
// Can't use array() or equal() directly because they fail with transient
// .front.
int[] result;
foreach (c; rr.joiner()) {
result ~= c;
}
assert(equal(result, [1,2,3,4,5,6,7]));
}
@safe unittest
{
import std.algorithm.internal : algoFormat;
import std.algorithm.comparison : equal;
struct TransientRange
{
@safe:
dchar[] _buf;
dstring[] _values;
this(dstring[] values)
{
_buf.length = 128;
_values = values;
}
@property bool empty()
{
return _values.length == 0;
}
@property auto front()
{
foreach (i; 0 .. _values.front.length)
{
_buf[i] = _values[0][i];
}
return _buf[0 .. _values.front.length];
}
void popFront()
{
_values = _values[1 .. $];
}
}
auto rr = TransientRange(["abc"d, "12"d, "def"d, "34"d]);
// Can't use array() or equal() directly because they fail with transient
// .front.
dchar[] result;
foreach (c; rr.joiner()) {
result ~= c;
}
assert(equal(result, "abc12def34"d),
"Unexpected result: '%s'"d.algoFormat(result));
}
// Issue 8061
unittest
{
import std.range.interfaces;
import std.conv : to;
auto r = joiner([inputRangeObject("ab"), inputRangeObject("cd")]);
assert(isForwardRange!(typeof(r)));
auto str = to!string(r);
assert(str == "abcd");
}
/++
Implements the homonym function (also known as $(D accumulate), $(D
compress), $(D inject), or $(D foldl)) present in various programming
languages of functional flavor. The call $(D reduce!(fun)(seed,
range)) first assigns $(D seed) to an internal variable $(D result),
also called the accumulator. Then, for each element $(D x) in $(D
range), $(D result = fun(result, x)) gets evaluated. Finally, $(D
result) is returned. The one-argument version $(D reduce!(fun)(range))
works similarly, but it uses the first element of the range as the
seed (the range must be non-empty).
Returns:
the accumulated $(D result)
See_Also:
$(WEB en.wikipedia.org/wiki/Fold_(higher-order_function), Fold (higher-order function))
$(LREF sum) is similar to $(D reduce!((a, b) => a + b)) that offers
precise summing of floating point numbers.
+/
template reduce(fun...) if (fun.length >= 1)
{
import std.typetuple : staticMap;
alias binfuns = staticMap!(binaryFun, fun);
static if (fun.length > 1)
import std.typecons : tuple, isTuple;
/++
No-seed version. The first element of $(D r) is used as the seed's value.
For each function $(D f) in $(D fun), the corresponding
seed type $(D S) is $(D Unqual!(typeof(f(e, e)))), where $(D e) is an
element of $(D r): $(D ElementType!R) for ranges,
and $(D ForeachType!R) otherwise.
Once S has been determined, then $(D S s = e;) and $(D s = f(s, e);)
must both be legal.
If $(D r) is empty, an $(D Exception) is thrown.
+/
auto reduce(R)(R r)
if (isIterable!R)
{
import std.exception : enforce;
alias E = Select!(isInputRange!R, ElementType!R, ForeachType!R);
alias Args = staticMap!(ReduceSeedType!E, binfuns);
static if (isInputRange!R)
{
enforce(!r.empty);
Args result = r.front;
r.popFront();
return reduceImpl!false(r, result);
}
else
{
auto result = Args.init;
return reduceImpl!true(r, result);
}
}
/++
Seed version. The seed should be a single value if $(D fun) is a
single function. If $(D fun) is multiple functions, then $(D seed)
should be a $(XREF typecons,Tuple), with one field per function in $(D f).
For convenience, if the seed is const, or has qualified fields, then
$(D reduce) will operate on an unqualified copy. If this happens
then the returned type will not perfectly match $(D S).
+/
auto reduce(S, R)(S seed, R r)
if (isIterable!R)
{
static if (fun.length == 1)
return reducePreImpl(r, seed);
else
{
import std.algorithm.internal : algoFormat;
static assert(isTuple!S, algoFormat("Seed %s should be a Tuple", S.stringof));
return reducePreImpl(r, seed.expand);
}
}
private auto reducePreImpl(R, Args...)(R r, ref Args args)
{
alias Result = staticMap!(Unqual, Args);
static if (is(Result == Args))
alias result = args;
else
Result result = args;
return reduceImpl!false(r, result);
}
private auto reduceImpl(bool mustInitialize, R, Args...)(R r, ref Args args)
if (isIterable!R)
{
import std.algorithm.internal : algoFormat;
static assert(Args.length == fun.length,
algoFormat("Seed %s does not have the correct amount of fields (should be %s)", Args.stringof, fun.length));
alias E = Select!(isInputRange!R, ElementType!R, ForeachType!R);
static if (mustInitialize) bool initialized = false;
foreach (/+auto ref+/ E e; r) // @@@4707@@@
{
foreach (i, f; binfuns)
static assert(is(typeof(args[i] = f(args[i], e))),
algoFormat("Incompatible function/seed/element: %s/%s/%s", fullyQualifiedName!f, Args[i].stringof, E.stringof));
static if (mustInitialize) if (initialized == false)
{
import std.conv : emplaceRef;
foreach (i, f; binfuns)
emplaceRef!(Args[i])(args[i], e);
initialized = true;
continue;
}
foreach (i, f; binfuns)
args[i] = f(args[i], e);
}
static if (mustInitialize) if (!initialized) throw new Exception("Cannot reduce an empty iterable w/o an explicit seed value.");
static if (Args.length == 1)
return args[0];
else
return tuple(args);
}
}
//Helper for Reduce
private template ReduceSeedType(E)
{
static template ReduceSeedType(alias fun)
{
import std.algorithm.internal : algoFormat;
E e = E.init;
static alias ReduceSeedType = Unqual!(typeof(fun(e, e)));
//Check the Seed type is useable.
ReduceSeedType s = ReduceSeedType.init;
static assert(is(typeof({ReduceSeedType s = e;})) && is(typeof(s = fun(s, e))),
algoFormat("Unable to deduce an acceptable seed type for %s with element type %s.", fullyQualifiedName!fun, E.stringof));
}
}
/**
Many aggregate range operations turn out to be solved with $(D reduce)
quickly and easily. The example below illustrates $(D reduce)'s
remarkable power and flexibility.
*/
@safe unittest
{
import std.algorithm.comparison : max, min;
import std.math : approxEqual;
import std.range;
int[] arr = [ 1, 2, 3, 4, 5 ];
// Sum all elements
auto sum = reduce!((a,b) => a + b)(0, arr);
assert(sum == 15);
// Sum again, using a string predicate with "a" and "b"
sum = reduce!"a + b"(0, arr);
assert(sum == 15);
// Compute the maximum of all elements
auto largest = reduce!(max)(arr);
assert(largest == 5);
// Max again, but with Uniform Function Call Syntax (UFCS)
largest = arr.reduce!(max);
assert(largest == 5);
// Compute the number of odd elements
auto odds = reduce!((a,b) => a + (b & 1))(0, arr);
assert(odds == 3);
// Compute the sum of squares
auto ssquares = reduce!((a,b) => a + b * b)(0, arr);
assert(ssquares == 55);
// Chain multiple ranges into seed
int[] a = [ 3, 4 ];
int[] b = [ 100 ];
auto r = reduce!("a + b")(chain(a, b));
assert(r == 107);
// Mixing convertible types is fair game, too
double[] c = [ 2.5, 3.0 ];
auto r1 = reduce!("a + b")(chain(a, b, c));
assert(approxEqual(r1, 112.5));
// To minimize nesting of parentheses, Uniform Function Call Syntax can be used
auto r2 = chain(a, b, c).reduce!("a + b");
assert(approxEqual(r2, 112.5));
}
/**
Sometimes it is very useful to compute multiple aggregates in one pass.
One advantage is that the computation is faster because the looping overhead
is shared. That's why $(D reduce) accepts multiple functions.
If two or more functions are passed, $(D reduce) returns a
$(XREF typecons, Tuple) object with one member per passed-in function.
The number of seeds must be correspondingly increased.
*/
@safe unittest
{
import std.algorithm.comparison : max, min;
import std.math : approxEqual, sqrt;
import std.typecons : tuple, Tuple;
double[] a = [ 3.0, 4, 7, 11, 3, 2, 5 ];
// Compute minimum and maximum in one pass
auto r = reduce!(min, max)(a);
// The type of r is Tuple!(int, int)
assert(approxEqual(r[0], 2)); // minimum
assert(approxEqual(r[1], 11)); // maximum
// Compute sum and sum of squares in one pass
r = reduce!("a + b", "a + b * b")(tuple(0.0, 0.0), a);
assert(approxEqual(r[0], 35)); // sum
assert(approxEqual(r[1], 233)); // sum of squares
// Compute average and standard deviation from the above
auto avg = r[0] / a.length;
auto stdev = sqrt(r[1] / a.length - avg * avg);
}
unittest
{
import std.algorithm.comparison : max, min;
import std.exception : assertThrown;
import std.range;
import std.typecons : tuple, Tuple;
double[] a = [ 3, 4 ];
auto r = reduce!("a + b")(0.0, a);
assert(r == 7);
r = reduce!("a + b")(a);
assert(r == 7);
r = reduce!(min)(a);
assert(r == 3);
double[] b = [ 100 ];
auto r1 = reduce!("a + b")(chain(a, b));
assert(r1 == 107);
// two funs
auto r2 = reduce!("a + b", "a - b")(tuple(0.0, 0.0), a);
assert(r2[0] == 7 && r2[1] == -7);
auto r3 = reduce!("a + b", "a - b")(a);
assert(r3[0] == 7 && r3[1] == -1);
a = [ 1, 2, 3, 4, 5 ];
// Stringize with commas
string rep = reduce!("a ~ `, ` ~ to!(string)(b)")("", a);
assert(rep[2 .. $] == "1, 2, 3, 4, 5", "["~rep[2 .. $]~"]");
// Test the opApply case.
static struct OpApply
{
bool actEmpty;
int opApply(int delegate(ref int) dg)
{
int res;
if (actEmpty) return res;
foreach (i; 0..100)
{
res = dg(i);
if (res) break;
}
return res;
}
}
OpApply oa;
auto hundredSum = reduce!"a + b"(iota(100));
assert(reduce!"a + b"(5, oa) == hundredSum + 5);
assert(reduce!"a + b"(oa) == hundredSum);
assert(reduce!("a + b", max)(oa) == tuple(hundredSum, 99));
assert(reduce!("a + b", max)(tuple(5, 0), oa) == tuple(hundredSum + 5, 99));
// Test for throwing on empty range plus no seed.
assertThrown(reduce!"a + b"([1, 2][0..0]));
oa.actEmpty = true;
assertThrown(reduce!"a + b"(oa));
}
@safe unittest
{
debug(std_algorithm) scope(success)
writeln("unittest @", __FILE__, ":", __LINE__, " done.");
const float a = 0.0;
const float[] b = [ 1.2, 3, 3.3 ];
float[] c = [ 1.2, 3, 3.3 ];
auto r = reduce!"a + b"(a, b);
r = reduce!"a + b"(a, c);
}
@safe unittest
{
// Issue #10408 - Two-function reduce of a const array.
import std.algorithm.comparison : max, min;
import std.typecons : tuple, Tuple;
const numbers = [10, 30, 20];
immutable m = reduce!(min)(numbers);
assert(m == 10);
immutable minmax = reduce!(min, max)(numbers);
assert(minmax == tuple(10, 30));
}
@safe unittest
{
//10709
import std.typecons : tuple, Tuple;
enum foo = "a + 0.5 * b";
auto r = [0, 1, 2, 3];
auto r1 = reduce!foo(r);
auto r2 = reduce!(foo, foo)(r);
assert(r1 == 3);
assert(r2 == tuple(3, 3));
}
unittest
{
int i = 0;
static struct OpApply
{
int opApply(int delegate(ref int) dg)
{
int[] a = [1, 2, 3];
int res = 0;
foreach (ref e; a)
{
res = dg(e);
if (res) break;
}
return res;
}
}
//test CTFE and functions with context
int fun(int a, int b){return a + b + 1;}
auto foo()
{
import std.algorithm.comparison : max;
import std.typecons : tuple, Tuple;
auto a = reduce!(fun)([1, 2, 3]);
auto b = reduce!(fun, fun)([1, 2, 3]);
auto c = reduce!(fun)(0, [1, 2, 3]);
auto d = reduce!(fun, fun)(tuple(0, 0), [1, 2, 3]);
auto e = reduce!(fun)(0, OpApply());
auto f = reduce!(fun, fun)(tuple(0, 0), OpApply());
return max(a, b.expand, c, d.expand);
}
auto a = foo();
enum b = foo();
}
@safe unittest
{
import std.algorithm.comparison : max, min;
import std.typecons : tuple, Tuple;
//http://forum.dlang.org/thread/oghtttkopzjshsuflelk@forum.dlang.org
//Seed is tuple of const.
static auto minmaxElement(alias F = min, alias G = max, R)(in R range)
@safe pure nothrow if (isInputRange!R)
{
return reduce!(F, G)(tuple(ElementType!R.max,
ElementType!R.min), range);
}
assert(minmaxElement([1, 2, 3])== tuple(1, 3));
}
@safe unittest //12569
{
import std.algorithm.comparison : max, min;
import std.typecons: tuple;
dchar c = 'a';
reduce!(min, max)(tuple(c, c), "hello"); // OK
static assert(!is(typeof(reduce!(min, max)(tuple(c), "hello"))));
static assert(!is(typeof(reduce!(min, max)(tuple(c, c, c), "hello"))));
//"Seed dchar should be a Tuple"
static assert(!is(typeof(reduce!(min, max)(c, "hello"))));
//"Seed (dchar) does not have the correct amount of fields (should be 2)"
static assert(!is(typeof(reduce!(min, max)(tuple(c), "hello"))));
//"Seed (dchar, dchar, dchar) does not have the correct amount of fields (should be 2)"
static assert(!is(typeof(reduce!(min, max)(tuple(c, c, c), "hello"))));
//"Incompatable function/seed/element: all(alias pred = "a")/int/dchar"
static assert(!is(typeof(reduce!all(1, "hello"))));
static assert(!is(typeof(reduce!(all, all)(tuple(1, 1), "hello"))));
}
@safe unittest //13304
{
int[] data;
static assert(is(typeof(reduce!((a, b)=>a+b)(data))));
}
// splitter
/**
Lazily splits a range using an element as a separator. This can be used with
any narrow string type or sliceable range type, but is most popular with string
types.
Two adjacent separators are considered to surround an empty element in
the split range. Use $(D filter!(a => !a.empty)) on the result to compress
empty elements.
If the empty range is given, the result is a range with one empty
element. If a range with one separator is given, the result is a range
with two empty elements.
If splitting a string on whitespace and token compression is desired,
consider using $(D splitter) without specifying a separator (see fourth overload
below).
Params:
pred = The predicate for comparing each element with the separator,
defaulting to $(D "a == b").
r = The $(XREF2 range, isInputRange, input range) to be split. Must support
slicing and $(D .length).
s = The element to be treated as the separator between range segments to be
split.
Constraints:
The predicate $(D pred) needs to accept an element of $(D r) and the
separator $(D s).
Returns:
An input range of the subranges of elements between separators. If $(D r)
is a forward range or bidirectional range, the returned range will be
likewise.
See_Also:
$(XREF regex, _splitter) for a version that splits using a regular
expression defined separator.
*/
auto splitter(alias pred = "a == b", Range, Separator)(Range r, Separator s)
if (is(typeof(binaryFun!pred(r.front, s)) : bool)
&& ((hasSlicing!Range && hasLength!Range) || isNarrowString!Range))
{
import std.algorithm.searching : find;
import std.conv : unsigned;
static struct Result
{
private:
Range _input;
Separator _separator;
// Do we need hasLength!Range? popFront uses _input.length...
alias IndexType = typeof(unsigned(_input.length));
enum IndexType _unComputed = IndexType.max - 1, _atEnd = IndexType.max;
IndexType _frontLength = _unComputed;
IndexType _backLength = _unComputed;
static if (isNarrowString!Range)
{
size_t _separatorLength;
}
else
{
enum _separatorLength = 1;
}
static if (isBidirectionalRange!Range)
{
static IndexType lastIndexOf(Range haystack, Separator needle)
{
import std.range : retro;
auto r = haystack.retro().find!pred(needle);
return r.retro().length - 1;
}
}
public:
this(Range input, Separator separator)
{
_input = input;
_separator = separator;
static if (isNarrowString!Range)
{
import std.utf : codeLength;
_separatorLength = codeLength!(ElementEncodingType!Range)(separator);
}
if (_input.empty)
_frontLength = _atEnd;
}
static if (isInfinite!Range)
{
enum bool empty = false;
}
else
{
@property bool empty()
{
return _frontLength == _atEnd;
}
}
@property Range front()
{
assert(!empty);
if (_frontLength == _unComputed)
{
auto r = _input.find!pred(_separator);
_frontLength = _input.length - r.length;
}
return _input[0 .. _frontLength];
}
void popFront()
{
assert(!empty);
if (_frontLength == _unComputed)
{
front;
}
assert(_frontLength <= _input.length);
if (_frontLength == _input.length)
{
// no more input and need to fetch => done
_frontLength = _atEnd;
// Probably don't need this, but just for consistency:
_backLength = _atEnd;
}
else
{
_input = _input[_frontLength + _separatorLength .. _input.length];
_frontLength = _unComputed;
}
}
static if (isForwardRange!Range)
{
@property typeof(this) save()
{
auto ret = this;
ret._input = _input.save;
return ret;
}
}
static if (isBidirectionalRange!Range)
{
@property Range back()
{
assert(!empty);
if (_backLength == _unComputed)
{
immutable lastIndex = lastIndexOf(_input, _separator);
if (lastIndex == -1)
{
_backLength = _input.length;
}
else
{
_backLength = _input.length - lastIndex - 1;
}
}
return _input[_input.length - _backLength .. _input.length];
}
void popBack()
{
assert(!empty);
if (_backLength == _unComputed)
{
// evaluate back to make sure it's computed
back;
}
assert(_backLength <= _input.length);
if (_backLength == _input.length)
{
// no more input and need to fetch => done
_frontLength = _atEnd;
_backLength = _atEnd;
}
else
{
_input = _input[0 .. _input.length - _backLength - _separatorLength];
_backLength = _unComputed;
}
}
}
}
return Result(r, s);
}
///
@safe unittest
{
import std.algorithm.comparison : equal;
assert(equal(splitter("hello world", ' '), [ "hello", "", "world" ]));
int[] a = [ 1, 2, 0, 0, 3, 0, 4, 5, 0 ];
int[][] w = [ [1, 2], [], [3], [4, 5], [] ];
assert(equal(splitter(a, 0), w));
a = [ 0 ];
assert(equal(splitter(a, 0), [ (int[]).init, (int[]).init ]));
a = [ 0, 1 ];
assert(equal(splitter(a, 0), [ [], [1] ]));
w = [ [0], [1], [2] ];
assert(equal(splitter!"a.front == b"(w, 1), [ [[0]], [[2]] ]));
}
@safe unittest
{
import std.internal.test.dummyrange;
import std.algorithm;
import std.array : array;
import std.range : retro;
debug(std_algorithm) scope(success)
writeln("unittest @", __FILE__, ":", __LINE__, " done.");
assert(equal(splitter("hello world", ' '), [ "hello", "", "world" ]));
assert(equal(splitter("žlutoučkýřkůň", 'ř'), [ "žlutoučký", "kůň" ]));
int[] a = [ 1, 2, 0, 0, 3, 0, 4, 5, 0 ];
int[][] w = [ [1, 2], [], [3], [4, 5], [] ];
static assert(isForwardRange!(typeof(splitter(a, 0))));
// foreach (x; splitter(a, 0)) {
// writeln("[", x, "]");
// }
assert(equal(splitter(a, 0), w));
a = null;
assert(equal(splitter(a, 0), (int[][]).init));
a = [ 0 ];
assert(equal(splitter(a, 0), [ (int[]).init, (int[]).init ][]));
a = [ 0, 1 ];
assert(equal(splitter(a, 0), [ [], [1] ][]));
// Thoroughly exercise the bidirectional stuff.
auto str = "abc abcd abcde ab abcdefg abcdefghij ab ac ar an at ada";
assert(equal(
retro(splitter(str, 'a')),
retro(array(splitter(str, 'a')))
));
// Test interleaving front and back.
auto split = splitter(str, 'a');
assert(split.front == "");
assert(split.back == "");
split.popBack();
assert(split.back == "d");
split.popFront();
assert(split.front == "bc ");
assert(split.back == "d");
split.popFront();
split.popBack();
assert(split.back == "t ");
split.popBack();
split.popBack();
split.popFront();
split.popFront();
assert(split.front == "b ");
assert(split.back == "r ");
foreach (DummyType; AllDummyRanges) { // Bug 4408
static if (isRandomAccessRange!DummyType) {
static assert(isBidirectionalRange!DummyType);
DummyType d;
auto s = splitter(d, 5);
assert(equal(s.front, [1,2,3,4]));
assert(equal(s.back, [6,7,8,9,10]));
auto s2 = splitter(d, [4, 5]);
assert(equal(s2.front, [1,2,3]));
}
}
}
@safe unittest
{
import std.algorithm;
import std.range;
auto L = retro(iota(1L, 10L));
auto s = splitter(L, 5L);
assert(equal(s.front, [9L, 8L, 7L, 6L]));
s.popFront();
assert(equal(s.front, [4L, 3L, 2L, 1L]));
s.popFront();
assert(s.empty);
}
/**
Similar to the previous overload of $(D splitter), except this one uses another
range as a separator. This can be used with any narrow string type or sliceable
range type, but is most popular with string types.
Two adjacent separators are considered to surround an empty element in
the split range. Use $(D filter!(a => !a.empty)) on the result to compress
empty elements.
Params:
pred = The predicate for comparing each element with the separator,
defaulting to $(D "a == b").
r = The $(XREF2 range, isInputRange, input range) to be split.
s = The $(XREF2 range, isForwardRange, forward range) to be treated as the
separator between segments of $(D r) to be split.
Constraints:
The predicate $(D pred) needs to accept an element of $(D r) and an
element of $(D s).
Returns:
An input range of the subranges of elements between separators. If $(D r)
is a forward range or bidirectional range, the returned range will be
likewise.
See_Also: $(XREF regex, _splitter) for a version that splits using a regular
expression defined separator.
*/
auto splitter(alias pred = "a == b", Range, Separator)(Range r, Separator s)
if (is(typeof(binaryFun!pred(r.front, s.front)) : bool)
&& (hasSlicing!Range || isNarrowString!Range)
&& isForwardRange!Separator
&& (hasLength!Separator || isNarrowString!Separator))
{
import std.algorithm.searching : find;
import std.conv : unsigned;
static struct Result
{
private:
Range _input;
Separator _separator;
alias RIndexType = typeof(unsigned(_input.length));
// _frontLength == size_t.max means empty
RIndexType _frontLength = RIndexType.max;
static if (isBidirectionalRange!Range)
RIndexType _backLength = RIndexType.max;
@property auto separatorLength() { return _separator.length; }
void ensureFrontLength()
{
if (_frontLength != _frontLength.max) return;
assert(!_input.empty);
// compute front length
_frontLength = (_separator.empty) ? 1 :
_input.length - find!pred(_input, _separator).length;
static if (isBidirectionalRange!Range)
if (_frontLength == _input.length) _backLength = _frontLength;
}
void ensureBackLength()
{
static if (isBidirectionalRange!Range)
if (_backLength != _backLength.max) return;
assert(!_input.empty);
// compute back length
static if (isBidirectionalRange!Range && isBidirectionalRange!Separator)
{
import std.range : retro;
_backLength = _input.length -
find!pred(retro(_input), retro(_separator)).source.length;
}
}
public:
this(Range input, Separator separator)
{
_input = input;
_separator = separator;
}
@property Range front()
{
assert(!empty);
ensureFrontLength();
return _input[0 .. _frontLength];
}
static if (isInfinite!Range)
{
enum bool empty = false; // Propagate infiniteness
}
else
{
@property bool empty()
{
return _frontLength == RIndexType.max && _input.empty;
}
}
void popFront()
{
assert(!empty);
ensureFrontLength();
if (_frontLength == _input.length)
{
// done, there's no separator in sight
_input = _input[_frontLength .. _frontLength];
_frontLength = _frontLength.max;
static if (isBidirectionalRange!Range)
_backLength = _backLength.max;
return;
}
if (_frontLength + separatorLength == _input.length)
{
// Special case: popping the first-to-last item; there is
// an empty item right after this.
_input = _input[_input.length .. _input.length];
_frontLength = 0;
static if (isBidirectionalRange!Range)
_backLength = 0;
return;
}
// Normal case, pop one item and the separator, get ready for
// reading the next item
_input = _input[_frontLength + separatorLength .. _input.length];
// mark _frontLength as uninitialized
_frontLength = _frontLength.max;
}
static if (isForwardRange!Range)
{
@property typeof(this) save()
{
auto ret = this;
ret._input = _input.save;
return ret;
}
}
// Bidirectional functionality as suggested by Brad Roberts.
static if (isBidirectionalRange!Range && isBidirectionalRange!Separator)
{
//Deprecated. It will be removed in December 2015
deprecated("splitter!(Range, Range) cannot be iterated backwards (due to separator overlap).")
@property Range back()
{
ensureBackLength();
return _input[_input.length - _backLength .. _input.length];
}
//Deprecated. It will be removed in December 2015
deprecated("splitter!(Range, Range) cannot be iterated backwards (due to separator overlap).")
void popBack()
{
ensureBackLength();
if (_backLength == _input.length)
{
// done
_input = _input[0 .. 0];
_frontLength = _frontLength.max;
_backLength = _backLength.max;
return;
}
if (_backLength + separatorLength == _input.length)
{
// Special case: popping the first-to-first item; there is
// an empty item right before this. Leave the separator in.
_input = _input[0 .. 0];
_frontLength = 0;
_backLength = 0;
return;
}
// Normal case
_input = _input[0 .. _input.length - _backLength - separatorLength];
_backLength = _backLength.max;
}
}
}
return Result(r, s);
}
///
@safe unittest
{
import std.algorithm.comparison : equal;
assert(equal(splitter("hello world", " "), [ "hello", "world" ]));
int[] a = [ 1, 2, 0, 0, 3, 0, 4, 5, 0 ];
int[][] w = [ [1, 2], [3, 0, 4, 5, 0] ];
assert(equal(splitter(a, [0, 0]), w));
a = [ 0, 0 ];
assert(equal(splitter(a, [0, 0]), [ (int[]).init, (int[]).init ]));
a = [ 0, 0, 1 ];
assert(equal(splitter(a, [0, 0]), [ [], [1] ]));
}
@safe unittest
{
import std.algorithm.comparison : equal;
import std.typecons : Tuple;
alias C = Tuple!(int, "x", int, "y");
auto a = [C(1,0), C(2,0), C(3,1), C(4,0)];
assert(equal(splitter!"a.x == b"(a, [2, 3]), [ [C(1,0)], [C(4,0)] ]));
}
@safe unittest
{
import std.algorithm.comparison : equal;
import std.conv : text;
import std.array : split;
debug(std_algorithm) scope(success)
writeln("unittest @", __FILE__, ":", __LINE__, " done.");
auto s = ",abc, de, fg,hi,";
auto sp0 = splitter(s, ',');
// //foreach (e; sp0) writeln("[", e, "]");
assert(equal(sp0, ["", "abc", " de", " fg", "hi", ""][]));
auto s1 = ", abc, de, fg, hi, ";
auto sp1 = splitter(s1, ", ");
//foreach (e; sp1) writeln("[", e, "]");
assert(equal(sp1, ["", "abc", "de", " fg", "hi", ""][]));
static assert(isForwardRange!(typeof(sp1)));
int[] a = [ 1, 2, 0, 3, 0, 4, 5, 0 ];
int[][] w = [ [1, 2], [3], [4, 5], [] ];
uint i;
foreach (e; splitter(a, 0))
{
assert(i < w.length);
assert(e == w[i++]);
}
assert(i == w.length);
// // Now go back
// auto s2 = splitter(a, 0);
// foreach (e; retro(s2))
// {
// assert(i > 0);
// assert(equal(e, w[--i]), text(e));
// }
// assert(i == 0);
wstring names = ",peter,paul,jerry,";
auto words = split(names, ",");
assert(walkLength(words) == 5, text(walkLength(words)));
}
@safe unittest
{
int[][] a = [ [1], [2], [0], [3], [0], [4], [5], [0] ];
int[][][] w = [ [[1], [2]], [[3]], [[4], [5]], [] ];
uint i;
foreach (e; splitter!"a.front == 0"(a, 0))
{
assert(i < w.length);
assert(e == w[i++]);
}
assert(i == w.length);
}
@safe unittest
{
import std.algorithm.comparison : equal;
debug(std_algorithm) scope(success)
writeln("unittest @", __FILE__, ":", __LINE__, " done.");
auto s6 = ",";
auto sp6 = splitter(s6, ',');
foreach (e; sp6)
{
//writeln("{", e, "}");
}
assert(equal(sp6, ["", ""][]));
}
@safe unittest
{
import std.algorithm.comparison : equal;
// Issue 10773
auto s = splitter("abc", "");
assert(s.equal(["a", "b", "c"]));
}
@safe unittest
{
import std.algorithm.comparison : equal;
// Test by-reference separator
class RefSep {
@safe:
string _impl;
this(string s) { _impl = s; }
@property empty() { return _impl.empty; }
@property auto front() { return _impl.front; }
void popFront() { _impl = _impl[1..$]; }
@property RefSep save() { return new RefSep(_impl); }
@property auto length() { return _impl.length; }
}
auto sep = new RefSep("->");
auto data = "i->am->pointing";
auto words = splitter(data, sep);
assert(words.equal([ "i", "am", "pointing" ]));
}
/**
Similar to the previous overload of $(D splitter), except this one does not use a separator.
Instead, the predicate is an unary function on the input range's element type.
Two adjacent separators are considered to surround an empty element in
the split range. Use $(D filter!(a => !a.empty)) on the result to compress
empty elements.
Params:
isTerminator = The predicate for deciding where to split the range.
input = The $(XREF2 range, isInputRange, input range) to be split.
Constraints:
The predicate $(D isTerminator) needs to accept an element of $(D input).
Returns:
An input range of the subranges of elements between separators. If $(D input)
is a forward range or bidirectional range, the returned range will be
likewise.
See_Also: $(XREF regex, _splitter) for a version that splits using a regular
expression defined separator.
*/
auto splitter(alias isTerminator, Range)(Range input)
if (isForwardRange!Range && is(typeof(unaryFun!isTerminator(input.front))))
{
return SplitterResult!(unaryFun!isTerminator, Range)(input);
}
///
@safe unittest
{
import std.algorithm.comparison : equal;
assert(equal(splitter!"a == ' '"("hello world"), [ "hello", "", "world" ]));
int[] a = [ 1, 2, 0, 0, 3, 0, 4, 5, 0 ];
int[][] w = [ [1, 2], [], [3], [4, 5], [] ];
assert(equal(splitter!"a == 0"(a), w));
a = [ 0 ];
assert(equal(splitter!"a == 0"(a), [ (int[]).init, (int[]).init ]));
a = [ 0, 1 ];
assert(equal(splitter!"a == 0"(a), [ [], [1] ]));
w = [ [0], [1], [2] ];
assert(equal(splitter!"a.front == 1"(w), [ [[0]], [[2]] ]));
}
private struct SplitterResult(alias isTerminator, Range)
{
import std.algorithm.searching : find;
enum fullSlicing = (hasLength!Range && hasSlicing!Range) || isSomeString!Range;
private Range _input;
private size_t _end = 0;
static if(!fullSlicing)
private Range _next;
private void findTerminator()
{
static if (fullSlicing)
{
auto r = find!isTerminator(_input.save);
_end = _input.length - r.length;
}
else
for ( _end = 0; !_next.empty ; _next.popFront)
{
if (isTerminator(_next.front))
break;
++_end;
}
}
this(Range input)
{
_input = input;
static if(!fullSlicing)
_next = _input.save;
if (!_input.empty)
findTerminator();
else
_end = size_t.max;
}
static if (isInfinite!Range)
{
enum bool empty = false; // Propagate infiniteness.
}
else
{
@property bool empty()
{
return _end == size_t.max;
}
}
@property auto front()
{
version(assert)
{
import core.exception : RangeError;
if (empty)
throw new RangeError();
}
static if (fullSlicing)
return _input[0 .. _end];
else
{
import std.range : takeExactly;
return _input.takeExactly(_end);
}
}
void popFront()
{
version(assert)
{
import core.exception : RangeError;
if (empty)
throw new RangeError();
}
static if (fullSlicing)
{
_input = _input[_end .. _input.length];
if (_input.empty)
{
_end = size_t.max;
return;
}
_input.popFront();
}
else
{
if (_next.empty)
{
_input = _next;
_end = size_t.max;
return;
}
_next.popFront();
_input = _next.save;
}
findTerminator();
}
@property typeof(this) save()
{
auto ret = this;
ret._input = _input.save;
static if (!fullSlicing)
ret._next = _next.save;
return ret;
}
}
@safe unittest
{
import std.algorithm.comparison : equal;
import std.range : iota;
auto L = iota(1L, 10L);
auto s = splitter(L, [5L, 6L]);
assert(equal(s.front, [1L, 2L, 3L, 4L]));
s.popFront();
assert(equal(s.front, [7L, 8L, 9L]));
s.popFront();
assert(s.empty);
}
@safe unittest
{
import std.algorithm.internal : algoFormat;
import std.algorithm.comparison : equal;
import std.internal.test.dummyrange;
debug(std_algorithm) scope(success)
writeln("unittest @", __FILE__, ":", __LINE__, " done.");
void compare(string sentence, string[] witness)
{
auto r = splitter!"a == ' '"(sentence);
assert(equal(r.save, witness), algoFormat("got: %(%s, %) expected: %(%s, %)", r, witness));
}
compare(" Mary has a little lamb. ",
["", "Mary", "", "has", "a", "little", "lamb.", "", "", ""]);
compare("Mary has a little lamb. ",
["Mary", "", "has", "a", "little", "lamb.", "", "", ""]);
compare("Mary has a little lamb.",
["Mary", "", "has", "a", "little", "lamb."]);
compare("", (string[]).init);
compare(" ", ["", ""]);
static assert(isForwardRange!(typeof(splitter!"a == ' '"("ABC"))));
foreach (DummyType; AllDummyRanges)
{
static if (isRandomAccessRange!DummyType)
{
auto rangeSplit = splitter!"a == 5"(DummyType.init);
assert(equal(rangeSplit.front, [1,2,3,4]));
rangeSplit.popFront();
assert(equal(rangeSplit.front, [6,7,8,9,10]));
}
}
}
@safe unittest
{
import std.algorithm.internal : algoFormat;
import std.algorithm.comparison : equal;
import std.range;
struct Entry
{
int low;
int high;
int[][] result;
}
Entry[] entries = [
Entry(0, 0, []),
Entry(0, 1, [[0]]),
Entry(1, 2, [[], []]),
Entry(2, 7, [[2], [4], [6]]),
Entry(1, 8, [[], [2], [4], [6], []]),
];
foreach ( entry ; entries )
{
auto a = iota(entry.low, entry.high).filter!"true"();
auto b = splitter!"a%2"(a);
assert(equal!equal(b.save, entry.result), algoFormat("got: %(%s, %) expected: %(%s, %)", b, entry.result));
}
}
@safe unittest
{
import std.algorithm.comparison : equal;
import std.uni : isWhite;
//@@@6791@@@
assert(equal(splitter("là dove terminava quella valle"), ["là", "dove", "terminava", "quella", "valle"]));
assert(equal(splitter!(std.uni.isWhite)("là dove terminava quella valle"), ["là", "dove", "terminava", "quella", "valle"]));
assert(equal(splitter!"a=='本'"("日本語"), ["日", "語"]));
}
/++
Lazily splits the string $(D s) into words, using whitespace as the delimiter.
This function is string specific and, contrary to
$(D splitter!(std.uni.isWhite)), runs of whitespace will be merged together
(no empty tokens will be produced).
Params:
s = The string to be split.
Returns:
An $(XREF2 range, isInputRange, input range) of slices of the original
string split by whitespace.
+/
auto splitter(C)(C[] s)
if (isSomeChar!C)
{
import std.algorithm.searching : find;
static struct Result
{
private:
import core.exception;
C[] _s;
size_t _frontLength;
void getFirst() pure @safe
{
import std.uni : isWhite;
auto r = find!(isWhite)(_s);
_frontLength = _s.length - r.length;
}
public:
this(C[] s) pure @safe
{
import std.string : strip;
_s = s.strip();
getFirst();
}
@property C[] front() pure @safe
{
version(assert) if (empty) throw new RangeError();
return _s[0 .. _frontLength];
}
void popFront() pure @safe
{
import std.string : stripLeft;
version(assert) if (empty) throw new RangeError();
_s = _s[_frontLength .. $].stripLeft();
getFirst();
}
@property bool empty() const @safe pure nothrow
{
return _s.empty;
}
@property inout(Result) save() inout @safe pure nothrow
{
return this;
}
}
return Result(s);
}
///
@safe pure unittest
{
import std.algorithm.comparison : equal;
auto a = " a bcd ef gh ";
assert(equal(splitter(a), ["a", "bcd", "ef", "gh"][]));
}
@safe pure unittest
{
import std.algorithm.comparison : equal;
import std.typetuple : TypeTuple;
foreach(S; TypeTuple!(string, wstring, dstring))
{
import std.conv : to;
S a = " a bcd ef gh ";
assert(equal(splitter(a), [to!S("a"), to!S("bcd"), to!S("ef"), to!S("gh")]));
a = "";
assert(splitter(a).empty);
}
immutable string s = " a bcd ef gh ";
assert(equal(splitter(s), ["a", "bcd", "ef", "gh"][]));
}
@safe unittest
{
import std.conv : to;
import std.string : strip;
// TDPL example, page 8
uint[string] dictionary;
char[][3] lines;
lines[0] = "line one".dup;
lines[1] = "line \ttwo".dup;
lines[2] = "yah last line\ryah".dup;
foreach (line; lines) {
foreach (word; splitter(strip(line))) {
if (word in dictionary) continue; // Nothing to do
auto newID = dictionary.length;
dictionary[to!string(word)] = cast(uint)newID;
}
}
assert(dictionary.length == 5);
assert(dictionary["line"]== 0);
assert(dictionary["one"]== 1);
assert(dictionary["two"]== 2);
assert(dictionary["yah"]== 3);
assert(dictionary["last"]== 4);
}
@safe unittest
{
import std.algorithm.internal : algoFormat;
import std.algorithm.comparison : equal;
import std.conv : text;
import std.array : split;
// Check consistency:
// All flavors of split should produce the same results
foreach (input; [(int[]).init,
[0],
[0, 1, 0],
[1, 1, 0, 0, 1, 1],
])
{
foreach (s; [0, 1])
{
auto result = split(input, s);
assert(equal(result, split(input, [s])), algoFormat(`"[%(%s,%)]"`, split(input, [s])));
//assert(equal(result, split(input, [s].filter!"true"()))); //Not yet implemented
assert(equal(result, split!((a) => a == s)(input)), text(split!((a) => a == s)(input)));
//assert(equal!equal(result, split(input.filter!"true"(), s))); //Not yet implemented
//assert(equal!equal(result, split(input.filter!"true"(), [s]))); //Not yet implemented
//assert(equal!equal(result, split(input.filter!"true"(), [s].filter!"true"()))); //Not yet implemented
assert(equal!equal(result, split!((a) => a == s)(input.filter!"true"())));
assert(equal(result, splitter(input, s)));
assert(equal(result, splitter(input, [s])));
//assert(equal(result, splitter(input, [s].filter!"true"()))); //Not yet implemented
assert(equal(result, splitter!((a) => a == s)(input)));
//assert(equal!equal(result, splitter(input.filter!"true"(), s))); //Not yet implemented
//assert(equal!equal(result, splitter(input.filter!"true"(), [s]))); //Not yet implemented
//assert(equal!equal(result, splitter(input.filter!"true"(), [s].filter!"true"()))); //Not yet implemented
assert(equal!equal(result, splitter!((a) => a == s)(input.filter!"true"())));
}
}
foreach (input; [string.init,
" ",
" hello ",
"hello hello",
" hello what heck this ? "
])
{
foreach (s; [' ', 'h'])
{
auto result = split(input, s);
assert(equal(result, split(input, [s])));
//assert(equal(result, split(input, [s].filter!"true"()))); //Not yet implemented
assert(equal(result, split!((a) => a == s)(input)));
//assert(equal!equal(result, split(input.filter!"true"(), s))); //Not yet implemented
//assert(equal!equal(result, split(input.filter!"true"(), [s]))); //Not yet implemented
//assert(equal!equal(result, split(input.filter!"true"(), [s].filter!"true"()))); //Not yet implemented
assert(equal!equal(result, split!((a) => a == s)(input.filter!"true"())));
assert(equal(result, splitter(input, s)));
assert(equal(result, splitter(input, [s])));
//assert(equal(result, splitter(input, [s].filter!"true"()))); //Not yet implemented
assert(equal(result, splitter!((a) => a == s)(input)));
//assert(equal!equal(result, splitter(input.filter!"true"(), s))); //Not yet implemented
//assert(equal!equal(result, splitter(input.filter!"true"(), [s]))); //Not yet implemented
//assert(equal!equal(result, splitter(input.filter!"true"(), [s].filter!"true"()))); //Not yet implemented
assert(equal!equal(result, splitter!((a) => a == s)(input.filter!"true"())));
}
}
}
// sum
/**
Sums elements of $(D r), which must be a finite $(XREF2 range, isInputRange, input range). Although
conceptually $(D sum(r)) is equivalent to $(LREF reduce)!((a, b) => a +
b)(0, r), $(D sum) uses specialized algorithms to maximize accuracy,
as follows.
$(UL
$(LI If $(D $(XREF range, ElementType)!R) is a floating-point type and $(D R) is a
$(XREF2 range, isRandomAccessRange, random-access range) with length and slicing, then $(D sum) uses the
$(WEB en.wikipedia.org/wiki/Pairwise_summation, pairwise summation)
algorithm.)
$(LI If $(D ElementType!R) is a floating-point type and $(D R) is a
finite input range (but not a random-access range with slicing), then
$(D sum) uses the $(WEB en.wikipedia.org/wiki/Kahan_summation,
Kahan summation) algorithm.)
$(LI In all other cases, a simple element by element addition is done.)
)
For floating point inputs, calculations are made in $(LINK2 ../type.html, $(D real))
precision for $(D real) inputs and in $(D double) precision otherwise
(Note this is a special case that deviates from $(D reduce)'s behavior,
which would have kept $(D float) precision for a $(D float) range).
For all other types, the calculations are done in the same type obtained
from from adding two elements of the range, which may be a different
type from the elements themselves (for example, in case of $(LINK2 ../type.html#integer-promotions, integral promotion)).
A seed may be passed to $(D sum). Not only will this seed be used as an initial
value, but its type will override all the above, and determine the algorithm
and precision used for sumation.
Note that these specialized summing algorithms execute more primitive operations
than vanilla summation. Therefore, if in certain cases maximum speed is required
at expense of precision, one can use $(D reduce!((a, b) => a + b)(0, r)), which
is not specialized for summation.
Returns:
The sum of all the elements in the range r.
*/
auto sum(R)(R r)
if (isInputRange!R && !isInfinite!R && is(typeof(r.front + r.front)))
{
alias E = Unqual!(ElementType!R);
static if (isFloatingPoint!E)
alias Seed = typeof(E.init + 0.0); //biggest of double/real
else
alias Seed = typeof(r.front + r.front);
return sum(r, Unqual!Seed(0));
}
/// ditto
auto sum(R, E)(R r, E seed)
if (isInputRange!R && !isInfinite!R && is(typeof(seed = seed + r.front)))
{
static if (isFloatingPoint!E)
{
static if (hasLength!R && hasSlicing!R)
return seed + sumPairwise!E(r);
else
return sumKahan!E(seed, r);
}
else
{
return reduce!"a + b"(seed, r);
}
}
// Pairwise summation http://en.wikipedia.org/wiki/Pairwise_summation
private auto sumPairwise(Result, R)(R r)
{
static assert (isFloatingPoint!Result);
switch (r.length)
{
case 0: return cast(Result) 0;
case 1: return cast(Result) r.front;
case 2: return cast(Result) r[0] + cast(Result) r[1];
default: return sumPairwise!Result(r[0 .. $ / 2]) + sumPairwise!Result(r[$ / 2 .. $]);
}
}
// Kahan algo http://en.wikipedia.org/wiki/Kahan_summation_algorithm
private auto sumKahan(Result, R)(Result result, R r)
{
static assert (isFloatingPoint!Result && isMutable!Result);
Result c = 0;
for (; !r.empty; r.popFront())
{
auto y = r.front - c;
auto t = result + y;
c = (t - result) - y;
result = t;
}
return result;
}
/// Ditto
@safe pure nothrow unittest
{
import std.range;
//simple integral sumation
assert(sum([ 1, 2, 3, 4]) == 10);
//with integral promotion
assert(sum([false, true, true, false, true]) == 3);
assert(sum(ubyte.max.repeat(100)) == 25500);
//The result may overflow
assert(uint.max.repeat(3).sum() == 4294967293U );
//But a seed can be used to change the sumation primitive
assert(uint.max.repeat(3).sum(ulong.init) == 12884901885UL);
//Floating point sumation
assert(sum([1.0, 2.0, 3.0, 4.0]) == 10);
//Floating point operations have double precision minimum
static assert(is(typeof(sum([1F, 2F, 3F, 4F])) == double));
assert(sum([1F, 2, 3, 4]) == 10);
//Force pair-wise floating point sumation on large integers
import std.math : approxEqual;
assert(iota(ulong.max / 2, ulong.max / 2 + 4096).sum(0.0)
.approxEqual((ulong.max / 2) * 4096.0 + 4096^^2 / 2));
}
@safe pure nothrow unittest
{
static assert(is(typeof(sum([cast( byte)1])) == int));
static assert(is(typeof(sum([cast(ubyte)1])) == int));
static assert(is(typeof(sum([ 1, 2, 3, 4])) == int));
static assert(is(typeof(sum([ 1U, 2U, 3U, 4U])) == uint));
static assert(is(typeof(sum([ 1L, 2L, 3L, 4L])) == long));
static assert(is(typeof(sum([1UL, 2UL, 3UL, 4UL])) == ulong));
int[] empty;
assert(sum(empty) == 0);
assert(sum([42]) == 42);
assert(sum([42, 43]) == 42 + 43);
assert(sum([42, 43, 44]) == 42 + 43 + 44);
assert(sum([42, 43, 44, 45]) == 42 + 43 + 44 + 45);
}
@safe pure nothrow unittest
{
static assert(is(typeof(sum([1.0, 2.0, 3.0, 4.0])) == double));
static assert(is(typeof(sum([ 1F, 2F, 3F, 4F])) == double));
const(float[]) a = [1F, 2F, 3F, 4F];
static assert(is(typeof(sum(a)) == double));
const(float)[] b = [1F, 2F, 3F, 4F];
static assert(is(typeof(sum(a)) == double));
double[] empty;
assert(sum(empty) == 0);
assert(sum([42.]) == 42);
assert(sum([42., 43.]) == 42 + 43);
assert(sum([42., 43., 44.]) == 42 + 43 + 44);
assert(sum([42., 43., 44., 45.5]) == 42 + 43 + 44 + 45.5);
}
@safe pure nothrow unittest
{
import std.container;
static assert(is(typeof(sum(SList!float()[])) == double));
static assert(is(typeof(sum(SList!double()[])) == double));
static assert(is(typeof(sum(SList!real()[])) == real));
assert(sum(SList!double()[]) == 0);
assert(sum(SList!double(1)[]) == 1);
assert(sum(SList!double(1, 2)[]) == 1 + 2);
assert(sum(SList!double(1, 2, 3)[]) == 1 + 2 + 3);
assert(sum(SList!double(1, 2, 3, 4)[]) == 10);
}
@safe pure nothrow unittest // 12434
{
immutable a = [10, 20];
auto s1 = sum(a); // Error
auto s2 = a.map!(x => x).sum; // Error
}
unittest
{
import std.bigint;
import std.range;
immutable BigInt[] a = BigInt("1_000_000_000_000_000_000").repeat(10).array();
immutable ulong[] b = (ulong.max/2).repeat(10).array();
auto sa = a.sum();
auto sb = b.sum(BigInt(0)); //reduce ulongs into bigint
assert(sa == BigInt("10_000_000_000_000_000_000"));
assert(sb == (BigInt(ulong.max/2) * 10));
}
// uniq
/**
Lazily iterates unique consecutive elements of the given range (functionality
akin to the $(WEB wikipedia.org/wiki/_Uniq, _uniq) system
utility). Equivalence of elements is assessed by using the predicate
$(D pred), by default $(D "a == b"). If the given range is
bidirectional, $(D uniq) also yields a bidirectional range.
Params:
pred = Predicate for determining equivalence between range elements.
r = An $(XREF2 range, isInputRange, input range) of elements to filter.
Returns:
An $(XREF2 range, isInputRange, input range) of consecutively unique
elements in the original range. If $(D r) is also a forward range or
bidirectional range, the returned range will be likewise.
*/
auto uniq(alias pred = "a == b", Range)(Range r)
if (isInputRange!Range && is(typeof(binaryFun!pred(r.front, r.front)) == bool))
{
return UniqResult!(binaryFun!pred, Range)(r);
}
///
@safe unittest
{
import std.algorithm.mutation : copy;
import std.algorithm.comparison : equal;
int[] arr = [ 1, 2, 2, 2, 2, 3, 4, 4, 4, 5 ];
assert(equal(uniq(arr), [ 1, 2, 3, 4, 5 ][]));
// Filter duplicates in-place using copy
arr.length -= arr.uniq().copy(arr).length;
assert(arr == [ 1, 2, 3, 4, 5 ]);
// Note that uniqueness is only determined consecutively; duplicated
// elements separated by an intervening different element will not be
// eliminated:
assert(equal(uniq([ 1, 1, 2, 1, 1, 3, 1]), [1, 2, 1, 3, 1]));
}
private struct UniqResult(alias pred, Range)
{
Range _input;
this(Range input)
{
_input = input;
}
auto opSlice()
{
return this;
}
void popFront()
{
auto last = _input.front;
do
{
_input.popFront();
}
while (!_input.empty && pred(last, _input.front));
}
@property ElementType!Range front() { return _input.front; }
static if (isBidirectionalRange!Range)
{
void popBack()
{
auto last = _input.back;
do
{
_input.popBack();
}
while (!_input.empty && pred(last, _input.back));
}
@property ElementType!Range back() { return _input.back; }
}
static if (isInfinite!Range)
{
enum bool empty = false; // Propagate infiniteness.
}
else
{
@property bool empty() { return _input.empty; }
}
static if (isForwardRange!Range) {
@property typeof(this) save() {
return typeof(this)(_input.save);
}
}
}
@safe unittest
{
import std.algorithm.comparison : equal;
import std.internal.test.dummyrange;
import std.range;
debug(std_algorithm) scope(success)
writeln("unittest @", __FILE__, ":", __LINE__, " done.");
int[] arr = [ 1, 2, 2, 2, 2, 3, 4, 4, 4, 5 ];
auto r = uniq(arr);
static assert(isForwardRange!(typeof(r)));
assert(equal(r, [ 1, 2, 3, 4, 5 ][]));
assert(equal(retro(r), retro([ 1, 2, 3, 4, 5 ][])));
foreach (DummyType; AllDummyRanges) {
DummyType d;
auto u = uniq(d);
assert(equal(u, [1,2,3,4,5,6,7,8,9,10]));
static assert(d.rt == RangeType.Input || isForwardRange!(typeof(u)));
static if (d.rt >= RangeType.Bidirectional) {
assert(equal(retro(u), [10,9,8,7,6,5,4,3,2,1]));
}
}
}
|
D
|
/******************************************************************//**
* \file src/gui/objects/liquid.d
* \brief LiquidMap is a HeightMap with liquid effect
*
* <i>Copyright (c) 2012</i> Danny Arends<br>
* Last modified Feb, 2012<br>
* First written Dec, 2011<br>
* Written in the D Programming Language (http://www.digitalmars.com/d)
**********************************************************************/
module gui.objects.liquid;
import std.stdio, std.conv, std.math, std.random;
import gl.gl_1_0, gl.gl_1_1;
import core.arrays.types;
import core.typedefs.types, core.typedefs.color;
import gui.formats.tga;
import gui.objects.surface;
class Liquid : HeightMap{
public:
this(double x, double y, double z, Texture texture){
super(x, y, z, texture);
liquid[0] = newmatrix!float(texture.width, texture.height, 0.0);
liquid[1] = newmatrix!float(texture.width, texture.height, 0.0);
dampmap = dampFromAlpha(texture);
}
this(double x, double y, double z, int sx, int sy){
super(x, y, z, sx, sy);
liquid[0] = newmatrix!float(sx, sy, 0.0);
liquid[1] = newmatrix!float(sx, sy, 0.0);
dampmap = newmatrix!bool(sx, sy, true);
}
float calcN(int x, int y, float x1, float x2, float y1, float y2 = 0.0){
if(!dampmap) return 0.0;
float n = (x1 + x2 + y1 + y2) / 2.0;
n -= liquid[f][x][y];
n = n - (n / 20.0);
return n;
}
override void update(){
int x, y;
float n;
for(x = 1; x < getMapX()-1; x++) {
for(y = 1; y < getMapY()-1; y++) {
liquid[f][x][y] = calcN(x, y,liquid[t][x-1][y],liquid[t][x+1][y],liquid[t][x][y-1],liquid[t][x][y+1]);
}
}
y = 0;
for(x = 1; x < getMapX()-1; x++) {
liquid[f][x][y] = calcN(x,y,liquid[t][x-1][y],liquid[t][x+1][y],liquid[t][x][y+1]);
}
x = 0;
for(y = 1; y < getMapY()-1; y++) {
liquid[f][x][y] = calcN(x,y,liquid[t][x+1][y],liquid[t][x][y-1],liquid[t][x][y+1]);
}
x = getMapX()-1;
for(y = 1; y < getMapY()-1; y++) {
liquid[f][x][y] = calcN(x,y,liquid[t][x-1][y],liquid[t][x][y-1],liquid[t][x][y+1]);
}
y = getMapY()-1;
for(x = 1; x < getMapX()-1; x++) {
liquid[f][x][y] = calcN(x,y,liquid[t][x-1][y],liquid[t][x+1][y],liquid[t][x][y-1]);
}
int tmp = t; t = f; f = tmp;
}
override float getHeight(int x, int y){
float sm = super.getHeight(x,y);
if(dampmap[x][y]){
return sm;
}
return sm+liquid[t][x][y];
}
override Color getColor(int x, int y){
Color c = super.getColor(x,y);
if(dampmap[x][y]) return c;
c.updateColor(2,liquid[t][x][y]+0.6);
return c;
}
void effect(int x, int y, float effect = 10){
if(x > 0 && x < getMapX()){
if(y > 0 && y < getMapY()){
liquid[f][x][y] -= effect;
}
}
}
int t = 0;
int f = 1;
float[][] liquid[3];
bool[][] dampmap;
}
|
D
|
/* _______ __ __ __ ______ __ __ _______ __ __
* / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___ /\ / |\/ /\
* / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / /
* / / /__ / / // / // / // / / / ___ / // ___ / // /| ' / /
* / /_// /\ / /_// / // / // /_/_ / / // / // /\_/ / // / | / /
* /______/ //______/ //_/ //_____/\ /_/ //_/ //_/ //_/ //_/ /|_/ /
* \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/
*
* Copyright (c) 2004 - 2008 Olof Naess�n and Per Larsson
*
*
* Per Larsson a.k.a finalman
* Olof Naess�n a.k.a jansem/yakslem
*
* Visit: http://guichan.sourceforge.net
*
* License: (BSD)
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Guichan nor the names of its contributors may
* be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* For comments regarding functions please see the header file.
*/
#include "guichan/cliprectangle.hpp"
namespace gcn
{
ClipRectangle::ClipRectangle()
{
x = y = width = height = xOffset = yOffset = 0;
}
ClipRectangle::ClipRectangle(int x, int y, int width, int height, int xOffset, int yOffset)
{
this->x = x;
this->y = y;
this->width = width;
this->height = height;
this->xOffset = xOffset;
this->yOffset = yOffset;
}
const ClipRectangle& ClipRectangle::operator=(const Rectangle& other)
{
x = other.x;
y = other.y;
width = other.width;
height = other.height;
return *this;
}
}
|
D
|
module android.java.android.print.PageRange;
public import android.java.android.print.PageRange_d_interface;
import arsd.jni : ImportExportImpl;
mixin ImportExportImpl!PageRange;
import import1 = android.java.java.lang.Class;
|
D
|
instance STRF_1118_Addon_Patrick(Npc_Default)
{
name[0] = "Patrick";
guild = GIL_STRF;
id = 1118;
voice = 7;
flags = 0;
npcType = npctype_main;
aivar[AIV_NoFightParker] = TRUE;
aivar[AIV_IgnoresArmor] = TRUE;
aivar[AIV_ToughGuy] = TRUE;
aivar[AIV_ToughGuyNewsOverride] = TRUE;
aivar[AIV_IGNORE_Murder] = TRUE;
aivar[AIV_IGNORE_Theft] = TRUE;
aivar[AIV_IGNORE_Sheepkiller] = TRUE;
aivar[AIV_NewsOverride] = TRUE;
B_SetAttributesToChapter(self,3);
fight_tactic = FAI_HUMAN_NORMAL;
B_CreateAmbientInv(self);
EquipItem(self,ItMw_StoneHammer);
B_SetNpcVisual(self,MALE,"Hum_Head_Bald",Face_L_NormalBart02,BodyTex_L,ITAR_Prisoner);
Mdl_SetModelFatness(self,1);
Mdl_ApplyOverlayMds(self,"Humans_Tired.mds");
B_GiveNpcTalents(self);
B_SetFightSkills(self,30);
daily_routine = Rtn_Start_1118;
};
func void Rtn_Start_1118()
{
TA_Pick_Ore(8,0,23,0,"ADW_MINE_LAGER_05");
TA_Pick_Ore(23,0,8,0,"ADW_MINE_LAGER_05");
};
func void Rtn_Flucht_1118()
{
TA_RunToWP(8,0,23,0,"ADW_BL_HOEHLE_04");
TA_RunToWP(23,0,8,0,"ADW_BL_HOEHLE_04");
};
func void Rtn_Tot_1118()
{
TA_Sleep(8,0,23,0,"TOT");
TA_Sleep(23,0,8,0,"TOT");
};
|
D
|
module stack;
import value;
import exception;
import std.conv;
class InnerStack {
protected:
uint max_stack_size_;
Value[] stack_;
uint sp_;
public:
this(uint max_stack_size) {
this.max_stack_size_ = max_stack_size;
this.sp_ = 0;
this.stack_.length = 1;
}
@property ulong sp() {
return this.sp_;
}
void push(in Value v) {
// extending stack size
while (this.stack_.length <= sp_) {
if (this.stack_.length * 2 >= max_stack_size_) {
this.stack_.length = this.max_stack_size_;
} else {
this.stack_.length = this.stack_.length * 2;
}
}
this.stack_[sp_] = v;
sp_++;
if (sp_ >= this.max_stack_size_) {
throw new DMRuntimeError("stack error");
}
}
Value pop() {
if (sp_ == 0) {
throw new DMRuntimeError("stack error");
}
sp_--;
return this.stack_[sp_];
}
ulong inc() {
this.sp_++;
if (sp_ >= this.max_stack_size_) {
throw new DMRuntimeError("stack error");
}
return this.sp_;
}
ulong dec() {
if (sp_ == 0) {
throw new DMRuntimeError("stack error");
}
this.sp_--;
return this.sp_;
}
string dump() {
return this.stack_[0..sp_].to!string;
}
}
class Stack {
protected:
uint max_stack_num_;
uint max_stack_size_;
uint si_; /// stack id
InnerStack[] stack_;
public:
this(uint max_stack_size, uint max_stack_num) {
this.max_stack_size_ = max_stack_size;
this.max_stack_num_ = max_stack_num;
this.si_ = 0;
this.stack_ = [ new InnerStack(max_stack_size_) ];
}
@property InnerStack inner() { return this.stack_[si_]; }
@property ulong sp() {
return this.inner.sp;
}
void next() {
this.si_++;
if (this.si_ >= max_stack_num_) {
throw new DMRuntimeError("too many stacks");
}
if (this.si_ >= stack_.length) {
this.stack_ ~= new InnerStack(max_stack_size_);
}
}
void prev() {
if (this.si_ == 0) {
throw new DMRuntimeError("negative stack id");
}
this.si_--;
}
void push(in Value v) {
this.inner.push(v);
}
Value pop() {
return this.inner.pop();
}
ulong inc() {
return this.inner.inc();
}
ulong dec() {
return this.inner.dec();
}
string dump() {
return this.inner.dump();
}
}
|
D
|
module compiler.compiler_test;
import std.stdio;
import std.string;
import std.conv;
import std.typecons;
import vm.vm;
import ast.ast;
import code.code;
import lexer.lexer;
import objekt.objekt;
import parser.parser;
import compiler.compiler;
import compiler.symbol_table;
unittest {
testIntegerArithmetic();
testBooleanExpressions();
testConditionals();
testGlobalLetStatements();
testStringExpressions();
testArrayLiterals();
testHashLiterals();
testIndexExpressions();
testFunctions();
testCompilerScopes();
testFunctionCalls();
testLetStatementScopes();
testIntBuiltins();
testBuiltins();
testClosures();
testRecursiveFunctions();
}
/++
+
+/
struct CompilerTestCase(T) {
string input; /// input
T[] expectedConstants; /// expectedConstants
Instructions[] expectedInstructions; /// expectedInstructions
}
///
void testIntegerArithmetic() {
auto tests = [
CompilerTestCase!int(
"1 + 2",
[1, 2],
[
make(OPCODE.OpConstant, 0),
make(OPCODE.OpConstant, 1),
make(OPCODE.OpAdd),
make(OPCODE.OpPop),
]
),
CompilerTestCase!int(
"1; 2",
[1, 2],
[
make(OPCODE.OpConstant, 0),
make(OPCODE.OpPop),
make(OPCODE.OpConstant, 1),
make(OPCODE.OpPop),
]
),
CompilerTestCase!int(
"1 - 2",
[1, 2],
[
make(OPCODE.OpConstant, 0),
make(OPCODE.OpConstant, 1),
make(OPCODE.OpSub),
make(OPCODE.OpPop),
]
),
CompilerTestCase!int(
"1 * 2",
[1, 2],
[
make(OPCODE.OpConstant, 0),
make(OPCODE.OpConstant, 1),
make(OPCODE.OpMul),
make(OPCODE.OpPop),
]
),
CompilerTestCase!int(
"2 / 1",
[2, 1],
[
make(OPCODE.OpConstant, 0),
make(OPCODE.OpConstant, 1),
make(OPCODE.OpDiv),
make(OPCODE.OpPop),
]
),
CompilerTestCase!int(
"-1",
[1],
[
make(OPCODE.OpConstant, 0),
make(OPCODE.OpMinus),
make(OPCODE.OpPop),
]
),
];
runCompilerTests!int(tests);
}
///
void testBooleanExpressions() {
auto tests = [
CompilerTestCase!int(
"1 > 2",
[1, 2],
[
make(OPCODE.OpConstant, 0),
make(OPCODE.OpConstant, 1),
make(OPCODE.OpGreaterThan),
make(OPCODE.OpPop),
]
),
CompilerTestCase!int(
"1 < 2",
[2, 1],
[
make(OPCODE.OpConstant, 0),
make(OPCODE.OpConstant, 1),
make(OPCODE.OpGreaterThan),
make(OPCODE.OpPop),
]
),
CompilerTestCase!int(
"1 == 2",
[1, 2],
[
make(OPCODE.OpConstant, 0),
make(OPCODE.OpConstant, 1),
make(OPCODE.OpEqual),
make(OPCODE.OpPop),
]
),
CompilerTestCase!int(
"1 != 2",
[1, 2],
[
make(OPCODE.OpConstant, 0),
make(OPCODE.OpConstant, 1),
make(OPCODE.OpNotEqual),
make(OPCODE.OpPop),
]
),
CompilerTestCase!int(
"true == false",
[],
[
make(OPCODE.OpTrue),
make(OPCODE.OpFalse),
make(OPCODE.OpEqual),
make(OPCODE.OpPop),
]
),
CompilerTestCase!int(
"true != false",
[],
[
make(OPCODE.OpTrue),
make(OPCODE.OpFalse),
make(OPCODE.OpNotEqual),
make(OPCODE.OpPop),
]
),
CompilerTestCase!int(
"!true",
[],
[
make(OPCODE.OpTrue),
make(OPCODE.OpBang),
make(OPCODE.OpPop),
]
),
CompilerTestCase!int(
"true",
[],
[
make(OPCODE.OpTrue),
make(OPCODE.OpPop),
]
),
CompilerTestCase!int(
"false",
[],
[
make(OPCODE.OpFalse),
make(OPCODE.OpPop),
]
),
];
runCompilerTests!int(tests);
}
///
void testConditionals() {
auto tests = [
CompilerTestCase!int(
`if (true) { 10 }; 3333;`,
[10, 3333],
[
make(OPCODE.OpTrue), /// 0000
make(OPCODE.OpJumpNotTruthy, 10), /// 0001
make(OPCODE.OpConstant, 0), /// 0004
make(OPCODE.OpJump, 11), /// 0007
make(OPCODE.OpNull), /// 0010
make(OPCODE.OpPop), /// 0011
make(OPCODE.OpConstant, 1), /// 0012
make(OPCODE.OpPop), /// 0015
]
),
CompilerTestCase!int(
`if (true) { 10 } else { 20 }; 3333;`,
[10, 20, 3333],
[
make(OPCODE.OpTrue), /// 0000
make(OPCODE.OpJumpNotTruthy, 10), /// 0001
make(OPCODE.OpConstant, 0), /// 0004
make(OPCODE.OpJump, 13), /// 0007
make(OPCODE.OpConstant, 1), /// 0010
make(OPCODE.OpPop), /// 0013
make(OPCODE.OpConstant, 2), /// 0014
make(OPCODE.OpPop), /// 0017
]
),
];
runCompilerTests!int(tests);
}
///
void runCompilerTests(T) (CompilerTestCase!(T)[] tests) {
foreach (i, tt; tests) {
Objekt[] constants;
auto symTable = new SymbolTable(null);
auto program = parse(tt.input);
auto compiler = Compiler(symTable, constants);
auto err = compiler.compile(program);
if(err !is null) {
stderr.writefln("compiler error: %s", err.msg);
assert(err is null);
}
auto bytecode = compiler.bytecode();
err = testInstructions(tt.expectedInstructions, bytecode.instructions);
if(err !is null) {
stderr.writefln("testInstructions failed: %s", err.msg);
assert(err is null);
}
err = testConstants!T(tt.expectedConstants, bytecode.constants);
if(err !is null) {
stderr.writefln("testConstants failed: %s", err.msg);
assert(err is null);
}
}
}
/+++/
Program parse(string input) {
auto lex = Lexer(input);
auto parser = Parser(lex);
return parser.parseProgram();
}
///
Error testInstructions(Instructions[] expected, Instructions actual) {
auto concatted = concatInstructions(expected);
if (actual.length != concatted.length)
return new Error(format("wrong instructions length.\nwant=%s\ngot =%s",
asString(concatted), asString(actual)));
foreach(i, ins; concatted) {
if(actual[i] != ins)
return new Error(format("wrong instruction at %d.\nwant=%s\ngot =%s",
i, asString(concatted), asString(actual)));
}
return null;
}
/+++/
Instructions concatInstructions(Instructions[] s) {
Instructions output = [];
foreach(ins; s) {
output ~= ins;
}
return output;
}
/+++/
Error testConstants(T) (T[] expected, Objekt[] actual) {
if(expected.length != actual.length) {
return new Error(format("wrong number of constants. got=%d, want=%d",
actual.length, expected.length));
}
foreach(i, constant; expected) {
switch (to!string(typeid(constant))) {
case "int":
auto err = testIntegerObject(to!long(constant), actual[i]);
if(err !is null)
return new Error(format("constant %d - testIntegerObject failed: %s", i, err.msg));
break;
case "immutable(char)[]":
auto err = testStringObject(to!string(constant), actual[i]);
if(err !is null)
return new Error(format("constant %d - testStringObject failed: %s",i, err.msg));
break;
default:
break;
}
}
return null;
}
///
Error testIntegerObject(long expected, Objekt actual) {
auto result = cast(Integer) actual;
if(result is null)
return new Error(format("object is not Integer. got=%s (%s)", actual, actual));
if(result.value != expected)
return new Error(format("object has wrong value. got=%d, want=%d", result.value, expected));
return null;
}
///
void testGlobalLetStatements() {
auto tests = [
CompilerTestCase!int(
`let one = 1; let two = 2;`,
[1, 2],
[
make(OPCODE.OpConstant, 0),
make(OPCODE.OpSetGlobal, 0),
make(OPCODE.OpConstant, 1),
make(OPCODE.OpSetGlobal, 1),
]
),
CompilerTestCase!int(
`let one = 1; one;`,
[1],
[
make(OPCODE.OpConstant, 0),
make(OPCODE.OpSetGlobal, 0),
make(OPCODE.OpGetGlobal, 0),
make(OPCODE.OpPop),
]
),
CompilerTestCase!int(
`let one = 1; let two = one; two;`,
[1],
[
make(OPCODE.OpConstant, 0),
make(OPCODE.OpSetGlobal, 0),
make(OPCODE.OpGetGlobal, 0),
make(OPCODE.OpSetGlobal, 1),
make(OPCODE.OpGetGlobal, 1),
make(OPCODE.OpPop),
]
),
];
runCompilerTests!int(tests);
}
///
void testStringExpressions() {
auto tests = [
CompilerTestCase!string(
`"monkey"`,
["monkey"],
[
make(OPCODE.OpConstant, 0),
make(OPCODE.OpPop),
]
),
CompilerTestCase!string(
`"mon" + "key"`,
["mon", "key"],
[
make(OPCODE.OpConstant, 0),
make(OPCODE.OpConstant, 1),
make(OPCODE.OpAdd),
make(OPCODE.OpPop),
]
),
];
runCompilerTests!string(tests);
}
///
Error testStringObject(string expected, Objekt actual) {
auto result = cast(String) actual;
if(result is null)
return new Error(format("object is not String. got=%s (%s)", actual, actual));
if(result.value != expected)
return new Error(format("object has wrong value. got=%s, want=%s", result.value, expected));
return null;
}
///
void testArrayLiterals() {
auto tests = [
CompilerTestCase!int(
"[]",
[],
[
make(OPCODE.OpArray, 0),
make(OPCODE.OpPop),
]
),
CompilerTestCase!int(
"[1, 2, 3]",
[1, 2, 3],
[
make(OPCODE.OpConstant, 0),
make(OPCODE.OpConstant, 1),
make(OPCODE.OpConstant, 2),
make(OPCODE.OpArray, 3),
make(OPCODE.OpPop),
]
),
CompilerTestCase!int(
"[1 + 2, 3 - 4, 5 * 6]",
[1, 2, 3, 4, 5, 6],
[
make(OPCODE.OpConstant, 0),
make(OPCODE.OpConstant, 1),
make(OPCODE.OpAdd),
make(OPCODE.OpConstant, 2),
make(OPCODE.OpConstant, 3),
make(OPCODE.OpSub),
make(OPCODE.OpConstant, 4),
make(OPCODE.OpConstant, 5),
make(OPCODE.OpMul),
make(OPCODE.OpArray, 3),
make(OPCODE.OpPop),
]
),
];
runCompilerTests!int(tests);
}
///
void testHashLiterals() {
auto tests = [
CompilerTestCase!int(
"{}",
[],
[
make(OPCODE.OpHash, 0),
make(OPCODE.OpPop),
]
),
CompilerTestCase!int(
"{1: 2, 3: 4, 5: 6}",
[1, 2, 3, 4, 5, 6],
[
make(OPCODE.OpConstant, 0),
make(OPCODE.OpConstant, 1),
make(OPCODE.OpConstant, 2),
make(OPCODE.OpConstant, 3),
make(OPCODE.OpConstant, 4),
make(OPCODE.OpConstant, 5),
make(OPCODE.OpHash, 6),
make(OPCODE.OpPop),
]
),
CompilerTestCase!int(
"{1: 2 + 3, 4: 5 * 6}",
[1, 2, 3, 4, 5, 6],
[
make(OPCODE.OpConstant, 0),
make(OPCODE.OpConstant, 1),
make(OPCODE.OpConstant, 2),
make(OPCODE.OpAdd),
make(OPCODE.OpConstant, 3),
make(OPCODE.OpConstant, 4),
make(OPCODE.OpConstant, 5),
make(OPCODE.OpMul),
make(OPCODE.OpHash, 4),
make(OPCODE.OpPop),
]
),
];
runCompilerTests(tests);
}
///
void testIndexExpressions() {
auto tests = [
CompilerTestCase!int(
"[1, 2, 3][1 + 1]",
[1, 2, 3, 1, 1],
[
make(OPCODE.OpConstant, 0),
make(OPCODE.OpConstant, 1),
make(OPCODE.OpConstant, 2),
make(OPCODE.OpArray, 3),
make(OPCODE.OpConstant, 3),
make(OPCODE.OpConstant, 4),
make(OPCODE.OpAdd),
make(OPCODE.OpIndex),
make(OPCODE.OpPop),
]
),
CompilerTestCase!int(
"{1: 2}[2 - 1]",
[1, 2, 2, 1],
[
make(OPCODE.OpConstant, 0),
make(OPCODE.OpConstant, 1),
make(OPCODE.OpHash, 2),
make(OPCODE.OpConstant, 2),
make(OPCODE.OpConstant, 3),
make(OPCODE.OpSub),
make(OPCODE.OpIndex),
make(OPCODE.OpPop),
]
),
];
runCompilerTests!int(tests);
}
alias Foo = Tuple!(int, int, Instructions[]);
///
void testFunctions() {
auto tests = [
CompilerTestCase!Foo(
`fn() { return 5 + 10 }`,
[
tuple(
5, 10,
[
make(OPCODE.OpConstant, 0),
make(OPCODE.OpConstant, 1),
make(OPCODE.OpAdd),
make(OPCODE.OpReturnValue),
]
),
],
[
make(OPCODE.OpClosure, 2, 0),
make(OPCODE.OpPop),
]
),
CompilerTestCase!Foo(
`fn() { 5 + 10 }`,
[
tuple(
5, 10,
[
make(OPCODE.OpConstant, 0),
make(OPCODE.OpConstant, 1),
make(OPCODE.OpAdd),
make(OPCODE.OpReturnValue),
]
),
],
[
make(OPCODE.OpClosure, 2, 0),
make(OPCODE.OpPop),
]
),
CompilerTestCase!Foo(
`fn() { 1; 2 }`,
[
tuple(
1, 2,
[
make(OPCODE.OpConstant, 0),
make(OPCODE.OpPop),
make(OPCODE.OpConstant, 1),
make(OPCODE.OpReturnValue),
]
),
],
[
make(OPCODE.OpClosure, 2, 0),
make(OPCODE.OpPop),
]
),
CompilerTestCase!Foo(
`fn() { }`,
[
tuple(
0, 0,
[
make(OPCODE.OpReturn),
]
),
],
[
make(OPCODE.OpClosure, 0, 0),
make(OPCODE.OpPop),
]
),
];
foreach (i, tt; tests) {
Objekt[] constants;
auto symTable = new SymbolTable(null);
auto program = parse(tt.input);
auto compiler = Compiler(symTable, constants);
auto err = compiler.compile(program);
if(err !is null) {
stderr.writefln("compiler error: %s", err.msg);
assert(err is null);
}
auto bytecode = compiler.bytecode();
err = testInstructions(tt.expectedInstructions, bytecode.instructions);
if(err !is null) {
stderr.writefln("testInstructions failed: %s", err.msg);
assert(err is null);
}
err = testFunctionConstants(tt.expectedConstants[0][2], bytecode.constants);
if(err !is null) {
stderr.writefln("testConstants failed: %s", err.msg);
assert(err is null);
}
}
}
///
Error testFunctionConstants(Instructions[] expected, Objekt[] actual) {
foreach(constant; actual) {
auto nde = to!string(typeid((cast(Object) constant)));
if(nde == "objekt.objekt.CompiledFunction") {
auto fn = cast(CompiledFunction) constant;
if(fn is null)
return new Error(format("constant - not a function: %s", constant));
auto err = testInstructions(expected, fn.instructions);
if(err !is null)
return new Error(format("constant - testInstructions failed: %s", err));
}
}
return null;
}
///
void testCompilerScopes() {
Objekt[] constants;
auto symTable = new SymbolTable(null);
auto compiler = Compiler(symTable, constants);
if (compiler.scopeIndex != 0) {
stderr.writefln("scopeIndex wrong. got=%d, want=%d", compiler.scopeIndex, 0);
assert(compiler.scopeIndex == 0);
}
auto globalSymbolTable = compiler.symTable;
compiler.emit(OPCODE.OpMul);
compiler.enterScope();
if (compiler.scopeIndex != 1) {
stderr.writefln("scopeIndex wrong. got=%d, want=%d", compiler.scopeIndex, 1);
assert(compiler.scopeIndex == 1);
}
compiler.emit(OPCODE.OpSub);
if(compiler.scopes[compiler.scopeIndex].instructions.length != 1) {
stderr.writefln("instructions length wrong. got=%d",
compiler.scopes[compiler.scopeIndex].instructions.length);
assert(compiler.scopes[compiler.scopeIndex].instructions.length == 1);
}
auto last = compiler.scopes[compiler.scopeIndex].lastInstruction;
if (last.opcode != OPCODE.OpSub) {
stderr.writefln("lastInstruction.Opcode wrong. got=%d, want=%d", last.opcode, OPCODE.OpSub);
assert(last.opcode == OPCODE.OpSub);
}
if(compiler.symTable.outer !is globalSymbolTable) {
stderr.writefln("compiler did not enclose symbolTable");
assert(compiler.symTable.outer is globalSymbolTable);
}
compiler.leaveScope();
if (compiler.scopeIndex != 0) {
stderr.writefln("scopeIndex wrong. got=%d, want=%d", compiler.scopeIndex, 0);
assert(compiler.scopeIndex == 0);
}
if(compiler.symTable !is globalSymbolTable) {
stderr.writefln("compiler did not restore global symbol table");
assert(compiler.symTable is globalSymbolTable);
}
if(compiler.symTable.outer !is null) {
stderr.writefln("compiler modified global symbol table incorrectly");
assert(compiler.symTable.outer is null);
}
compiler.emit(OPCODE.OpAdd);
if (compiler.scopes[compiler.scopeIndex].instructions.length != 2) {
stderr.writefln("instructions length wrong. got=%d", compiler.scopes[compiler.scopeIndex].instructions.length);
assert(compiler.scopes[compiler.scopeIndex].instructions.length == 2);
}
last = compiler.scopes[compiler.scopeIndex].lastInstruction;
if(last.opcode != OPCODE.OpAdd) {
stderr.writefln("lastInstruction.Opcode wrong. got=%d, want=%d", last.opcode, OPCODE.OpAdd);
assert(last.opcode == OPCODE.OpAdd);
}
auto previous = compiler.scopes[compiler.scopeIndex].previousInstruction;
if (previous.opcode != OPCODE.OpMul) {
stderr.writefln("previousInstruction.Opcode wrong. got=%d, want=%d", previous.opcode, OPCODE.OpMul);
assert(previous.opcode == OPCODE.OpMul);
}
}
///
void testFunctionCalls() {
auto tests = [
CompilerTestCase!Foo(
`fn() { 24 }();`,
[
tuple(
0, 24,
[
make(OPCODE.OpConstant, 0), // The literal "24"
make(OPCODE.OpReturnValue),
]
),
],
[
make(OPCODE.OpClosure, 1, 0), // The compiled function
make(OPCODE.OpCall, 0),
make(OPCODE.OpPop),
]
),
CompilerTestCase!Foo(
`let noArg = fn() { 24 };
noArg();`,
[
tuple(
0, 24,
[
make(OPCODE.OpConstant, 0), // The literal "24"
make(OPCODE.OpReturnValue),
]
),
],
[
make(OPCODE.OpClosure, 1, 0), // The compiled function
make(OPCODE.OpSetGlobal, 0),
make(OPCODE.OpGetGlobal, 0),
make(OPCODE.OpCall, 0),
make(OPCODE.OpPop),
]
),
CompilerTestCase!Foo(
`let oneArg = fn(a) { a };oneArg(24);`,
[
tuple(
0, 0,
[
make(OPCODE.OpGetLocal, 0),
make(OPCODE.OpReturnValue),
]
),
],
[
make(OPCODE.OpClosure, 0, 0),
make(OPCODE.OpSetGlobal, 0),
make(OPCODE.OpGetGlobal, 0),
make(OPCODE.OpConstant, 1),
make(OPCODE.OpCall, 1),
make(OPCODE.OpPop),
]
),
CompilerTestCase!Foo(
`let manyArg = fn(a, b, c) { a; b; c };manyArg(24, 25, 26);`,
[
tuple(
0, 0,
[
make(OPCODE.OpGetLocal, 0),
make(OPCODE.OpPop),
make(OPCODE.OpGetLocal, 1),
make(OPCODE.OpPop),
make(OPCODE.OpGetLocal, 2),
make(OPCODE.OpReturnValue),
]
),
],
[
make(OPCODE.OpClosure, 0, 0),
make(OPCODE.OpSetGlobal, 0),
make(OPCODE.OpGetGlobal, 0),
make(OPCODE.OpConstant, 1),
make(OPCODE.OpConstant, 2),
make(OPCODE.OpConstant, 3),
make(OPCODE.OpCall, 3),
make(OPCODE.OpPop),
]
),
];
foreach (i, tt; tests) {
Objekt[] constants = [];
auto symTable = new SymbolTable(null);
auto program = parse(tt.input);
auto compiler = Compiler(symTable, constants);
auto err = compiler.compile(program);
if(err !is null) {
stderr.writefln("compiler error: %s", err.msg);
assert(err is null);
}
auto bytecode = compiler.bytecode();
err = testInstructions(tt.expectedInstructions, bytecode.instructions);
if(err !is null) {
stderr.writefln("testInstructions failed: %s", err.msg);
assert(err is null);
}
err = testFunctionConstants(tt.expectedConstants[0][2], bytecode.constants);
if(err !is null) {
stderr.writefln("testConstants failed: %s", err.msg);
assert(err is null);
}
}
}
///
void testLetStatementScopes() {
auto tests = [
CompilerTestCase!Foo(
`let num = 55;fn() { num }`,
[
tuple(
0, 55,
[
make(OPCODE.OpGetGlobal, 0),
make(OPCODE.OpReturnValue),
]
),
],
[
make(OPCODE.OpConstant, 0),
make(OPCODE.OpSetGlobal, 0),
make(OPCODE.OpClosure, 1, 0),
make(OPCODE.OpPop),
]
),
CompilerTestCase!Foo(
`fn() {let num = 55;num}`,
[
tuple(
0, 55,
[
make(OPCODE.OpConstant, 0),
make(OPCODE.OpSetLocal, 0),
make(OPCODE.OpGetLocal, 0),
make(OPCODE.OpReturnValue),
]
),
],
[
make(OPCODE.OpClosure, 1, 0),
make(OPCODE.OpPop),
]
),
CompilerTestCase!Foo(
`fn() {let a = 55;let b = 77;a + b}`,
[
tuple(
55, 77,
[
make(OPCODE.OpConstant, 0),
make(OPCODE.OpSetLocal, 0),
make(OPCODE.OpConstant, 1),
make(OPCODE.OpSetLocal, 1),
make(OPCODE.OpGetLocal, 0),
make(OPCODE.OpGetLocal, 1),
make(OPCODE.OpAdd),
make(OPCODE.OpReturnValue),
]
)
],
[
make(OPCODE.OpClosure, 2, 0),
make(OPCODE.OpPop),
]
),
];
foreach (i, tt; tests) {
Objekt[] constants = [];
auto symTable = new SymbolTable(null);
auto program = parse(tt.input);
auto compiler = Compiler(symTable, constants);
auto err = compiler.compile(program);
if(err !is null) {
stderr.writefln("compiler error: %s", err.msg);
assert(err is null);
}
auto bytecode = compiler.bytecode();
err = testInstructions(tt.expectedInstructions, bytecode.instructions);
if(err !is null) {
stderr.writefln("testInstructions failed: %s", err.msg);
assert(err is null);
}
err = testFunctionConstants(tt.expectedConstants[0][2], bytecode.constants);
if(err !is null) {
stderr.writefln("testConstants failed: %s", err.msg);
assert(err is null);
}
}
}
///
void testIntBuiltins() {
auto tests = [
CompilerTestCase!int(
`len([]);push([], 1);`,
[1],
[
make(OPCODE.OpGetBuiltin, 0),
make(OPCODE.OpArray, 0),
make(OPCODE.OpCall, 1),
make(OPCODE.OpPop),
make(OPCODE.OpGetBuiltin, 5),
make(OPCODE.OpArray, 0),
make(OPCODE.OpConstant, 0),
make(OPCODE.OpCall, 2),
make(OPCODE.OpPop),
]
),
];
runCompilerTests!int(tests);
}
///
void testBuiltins() {
auto tests = [
CompilerTestCase!(Instructions[])(
`fn() { len([]) }`,
[
[
make(OPCODE.OpGetBuiltin, 0),
make(OPCODE.OpArray, 0),
make(OPCODE.OpCall, 1),
make(OPCODE.OpReturnValue),
]
],
[
make(OPCODE.OpClosure, 0, 0),
make(OPCODE.OpPop),
]
),
];
foreach (i, tt; tests) {
Objekt[] constants = [];
auto symTable = new SymbolTable(null);
auto program = parse(tt.input);
auto compiler = Compiler(symTable, constants);
auto err = compiler.compile(program);
if(err !is null) {
stderr.writefln("compiler error: %s", err.msg);
assert(err is null);
}
auto bytecode = compiler.bytecode();
err = testInstructions(tt.expectedInstructions, bytecode.instructions);
if(err !is null) {
stderr.writefln("testInstructions failed: %s", err.msg);
assert(err is null);
}
err = testFunctionConstants(tt.expectedConstants[0], bytecode.constants);
if(err !is null) {
stderr.writefln("testConstants failed: %s", err.msg);
assert(err is null);
}
}
}
///
void testClosures() {
auto tests = [
CompilerTestCase!(Instructions[])(
`fn(a) {fn(b) {a + b}}`,
[
[
make(OPCODE.OpGetFree, 0),
make(OPCODE.OpGetLocal, 0),
make(OPCODE.OpAdd),
make(OPCODE.OpReturnValue),
],
[
make(OPCODE.OpGetLocal, 0),
make(OPCODE.OpClosure, 0, 1),
make(OPCODE.OpReturnValue),
]
],
[
make(OPCODE.OpClosure, 1, 0),
make(OPCODE.OpPop),
]
),
CompilerTestCase!(Instructions[])(
`fn(a) {fn(b) {fn(c) {a + b + c}}};`,
[
[
make(OPCODE.OpGetFree, 0),
make(OPCODE.OpGetFree, 1),
make(OPCODE.OpAdd),
make(OPCODE.OpGetLocal, 0),
make(OPCODE.OpAdd),
make(OPCODE.OpReturnValue),
],
[
make(OPCODE.OpGetFree, 0),
make(OPCODE.OpGetLocal, 0),
make(OPCODE.OpClosure, 0, 2),
make(OPCODE.OpReturnValue),
],
[
make(OPCODE.OpGetLocal, 0),
make(OPCODE.OpClosure, 1, 1),
make(OPCODE.OpReturnValue),
]
],
[
make(OPCODE.OpClosure, 2, 0),
make(OPCODE.OpPop),
]
),
CompilerTestCase!(Instructions[])(
`let global = 55;fn() {let a = 66;fn() {let b = 77;fn() {let c = 88;global + a + b + c;}}}`,
[
[ make(OPCODE.OpConstant, 0)],
[ make(OPCODE.OpConstant, 0)],
[ make(OPCODE.OpConstant, 0)],
[ make(OPCODE.OpConstant, 0)],
[
make(OPCODE.OpConstant, 3),
make(OPCODE.OpSetLocal, 0),
make(OPCODE.OpGetGlobal, 0),
make(OPCODE.OpGetFree, 0),
make(OPCODE.OpAdd),
make(OPCODE.OpGetFree, 1),
make(OPCODE.OpAdd),
make(OPCODE.OpGetLocal, 0),
make(OPCODE.OpAdd),
make(OPCODE.OpReturnValue),
],
[
make(OPCODE.OpConstant, 2),
make(OPCODE.OpSetLocal, 0),
make(OPCODE.OpGetFree, 0),
make(OPCODE.OpGetLocal, 0),
make(OPCODE.OpClosure, 4, 2),
make(OPCODE.OpReturnValue),
],
[
make(OPCODE.OpConstant, 1),
make(OPCODE.OpSetLocal, 0),
make(OPCODE.OpGetLocal, 0),
make(OPCODE.OpClosure, 5, 1),
make(OPCODE.OpReturnValue),
]
],
[
make(OPCODE.OpConstant, 0),
make(OPCODE.OpSetGlobal, 0),
make(OPCODE.OpClosure, 6, 0),
make(OPCODE.OpPop),
]
),
];
foreach (i, tt; tests) {
Objekt[] constants = [];
auto symTable = new SymbolTable(null);
auto program = parse(tt.input);
auto compiler = Compiler(symTable, constants);
auto err = compiler.compile(program);
if(err !is null) {
stderr.writefln("compiler error: %s", err.msg);
assert(err is null);
}
auto bytecode = compiler.bytecode();
err = testInstructions(tt.expectedInstructions, bytecode.instructions);
if(err !is null) {
stderr.writefln("testInstructions failed: %s", err.msg);
assert(err is null);
}
err = testInstrConstants(tt.expectedConstants, bytecode.constants);
if(err !is null) {
stderr.writefln("testConstants failed: %s", err.msg);
assert(err is null);
}
}
}
///
Error testInstrConstants(Instructions[][] expected, Objekt[] actual) {
foreach(i, constant; actual) {
auto nde = to!string(typeid((cast(Object) constant)));
if(nde == "objekt.objekt.CompiledFunction") {
auto fn = cast(CompiledFunction) constant;
if(fn is null)
return new Error(format("constant - not a function: %s", constant));
auto err = testInstructions(expected[i], fn.instructions);
if(err !is null)
return new Error(format("constant - testInstructions failed: %s", err));
}
}
return null;
}
///
void testRecursiveFunctions() {
auto tests = [
CompilerTestCase!(Instructions[]) (
`let countDown = fn(x) { countDown(x - 1); };countDown(1);`,
[
[
make(OPCODE.OpConstant, 0)
],
[
make(OPCODE.OpCurrentClosure),
make(OPCODE.OpGetLocal, 0),
make(OPCODE.OpConstant, 0),
make(OPCODE.OpSub),
make(OPCODE.OpCall, 1),
make(OPCODE.OpReturnValue),
],
[
make(OPCODE.OpConstant, 0)
],
],
[
make(OPCODE.OpClosure, 1, 0),
make(OPCODE.OpSetGlobal, 0),
make(OPCODE.OpGetGlobal, 0),
make(OPCODE.OpConstant, 2),
make(OPCODE.OpCall, 1),
make(OPCODE.OpPop),
]
),
CompilerTestCase!(Instructions[]) (
`let wrapper = fn() {let countDown = fn(x) { countDown(x - 1); };
countDown(1);};wrapper();`,
[
[
make(OPCODE.OpConstant, 0)
],
[
make(OPCODE.OpCurrentClosure),
make(OPCODE.OpGetLocal, 0),
make(OPCODE.OpConstant, 0),
make(OPCODE.OpSub),
make(OPCODE.OpCall, 1),
make(OPCODE.OpReturnValue),
],
[
make(OPCODE.OpConstant, 0)
],
[
make(OPCODE.OpClosure, 1, 0),
make(OPCODE.OpSetLocal, 0),
make(OPCODE.OpGetLocal, 0),
make(OPCODE.OpConstant, 2),
make(OPCODE.OpCall, 1),
make(OPCODE.OpReturnValue),
],
],
[
make(OPCODE.OpClosure, 3, 0),
make(OPCODE.OpSetGlobal, 0),
make(OPCODE.OpGetGlobal, 0),
make(OPCODE.OpCall, 0),
make(OPCODE.OpPop),
]
)
];
foreach (i, tt; tests) {
Objekt[] constants = [];
auto symTable = new SymbolTable(null);
auto program = parse(tt.input);
auto compiler = Compiler(symTable, constants);
auto err = compiler.compile(program);
if(err !is null) {
stderr.writefln("compiler error: %s", err.msg);
assert(err is null);
}
auto bytecode = compiler.bytecode();
err = testInstructions(tt.expectedInstructions, bytecode.instructions);
if(err !is null) {
stderr.writefln("testInstructions failed: %s", err.msg);
assert(err is null);
}
err = testInstrConstants(tt.expectedConstants, bytecode.constants);
if(err !is null) {
stderr.writefln("testConstants failed: %s", err.msg);
assert(err is null);
}
}
}
|
D
|
const string Grd_213_CHECKPOINT = "OCC_GATE_INSIDE";
instance Info_Grd_213_FirstWarn(C_Info)
{
npc = Grd_213_Torwache;
nr = 1;
condition = Info_Grd_213_FirstWarn_Condition;
information = Info_Grd_213_FirstWarn_Info;
permanent = 1;
important = 1;
};
func int Info_Grd_213_FirstWarn_Condition()
{
if((hero.aivar[AIV_GUARDPASSAGE_STATUS] == AIV_GPS_BEGIN) && (self.aivar[AIV_PASSGATE] == FALSE) && (Npc_GetAttitude(self,hero) != ATT_FRIENDLY) && Hlp_StrCmp(Npc_GetNearestWP(self),self.wp))
{
return TRUE;
};
};
func void Info_Grd_213_FirstWarn_Info()
{
PrintGlobals(PD_MISSION);
AI_Output(self,hero,"Info_Grd_213_FirstWarn_Info_07_01"); //STŮJ!
AI_Output(hero,self,"Info_Grd_213_FirstWarn_Info_15_02"); //Co se děje?
AI_Output(self,hero,"Info_Grd_213_FirstWarn_Info_07_03"); //Na hrad nesmíš! Vypadni!
hero.aivar[AIV_LASTDISTTOWP] = Npc_GetDistToWP(hero,Grd_213_CHECKPOINT);
hero.aivar[AIV_GUARDPASSAGE_STATUS] = AIV_GPS_FIRSTWARN;
AI_StopProcessInfos(self);
};
instance Info_Grd_213_LastWarn(C_Info)
{
npc = Grd_213_Torwache;
nr = 1;
condition = Info_Grd_213_LastWarn_Condition;
information = Info_Grd_213_LastWarn_Info;
permanent = 1;
important = 1;
};
func int Info_Grd_213_LastWarn_Condition()
{
if((hero.aivar[AIV_GUARDPASSAGE_STATUS] == AIV_GPS_FIRSTWARN) && (self.aivar[AIV_PASSGATE] == FALSE) && (Npc_GetAttitude(self,hero) != ATT_FRIENDLY) && (Npc_GetDistToWP(hero,Grd_213_CHECKPOINT) < (hero.aivar[AIV_LASTDISTTOWP] - 100)) && Hlp_StrCmp(Npc_GetNearestWP(self),self.wp))
{
return TRUE;
};
};
func void Info_Grd_213_LastWarn_Info()
{
AI_Output(self,hero,"Info_Grd_213_LastWarn_07_01"); //Jsi hluchý? Ještě krok a je z tebe potrava pro červy!
hero.aivar[AIV_LASTDISTTOWP] = Npc_GetDistToWP(hero,Grd_213_CHECKPOINT);
hero.aivar[AIV_GUARDPASSAGE_STATUS] = AIV_GPS_LASTWARN;
AI_StopProcessInfos(self);
};
instance Info_Grd_213_Attack(C_Info)
{
npc = Grd_213_Torwache;
nr = 1;
condition = Info_Grd_213_Attack_Condition;
information = Info_Grd_213_Attack_Info;
permanent = 1;
important = 1;
};
func int Info_Grd_213_Attack_Condition()
{
if((hero.aivar[AIV_GUARDPASSAGE_STATUS] == AIV_GPS_LASTWARN) && (self.aivar[AIV_PASSGATE] == FALSE) && (Npc_GetAttitude(self,hero) != ATT_FRIENDLY) && (Npc_GetDistToWP(hero,Grd_213_CHECKPOINT) < (hero.aivar[AIV_LASTDISTTOWP] - 100)) && Hlp_StrCmp(Npc_GetNearestWP(self),self.wp))
{
return TRUE;
};
};
func void Info_Grd_213_Attack_Info()
{
hero.aivar[AIV_LASTDISTTOWP] = 0;
hero.aivar[AIV_GUARDPASSAGE_STATUS] = AIV_GPS_PUNISH;
B_FullStop(self);
AI_StopProcessInfos(self);
B_IntruderAlert(self,other);
B_SetAttackReason(self,AIV_AR_INTRUDER);
Npc_SetTarget(self,hero);
AI_StartState(self,ZS_Attack,1,"");
};
instance Grd_213_Torwache_WELCOME(C_Info)
{
npc = Grd_213_Torwache;
condition = Grd_213_Torwache_WELCOME_Condition;
information = Grd_213_Torwache_WELCOME_Info;
important = 1;
permanent = 0;
};
func int Grd_213_Torwache_WELCOME_Condition()
{
if(Npc_GetTrueGuild(hero) == GIL_GRD)
{
return TRUE;
};
};
func void Grd_213_Torwache_WELCOME_Info()
{
AI_Output(self,other,"Grd_213_Torwache_WELCOME_Info_07_01"); //Slyšel jsem, že jsi jedním z nás? Na někoho, kdo tady není dlouho, to není špatné.
};
instance Info_Grd_213_EXIT(C_Info)
{
npc = Grd_213_Torwache;
nr = 999;
condition = Info_Grd_213_EXIT_Condition;
information = Info_Grd_213_EXIT_Info;
permanent = 1;
description = DIALOG_ENDE;
};
func int Info_Grd_213_EXIT_Condition()
{
return 1;
};
func void Info_Grd_213_EXIT_Info()
{
AI_StopProcessInfos(self);
};
instance Info_Grd_213_Abblitzen(C_Info)
{
npc = Grd_213_Torwache;
nr = 1;
condition = Info_Grd_213_Abblitzen_Condition;
information = Info_Grd_213_Abblitzen_Info;
permanent = 1;
description = "Trochu života do toho umírání! Jako kdyby někdo...";
};
func int Info_Grd_213_Abblitzen_Condition()
{
if(self.aivar[AIV_PASSGATE] == FALSE)
{
return 1;
};
};
func void Info_Grd_213_Abblitzen_Info()
{
AI_Output(other,self,"Info_Grd_213_Abblitzen_15_00"); //Víš, měl bys do života vnést trochu víc vzrušení. Jako třeba vpustit někoho na hrad.
AI_Output(self,other,"Info_Grd_213_Abblitzen_07_01"); //Vzrušení? To není špatný nápad - už dlouho jsem nevyrazil někoho, jako jsi ty!
AI_StopProcessInfos(self);
};
instance Info_Grd_213_Passgate(C_Info)
{
npc = Grd_213_Torwache;
nr = 1;
condition = Info_Grd_213_Passgate_Condition;
information = Info_Grd_213_Passgate_Info;
permanent = 1;
description = "Jsi v pořádku?";
};
func int Info_Grd_213_Passgate_Condition()
{
if(self.aivar[AIV_PASSGATE] == TRUE)
{
return 1;
};
};
func void Info_Grd_213_Passgate_Info()
{
AI_Output(other,self,"Info_Grd_213_Passgate_15_00"); //Hej, jsi v pořádku?
AI_Output(self,other,"Info_Grd_213_Passgate_07_01"); //Moc se tady nemotej - běž dovnitř.
AI_StopProcessInfos(self);
};
|
D
|
/Users/sunchuyue/Documents/test/RX_Product/DerivedData/RX_Product/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RxSwift.build/Objects-normal/x86_64/Timeout.o : /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Amb.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Deferred.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Deprecated.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Enumerated.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/Maybe.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Sequence.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/ObservableType+PrimitiveSequence.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Debounce.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Reduce.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Range.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Merge.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Take.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Cancelable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/Completable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/GroupedObservable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/Single.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/AsSingle.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Sample.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Throttle.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ObservableType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ConnectableObservableType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/SchedulerType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ObserverType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Subjects/SubjectType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Create.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Generate.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DataStructures/Queue.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Reactive.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Materialize.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/AddRef.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DataStructures/Bag.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Using.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Debug.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Catch.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Switch.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/StartWith.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/Lock.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/RecursiveLock.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Sink.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Optional.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Scan.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/Completable+AndThen.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/Platform.Darwin.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Do.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Map.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Zip.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Skip.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Producer.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Buffer.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Timer.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DeprecationWarner.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Filter.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Never.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/AnyObserver.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Error.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/Disposables.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Errors.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/ElementAt.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Concat.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Repeat.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Subjects/AsyncSubject.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Subjects/PublishSubject.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Subjects/BehaviorSubject.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Subjects/ReplaySubject.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Event.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/SwiftSupport/SwiftSupport.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/TakeLast.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Multicast.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/First.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Just.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Timeout.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Window.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Rx.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/RxMutableBox.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/Platform.Linux.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/GroupBy.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Delay.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/ToArray.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence+Zip+arity.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Empty.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/sunchuyue/Documents/test/RX_Product/Pods/Target\ Support\ Files/RxSwift/RxSwift-umbrella.h /Users/sunchuyue/Documents/test/RX_Product/DerivedData/RX_Product/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RxSwift.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/sunchuyue/Documents/test/RX_Product/DerivedData/RX_Product/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RxSwift.build/Objects-normal/x86_64/Timeout~partial.swiftmodule : /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Amb.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Deferred.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Deprecated.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Enumerated.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/Maybe.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Sequence.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/ObservableType+PrimitiveSequence.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Debounce.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Reduce.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Range.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Merge.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Take.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Cancelable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/Completable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/GroupedObservable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/Single.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/AsSingle.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Sample.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Throttle.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ObservableType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ConnectableObservableType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/SchedulerType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ObserverType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Subjects/SubjectType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Create.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Generate.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DataStructures/Queue.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Reactive.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Materialize.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/AddRef.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DataStructures/Bag.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Using.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Debug.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Catch.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Switch.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/StartWith.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/Lock.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/RecursiveLock.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Sink.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Optional.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Scan.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/Completable+AndThen.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/Platform.Darwin.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Do.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Map.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Zip.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Skip.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Producer.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Buffer.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Timer.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DeprecationWarner.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Filter.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Never.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/AnyObserver.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Error.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/Disposables.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Errors.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/ElementAt.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Concat.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Repeat.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Subjects/AsyncSubject.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Subjects/PublishSubject.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Subjects/BehaviorSubject.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Subjects/ReplaySubject.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Event.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/SwiftSupport/SwiftSupport.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/TakeLast.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Multicast.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/First.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Just.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Timeout.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Window.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Rx.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/RxMutableBox.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/Platform.Linux.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/GroupBy.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Delay.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/ToArray.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence+Zip+arity.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Empty.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/sunchuyue/Documents/test/RX_Product/Pods/Target\ Support\ Files/RxSwift/RxSwift-umbrella.h /Users/sunchuyue/Documents/test/RX_Product/DerivedData/RX_Product/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RxSwift.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/sunchuyue/Documents/test/RX_Product/DerivedData/RX_Product/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RxSwift.build/Objects-normal/x86_64/Timeout~partial.swiftdoc : /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Amb.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Deferred.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Deprecated.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Enumerated.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/Maybe.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Sequence.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/ObservableType+PrimitiveSequence.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Debounce.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Reduce.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Range.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Merge.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Take.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Cancelable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/Completable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/GroupedObservable.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/Single.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/AsSingle.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Sample.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Throttle.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ObservableType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ConnectableObservableType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/SchedulerType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ObserverType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Subjects/SubjectType.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Create.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Generate.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DataStructures/Queue.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Reactive.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Materialize.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/AddRef.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DataStructures/Bag.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Using.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Debug.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Catch.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Switch.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/StartWith.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/Lock.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/RecursiveLock.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Sink.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Optional.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Scan.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/Completable+AndThen.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/Platform.Darwin.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Do.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Map.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Zip.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Skip.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Producer.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Buffer.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Timer.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DeprecationWarner.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Filter.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Never.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/AnyObserver.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Error.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Disposables/Disposables.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Errors.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/ElementAt.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Concat.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Repeat.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Subjects/AsyncSubject.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Subjects/PublishSubject.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Subjects/BehaviorSubject.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Subjects/ReplaySubject.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Event.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/SwiftSupport/SwiftSupport.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/TakeLast.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Multicast.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/First.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Just.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Timeout.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Window.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Rx.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/RxMutableBox.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/Platform/Platform.Linux.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/GroupBy.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Delay.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/ToArray.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence+Zip+arity.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/Empty.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift /Users/sunchuyue/Documents/test/RX_Product/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/sunchuyue/Documents/test/RX_Product/Pods/Target\ Support\ Files/RxSwift/RxSwift-umbrella.h /Users/sunchuyue/Documents/test/RX_Product/DerivedData/RX_Product/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RxSwift.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
/home/komal/projects/practice/target/debug/build/proc-macro2-b200893a3c4969f3/build_script_build-b200893a3c4969f3: /home/komal/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.1/build.rs
/home/komal/projects/practice/target/debug/build/proc-macro2-b200893a3c4969f3/build_script_build-b200893a3c4969f3.d: /home/komal/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.1/build.rs
/home/komal/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.1/build.rs:
|
D
|
import tango.io.Stdout;
import tango.math.Math;
void main()
{
int n = 2000000;
ulong s = 0;
bool primes[] = [false];
primes.length = n+1;
for (int i=2; i < n+1; i++)
primes[i] = true;
for (int i=2; i < sqrt(cast(real)(n+1)); i++)
if (primes[i])
for (int j=i*i; j < n+1; j += i)
primes[j] = false;
for (int i = 0; i < n+1; i++)
if (primes[i])
s += i;
Stdout.formatln("{}", s);
}
|
D
|
//taken from learning d by Michael Parker
template MyTemplate(T) {
struct ValWrapper {
T val;
void printVal() {
import std.stdio : writeln;
writeln("The type is ", typeid(T));
writeln("The value is ", val);
}
}
}
void main() {
MyTemplate!int.ValWrapper vw1;
MyTemplate!int.ValWrapper vw2;
vw1.val = 20;
vw2.val = 30;
vw1.printVal();
vw2.printVal();
}
|
D
|
/Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/SwiftSoup.build/Objects-normal/x86_64/XmlDeclaration.o : /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Node.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/DataNode.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/TextNode.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/DocumentType.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Validate.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/HtmlTreeBuilderState.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/TokeniserState.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Attribute.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/BooleanAttribute.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/TokenQueue.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Tag.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/String.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/BinarySearch.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/DataUtil.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/StringUtil.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Token.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/XmlDeclaration.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Connection.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Exception.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/SerializationException.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/HttpStatusException.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Pattern.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/SwiftSoup.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/UnicodeScalar.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/StreamReader.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/CharacterReader.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/TreeBuilder.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/XmlTreeBuilder.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/HtmlTreeBuilder.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/StringBuilder.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Cleaner.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Tokeniser.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Parser.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/QueryParser.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/ParseError.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/NodeTraversor.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Evaluator.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/CombiningEvaluator.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/StructuralEvaluator.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/CssSelector.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Collector.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/NodeVisitor.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Entities.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Attributes.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/ParseSettings.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Elements.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/OrderedSet.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Element.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/FormElement.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Comment.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Document.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/ParseErrorList.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Whitelist.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/CharacterExt.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/ArrayExt.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/SimpleDictionary.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/Target\ Support\ Files/SwiftSoup/SwiftSoup-umbrella.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/dyld.modulemap /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/SwiftSoup.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/SwiftSoup.build/Objects-normal/x86_64/XmlDeclaration~partial.swiftmodule : /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Node.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/DataNode.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/TextNode.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/DocumentType.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Validate.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/HtmlTreeBuilderState.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/TokeniserState.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Attribute.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/BooleanAttribute.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/TokenQueue.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Tag.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/String.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/BinarySearch.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/DataUtil.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/StringUtil.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Token.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/XmlDeclaration.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Connection.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Exception.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/SerializationException.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/HttpStatusException.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Pattern.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/SwiftSoup.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/UnicodeScalar.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/StreamReader.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/CharacterReader.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/TreeBuilder.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/XmlTreeBuilder.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/HtmlTreeBuilder.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/StringBuilder.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Cleaner.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Tokeniser.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Parser.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/QueryParser.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/ParseError.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/NodeTraversor.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Evaluator.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/CombiningEvaluator.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/StructuralEvaluator.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/CssSelector.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Collector.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/NodeVisitor.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Entities.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Attributes.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/ParseSettings.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Elements.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/OrderedSet.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Element.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/FormElement.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Comment.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Document.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/ParseErrorList.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Whitelist.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/CharacterExt.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/ArrayExt.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/SimpleDictionary.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/Target\ Support\ Files/SwiftSoup/SwiftSoup-umbrella.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/dyld.modulemap /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/SwiftSoup.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/SwiftSoup.build/Objects-normal/x86_64/XmlDeclaration~partial.swiftdoc : /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Node.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/DataNode.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/TextNode.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/DocumentType.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Validate.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/HtmlTreeBuilderState.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/TokeniserState.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Attribute.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/BooleanAttribute.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/TokenQueue.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Tag.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/String.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/BinarySearch.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/DataUtil.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/StringUtil.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Token.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/XmlDeclaration.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Connection.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Exception.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/SerializationException.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/HttpStatusException.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Pattern.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/SwiftSoup.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/UnicodeScalar.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/StreamReader.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/CharacterReader.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/TreeBuilder.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/XmlTreeBuilder.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/HtmlTreeBuilder.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/StringBuilder.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Cleaner.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Tokeniser.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Parser.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/QueryParser.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/ParseError.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/NodeTraversor.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Evaluator.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/CombiningEvaluator.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/StructuralEvaluator.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/CssSelector.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Collector.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/NodeVisitor.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Entities.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Attributes.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/ParseSettings.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Elements.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/OrderedSet.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Element.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/FormElement.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Comment.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Document.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/ParseErrorList.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Whitelist.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/CharacterExt.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/ArrayExt.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/SimpleDictionary.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/Target\ Support\ Files/SwiftSoup/SwiftSoup-umbrella.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/dyld.modulemap /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/SwiftSoup.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/SwiftSoup.build/Objects-normal/x86_64/XmlDeclaration~partial.swiftsourceinfo : /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Node.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/DataNode.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/TextNode.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/DocumentType.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Validate.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/HtmlTreeBuilderState.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/TokeniserState.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Attribute.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/BooleanAttribute.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/TokenQueue.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Tag.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/String.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/BinarySearch.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/DataUtil.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/StringUtil.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Token.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/XmlDeclaration.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Connection.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Exception.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/SerializationException.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/HttpStatusException.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Pattern.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/SwiftSoup.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/UnicodeScalar.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/StreamReader.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/CharacterReader.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/TreeBuilder.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/XmlTreeBuilder.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/HtmlTreeBuilder.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/StringBuilder.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Cleaner.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Tokeniser.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Parser.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/QueryParser.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/ParseError.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/NodeTraversor.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Evaluator.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/CombiningEvaluator.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/StructuralEvaluator.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/CssSelector.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Collector.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/NodeVisitor.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Entities.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Attributes.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/ParseSettings.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Elements.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/OrderedSet.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Element.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/FormElement.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Comment.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Document.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/ParseErrorList.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/Whitelist.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/CharacterExt.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/ArrayExt.swift /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/SwiftSoup/Sources/SimpleDictionary.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Pods/Target\ Support\ Files/SwiftSoup/SwiftSoup-umbrella.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/dyld.modulemap /Users/yongsangho/Desktop/Dev/carTalkProj/Project_CarTalk/carTalk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/SwiftSoup.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
module lib.physics.solver;
public {
import lib.physics.contact;
import lib.physics.rigidbody;
}
void solveContact(ref Contact c, float dt) pure nothrow @safe
{
RigidBody body1 = c.body1;
RigidBody body2 = c.body2;
//float bounce = min(body1.bounce, body2.bounce);
float bounce = body1.bounce;
Vector3f r1 = c.point - body1.position;
Vector3f r2 = c.point - body2.position;
Vector3f relativeVelocity; // by default initialization it is the Vector3f(0, 0, 0);
relativeVelocity += body1.linearVelocity + cross(body1.angularVelocity, r1);
relativeVelocity -= body2.linearVelocity + cross(body2.angularVelocity, r2);
/* Jacobian */
Vector3f n1 = c.normal;
Vector3f w1 = c.normal.cross(r1);
Vector3f n2 = -c.normal;
Vector3f w2 = -c.normal.cross(r2);
float initialVelocityProjection =
dot(n1, body1.linearVelocity)
+ dot(w1, body1.angularVelocity)
+ dot(n2, body2.linearVelocity)
+ dot(w2, body2.angularVelocity);
float velocityProjection = dot(relativeVelocity, c.normal);
/* Check if the bodies are already moving apart */
if (velocityProjection == -bounce * initialVelocityProjection)
return;
float a = dot (n1, body1.linearVelocity)
+ dot(n2, body2.linearVelocity)
+ dot(w1, body1.angularVelocity)
+ dot(w2, body2.angularVelocity)
+ bounce * initialVelocityProjection;
float b = dot(n1, n1 * body1.invMass)
+ dot(w1, w1 * body1.invInertia)
+ dot(n2, n2 * body2.invMass)
+ dot(w2, w2 * body2.invInertia);
float lambda = -a / b;
if(lambda < 0)
lambda = 0;
/* Speed correction */
body1.applyLinearVelocity(n1 * lambda * body1.invMass);
body1.applyAngularVelocity(w1 * lambda * body1.invInertia);
body2.applyLinearVelocity(n2 * lambda * body2.invMass);
body2.applyAngularVelocity(w2 * lambda * body2.invInertia);
}
|
D
|
module worldstate.time;
import std.string;
import std.exception;
immutable TICKS_PER_SECOND = 35; //Ticks per irl second
//immutable TicksPerMinute = 24; //This is then number of ticks required to increase world/game time with 1 minute
//For debug and quick day :)
immutable TicksPerMinute = 15;
immutable TicksPerHour = TicksPerMinute * 60;
immutable TicksPerDay = TicksPerMinute * 24;
mixin template WorldTimeClockCode() {
ulong worldTime = 0;
void updateTime() {
worldTime += 1;
}
//Returns
double getDayTime() const {
return 0.3;
//ulong localDayTime = worldTime % TicksPerDay;
//return (cast(double)localDayTime) / (cast(double)TicksPerDay);
}
string getDayTimeString() const {
double dayTime = getDayTime();
int hours = cast(int)floor(24*dayTime);
int minutes = cast(int)floor(24*60*dayTime);
minutes = minutes % 60;
return std.string.format("%02d:%02d", hours, minutes);
}
vec3d getSunPosition() {
auto sincos = expi(2*PI*getDayTime());
immutable double WorldSize = WorldSize;
immutable worldSize2 = 2 * WorldSize * 100;
return vec3d(worldSize2*sincos.im, 0, abs(worldSize2*sincos.re));
}
}
|
D
|
module wx.DC;
public import wx.common;
public import wx.Window;
public import wx.Pen;
public import wx.Brush;
public import wx.ArrayInt;
extern(D) class КонтекстУстройства : ВизОбъект
{
public this(ЦелУкз вхобъ);
~this();
public проц режимФона(ПСтильЗаливки значение);
public ПСтильЗаливки режимФона();
public проц кисть(Кисть значение);
public Кисть кисть();
public проц фон(Кисть значение);
public Кисть фон();
public проц рисуйБитмап(Битмап бмп, цел x, цел y, бул испМаску);
public проц рисуйБитмап(Битмап бмп, цел x, цел y);
public проц рисуйБитмап(Битмап бмп, Точка тчк, бул испМаску);
public проц рисуйБитмап(Битмап бмп, Точка тчк);
public проц рисуйЭллипс(цел x, цел y, цел ширь, цел высь);
public проц рисуйЭллипс(Точка тчк, wx.common.Размер рм);
public проц рисуйЭллипс(Прямоугольник прям);
public проц рисуйТочку(цел x, цел y);
public проц рисуйТочку(Точка тчк);
public проц рисуйЛинию(Точка p1, Точка p2);
public проц рисуйЛинию(цел x1, цел y1, цел x2, цел y2);
public проц рисуйПолигон(Точка[] точки);
public проц рисуйПолигон(Точка[] точки, цел ширсмещ, цел выссмещ);
public проц рисуйПолигон(Точка[] точки, цел ширсмещ, цел выссмещ, ПСтильЗаливки fill_style);
public проц рисуйПолигон(цел ч, Точка[] точки);
public проц рисуйПолигон(цел ч, Точка[] точки, цел ширсмещ, цел выссмещ);
public проц рисуйПолигон(цел ч, Точка[] точки, цел ширсмещ, цел выссмещ, ПСтильЗаливки fill_style);
public проц рисуйПрямоугольник(цел x1, цел y1, цел x2, цел y2);
public проц рисуйПрямоугольник(Точка тчк, wx.common.Размер рм);
public проц рисуйПрямоугольник(Прямоугольник прям);
public проц рисуйТекст(ткст текст, цел x, цел y);
public проц рисуйТекст(ткст текст, Точка поз);
public проц рисуйЗакруглённПрямоугольник(цел x, цел y, цел ширь, цел высь, дво radius);
public проц рисуйЗакруглённПрямоугольник(Точка тчк, wx.common.Размер рм, дво radius);
public проц рисуйЗакруглённПрямоугольник(Прямоугольник к, дво radius);
public проц перо(Перо значение);
public Перо перо();
public Цвет ппТекста();
public проц ппТекста(Цвет значение);
public Цвет зпТекста();
public проц зпТекста(Цвет значение);
public Шрифт шрифт();
public проц шрифт(Шрифт значение);
public проц очисть();
public проц дайПротяженностьТекста(ткст стр, out цел x, out цел y);
public проц дайПротяженностьТекста(ткст стр, out цел x, out цел y, out цел descent, out цел внешнееВступление, Шрифт theFont);
public проц удалиКлипОбласть();
public проц устКлипОбласть(цел x, цел y, цел ширь, цел высь);
public проц устКлипОбласть(Точка поз, wx.common.Размер размер);
public проц устКлипОбласть(Прямоугольник прям);
public проц устКлипОбласть(Регион рег);
public ПЛогика логФункция();
public проц логФункция(ПЛогика значение);
public проц стартрис();
public бул блит(цел цельХ, цел цельУ, цел ширь, цел высь, КонтекстУстройства исток, цел исхХ, цел исхУ, цел rop, бул испМаску, цел маскаИсхХ, цел маскаИсхУ);
public бул блит(цел цельХ, цел цельУ, цел ширь, цел высь, КонтекстУстройства исток);
public бул блит(цел цельХ, цел цельУ, цел ширь, цел высь, КонтекстУстройства исток, цел исхХ, цел исхУ);
public бул блит(цел цельХ, цел цельУ, цел ширь, цел высь, КонтекстУстройства исток, цел исхХ, цел исхУ, цел rop);
public бул блит(цел цельХ, цел цельУ, цел ширь, цел высь, КонтекстУстройства исток, цел исхХ, цел исхУ, цел rop, бул испМаску);
public бул блит(цел цельХ, цел цельУ, цел ширь, цел высь, КонтекстУстройства исток, цел исхХ, цел исхУ, цел rop, бул испМаску, цел маскаИсхХ);
public бул блит(Точка цельТчк, wx.common.Размер рм, КонтекстУстройства исток, Точка исхТчк, цел rop, бул испМаску, Точка маскаИсхТчк);
public бул блит(Точка цельТчк, wx.common.Размер рм, КонтекстУстройства исток, Точка исхТчк);
public бул блит(Точка цельТчк, wx.common.Размер рм, КонтекстУстройства исток, Точка исхТчк, цел rop);
public бул блит(Точка цельТчк, wx.common.Размер рм, КонтекстУстройства исток, Точка исхТчк, цел rop, бул испМаску);
public проц стоприс();
public бул залейФлуд(цел x, цел y, Цвет кол);
public бул залейФлуд(цел x, цел y, Цвет кол, цел стиль);
public бул залейФлуд(Точка тчк, Цвет кол);
public бул залейФлуд(Точка тчк, Цвет кол, цел стиль);
public бул дайПиксель(цел x, цел y, Цвет кол);
public бул дайПиксель(Точка тчк, Цвет кол);
public проц CrossHair(цел x, цел y);
public проц CrossHair(Точка тчк);
public проц рисуйДугу(цел x1, цел y1, цел x2, цел y2, цел xc, цел yc);
public проц рисуйДугу(Точка pt1, Точка pt2, Точка центр);
public проц рисуйЧекМарк(цел x, цел y, цел ширь, цел высь);
public проц рисуйЧекМарк(Прямоугольник прям);
public проц рисуйЭллиптичДугу(цел x, цел y, цел w, цел h, дво sa, дво ea);
public проц рисуйЭллиптичДугу(Точка тчк, wx.common.Размер рм, дво sa, дво ea);
public проц рисуйЛинии(Точка[] точки, цел ширсмещ, цел выссмещ);
public проц рисуйЛинии(Точка[] точки);
public проц рисуйЛинии(Точка[] точки, цел ширсмещ);
public проц рисуйКруг(цел x, цел y, цел radius);
public проц рисуйКруг(Точка тчк, цел radius);
public проц рисуйИконку(Пиктограмма пиктограмма, цел x, цел y);
public проц рисуйИконку(Пиктограмма пиктограмма, Точка тчк);
public проц рисуйВращТекст(ткст текст, цел x, цел y, дво угол);
public проц рисуйВращТекст(ткст текст, Точка тчк, дво угол);
public проц рисуйНадпись(ткст текст, Битмап рисунок, Прямоугольник прям, цел раскладка, цел индАксель, inout Прямоугольник rectBounding);
public проц рисуйНадпись(ткст текст, Битмап рисунок, Прямоугольник прям);
public проц рисуйНадпись(ткст текст, Битмап рисунок, Прямоугольник прям, цел раскладка);
public проц рисуйНадпись(ткст текст, Битмап рисунок, Прямоугольник прям, цел раскладка, цел индАксель);
public проц рисуйНадпись(ткст текст, Прямоугольник прям, цел раскладка, цел индАксель);
public проц рисуйНадпись(ткст текст, Прямоугольник прям);
public проц рисуйНадпись(ткст текст, Прямоугольник прям, цел раскладка);
public проц РисуйСплин(цел x1, цел y1, цел x2, цел y2, цел x3, цел y3);
public проц РисуйСплин(Точка[] точки);
public бул стартДок(ткст сообщение);
public проц стопДок();
public проц стартСтраницы();
public проц стопСтраницы();
public проц дайБоксОбрезки(out цел x, out цел y, out цел w, out цел h);
public проц дайБоксОбрезки(out Прямоугольник прям);
public проц дайПротяжённостьМногострочнТекста(ткст текст, out цел ширь, out цел высь, out цел выслиния, Шрифт шрифт);
public проц дайПротяжённостьМногострочнТекста(ткст текст, out цел ширь, out цел высь);
public проц дайПротяжённостьМногострочнТекста(ткст текст, out цел ширь, out цел высь, out цел выслиния);
public бул дайЧастичнПротяжённостиТекста(ткст текст, цел[] ширины);
public проц дайРазм(out цел ширь, out цел высь);
public Размер размер();
public проц дайРазмКП(out цел ширь, out цел высь);
public Размер размерКП();
public цел устрВЛогХ(цел x);
public цел устрВЛогУ(цел y);
public цел устрВЛогХОтн(цел x);
public цел устрВЛогУОтн(цел y);
public цел логВУстрХ(цел x);
public цел логВУстрУ(цел y);
public цел логВУстрХОтн(цел x);
public цел логВУстрУОтн(цел y);
public бул Ок();
public цел режимСоответствия();
public проц режимСоответствия(цел значение);
public проц дайПользовательскМасштаб(out дво x, out дво y);
public проц устПользовательскМасштаб(дво x, дво y);
public проц дайЛогичМасштаб(out дво x, out дво y);
public проц устЛогичМасштаб(дво x, дво y);
public проц дайЛогичИсхТочку(out цел x, out цел y);
public Точка логичИсхТочка();
public проц устЛогичИсхТочку(цел x, цел y);
public проц дайИсхТочкуУстройства(out цел x, out цел y);
public Точка исхТочкаУстройства();
public проц устИсхТочкуУстройства(цел x, цел y);
public проц устОриентациюОси(бул левоПравоХ, бул низВерхУ);
public проц вычислиОграничивающБокс(цел x, цел y);
public проц сбросьОграничивающБокс();
public цел минХ();
public цел максХ();
public цел минУ();
public цел максУ();
////public static ВизОбъект Нов(ЦелУкз укз);
}
//---------------------------------------------------------------------
extern(D) class КУОкна : КонтекстУстройства
{
public this(ЦелУкз вхобъ);
//private this(ЦелУкз вхобъ, бул памСобств);
public this();
public this(Окно ок);
public бул можноРисоватьБитмап();
public бул можноПолучитьПротяжённостьТекста();
public цел дайШиринуСим();
public цел дайВысотуСим();
public цел высьСим();
public цел ширьСим();
public override проц очисть();
public проц устШрифт(Шрифт шрифт);
public проц устПеро(Перо перо);
public проц устКисть(Кисть кисть);
public проц устФон(Кисть кисть);
public проц устЛогичФункцию(цел функц);
public проц устППТекста(Цвет цвет);
public проц устЗПТекста(Цвет цвет);
public проц устРежимФона(цел режим);
public проц устПалитру(Палитра палитра);
public Размер дайПНД();
public цел дайГлубину();
}
//---------------------------------------------------------------------
extern(D) class КУКлиента : КУОкна
{
public this(ЦелУкз вхобъ);
//private this(ЦелУкз вхобъ, бул памСобств);
public this();
public this(Окно окно);
}
//---------------------------------------------------------------------
extern(D) class КУРисования : КУОкна
{
public this(ЦелУкз вхобъ);
//private this(ЦелУкз вхобъ, бул памСобств);
public this();
public this(Окно окно);
}
|
D
|
make fit for, or change to suit a new purpose
adapt or conform oneself to new or different conditions
|
D
|
import vibe.appmain;
import vibe.core.core : runTask, sleep;
import vibe.core.log : logError, logInfo;
import vibe.core.net : TCPConnection, listenTCP;
import vibe.stream.operations : readLine;
import core.time;
shared static this()
{
// shows how to handle reading and writing of the TCP connection
// in separate tasks
listenTCP(7000, (conn) {
auto wtask = runTask!TCPConnection((conn) {
try {
while (conn.connected) {
conn.write("Hello, World!\r\n");
sleep(2.seconds());
}
} catch (Exception e) {
logError("Failed to write to client: %s", e.msg);
conn.close();
}
}, conn);
try {
while (!conn.empty) {
auto ln = cast(const(char)[])conn.readLine();
if (ln == "quit") {
logInfo("Client wants to quit.");
break;
} else logInfo("Got line: %s", ln);
}
} catch (Exception e) {
logError("Failed to read from client: %s", e.msg);
}
conn.close();
});
}
|
D
|
instance STRF_1135_Addon_Sklave(Npc_Default)
{
name[0] = NAME_Addon_Sklave;
guild = GIL_STRF;
id = 1135;
voice = 3;
flags = 0;
npcType = npctype_main;
aivar[AIV_NoFightParker] = TRUE;
aivar[AIV_IgnoresArmor] = TRUE;
B_SetAttributesToChapter(self,2);
fight_tactic = FAI_HUMAN_COWARD;
B_CreateAmbientInv(self);
B_SetNpcVisual(self,MALE,"Hum_Head_Psionic",Face_P_Tough_Torrez,BodyTex_P,ITAR_Slave);
Mdl_SetModelFatness(self,-1);
Mdl_ApplyOverlayMds(self,"Humans_Tired.mds");
B_GiveNpcTalents(self);
B_SetFightSkills(self,10);
daily_routine = Rtn_Start_1135;
};
func void Rtn_Start_1135()
{
TA_Stand_WP(8,0,23,0,"ADW_MINE_SKLAVENTOD_05");
TA_Stand_WP(23,0,8,0,"ADW_MINE_SKLAVENTOD_05");
};
|
D
|
/***********************************\
CONSOLECOMMANDS
\***********************************/
//========================================
// [intern] Class / Variables
//========================================
class CCItem {
var int fncID;
var string cmd;
};
instance CCItem@(CCItem);
const int _CC_List = 0; // Non-persistent record of all CCs
//========================================
// Check if CC is registered
//========================================
func int CC_Active(var func function) {
if (!_CC_List) {
return FALSE;
};
var int symID; symID = MEM_GetFuncID(function);
// Iterate over all registered CCs
var zCArray a; a = _^(_CC_List);
repeat(i, a.numInArray); var int i;
var CCItem cc; cc = _^(MEM_ReadIntArray(a.array, i));
if (cc.fncID == symID) {
return TRUE;
};
end;
return FALSE;
};
//========================================
// Remove CC
//========================================
func void CC_Remove(var func function) {
if (!_CC_List) {
return;
};
var int symID; symID = MEM_GetFuncID(function);
// Iterate over all registered CCs
var zCArray a; a = _^(_CC_List);
repeat(i, a.numInArray); var int i;
var int ccPtr; ccPtr = MEM_ReadIntArray(a.array, i);
var CCItem cc; cc = _^(ccPtr);
if (cc.fncID == symID) {
MEM_ArrayRemoveIndex(_CC_List, ccPtr);
MEM_Free(ccPtr);
};
end;
};
//========================================
// [intern] Register auto-completion
//========================================
func void CC_AutoComplete(var string commandPrefix, var string description) {
var int descPtr; descPtr = _@s(description);
var int comPtr; comPtr = _@s(commandPrefix);
const int call = 0;
if (CALL_Begin(call)) {
CALL_PtrParam(_@(descPtr));
CALL_PtrParam(_@(comPtr));
CALL__thiscall(_@(zcon_address_lego), zCConsole__Register);
call = CALL_End();
};
};
//========================================
// Register new CC
//========================================
func void CC_Register(var func function, var string commandPrefix, var string description) {
// Remove any left over handles (from LeGo 2.4.0) if they are unarchived from old game saves
if (hasHndl(CCItem@)) {
foreachHndl(CCItem@, _CCItem_deleteHandles);
};
// Only add if not already present
if (CC_Active(function)) {
return;
};
// Check validity of function signature
var int symID; symID = MEM_GetFuncID(function);
var zCPar_Symbol symb; symb = _^(MEM_GetSymbolByIndex(symID));
if ((symb.bitfield & zCPar_Symbol_bitfield_ele) != 1) || (symb.offset != (zPAR_TYPE_STRING >> 12)) {
MEM_Error(ConcatStrings("CONSOLECOMMANDS: Function has to have one parameter and needs to return a string: ",
symb.name));
return;
};
symb = _^(MEM_GetSymbolByIndex(symID+1));
if ((symb.bitfield & zCPar_Symbol_bitfield_type) != zPAR_TYPE_STRING) {
MEM_Error(ConcatStrings("CONSOLECOMMANDS: Function parameter needs to be a string: ", symb.name));
return;
};
// Register auto-completion
commandPrefix = STR_Upper(commandPrefix);
CC_AutoComplete(commandPrefix, description);
// Create CC object
var int ccPtr; ccPtr = create(CCItem@);
var CCItem cc; cc = _^(ccPtr);
cc.fncID = symID;
cc.cmd = commandPrefix;
// Initialize once
if (!_CC_List) {
_CC_List = MEM_ArrayCreate();
};
// Add CC to 'list'
MEM_ArrayInsert(_CC_List, ccPtr);
};
//========================================
// [intern] Engine hook
//========================================
func void _CC_Hook() {
if (!_CC_List) {
return;
};
// Get query entered into console
var int stackOffset; stackOffset = MEMINT_SwitchG1G2(/*2ach*/ 684, /*424h*/ 1060);
var string query; query = MEM_ReadString(MEM_ReadInt(ESP+stackOffset+4));
// Iterate over all registered CCs
var zCArray a; a = _^(_CC_List);
repeat(i, a.numInArray); var int i;
var CCItem cc; cc = _^(MEM_ReadIntArray(a.array, i));
// Check if entered query starts with defined command
if (STR_StartsWith(query, cc.cmd)) {
// Cut off everything after the command
var int cmdLen; cmdLen = STR_Len(cc.cmd);
var int qryLen; qryLen = STR_Len(query);
STR_SubStr(query, cmdLen, qryLen-cmdLen); // Leave on data stack
// Call the CC function (argument already on data stack)
MEM_CallByID(cc.fncID);
var string ret; ret = MEM_PopStringResult();
// If the CC function returns a valid string, stop the loop
// This additional check allows multiple CCs with the same command
if (!Hlp_StrCmp(ret, "")) {
MEM_WriteString(EAX, ret);
break;
};
};
end;
};
//=======================================
// Simple LeGo console command
//=======================================
func string CC_LeGo(var string _) {
var int s; s = SB_New();
SB(LeGO_Version);
SBc(10); SBc(13);
_LeGo_Flags;
MEM_Call(LeGo_FlagsHR);
SB(MEM_PopStringResult());
var string ret; ret = SB_ToString();
SB_Destroy();
return ret;
};
//========================================
// [intern] Old game save compatibility
//========================================
// ConsoleCommands have been rewritten to not be stored to game saves. To ensure compatibility with old game saves from
// LeGo 2.4.0, this function is necessary to prevent errors on unarchiving, because 'fncID' was stored as string.
func void CCItem_Unarchiver(var CCItem this) {};
func int _CCItem_deleteHandles(var int hndl) {
delete(hndl);
return rContinue;
};
|
D
|
// Copyright © 2011, Jakob Bornecrantz. All rights reserved.
// See copyright notice in src/charge/charge.d (GPLv2 only).
/**
* Source file for Texture (s).
*/
module charge.gfx.texture;
import std.string : format, toString;
import charge.sys.resource;
import charge.sys.logger;
import charge.sys.file;
import charge.math.ints;
import charge.math.color;
import charge.math.picture;
import charge.util.dds;
import charge.gfx.gl;
import charge.gfx.target;
/**
* 2D Texture with selectable filtering.
*
* @ingroup Resource
*/
class Texture : Resource
{
public:
enum Filter {
Nearest,
NearestLinear,
Linear,
LinearNone,
}
const string uri = "tex://";
protected:
uint w;
uint h;
GLuint glId;
GLuint glTarget;
private:
mixin Logging;
public:
uint id()
{
return glId;
}
static Texture opCall(Pool p, string filename)
in {
assert(p !is null);
assert(filename !is null);
}
body {
if (filename is null)
return null;
auto r = p.resource(uri, filename);
auto t = cast(Texture)r;
if (r !is null) {
assert(t !is null);
return t;
}
if (filename[$ - 4 .. $] == ".dds")
return fromDdsFile(p, filename);
else
return fromPicture(p, filename);
}
static Texture opCall(Picture pic)
{
auto id = textureFromPicture(pic);
auto t = new Texture(null, null, GL_TEXTURE_2D, id, pic.width, pic.height);
t.filter = Texture.Filter.Linear;
return t;
}
static Texture opCall(Pool p, string name, Picture pic)
in {
assert(p !is null);
assert(name !is null);
}
body {
auto id = textureFromPicture(pic);
auto t = new Texture(p, name, GL_TEXTURE_2D, id, pic.width, pic.height);
t.filter = Texture.Filter.Linear;
return t;
}
uint width()
{
return w;
}
uint height()
{
return h;
}
void filter(Filter f)
{
GLenum mag, min, clamp;
GLfloat aniso;
glBindTexture(glTarget, glId);
switch(f) {
case Filter.Nearest:
mag = GL_NEAREST;
min = GL_NEAREST;
clamp = GL_REPEAT;
aniso = 1.0f;
break;
case Filter.NearestLinear:
mag = GL_NEAREST;
min = GL_LINEAR_MIPMAP_LINEAR;
clamp = GL_REPEAT;
glGetFloatv(0x84FF, &aniso);
break;
case Filter.LinearNone:
mag = GL_LINEAR;
min = GL_LINEAR;
clamp = GL_REPEAT;
aniso = 1.0f;
break;
default:
mag = GL_LINEAR;
min = GL_LINEAR_MIPMAP_LINEAR;
clamp = GL_REPEAT;
//glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &aniso);
glGetFloatv(0x84FF, &aniso);
break;
}
glTexParameterf(glTarget, 0x84FE, aniso);
glTexParameteri(glTarget, GL_TEXTURE_WRAP_S, clamp);
glTexParameteri(glTarget, GL_TEXTURE_WRAP_T, clamp);
glTexParameterf(glTarget, GL_TEXTURE_MAG_FILTER, mag);
glTexParameterf(glTarget, GL_TEXTURE_MIN_FILTER, min);
//glTexParameterf(glTarget, GL_TEXTURE_MAX_ANISOTROPY_EXT, aniso);
glTexParameterf(glTarget, GL_TEXTURE_MAG_FILTER, mag);
glTexParameterf(glTarget, GL_TEXTURE_MIN_FILTER, min);
glBindTexture(glTarget, 0);
}
package:
this(Pool p, string name, GLuint target)
{
super(p, uri, name);
this.glTarget = target;
}
this(Pool p, string name, GLuint target, uint id, uint w, uint h)
{
this(p, name, target);
this.glId = id;
this.w = w;
this.h = h;
}
~this()
{
}
private:
static Texture fromPicture(Pool p, string filename)
{
Texture t;
auto pic = Picture(p, filename);
/* Error printing already taken care of */
if (pic is null)
return null;
scope(exit)
reference(&pic, null);
auto id = textureFromPicture(pic);
l.info("Loaded %s", filename);
t = new Texture(p, filename, GL_TEXTURE_2D, id, pic.width, pic.height);
t.filter = Texture.Filter.Linear;
return t;
}
static int textureFromPicture(Picture pic)
{
int glFormat = GL_RGBA;
int glComponents = 4;
float a;
uint id;
glGenTextures(1, cast(GLuint*)&id);
glBindTexture(GL_TEXTURE_2D, id);
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
glTexImage2D(
GL_TEXTURE_2D, //target
0, //level
glComponents, //internalformat
pic.width, //width
pic.height, //height
0, //border
glFormat, //format
GL_UNSIGNED_BYTE, //type
pic.pixels); //pixels
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_FALSE);
return id;
}
static Texture fromDdsFile(Pool p, string filename)
{
auto file = p.load(filename);
if (file is null)
return null;
scope(exit)
delete file;
DdsHeader* dds;
void[][] data;
try {
auto mem = file.peekMem;
dds = cast(DdsHeader*)mem.ptr;
data = extractBytes(mem);
} catch (Exception e) {
l.warn("%s: %s", e.classinfo, e);
return null;
}
GLuint id = textureFromDdsDataDXT(dds, data);
auto t = new Texture(p, filename, GL_TEXTURE_2D, id, dds.width, dds.height);
t.filter = Texture.Filter.Linear;
return t;
}
static int textureFromDdsDataDXT(DdsHeader* dds, void[][] data)
{
GLuint internalFormat;
GLuint id;
switch(dds.pf.fourCC) {
case "DXT1":
internalFormat = GL_COMPRESSED_RGB_S3TC_DXT1_EXT;
break;
case "DXT5":
internalFormat = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
break;
default:
l.warn("Unknown fourCC format");
}
glGenTextures(1, cast(GLuint*)&id);
glBindTexture(GL_TEXTURE_2D, id);
foreach (int i, d; data)
glCompressedTexImage2DARB(
GL_TEXTURE_2D, //target
i, //level
internalFormat, //internalformat
minify(dds.width, i), //width
minify(dds.height, i), //height
0, //border
cast(GLuint)d.length, //imageSize
d.ptr); //pixels
glBindTexture(GL_TEXTURE_2D, 0);
return id;
}
}
/**
* 2D Texture with selectable filtering.
*
* @ingroup Resource
*/
class ColorTexture : Texture
{
private:
mixin Logging;
public:
static ColorTexture opCall(Pool p, Color3f c)
{
return opCall(p, Color4f(c));
}
static ColorTexture opCall(Pool p, Color4f c)
{
Color4b rgba;
rgba.r = cast(ubyte)(c.r * 255);
rgba.g = cast(ubyte)(c.g * 255);
rgba.b = cast(ubyte)(c.b * 255);
rgba.a = cast(ubyte)(c.a * 255);
return opCall(p, rgba);
}
static ColorTexture opCall(Pool p, Color4b c)
{
auto path = "charge/gfx/texture/color";
auto str = format("%s%02x%02x%02x%02x", path, c.r, c.g, c.b, c.a);
auto r = p.resource(uri, str);
auto t = cast(ColorTexture)r;
if (r !is null) {
assert(t !is null);
return t;
}
l.info("created %s", str);
return new ColorTexture(p, str, c);
}
protected:
this(Pool p, string str, Color4b c)
{
GLuint id;
glGenTextures(1, cast(GLuint*)&id);
glBindTexture(GL_TEXTURE_2D, id);
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
glTexImage2D(
GL_TEXTURE_2D, //target
0, //level
4, //internalformat
1, //width
1, //height
0, //border
GL_RGBA, //format
GL_UNSIGNED_BYTE, //type
c.ptr); //pixels
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_FALSE);
glBindTexture(GL_TEXTURE_2D, 0);
super(p, str, GL_TEXTURE_2D, id, 1, 1);
filter = Texture.Filter.Nearest;
}
}
/**
* 2D Texture with selectable filtering.
*
* @ingroup Resource
*/
class DynamicTexture : Texture
{
public:
static DynamicTexture opCall()
{
return new DynamicTexture(null, null);
}
static DynamicTexture opCall(Pool p, string name)
in {
assert(p !is null);
assert(name !is null);
}
body {
if (name is null)
return null;
auto r = p.resource(uri, name);
auto t = cast(DynamicTexture)r;
if (r !is null) {
assert(t !is null);
return t;
}
return new DynamicTexture(p, name);
}
void update(uint id, uint w, uint h)
{
if (glIsTexture(this.glId) && id != glId)
glDeleteTextures(1, &this.glId);
this.glId = id;
this.w = w;
this.h = h;
}
protected:
this(Pool p, string name)
{
super(p, name, GL_TEXTURE_2D);
}
}
/**
* Texture that wraps another texture, used to swap out textures on the fly.
*
* @ingroup Resource
*/
class WrappedTexture : Texture
{
private:
Texture tex;
public:
static WrappedTexture opCall(Texture t)
{
return new WrappedTexture(null, null, t);
}
/**
* Wraps a texture, if name is already in pool returns
* it instead and updates it with t.
*/
static WrappedTexture opCall(Pool p, string name, Texture t)
in {
assert(p !is null);
assert(t !is null);
assert(name !is null);
assert(cast(WrappedTexture)t is null);
}
body {
if (name is null)
return null;
auto r = p.resource(uri, name);
auto wt = cast(WrappedTexture)r;
if (r !is null) {
assert(t !is null);
wt.update(t);
return wt;
}
return new WrappedTexture(p, name, t);
}
~this()
{
reference(&tex, null);
}
void update(Texture tex)
in {
assert(tex !is null);
assert(cast(WrappedTexture)tex is null);
}
body {
reference(&this.tex, tex);
}
uint width()
{
return tex.width;
}
uint height()
{
return tex.height;
}
uint id()
{
return tex.glId;
}
void filter(Filter)
{
assert(false, "filtering not supported");
}
protected:
this(Pool p, string name, Texture tex)
in {
assert(tex !is null);
assert(cast(WrappedTexture)tex is null);
}
body {
reference(&this.tex, tex);
super(p, name, 0);
}
}
/**
* 2D Texture usable as a target as well, with selectable filtering.
*
* @ingroup Resource
*/
class TextureTarget : Texture, RenderTarget
{
private:
GLuint fbo;
public:
static TextureTarget opCall(uint w, uint h)
{
return new TextureTarget(null, null, w, h);
}
static TextureTarget opCall(Pool p, string name, uint w, uint h)
in {
assert(p !is null);
assert(name !is null);
}
body {
return new TextureTarget(p, name, w, h);
}
~this()
{
if (fbo != 0)
glDeleteFramebuffersEXT(1, &fbo);
}
void setTarget()
{
static GLenum buffers[1] = [
GL_COLOR_ATTACHMENT0_EXT,
];
gluFrameBufferBind(fbo, buffers, w, h);
}
uint width()
{
return w;
}
uint height()
{
return h;
}
protected:
this(Pool p, string name, uint w, uint h)
{
GLuint colorTex;
if (!GL_EXT_framebuffer_object)
throw new Exception("GL_EXT_framebuffer_object not supported");
GLint colorFormat = GL_RGBA8;
glGenTextures(1, &colorTex);
glGenFramebuffersEXT(1, &fbo);
scope(failure) {
glDeleteFramebuffersEXT(1, &fbo);
glDeleteTextures(1, &colorTex);
fbo = colorTex = 0;
}
glBindTexture(GL_TEXTURE_2D, colorTex);
glTexImage2D(GL_TEXTURE_2D, 0, colorFormat, w, h, 0, GL_RGBA, GL_FLOAT, null);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glBindTexture(GL_TEXTURE_2D, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, colorTex, 0);
auto status = gluCheckFramebufferStatus();
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
if (status !is null)
throw new Exception(format("TextureTarget framebuffer not complete (%s) :(", status));
super(p, name, GL_TEXTURE_2D, colorTex, w, h);
}
}
/**
* Texture Array with selectable filtering.
*
* @ingroup Resource
*/
class TextureArray : Texture
{
public:
uint length;
private:
mixin Logging;
static bool checked;
static bool checkStatus;
public:
static bool check()
{
if (checked)
return checkStatus;
checked = true;
try {
if (!GL_EXT_texture_array)
throw new Exception("GL_EXT_texture_array not supported");
// Windows Intel driver lie
version (Windows) {
auto str = .toString(glGetString(GL_VENDOR));
if (str == "Intel")
throw new Exception("Intel drivers are blacklisted");
}
} catch (Exception e) {
l.info("Is not capable of using texture arrays");
l.bug(e.toString());
return false;
}
l.info("Can use TextureArrays");
checkStatus = true;
return true;
}
static TextureArray fromTileMap(Pool p, string name, int num_w, int num_h)
{
if (!check())
return null;
auto pic = Picture(p, name);
/* Error printing already taken care of */
if (pic is null)
return null;
scope(exit)
reference(&pic, null);
return fromTileMap(p, name, pic, num_w, num_h);
}
static TextureArray fromTileMap(Picture pic, int num_w, int num_h)
{
return fromTileMap(null, null, pic, num_w, num_h);
}
protected:
this(Pool p, string name, uint id, uint w, uint h, uint length)
{
super(p, name, GL_TEXTURE_2D_ARRAY_EXT, id, w, h);
this.length = length;
}
static TextureArray fromTileMap(Pool p, string name, Picture pic, int num_w, int num_h)
{
int glFormat = GL_RGBA;
int glComponents = 4;
uint tile_w, tile_h;
uint length;
GLuint id;
if (!check())
return null;
tile_w = pic.width / num_w;
tile_h = pic.height / num_h;
if (pic.width % tile_w || pic.height % tile_h) {
l.warn("image size not even dividable with tile size (%sx%s) (%s, %s)",
pic.width, pic.height, num_w, num_h);
return null;
}
length = num_w * num_h;
glGenTextures(1, cast(GLuint*)&id);
glBindTexture(GL_TEXTURE_2D_ARRAY_EXT, id);
glTexImage3D(
GL_TEXTURE_2D_ARRAY_EXT, //target
0, //level
glComponents, //internalformat
tile_w, //width
tile_h, //height
length, //depth
0, //border
glFormat, //format
GL_UNSIGNED_BYTE, //type
null); //pixels
glPixelStorei(GL_UNPACK_ROW_LENGTH, pic.width);
for (int y; y < num_h; y++) {
int *ptr = cast(int*)pic.pixels + pic.width * tile_h * y;
for (int x; x < num_w; x++, ptr += tile_w) {
glTexSubImage3D(
GL_TEXTURE_2D_ARRAY_EXT, //target
0, //level
0, //xoffset
0, //yoffset
x + y * num_w, //zoffset
tile_w, //width
tile_h, //height
1, //depth
glFormat, //format
GL_UNSIGNED_BYTE, //type
ptr); //pixels
}
}
glGenerateMipmapEXT(GL_TEXTURE_2D_ARRAY_EXT);
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
string new_name;
if (name !is null) {
new_name = name ~ "?array";
l.info("Loaded %s", new_name);
}
auto t = new TextureArray(p, new_name,
id, pic.width, pic.height, length);
t.filter = Texture.Filter.Linear;
return t;
}
}
|
D
|
/Users/student/Desktop/IAK/StackKIA/StackKIA/DerivedData/StackKIA/Build/Intermediates.noindex/StackKIA.build/Debug-iphonesimulator/StackKIA.build/Objects-normal/x86_64/AppDelegate.o : /Users/student/Desktop/IAK/StackKIA/StackKIA/StackKIA/AppDelegate.swift /Users/student/Desktop/IAK/StackKIA/StackKIA/StackKIA/StackKIATableViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/student/Desktop/IAK/StackKIA/StackKIA/DerivedData/StackKIA/Build/Intermediates.noindex/StackKIA.build/Debug-iphonesimulator/StackKIA.build/Objects-normal/x86_64/AppDelegate~partial.swiftmodule : /Users/student/Desktop/IAK/StackKIA/StackKIA/StackKIA/AppDelegate.swift /Users/student/Desktop/IAK/StackKIA/StackKIA/StackKIA/StackKIATableViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/student/Desktop/IAK/StackKIA/StackKIA/DerivedData/StackKIA/Build/Intermediates.noindex/StackKIA.build/Debug-iphonesimulator/StackKIA.build/Objects-normal/x86_64/AppDelegate~partial.swiftdoc : /Users/student/Desktop/IAK/StackKIA/StackKIA/StackKIA/AppDelegate.swift /Users/student/Desktop/IAK/StackKIA/StackKIA/StackKIA/StackKIATableViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
alias TypeTuple(T...) = T;
class A { }
class B : A { }
class C : B { }
/***************************************/
template Foo(int a, int b, int c)
{
const int Foo = 1;
}
template Foo(A...)
{
const int Foo = 2;
}
void test1()
{
int y = Foo!(1,2,3);
assert(y == 1);
y = Foo!(1,2);
assert(y == 2);
y = Foo!(1,2,3,4);
assert(y == 2);
}
/***************************************/
template Foo2(int a, int b, int c)
{
const int Foo2 = 1;
}
template Foo2(int a, int b, int c, A...)
{
const int Foo2 = 2;
}
void test2()
{
int y = Foo2!(1,2,3);
assert(y == 1);
y = Foo2!(1,2,3,4);
assert(y == 2);
}
/***************************************/
void bar3(int x, int y)
{
assert(x == 2);
assert(y == 3);
}
template Foo3(T, A...)
{
int Foo3(T t, A a)
{
assert(A.length == 2);
assert(a.length == 2);
bar3(a);
assert([a] == [2, 3]);
assert([cast(double)a] == [2.0, 3.0]);
assert(a[0] == 2);
assert(a[1] == 3);
assert(a[$ - 2] == 2);
assert(a[$ - 1] == 3);
static if (1 || a[6])
assert(1);
assert([a[]] == [2, 3]);
assert([a[0 .. $]] == [2, 3]);
assert([a[0 .. $ - 1]] == [2]);
return 3;
}
}
void test3()
{
int y = Foo3(1,2,3);
assert(y == 3);
}
/***************************************/
void foo4(A...)()
{
int[] ai;
int[] aa;
aa = null;
foreach (a; A)
{
aa ~= a;
}
assert(aa == [7,4,9]);
aa = null;
foreach (int a; A)
{
aa ~= a;
}
assert(aa == [7,4,9]);
ai = null;
aa = null;
foreach (int i, a; A)
{
ai ~= i;
aa ~= a;
}
assert(ai == [0,1,2]);
assert(aa == [7,4,9]);
ai = null;
aa = null;
foreach_reverse (uint i, a; A)
{
ai ~= i;
aa ~= a;
}
assert(ai == [2,1,0]);
assert(aa == [9,4,7]);
ai = null;
aa = null;
foreach_reverse (i, a; A)
{
ai ~= i;
aa ~= a;
}
assert(ai == [2,1,0]);
assert(aa == [9,4,7]);
ai = null;
aa = null;
foreach (int i, a; A)
{
ai ~= i;
aa ~= a;
if (i == 1)
break;
continue;
}
assert(ai == [0,1]);
assert(aa == [7,4]);
}
void test4()
{
foo4!(7,4,9)();
}
/***************************************/
int a12(TypeTuple!(int, int) t)
{
return t[0] + t[1];
}
int b12(TypeTuple!(TypeTuple!(int), TypeTuple!(int)) t)
{
return t[0] + t[1];
}
int c12(TypeTuple!(TypeTuple!(int), TypeTuple!(TypeTuple!(), int), TypeTuple!()) t)
{
return t[0] + t[1];
}
void test12()
{
assert(a12(1, 2) == 3);
assert(b12(1, 2) == 3);
assert(c12(1, 2) == 3);
}
/***************************************/
int plus13(TypeTuple!(int, long, float)[0 .. 2] t)
{
typeof(t)[0] e;
assert(typeid(typeof(e)) == typeid(int));
typeof(t)[1] f;
assert(typeid(typeof(f)) == typeid(long));
return t[0] + cast(int)t[1];
}
void test13()
{
assert(plus13(5, 6) == 11);
}
/***************************************/
int plus14(TypeTuple!(int, long, float)[0 .. $ - 1] t)
{
typeof(t)[$ - 2] e;
assert(typeid(typeof(e)) == typeid(int));
typeof(t)[1] f;
assert(typeid(typeof(f)) == typeid(long));
return t[0] + cast(int)t[1];
}
void test14()
{
assert(plus14(5, 6) == 11);
}
/***************************************/
void returnAndArgs(T, U...) (T delegate(U) dg)
{
static if (U.length == 0)
assert(dg() == 0);
else static if (U.length == 1)
assert(dg(false) == 1);
else
assert(dg(false, 63L) == 2);
}
void test24()
{
returnAndArgs(delegate int(){ return 0; });
returnAndArgs(delegate int(bool b){ return 1; });
returnAndArgs(delegate int(bool b, long c){ return 2; });
}
/***************************************/
void test28()
{
alias TypeTuple!(int, long, double) TL;
foreach (int i, T; TL)
{
switch (i)
{
case 0: assert(is(T == int)); break;
case 1: assert(is(T == long)); break;
case 2: assert(is(T == double)); break;
default:assert(0);
}
}
}
/***************************************/
template g32(alias B)
{
int g32 = 2;
}
int f32(A...)(A a)
{
return g32!(a);
}
void test32()
{
assert(f32(4) == 2);
}
/***************************************/
struct S34
{
int x;
long y;
double z;
}
void foo34(int x, long y, double z)
{
assert(x == 3);
assert(y == 8);
assert(z == 6.8);
}
void test34()
{
S34 s;
s.x = 3;
s.y = 8;
s.z = 6.8;
foo34(s.tupleof);
}
/***************************************/
alias TypeTuple!(int, long, double) TL35;
struct S35
{
TL35 tl;
}
void foo35(int x, long y, double z)
{
assert(x == 3);
assert(y == 8);
assert(z == 6.8);
}
void test35()
{
S35 s;
s.tl[0] = 3;
s.tl[1] = 8;
s.tl[2] = 6.8;
foo35(s.tupleof);
foo35(s.tl);
}
/***************************************/
alias TypeTuple!(int, long, double) TL36;
class C36
{
TL36 tl;
}
void foo36(int x, long y, double z)
{
assert(x == 3);
assert(y == 8);
assert(z == 6.8);
}
void test36()
{
C36 s = new C36;
s.tl[0] = 3;
s.tl[1] = 8;
s.tl[2] = 6.8;
foo36(s.tupleof);
foo36(s.tl);
}
/***************************************/
alias TypeTuple!(int, long, double) TL37;
class C37
{
TL37 tl;
}
void foo37(int x, long y, double z)
{
assert(x == 3);
assert(y == 8);
assert(z == 6.8);
}
void test37()
{
C37 s = new C37;
s.tl[0] = 3;
s.tl[1] = 8;
s.tl[2] = 6.8;
foo37(s.tupleof);
TL37 x;
assert(x[0] == 0);
x[0] = 3;
assert(x[0] == 3);
assert(x[1] == 0);
x[1] = 8;
x[2] = 6.8;
foo37(x);
}
/***************************************/
interface I38A { }
interface I38B { }
alias TypeTuple!(I38A, I38B) IL38;
class C38 : IL38
{
}
void test38()
{
auto c = new C38;
}
/***************************************/
void test39()
{
static const string a = "\x01";
static const char b = a[0];
static const string c = "test";
static assert(c[a[0]] == 'e');
alias TypeTuple!(ulong,uint,ushort,ubyte) tuple;
static assert(is(tuple[1] == uint));
static assert(is(tuple[a[0]] == uint));
}
/***************************************/
struct Foo45
{
static TypeTuple!(int) selements1;
TypeTuple!(int) elements1;
static TypeTuple!() selements0;
TypeTuple!() elements0;
}
void test45()
{
Foo45 foo;
static assert(Foo45.selements1.length == 1);
static assert(Foo45.elements1.length == 1);
static assert(Foo45.selements0.length == 0);
static assert(Foo45.elements0.length == 0);
static assert(foo.selements1.length == 1);
static assert(foo.elements1.length == 1);
static assert(foo.selements0.length == 0);
static assert(foo.elements0.length == 0);
}
/***************************************/
template Tuple46(E ...) { alias E Tuple46; }
alias Tuple46!(float, float, 3) TP46;
alias TP46[1..$] TQ46;
void test46()
{
TQ46[0] f = TQ46[1];
assert(is(typeof(f) == float));
assert(f == 3);
}
/***************************************/
template Foo47(T, Args...)
{
void bar(Args args, T t)
{
}
}
void test47()
{
alias Foo47!(int) aFoo;
}
/***************************************/
template Tuple48(E...)
{
alias E Tuple48;
}
void VarArg48(T...)(T args)
{
}
void test48()
{
VarArg48( );
VarArg48( Tuple48!(1,2,3) );
VarArg48( Tuple48!() );
}
/***************************************/
alias TypeTuple!(int, long) TX49;
void foo49(TX49 t)
{
TX49 s;
s = t;
assert(s[0] == 1);
assert(s[1] == 2);
}
void test49()
{
foo49(1, 2);
}
/***************************************/
void foo51(U...)(int t, U u)
{
assert(t == 1);
assert(u[0] == 2);
assert(u[1] == 3);
}
void bar51(U...)(U u, int t)
{
assert(u[0] == 1);
assert(u[1] == 2);
assert(t == 3);
}
void abc51(U...)(int s, U u, int t)
{
assert(s == 1);
assert(u[0] == 2);
assert(u[1] == 3);
assert(t == 4);
}
void test51()
{
foo51(1, 2, 3);
bar51(1, 2, 3);
bar51!(int, int)(1, 2, 3);
abc51(1,2,3,4);
}
/***************************************/
string to55(U, V)(V s) { return "he"; }
private S wyda(S, T...)(T args)
{
S result;
foreach (i, arg; args)
{
result ~= to55!(S)(args[i]);
}
return result;
}
string giba(U...)(U args)
{
return wyda!(string, U)(args);
}
void test55()
{
assert(giba(42, ' ', 1.5, ": xyz") == "hehehehe");
}
/***************************************/
private template implicitlyConverts(U, V)
{
enum bool implicitlyConverts = V.sizeof >= U.sizeof
&& is(typeof({U s; V t = s;}()));
}
T to56(T, S)(S s)
if (!implicitlyConverts!(S, T) /*&& isSomeString!(T)
&& isSomeString!(S)*/)
{
return T.init;
}
void test56()
{
auto x = to56!(int)("4");
assert(x == 0);
assert(!implicitlyConverts!(const(char)[], string));
assert(implicitlyConverts!(string, const(char)[]));
}
/***************************************/
struct A57(B...) {}
void test57()
{
alias A57!(int, float) X;
static if (!is(X Y == A57!(Z), Z...))
{
static assert(false);
}
}
/***************************************/
struct A58(B...) {}
void test58()
{
alias A58!(int, float) X;
static if (!is(X Y == A58!(Z), Z...))
{
static assert(false);
}
}
/***************************************/
struct Tuple59(T...)
{
T field;
}
template reduce(fun...)
{
alias Reduce!(fun).reduce reduce;
}
template Reduce(fun...)
{
Tuple59!(double, double)
reduce(Range)(Range r)
{
typeof(Tuple59!(double,double).field)[0] y;
typeof(typeof(return).field)[0] x;
Tuple59!(double, double) s;
return s;
}
}
void test59()
{
double[] a = [ 3.0, 4, 7, 11, 3, 2, 5 ];
static double sum(double a, double b) {return a + b;}
auto r = reduce!((a, b) { return a + b; },
(a, b) { return a + b; })(a);
}
/***************************************/
template tuple60(T...)
{
alias T tuple60;
}
template Foo60(S : void delegate(tuple60!(int))) {}
template Foo60(S : void delegate(tuple60!(int, int))) {}
alias Foo60!(void delegate(int)) Bar60;
void test60()
{
}
/***************************************/
template TypeTuple61(TList...){
alias TList TypeTuple61;
}
template List61(lst...) { alias lst list; }
alias TypeTuple61!(List61!(void)) A61;
alias TypeTuple61!(A61[0].list) B61;
void test61()
{
}
/***************************************/
template Tuple63(T...){
alias T Tuple63;
}
// Bugzilla 3336
static assert(!is(int[ Tuple63!(int, int) ]));
void test63()
{
}
/***************************************/
template Tuple1411(T ...) { alias T Tuple1411; }
void test1411()
{
int delegate(ref Tuple1411!(int, char[], real)) dg; // (*)
int f(ref int a, ref char[] b, ref real c) { return 77; }
dg = &f;
}
/***************************************/
// Bugzilla 4444
void test4444()
{
alias TypeTuple!(1) index;
auto arr = new int[4];
auto x = arr[index]; // error
}
/***************************************/
// 13864
struct Tuple13864(T...)
{
T expand;
alias expand this;
}
auto tuple13864(T...)(T args)
{
return Tuple13864!T(args);
}
void test13864()
{
int[] x = [2,3,4];
auto y = x[tuple13864(0).expand];
assert(y == 2);
}
/***************************************/
// 4884
struct A4884(T...)
{
void foo(T) {}
void bar(bool, T) {}
}
void test4884()
{
auto a1 = A4884!(int)();
auto a2 = A4884!(int, long)();
}
/***************************************/
// 4920
struct Test4920(parameters_...)
{
alias parameters_ parameters;
}
void test4920()
{
Test4920!(10, 20, 30) test;
static assert(typeof(test).parameters[1] == 20); // okay
static assert( test .parameters[1] == 20); // (7)
}
/***************************************/
// 4940
template Tuple4940(T...)
{
alias T Tuple4940;
}
struct S4940
{
Tuple4940!(int, int) x;
this(int) { }
}
void test4940()
{
auto w = S4940(0).x;
}
//----
struct S4940add
{
string s;
long x;
}
ref S4940add get4940add(ref S4940add s){ return s; }
void test4940add()
{
S4940add s;
get4940add(s).tupleof[1] = 20;
assert(s.x == 20);
}
/***************************************/
// 6530
struct S6530
{
int a, b, c;
}
struct HasPostblit6530
{
this(this) {} // Bug goes away without this.
}
auto toRandomAccessTuple6530(T...)(T input, HasPostblit6530 hasPostblit)
{
return S6530(1, 2, 3);
}
void doStuff6530(T...)(T args)
{
HasPostblit6530 hasPostblit;
// Bug goes away without the .tupleof.
auto foo = toRandomAccessTuple6530(args, hasPostblit).tupleof;
}
void test6530()
{
doStuff6530(1, 2, 3);
}
/***************************************/
import core.stdc.stdarg;
extern(C)
void func9495(int a, string format, ...)
{
va_list ap;
va_start(ap, format);
auto a1 = va_arg!int(ap);
auto a2 = va_arg!int(ap);
auto a3 = va_arg!int(ap);
assert(a1 == 0x11111111);
assert(a2 == 0x22222222);
assert(a3 == 0x33333333);
va_end(ap);
}
void test9495()
{
func9495(0, "", 0x11111111, 0x22222222, 0x33333333);
}
/***************************************/
void copya(int a, string format, ...)
{
va_list ap;
va_start(ap, format);
va_list ap2;
va_copy(ap2, ap);
auto a1 = va_arg!int(ap);
auto a2 = va_arg!int(ap);
auto a3 = va_arg!int(ap);
assert(a1 == 0x11111111);
assert(a2 == 0x22222222);
assert(a3 == 0x33333333);
auto b1 = va_arg!int(ap2);
auto b2 = va_arg!int(ap2);
auto b3 = va_arg!int(ap2);
assert(b1 == 0x11111111);
assert(b2 == 0x22222222);
assert(b3 == 0x33333333);
va_end(ap);
va_end(ap2);
}
void testCopy()
{
copya(0, "", 0x11111111, 0x22222222, 0x33333333);
}
/***************************************/
// 6700
template bug6700(TList ...) {
const int bug6700 = 2;
}
TypeTuple!(int, long) TT6700;
static assert(bug6700!( (TT6700[1..$]) )==2);
/***************************************/
// 6966
template X6966(T...)
{
alias const(T[0]) X6966;
}
static assert(is(X6966!(int) == const(int)));
static assert(is(X6966!(int, 0) == const(int)));
/***************************************/
// 7233
struct Foo7233 { int x, y; }
Foo7233[] front7233(Foo7233[][] a)
{
return a[0];
}
class Bar7233 { int x, y; }
Bar7233[] front7233(Bar7233[][] a)
{
return a[0];
}
void test7233()
{
Foo7233[][] b1 = [[Foo7233()]];
auto xy1 = b1.front7233[0].tupleof;
Bar7233[][] b2 = [[new Bar7233()]];
auto xy2 = b2.front7233[0].tupleof;
}
/***************************************/
// 7263
template TypeTuple7263(T...){ alias T TypeTuple7263; }
struct tuple7263
{
TypeTuple7263!(int, int) field;
alias field this;
}
auto front7263(T)(ref T arr){ return arr[0]; }
void test7263()
{
auto bars = [tuple7263(0, 0), tuple7263(1, 1)];
auto spam1 = bars.front7263[1];
auto spam2 = bars.front7263[1..2];
}
/***************************************/
// 8244
TypeTuple!(int,int)[] x8244;
static assert(is(typeof(x8244) == TypeTuple!(int, int)));
/***************************************/
// 9017
template X9017(Args...)
{
static if(__traits(compiles, { enum e = Args; }))
enum e = Args;
}
alias X9017!0 x9017;
static assert(x9017.e[0] == 0);
void test9017()
{
enum tup1 = TypeTuple!(11, 22);
enum tup2 = TypeTuple!("one", "two");
static assert(tup1 == TypeTuple!(11, 22));
static assert(tup2 == TypeTuple!("one", "two"));
static assert(tup1[0] == 11 && tup1[1] == 22);
static assert(tup2[0] == "one" && tup2[1] == "two");
shared const tup3 = TypeTuple!(10, 3.14);
immutable tup4 = TypeTuple!("a", [1,2]);
static assert(is(typeof(tup3[0]) == shared const int));
static assert(is(typeof(tup3[1]) == shared const double));
static assert(is(typeof(tup4[0]) == immutable string));
static assert(is(typeof(tup4[1]) == immutable int[]));
}
/***************************************/
// 10279
void foo10279(int[][] strs...) @trusted { }
void bar10279() @safe { foo10279(); }
/***************************************/
// 13508
struct S13508
{
this(T)(T[] t...) {}
}
template make13508(T)
{
T make13508(Args...)(Args args)
{
return T(args);
}
}
void test13508() @safe @nogc
{
S13508 s = make13508!S13508(5);
}
/***************************************/
// 14395
int v2u14395(uint[1] ar...)
{
return ar[0];
}
void print14395(int size = v2u14395(7))
{
assert(size == 7);
}
void test14395()
{
print14395();
}
/***************************************/
// 10414
void foo10414(void delegate()[] ...) { }
void bar10414() { }
void test10414()
{
foo10414
(
{ bar10414(); },
{ bar10414(); },
);
}
/***************************************/
import core.stdc.stdarg;
struct S14179
{
const(char)* filename;
uint linnum;
uint charnum;
}
extern(C++) const(char)* func14179(S14179 x, const(char)* string, ...)
{
return string;
}
void test14179()
{
const(char)* s = "hello";
assert(func14179(S14179(), s) == s);
}
/***************************************/
// 10722
struct S10722
{
int x;
}
template GetSomething10722(S...)
{
alias GetSomething = int;
}
void test10722()
{
alias X10722 = GetSomething10722!(S10722.tupleof[0]);
}
/***************************************/
void testx15417(ulong c1, ...)
{
check(c1, _argptr, _arguments);
}
class C15417
{
private void method ()
{
void test1 (ulong c1, ...)
{
check(c1, _argptr, _arguments);
}
void test2 (ulong c1, ...)
{
va_list ap;
version (Win64)
va_start(ap, c1);
else version (X86_64)
va_start(ap, __va_argsave);
else version (X86)
va_start(ap, c1);
check(c1, ap, _arguments);
}
testx15417(4242UL, char.init);
test1(4242UL, char.init);
test2(4242UL, char.init);
}
}
void check (ulong c1, va_list arglist, TypeInfo[] ti)
{
assert(ti.length == 1);
assert(ti[0].toString() == "char");
assert(char.init == va_arg!(char)(arglist));
}
void test15417()
{
auto c = new C15417;
c.method;
}
/***************************************/
int main()
{
test1();
test2();
test3();
test4();
test12();
test13();
test14();
test24();
test28();
test32();
test34();
test35();
test36();
test37();
test38();
test39();
test45();
test46();
test47();
test48();
test49();
test51();
test55();
test56();
test57();
test58();
test59();
test60();
test61();
test63();
test1411();
test4444();
test13864();
test4884();
test4920();
test4940();
test4940add();
test6530();
test7233();
test7263();
test9017();
test14395();
test10414();
test9495();
testCopy();
test14179();
test15417();
return 0;
}
|
D
|
// Copyright Ferdinand Majerech 2013.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
/// Resource descriptors used by builtin resources.
///
/// These descriptors can also be used by user code, but it is recommended to
/// import tharsis.defaults.descriptors instead of this module.
module tharsis.entity.descriptors;
/// A resource descriptor represented by a single string.
///
/// Used e.g. for resources loaded from files with file name as the descriptor.
///
/// Params: Resource = The resource type the descriptor describes. Templating by
/// the resource type avoids accidental assignments between
/// descriptors of different resource types.
struct StringDescriptor(Resource)
{
/// The string describing a resource.
string fileName;
/// Load a StringDescriptor from a Source such as YAML.
///
/// Params: source = Source to load from.
/// result = The descriptor will be written here, if loaded
/// succesfully.
///
/// Returns: true if succesfully loaded, false otherwise.
static bool load(Source)(ref Source source, out StringDescriptor result)
@safe nothrow
{
return source.readTo(result.fileName);
}
/// Determine if this descriptor maps to the same resource handle as another
/// descriptor.
///
/// Usually, this returns true if two descriptors describe the same resource
/// (e.g. if the descriptors are equal).
///
/// The resource manager uses this when a resource handle is requested to
/// decide whether to load a new resource or to reuse an existing one
/// (if a descriptor maps to the same handle as a descriptor of already
/// existing resource).
bool mapsToSameHandle(ref const(StringDescriptor) rhs) @safe pure nothrow const
{
return fileName == rhs.fileName;
}
}
|
D
|
Ddoc
$(DERS_BOLUMU $(IX contract programming) Contract Programming for Structs and Classes)
$(P
Contract programming is very effective in reducing coding errors. We have seen two of the contract programming features earlier in $(LINK2 contracts.html, the Contract Programming chapter): The $(C in) and $(C out) blocks ensure input and output contracts of functions.
)
$(P
$(I $(B Note:) It is very important that you consider the guidelines under the "$(C in) blocks versus $(C enforce) checks" section of that chapter. The examples in this chapter are based on the assumption that problems with object and parameter consistencies are due to programmer errors. Otherwise, you should use $(C enforce) checks inside function bodies.)
)
$(P
As a reminder, let's write a function that calculates the area of a triangle by Heron's formula. We will soon move the $(C in) and $(C out) blocks of this function to the constructor of a struct.
)
$(P
For this calculation to work correctly, the length of every side of the triangle must be greater than zero. Additionally, since it is impossible to have a triangle where one of the sides is greater than the sum of the other two, that condition must also be checked.
)
$(P
Once these input conditions are satisfied, the area of the triangle would be greater than zero. The following function ensures that all of these requirements are satisfied:
)
---
private import std.math;
double triangleArea(double a, double b, double c)
in {
// Every side must be greated than zero
assert(a > 0);
assert(b > 0);
assert(c > 0);
// Every side must be less than the sum of the other two
assert(a < (b + c));
assert(b < (a + c));
assert(c < (a + b));
} out (result) {
assert(result > 0);
} do {
immutable halfPerimeter = (a + b + c) / 2;
return sqrt(halfPerimeter
* (halfPerimeter - a)
* (halfPerimeter - b)
* (halfPerimeter - c));
}
---
$(H5 $(IX in, contract) $(IX out, contract) $(IX precondition) $(IX postcondition) Preconditions and postconditions for member functions)
$(P
The $(C in) and $(C out) blocks can be used with member functions as well.
)
$(P
Let's convert the function above to a member function of a $(C Triangle) struct:
)
---
import std.stdio;
import std.math;
struct Triangle {
private:
double a;
double b;
double c;
public:
double area() const
$(HILITE out (result)) {
assert(result > 0);
} do {
immutable halfPerimeter = (a + b + c) / 2;
return sqrt(halfPerimeter
* (halfPerimeter - a)
* (halfPerimeter - b)
* (halfPerimeter - c));
}
}
void main() {
auto threeFourFive = Triangle(3, 4, 5);
writeln(threeFourFive.area);
}
---
$(P
As the sides of the triangle are now member variables, the function does not take parameters anymore. That is why this function does not have an $(C in) block. Instead, it assumes that the members already have consistent values.
)
$(P
The consistency of objects can be ensured by the following features.
)
$(H5 Preconditions and postconditions for object consistency)
$(P
The member function above is written under the assumption that the members of the object already have consistent values. One way of ensuring that assumption is to define an $(C in) block for the constructor so that the objects are guaranteed to start their lives in consistent states:
)
---
struct Triangle {
// ...
this(double a, double b, double c)
$(HILITE in) {
// Every side must be greated than zero
assert(a > 0);
assert(b > 0);
assert(c > 0);
// Every side must be less than the sum of the other two
assert(a < (b + c));
assert(b < (a + c));
assert(c < (a + b));
} do {
this.a = a;
this.b = b;
this.c = c;
}
// ...
}
---
$(P
This prevents creating invalid $(C Triangle) objects at run time:
)
---
auto negativeSide = Triangle(-1, 1, 1);
auto sideTooLong = Triangle(1, 1, 10);
---
$(P
The $(C in) block of the constructor would prevent such invalid objects:
)
$(SHELL
core.exception.AssertError@deneme.d: Assertion failure
)
$(P
Although an $(C out) block has not been defined for the constructor above, it is possible to define one to ensure the consistency of members right after construction.
)
$(H5 $(IX invariant) $(C invariant()) blocks for object consistency)
$(P
The $(C in) and $(C out) blocks of constructors guarantee that the objects start their lives in consistent states and the $(C in) and $(C out) blocks of member functions guarantee that those functions themselves work correctly.
)
$(P
However, these checks are not suitable for guaranteeing that the objects are always in consistent states. Repeating the $(C out) blocks for every member function would be excessive and error-prone.
)
$(P
The conditions that define the consistency and validity of an object are called the $(I invariants) of that object. For example, if there is a one-to-one correspondence between the orders and the invoices of a customer class, then an invariant of that class would be that the lengths of the order and invoice arrays would be equal. When that condition is not satisfied for any object, then the object would be in an inconsistent state.
)
$(P
As an example of an invariant, let's consider the $(C School) class from $(LINK2 encapsulation.html, the Encapsulation and Protection Attributes chapter):
)
---
class School {
private:
Student[] students;
size_t femaleCount;
size_t maleCount;
// ...
}
---
$(P
The objects of that class are consistent only if an invariant that involves its three members are satisfied. The length of the student array must be equal to the sum of the female and male students:
)
---
assert(students.length == (femaleCount + maleCount));
---
$(P
If that condition is ever false, then there must be a bug in the implementation of this class.
)
$(P
$(C invariant()) blocks are for guaranteeing the invariants of user-defined types. $(C invariant()) blocks are defined inside the body of a $(C struct) or a $(C class). They contain $(C assert) checks similar to $(C in) and $(C out) blocks:
)
---
class School {
private:
Student[] students;
size_t femaleCount;
size_t maleCount;
$(HILITE invariant()) {
assert(students.length == (femaleCount + maleCount));
}
// ...
}
---
$(P
As needed, there can be more than one $(C invariant()) block in a user-defined type.
)
$(P
The $(C invariant()) blocks are executed automatically at the following times:
)
$(UL
$(LI After the execution of the constructor: This guarantees that every object starts its life in a consistent state.)
$(LI Before the execution of the destructor: This guarantees that the destructor will be executed on a consistent object.)
$(LI Before and after the execution of a $(C public) member function: This guarantees that the member functions do not invalidate the consistency of objects.
$(P
$(IX export) $(I $(B Note:) $(C export) functions are the same as $(C public) functions in this regard. (Very briefly, $(C export) functions are functions that are exported on dynamic library interfaces.))
)
)
)
$(P
If an $(C assert) check inside an $(C invariant()) block fails, an $(C AssertError) is thrown. This ensures that the program does not continue executing with invalid objects.
)
$(P
$(IX -release, compiler switch) As with $(C in) and $(C out) blocks, the checks inside $(C invariant()) blocks can be disabled by the $(C -release) command line option:
)
$(SHELL
$ dmd deneme.d -w -release
)
$(H5 $(IX contract inheritance) $(IX inheritance, contract) $(IX precondition, inherited) $(IX postcondition, inherited) $(IX in, inherited) $(IX out, inherited) Contract inheritance)
$(P
Interface and class member functions can have $(C in) and $(C out) blocks as well. This allows an $(C interface) or a $(C class) to define preconditions for its derived types to depend on, as well as to define postconditions for its users to depend on. Derived types can define further $(C in) and $(C out) blocks for the overrides of those member functions. Overridden $(C in) blocks can loosen preconditions and overridden $(C out) blocks can offer more guarantees.
)
$(P
User code is commonly $(I abstracted away) from the derived types, written in a way to satisfy the preconditions of the topmost type in a hierarchy. The user code does not even know about the derived types. Since user code would be written for the contracts of an interface, it would not be acceptable for a derived type to put stricter preconditions on an overridden member function. However, the preconditions of a derived type can be more permissive than the preconditions of its superclass.
)
$(P
Upon entering a function, the $(C in) blocks are executed automatically from the topmost type to the bottom-most type in the hierarchy . If $(I any) $(C in) block succeeds without any $(C assert) failure, then the preconditions are considered to be fulfilled.
)
$(P
Similarly, derived types can define $(C out) blocks as well. Since postconditions are about guarantees that a function provides, the member functions of the derived type must observe the postconditions of its ancestors as well. On the other hand, it can provide additional guarantees.
)
$(P
Upon exiting a function, the $(C out) blocks are executed automatically from the topmost type to the bottom-most type. The function is considered to have fullfilled its postconditions only if $(I all) of the $(C out) blocks succeed.
)
$(P
The following artificial program demonstrates these features on an $(C interface) and a $(C class). The $(C class) requires less from its callers while providing more guarantees:
)
---
interface Iface {
int[] func(int[] a, int[] b)
$(HILITE in) {
writeln("Iface.func.in");
/* This interface member function requires that the
* lengths of the two parameters are equal. */
assert(a.length == b.length);
} $(HILITE out) (result) {
writeln("Iface.func.out");
/* This interface member function guarantees that the
* result will have even number of elements.
* (Note that an empty slice is considered to have
* even number of elements.) */
assert((result.length % 2) == 0);
}
}
class Class : Iface {
int[] func(int[] a, int[] b)
$(HILITE in) {
writeln("Class.func.in");
/* This class member function loosens the ancestor's
* preconditions by allowing parameters with unequal
* lengths as long as at least one of them is empty. */
assert((a.length == b.length) ||
(a.length == 0) ||
(b.length == 0));
} $(HILITE out) (result) {
writeln("Class.func.out");
/* This class member function provides additional
* guarantees: The result will not be empty and that
* the first and the last elements will be equal. */
assert((result.length != 0) &&
(result[0] == result[$ - 1]));
} do {
writeln("Class.func.do");
/* This is just an artificial implementation to
* demonstrate how the 'in' and 'out' blocks are
* executed. */
int[] result;
if (a.length == 0) {
a = b;
}
if (b.length == 0) {
b = a;
}
foreach (i; 0 .. a.length) {
result ~= a[i];
result ~= b[i];
}
result[0] = result[$ - 1] = 42;
return result;
}
}
import std.stdio;
void main() {
auto c = new Class();
/* Although the following call fails Iface's precondition,
* it is accepted because it fulfills Class' precondition. */
writeln(c.func([1, 2, 3], $(HILITE [])));
}
---
$(P
The $(C in) block of $(C Class) is executed only because the parameters fail to satisfy the preconditions of $(C Iface):
)
$(SHELL
Iface.func.in
Class.func.in $(SHELL_NOTE would not be executed if Iface.func.in succeeded)
Class.func.do
Iface.func.out
Class.func.out
[42, 1, 2, 2, 3, 42]
)
$(H5 Summary)
$(UL
$(LI $(C in) and $(C out) blocks are useful in constructors as well. They ensure that objects are constructed in valid states.
)
$(LI
$(C invariant()) blocks ensure that objects remain in valid states throughout their lifetimes.
)
$(LI
Derived types can define $(C in) blocks for overridden member functions. Preconditions of a derived type should not be stricter than the preconditions of its superclasses. ($(I Note that not defining an $(C in) block means "no precondition at all", which may not be the intent of the programmer.))
)
$(LI
Derived types can define $(C out) blocks for overridden member functions. In addition to its own, a derived member function must observe the postconditions of its superclasses as well.
)
)
Macros:
TITLE=Contract Programming for Structs and Classes
DESCRIPTION=The invariant keyword that ensures that struct and class objects are always in consistent states.
KEYWORDS=d programming lesson book tutorial invariant
|
D
|
// Based on https://github.com/pokedpeter/dlang-derelict-sdl2-example1
import std.stdio;
import derelict.sdl2.sdl;
import derelict.sdl2.image;
import std.conv;
void main()
{
DerelictSDL2.load();
DerelictSDL2Image.load();
// Initialise SDL
if (SDL_Init(SDL_INIT_VIDEO) != 0) {
writeln("SDL_Init: ", SDL_GetError());
}
// Initialise IMG
int flags = IMG_INIT_PNG;
if ((IMG_Init(flags) & flags) != flags) {
writeln("IMG_Init: ", to!string(IMG_GetError()));
}
// Load image
SDL_Surface *imgSurf = IMG_Load("../img/grumpy-cat.png");
if (imgSurf is null) {
writeln("IMG_Load: ", to!string(IMG_GetError()));
}
// Create a window
SDL_Window* appWin = SDL_CreateWindow(
"Hello, World!",
SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED,
imgSurf.w,
imgSurf.h,
SDL_WINDOW_OPENGL
);
if (appWin is null) {
writefln("SDL_CreateWindow: ", SDL_GetError());
return;
}
// Get the window surface
SDL_Surface *winSurf = SDL_GetWindowSurface(appWin);
if (winSurf is null) {
writeln("SDL_GetWindowSurface: ", SDL_GetError());
}
// Define a colour for the surface, based on RGB values
int colour = SDL_MapRGB(winSurf.format, 0xFF, 0xFF, 0xFF);
// Fill the window surface with the colour
SDL_FillRect(winSurf, null, colour);
// Copy loaded image to window surface
SDL_Rect dstRect;
dstRect.x = 0;
dstRect.y = 0;
SDL_BlitSurface(imgSurf, null, winSurf, &dstRect);
// Copy the window surface to the screen
SDL_UpdateWindowSurface(appWin);
// Polling for events
for (int i = 0; i < 20; i++) {
SDL_Delay(100);
}
// Close and destroy the window
if (appWin !is null) {
SDL_DestroyWindow(appWin);
}
// Tidy up
IMG_Quit();
SDL_Quit();
}
|
D
|
/Users/pacmac/Documents/GitHub/Blockchain/substarte_blockchain/substrate-node-template/target/debug/wbuild/node-template-runtime/target/release/deps/proc_macro_crate-ea2e82fb3c0a24eb.rmeta: /Users/pacmac/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro-crate-1.0.0/src/lib.rs
/Users/pacmac/Documents/GitHub/Blockchain/substarte_blockchain/substrate-node-template/target/debug/wbuild/node-template-runtime/target/release/deps/libproc_macro_crate-ea2e82fb3c0a24eb.rlib: /Users/pacmac/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro-crate-1.0.0/src/lib.rs
/Users/pacmac/Documents/GitHub/Blockchain/substarte_blockchain/substrate-node-template/target/debug/wbuild/node-template-runtime/target/release/deps/proc_macro_crate-ea2e82fb3c0a24eb.d: /Users/pacmac/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro-crate-1.0.0/src/lib.rs
/Users/pacmac/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro-crate-1.0.0/src/lib.rs:
|
D
|
/Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Core.build/MediaType.swift.o : /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/Data+Base64URL.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/NestedData.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/Thread+Async.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/Deprecated.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/NotFound.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/CodableReflection/ReflectionDecodable.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/CodableReflection/Decodable+Reflectable.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/Reflectable.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/LosslessDataConvertible.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/File.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/MediaType.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/OptionalType.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/Process+Execute.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/HeaderValue.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/DirectoryConfig.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/CaseInsensitiveString.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/Future+Unwrap.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/FutureEncoder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/CoreError.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/String+Utilities.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/DataCoders.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/CodableReflection/ReflectionDecoders.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/Exports.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/Data+Hex.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/BasicKey.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/XPC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/IOKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Core.build/MediaType~partial.swiftmodule : /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/Data+Base64URL.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/NestedData.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/Thread+Async.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/Deprecated.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/NotFound.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/CodableReflection/ReflectionDecodable.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/CodableReflection/Decodable+Reflectable.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/Reflectable.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/LosslessDataConvertible.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/File.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/MediaType.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/OptionalType.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/Process+Execute.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/HeaderValue.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/DirectoryConfig.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/CaseInsensitiveString.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/Future+Unwrap.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/FutureEncoder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/CoreError.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/String+Utilities.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/DataCoders.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/CodableReflection/ReflectionDecoders.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/Exports.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/Data+Hex.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/BasicKey.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/XPC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/IOKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Core.build/MediaType~partial.swiftdoc : /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/Data+Base64URL.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/NestedData.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/Thread+Async.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/Deprecated.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/NotFound.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/CodableReflection/ReflectionDecodable.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/CodableReflection/Decodable+Reflectable.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/Reflectable.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/LosslessDataConvertible.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/File.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/MediaType.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/OptionalType.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/Process+Execute.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/HeaderValue.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/DirectoryConfig.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/CaseInsensitiveString.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/Future+Unwrap.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/FutureEncoder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/CoreError.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/String+Utilities.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/DataCoders.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/CodableReflection/ReflectionDecoders.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/Exports.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/Data+Hex.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/core/Sources/Core/BasicKey.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/XPC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/IOKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
<?xml version="1.0" encoding="ASCII"?>
<di:SashWindowsMngr xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.eclipse.org/papyrus/0.7.0/sashdi">
<pageList>
<availablePage>
<emfPageIdentifier href="_Q8Hd4FwYEemawpDNrkj6eg-Statemachine.notation#_wN5fsFzREemXstz2ddlLtA"/>
</availablePage>
</pageList>
<sashModel currentSelection="//@sashModel/@windows.0/@children.0">
<windows>
<children xsi:type="di:TabFolder">
<children>
<emfPageIdentifier href="_Q8Hd4FwYEemawpDNrkj6eg-Statemachine.notation#_wN5fsFzREemXstz2ddlLtA"/>
</children>
</children>
</windows>
</sashModel>
</di:SashWindowsMngr>
|
D
|
import std.stdio;
void main()
{
writeln(" *Notices Bulge*");
writeln("__ ___ _ _ _ _ _ ");
writeln("\\ \\ / / |__ __ _| |_ ( ) ___ | |_| |__ (_) ___ ");
writeln(" \\ \\ /\\ / /| '_ \\ / _\\`| __|// / __| | __| '_ \\| |/ __|");
writeln(" \\ V V / | | | | (_| | |_ \\__ \\ | |_| | | | |\\__ \\");
writeln(" \\_/\\_/ |_| |_|\\__,_|\\__| |___/ \\___|_| |_|_|/___/");
}
|
D
|
/*******************************************************************************
@file Conduit.d
Copyright (c) 2004 Kris Bell
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for damages
of any kind arising from the use of this software.
Permission is hereby granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and/or
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment within documentation of
said product would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any distribution
of the source.
4. Derivative works are permitted, but they must carry this notice
in full and credit the original source.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@version Initial version, March 2004
@author Kris
*******************************************************************************/
module mango.io.Conduit;
private import mango.io.Buffer,
mango.io.Exception;
public import mango.io.model.IConduit;
/*******************************************************************************
Conduit abstract base-class, implementing interface IConduit.
Only the conduit-specific read, write, and buffer-factory
need to be implemented for a concrete conduit implementation.
See FileConduit for an example.
Conduits provide virtualized access to external content, and
represent things like files or Internet connections. Conduits
are modelled by mango.io.model.IConduit, and implemented via
classes FileConduit and SocketConduit.
Additional kinds of conduit are easy to construct: one either
subclasses mango.io.Conduit, or implements mango.io.model.IConduit.
A conduit typically reads and writes from/to an IBuffer in large
chunks, typically the entire buffer. Alternatively, one can invoke
read(dst[]) and/or write(src[]) directly.
*******************************************************************************/
class Conduit : IConduit, IConduitFilter
{
private ConduitStyle.Bits style;
private IConduitFilter filter;
private bool seekable;
/***********************************************************************
Return a preferred size for buffering conduit I/O
***********************************************************************/
abstract uint bufferSize ();
/***********************************************************************
Return the underlying OS handle of this Conduit
***********************************************************************/
abstract Handle getHandle ();
/***********************************************************************
conduit-specific reader
***********************************************************************/
protected abstract uint reader (void[] dst);
/***********************************************************************
conduit-specific writer
***********************************************************************/
protected abstract uint writer (void[] src);
/***********************************************************************
Construct a conduit with the given style and seek abilities.
Conduits are either seekable or non-seekable.
***********************************************************************/
this (ConduitStyle.Bits style, bool seekable)
{
filter = this;
this.style = style;
this.seekable = seekable;
}
/***********************************************************************
Method to close the filters. This is invoked from the
Resource base-class when the resource is being closed.
You should ensure that a subclass invokes this as part
of its closure mechanics.
***********************************************************************/
void close ()
{
filter.unbind ();
filter = this;
}
/***********************************************************************
flush provided content to the conduit
***********************************************************************/
bool flush (void[] src)
{
int len = src.length;
for (int i, written; written < len;)
if ((i = write (src[written..len])) != Eof)
written += i;
else
return false;
return true;
}
/***********************************************************************
Please refer to IConduit.attach for details
***********************************************************************/
void attach (IConduitFilter filter)
{
filter.bind (this, this.filter);
}
/***********************************************************************
***********************************************************************/
protected void bind (IConduit conduit, IConduitFilter next)
{
}
/***********************************************************************
***********************************************************************/
protected void unbind ()
{
}
/***********************************************************************
read from conduit into a target buffer
***********************************************************************/
uint read (void[] dst)
{
return filter.reader (dst);
}
/***********************************************************************
write to conduit from a source buffer
***********************************************************************/
uint write (void [] src)
{
return filter.writer (src);
}
/***********************************************************************
Returns true if this conduit is seekable (whether it
implements ISeekable)
***********************************************************************/
bool isSeekable ()
{
return seekable;
}
/***********************************************************************
Returns true is this conduit can be read from
***********************************************************************/
bool isReadable ()
{
return cast(bool) ((style.access & ConduitStyle.Access.Read) != 0);
}
/***********************************************************************
Returns true if this conduit can be written to
***********************************************************************/
bool isWritable ()
{
return cast(bool) ((style.access & ConduitStyle.Access.Write) != 0);
}
/***********************************************************************
Returns true if this conduit is text-based
***********************************************************************/
bool isTextual ()
{
return false;
}
/***********************************************************************
Transfer the content of another conduit to this one. Returns
a reference to this class, and throws IOException on failure.
***********************************************************************/
IConduit copy (IConduit source)
{
Buffer buffer = new Buffer (this);
while (buffer.fill (source) != Eof)
if (buffer.drain () == Eof)
throw new IOException ("Eof while copying conduit");
// flush any remains into the target
buffer.flush ();
return this;
}
/**********************************************************************
Fill the provided buffer. Returns true if the request
can be satisfied; false otherwise
**********************************************************************/
bool fill (void[] dst)
{
uint len;
do {
int i = read (dst [len .. $]);
if (i is Eof)
return false;
len += i;
} while (len < dst.length);
return true;
}
/***********************************************************************
Return the style used when creating this conduit
***********************************************************************/
ConduitStyle.Bits getStyle ()
{
return style;
}
/***********************************************************************
Is the application terminating?
***********************************************************************/
static bool isHalting ()
{
return halting;
}
}
/*******************************************************************************
Define a conduit filter base-class. The filter is invoked
via its reader() method whenever a block of content is
being read, and by its writer() method whenever content is
being written.
The filter should return the number of bytes it has actually
produced: less than or equal to the length of the provided
array.
Filters are chained together such that the last filter added
is the first one invoked. It is the responsibility of each
filter to invoke the next link in the chain; for example:
@code
class MungingFilter : ConduitFilter
{
int reader (void[] dst)
{
// read the next X bytes
int count = next.reader (dst);
// set everything to '*' !
dst[0..count] = '*';
// say how many we read
return count;
}
int writer (void[] src)
{
byte[] tmp = new byte[src.length];
// set everything to '*'
tmp = '*';
// write the munged output
return next.writer (tmp);
}
}
@endcode
Notice how this filter invokes the 'next' instance before
munging the content ... the far end of the chain is where
the original IConduit reader is attached, so it will get
invoked eventually assuming each filter invokes 'next'.
If the next reader fails it will return IConduit.Eof, as
should your filter (or throw an IOException). From a client
perspective, filters are attached like this:
@code
FileConduit fc = new FileConduit (...);
fc.attach (new ZipFilter);
fc.attach (new MungingFilter);
@endcode
Again, the last filter attached is the first one invoked
when a block of content is actually read. Each filter has
two additional methods that it may use to control behavior:
@code
class ConduitFilter : IConduitFilter
{
protected IConduitFilter next;
void bind (IConduit conduit, IConduitFilter next)
{
this.next = next;
}
void unbind ()
{
}
}
@endcode
The first method is invoked when the filter is attached to a
conduit, while the second is invoked just before the conduit
is closed. Both of these may be overridden by the filter for
whatever purpose desired.
Note that a conduit filter can choose to sidestep reading from
the conduit (per the usual case), and produce its input from
somewhere else entirely. This mechanism supports the notion
of 'piping' between multiple conduits, or between a conduit
and something else entirely; it's a bridging mechanism.
*******************************************************************************/
class ConduitFilter : IConduitFilter
{
protected IConduitFilter next;
/***********************************************************************
***********************************************************************/
uint reader (void[] dst)
{
return next.reader (dst);
}
/***********************************************************************
***********************************************************************/
uint writer (void[] src)
{
return next.writer (src);
}
/***********************************************************************
***********************************************************************/
protected void bind (IConduit conduit, IConduitFilter next)
{
this.next = next;
}
/***********************************************************************
***********************************************************************/
protected void unbind ()
{
next.unbind ();
}
/***********************************************************************
***********************************************************************/
protected final void error (char[] msg)
{
throw new IOException (msg);
}
}
/*******************************************************************************
Set a flag when the application is halting. This is used to avoid
closure mechanics while the object pool may be in a state of flux.
*******************************************************************************/
private static bool halting;
private static ~this()
{
halting = true;
}
|
D
|
module levelScreen;
import tango.stdc.stringz;
import ncurses;
import tango.io.Stdout;
import level;
import dataScore;
import arrowSection;
import dancingMan;
import asciiSprite;
import narwhal;
import backupDancer;
import warningBar;
import util.soundclip;
class LevelScreen {
DataScore _score;
ArrowSection _arrowSect;
DancingMan _dancingMan;
AsciiSprite _spotlight;
Narwhal _narwhal;
BackupDancer _backup1;
BackupDancer _backup2;
WarningBar _warningBar;
bool _playing;
this(Level currentLevel) {
_score = new DataScore(currentLevel._name);
_arrowSect = new ArrowSection(currentLevel._arrowChart);
_dancingMan = new DancingMan();
_backup1 = new BackupDancer(20, 20);
_backup2 = new BackupDancer(32, 20);
_playing = true;
_spotlight = new AsciiSprite("graphics/spotlight.txt", null, false, 10, 18);
_narwhal = new Narwhal();
_warningBar = new WarningBar();
}
void draw(bool fast) {
_score.setScore((-50*_arrowSect.misses) + (100*_arrowSect.good) + (200*_arrowSect.great));
_warningBar.updateWarningBar(_arrowSect.misses, _arrowSect.great);
if(_warningBar._level >= 32 && _arrowSect.misses > 5){
endGame(false);
}
if(_arrowSect.noMoreBeats){
endGame(true);
}
move(0,0);
_score.draw();
_warningBar.draw();
_spotlight.drawSprite();
_arrowSect.draw(fast);
_dancingMan.draw();
_narwhal.animate();
_dancingMan.animate();
_backup1.animate();
_backup2.animate();
}
void endGame(bool win) {
SoundClip sc;
_playing = false;
AsciiSprite winText = new AsciiSprite("graphics/victory.txt", null, false, 62, 15);
AsciiSprite loseText = new AsciiSprite("graphics/failure.txt", null, false, 62, 15);
if(win){
sc = new SoundClip("sounds/win.mp3");
sc.start();
winText.drawSprite();
} else {
sc = new SoundClip("sounds/fail.mp3");
sc.start();
loseText.drawSprite();
}
}
}
|
D
|
/Users/deepansh/Desktop/ForexWatchlist/DerivedData/ForexWatchlist/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/HandyJSON.build/Objects-normal/x86_64/TransformOf.o : /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Metadata.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/CBridge.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Transformable.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Measuable.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/MangledName.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/ExtendCustomBasicType.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/BuiltInBasicType.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/BuiltInBridgeType.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/ExtendCustomModelType.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/TransformType.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/EnumType.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/PointerType.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/ContextDescriptorType.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/TransformOf.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/URLTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/DataTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/DateTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/ISO8601DateTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/EnumTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/NSDecimalNumberTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/DateFormatterTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/HexColorTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/CustomDateFormatTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/OtherExtension.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Configuration.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/PropertyInfo.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Logger.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/ReflectionHelper.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/HelpingMapper.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Serializer.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Deserializer.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/FieldDescriptor.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Properties.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/AnyExtensions.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Export.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/HandyJSON.h /Users/deepansh/Desktop/ForexWatchlist/Pods/Target\ Support\ Files/HandyJSON/HandyJSON-umbrella.h /Users/deepansh/Desktop/ForexWatchlist/DerivedData/ForexWatchlist/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/HandyJSON.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/deepansh/Desktop/ForexWatchlist/DerivedData/ForexWatchlist/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/HandyJSON.build/Objects-normal/x86_64/TransformOf~partial.swiftmodule : /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Metadata.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/CBridge.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Transformable.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Measuable.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/MangledName.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/ExtendCustomBasicType.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/BuiltInBasicType.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/BuiltInBridgeType.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/ExtendCustomModelType.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/TransformType.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/EnumType.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/PointerType.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/ContextDescriptorType.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/TransformOf.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/URLTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/DataTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/DateTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/ISO8601DateTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/EnumTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/NSDecimalNumberTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/DateFormatterTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/HexColorTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/CustomDateFormatTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/OtherExtension.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Configuration.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/PropertyInfo.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Logger.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/ReflectionHelper.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/HelpingMapper.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Serializer.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Deserializer.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/FieldDescriptor.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Properties.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/AnyExtensions.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Export.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/HandyJSON.h /Users/deepansh/Desktop/ForexWatchlist/Pods/Target\ Support\ Files/HandyJSON/HandyJSON-umbrella.h /Users/deepansh/Desktop/ForexWatchlist/DerivedData/ForexWatchlist/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/HandyJSON.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/deepansh/Desktop/ForexWatchlist/DerivedData/ForexWatchlist/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/HandyJSON.build/Objects-normal/x86_64/TransformOf~partial.swiftdoc : /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Metadata.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/CBridge.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Transformable.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Measuable.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/MangledName.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/ExtendCustomBasicType.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/BuiltInBasicType.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/BuiltInBridgeType.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/ExtendCustomModelType.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/TransformType.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/EnumType.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/PointerType.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/ContextDescriptorType.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/TransformOf.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/URLTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/DataTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/DateTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/ISO8601DateTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/EnumTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/NSDecimalNumberTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/DateFormatterTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/HexColorTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/CustomDateFormatTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/OtherExtension.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Configuration.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/PropertyInfo.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Logger.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/ReflectionHelper.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/HelpingMapper.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Serializer.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Deserializer.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/FieldDescriptor.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Properties.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/AnyExtensions.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Export.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/HandyJSON.h /Users/deepansh/Desktop/ForexWatchlist/Pods/Target\ Support\ Files/HandyJSON/HandyJSON-umbrella.h /Users/deepansh/Desktop/ForexWatchlist/DerivedData/ForexWatchlist/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/HandyJSON.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/deepansh/Desktop/ForexWatchlist/DerivedData/ForexWatchlist/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/HandyJSON.build/Objects-normal/x86_64/TransformOf~partial.swiftsourceinfo : /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Metadata.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/CBridge.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Transformable.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Measuable.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/MangledName.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/ExtendCustomBasicType.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/BuiltInBasicType.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/BuiltInBridgeType.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/ExtendCustomModelType.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/TransformType.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/EnumType.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/PointerType.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/ContextDescriptorType.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/TransformOf.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/URLTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/DataTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/DateTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/ISO8601DateTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/EnumTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/NSDecimalNumberTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/DateFormatterTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/HexColorTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/CustomDateFormatTransform.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/OtherExtension.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Configuration.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/PropertyInfo.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Logger.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/ReflectionHelper.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/HelpingMapper.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Serializer.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Deserializer.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/FieldDescriptor.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Properties.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/AnyExtensions.swift /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/Export.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/deepansh/Desktop/ForexWatchlist/Pods/HandyJSON/Source/HandyJSON.h /Users/deepansh/Desktop/ForexWatchlist/Pods/Target\ Support\ Files/HandyJSON/HandyJSON-umbrella.h /Users/deepansh/Desktop/ForexWatchlist/DerivedData/ForexWatchlist/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/HandyJSON.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
module RC;
import core.stdc.stdio;
import core.stdc.stdlib;
import core.stdc.string;
import std.algorithm;
import std.typecons;
import std.algorithm.mutation : move;
import std.traits: isCopyable, isOrderingComparable;
//version = noboundcheck;
nothrow:
private struct _StringData{
nothrow:
char* _ptr;
size_t _length;
size_t _capacity;
@disable this(this); // not copyable
~this() {
if(_ptr) {
//printf("Free String\n");
free(_ptr);
_ptr = null;
}
}
}
struct String {
nothrow:
private RefCounted!(_StringData, RefCountedAutoInitialize.no) _data;
bool isInitialized() {
return _data.refCountedStore().isInitialized();
}
private static String _emptyString() {
String result;
auto data = _StringData(null, 0, 0);
result._data = refCounted(move(data));
return result;
}
static String opCall() {
auto result = _emptyString();
result._data._ptr = cast(char*) malloc(1);
result._data._ptr[0] = 0;
result._data._length = 0;
result._data._capacity = 1;
return result;
}
private void _ensureCap(size_t new_capacity) {
if(new_capacity <= _data._capacity) return;
size_t capacity = _data._capacity;
while(capacity < new_capacity) {
capacity += capacity/2 + 8;
}
if(!_data._ptr) {
_data._ptr = cast(char*) malloc(capacity);
memset(_data._ptr, 0, capacity);
}else {
_data._ptr = cast(char*) realloc(_data._ptr, capacity);
memset(_data._ptr + _data._length, 0, capacity - _data._length);
}
}
static String opCall(string st) {
auto result = _emptyString();
size_t len = st.length;
result._data._ptr = cast(char*) malloc(len+1);
if(len > 0) strncpy(result._data._ptr, &st[0], len);
result._data._ptr[len] = 0;
result._data._length = len;
return result;
}
void opAssign(string rhs) {
size_t len = rhs.length;
_ensureCap(len + 1);
if(len > 0) strncpy(_data._ptr, &rhs[0], len);
_data._ptr[len] = 0;
_data._length = len;
}
size_t length() {
return _data._length;
}
String opBinary(string op)(String rhs)
{
static if (op == "+") {
auto result = _emptyString();
int len1 = _data._length;
int len2 = rhs._data._length;
result._data._ptr = cast(char*) malloc(len1 + len2 + 1);
if(len1 > 0) strncpy(result._data._ptr, _data._ptr, len1);
if(len2 > 0) strncpy(result._data._ptr + len1, rhs._data._ptr, len2);
result._data._ptr[len1+len2] = 0;
result._data._length = len1+len2;
return result;
}
else static assert(0, "Operator "~op~" not implemented");
}
String opBinary(string op)(string rhs)
{
static if (op == "+") {
auto result = _emptyString();
size_t len1 = _data._length;
size_t len2 = rhs.length;
result._data._ptr = cast(char*) malloc(len1 + len2 + 1);
if(len1 > 0) strncpy(result._data._ptr, _data._ptr, len1);
if(len2 > 0) strncpy(result._data._ptr + len1, &rhs[0], len2);
result._data._ptr[len1+len2] = 0;
result._data._length = len1+len2;
return result;
}
else static assert(0, "Operator "~op~" not implemented");
}
String opBinary(string op, T)(T rhs)
{
static if (op == "+") {
static if(is(typeof(rhs) == String)) {
return opBinary!op(rhs);
}else static if (is(typeof(rhs.toString()) == String)) {
return opBinary!op(rhs.toString());
}else {
auto result = String("[");
char[1024] tmp;
char* cptr = cast(char*) tmp;
format!T(cptr, rhs);
size_t len1 = _data._length;
size_t len2 = strlen(cptr);
result._data._ptr = cast(char*) malloc(len1 + len2 + 1);
if(len1 > 0) strncpy(result._data._ptr, _data._ptr, len1);
if(len2 > 0) strncpy(result._data._ptr + len1, cptr, len2);
result._data._ptr[len1+len2] = 0;
result._data._length = len1+len2;
return result;
}
}
else static assert(0, "Operator "~op~" not implemented");
}
void opOpAssign(string op)(string rhs) {
static if (op == "+") {
size_t len1 = _data._length;
size_t len2 = rhs.length;
_ensureCap(len1 + len2 + 1);
if(len2 > 0) strncpy(_data._ptr + len1, &rhs[0], len2);
_data._ptr[len1+len2] = 0;
_data._length = len1 + len2;
}
else static assert(0, "Operator "~op~" not implemented");
}
void opOpAssign(string op)(String rhs) {
static if (op == "+") {
size_t len1 = _data._length;
size_t len2 = rhs.length;
_ensureCap(len1 + len2 + 1);
if(len2 > 0) strncpy(_data._ptr + len1, rhs._data._ptr, len2);
_data._ptr[len1+len2] = 0;
_data._length = len1 + len2;
}
else static assert(0, "Operator "~op~" not implemented");
}
void opOpAssign(string op, T)(T rhs) {
static if (op == "+") {
static if(is(typeof(rhs) == String)) {
opOpAssign!op(rhs);
}else static if (is(typeof(rhs.toString()) == String)) {
opOpAssign!op(rhs.toString());
}else {
char [1024] tmp;
char* cptr = cast(char*) tmp;
format!T(cptr, rhs);
int len1 = _data._length;
int len2 = strlen(cptr);
_ensureCap(len1 + len2 + 1);
if(len2 > 0) strncpy(_data._ptr + len1, cptr, len2);
_data._ptr[len1+len2] = 0;
_data._length = len1 + len2;
}
}
else static assert(0, "Operator "~op~" not implemented");
}
String subString(size_t start, size_t end) {
if(start < 0) start = 0;
if(end > _data._length) end = _data._length;
if(start > end) end = start;
int len = cast(int) (end - start);
auto result = _emptyString();
result._data._ptr = cast(char*) malloc(len + 1);
if(len > 0) strncpy(result._data._ptr, _data._ptr + start, len);
result._data._ptr[len] = 0;
result._data._length = len;
return result;
}
String subString(int start) {
return subString(start, _data._length);
}
private int indexOf(const char* ptr) {
char* pos = strstr(_data._ptr, ptr);
if(pos) {
return cast(int)(pos - _data._ptr);
}
return -1;
}
int indexOf(string st) {
const char* ptr = &st[0];
return indexOf(ptr);
}
int indexOf(String st) {
return indexOf(st._data._ptr);
}
private List!String _split(const char* delimiter) {
auto lst = List!String();
size_t delimiter_len = strlen(delimiter);
char *ptr = _data._ptr;
char *pos;
while (true)
{
pos = strstr(ptr, delimiter);
if(!pos) break;
int len = cast(int)(pos - ptr);
if (len > 0) {
lst.add(String(cast (string) (ptr[0..len])));
}
ptr = pos + delimiter_len;
}
if (ptr < _data._ptr + _data._length){
int len = cast(int)(_data._ptr + _data._length - ptr);
lst.add(String(cast (string) (ptr[0..len])));
}
return lst;
}
List!String split(string st) {
return _split(&st[0]);
}
List!String split(String st) {
return _split(st._data._ptr);
}
String join(List!String lst) {
int totalLength = 0;
foreach(i,st; lst) {
totalLength += st._data._length;
if(i + 1 < lst.size()) {
totalLength += _data._length;
}
}
auto result = _emptyString();
result._data._ptr = cast(char*) malloc(totalLength + 1);
char* ptr = result._data._ptr;
foreach(i,st; lst) {
memcpy(ptr, st._data._ptr, st._data._length);
ptr += st._data._length;
if(i + 1 < lst.size()) {
memcpy(ptr, _data._ptr, _data._length);
ptr += _data._length;
}
}
ptr[0] = 0;
result._data._length = totalLength;
return result;
}
hash_t toHash() const nothrow {
return hashOf(cast(string)_data._ptr[0.._data._length]);
}
bool opEquals(String st2){
auto s1 = cast(string) _data._ptr[0.._data._length];
auto s2 = cast(string) st2._data._ptr[0..st2._data._length];
return s1 == s2;
}
bool opEquals(string st2){
auto s1 = cast(string) _data._ptr[0.._data._length];
return s1 == st2;
}
void print() {
printf("%s", _data._ptr);
}
void printLine() {
printf("%s\n", _data._ptr);
}
unittest {
auto items = String("1,2,3,4").split(",");
assert(String("-").join(items) == "1-2-3-4");
auto st = String("Hello world");
assert(st.indexOf("123") == -1);
assert(st.indexOf("world") == 6);
assert(st.subString(6, 8) == "wo");
assert(st.subString(6) == "world");
}
}
private struct _ListData(T) {
T* _items;
size_t _size;
size_t _capacity;
@disable this(this); // not copyable
~this() {
if(_items) {
//printf("Free List\n");
for(int i = 0; i < _size; i++) {
static if(!is(typeof(_items[0]) == String)) {
destroy(_items[i]);
}else {
destroy(_items[i]._data);
}
}
free(_items);
_items = null;
_size = _capacity = 0;
}
}
}
struct List(T) {
nothrow:
private RefCounted!(_ListData!T, RefCountedAutoInitialize.no) _data;
@disable hash_t toHash();
bool isInitialized() {
return _data.refCountedStore().isInitialized();
}
static List opCall(size_t sz) {
List lst;
auto data = _ListData!T(null, 0, 0);
lst._data = refCounted(move(data));
lst._data._items = cast (T*) malloc(T.sizeof * sz);
//memset(cast(char*) lst._data._items, 0, T.sizeof * sz);
for(size_t i = 0; i < sz; i++) {
lst._data._items[i] = T();
}
lst._data._size = lst._data._capacity = sz;
return lst;
}
static List opCall() {
return opCall(0);
}
private void _ensureCap(size_t new_capacity) {
if(new_capacity < _data._capacity) return;
size_t capacity = _data._capacity;
while(capacity < new_capacity) {
capacity += capacity/2 + 8;
}
if(_data._items == null) {
_data._items = cast (T*) malloc(T.sizeof * capacity);
memset(cast(char*) _data._items, 0, T.sizeof * capacity);
}else {
_data._items = cast (T*) realloc(_data._items, T.sizeof*capacity);
memset(cast(char*) _data._items + _data._size * T.sizeof, 0, T.sizeof * (capacity - _data._size));
}
_data._capacity = capacity;
}
size_t size() {
return _data._size;
}
void resize(size_t size) {
_ensureCap(size);
if(size > _data._size) {
for(size_t i = _data._size; i < size; i++) {
_data._items[i] = T();
}
}
_data._size = size;
}
static if(isCopyable!T) {
void add(T item) {
_ensureCap(1 + _data._size);
_data._items[_data._size] = item;
_data._size += 1;
}
void remove(int index) {
if(cast(uint) index >= _data._size) {
printf("List index %d is out of range %d", cast(int) index, cast(int) _data._size);
exit(0);
}
destroy(_data._items[index]);
for(int i = index; i < _data._size - 1; i++) {
_data._items[i] = _data._items[i+1];
}
_data._size -= 1;
}
}else {
void add(T item) {
_ensureCap(1 + _data._size);
_data._items[_data._size] = move(item);
_data._size += 1;
}
void remove(int index) {
if(cast(uint) index >= _data._size) {
printf("List index %d is out of range %d", cast(int) index, cast(int) _data._size);
exit(0);
}
destroy(_data._items[index]);
for(int i = index; i < _data._size - 1; i++) {
_data._items[i] = move(_data._items[i+1]);
}
_data._size -= 1;
}
}
ref T opIndex(int i) {
version(noboundcheck) {} else {
if(cast(uint) i >= _data._size) {
printf("List index %d is out of range %d", cast(int) i, cast(int) _data._size);
exit(0);
}
}
return _data._items[i];
}
static if(isCopyable!T) {
private static List _fromRaw(T* ptr, size_t size) {
List lst;
auto data = _ListData!T(null, 0, 0);
lst._data = refCounted(move(data));
lst._data._items = ptr;
lst._data._size = size;
lst._data._capacity = size;
return lst;
}
static List opCall(T[] items) {
auto lst = List();
lst.resize(items.length);
for(int i = 0; i < items.length; i++) {
lst._data._items[i] = items[i];
}
return lst;
}
int find(T item) {
for(int i = 0; i < _data._size; i++) {
if(_data._items[i] == item) return i;
}
return -1;
}
List!int findAll(T item) {
List!int lst = List!int();
for(int i = 0; i < _data._size; i++) {
if(_data._items[i] == item) lst.add(i);
}
return lst;
}
int rfind(T item) {
for(int i = cast(int) (_data._size-1); i >= 0; i--) {
if(_data._items[i] == item) return i;
}
return -1;
}
List opSlice(size_t start, size_t end) {
if(start < 0) start = 0;
if(end > _data._size) end = _data._size;
if(end > start) {
size_t size = end - start;
T* ptr = cast(T*) malloc(T.sizeof * size);
memcpy(cast(void*) ptr, cast(void*)_data._items + T.sizeof*start, T.sizeof*size);
return _fromRaw(ptr, size);
}
return List();
}
List opIndex(int[] indexes) {
auto lst = List();
lst.resize(indexes.length);
T[] tmp = lst._view();
for(int i = 0; i < indexes.length; i++) {
int index = indexes[i];
version(noboundcheck) {} else {
if(cast(uint) index >= _data._size) {
printf("List index %d is out of range %d", cast(int) index, cast(int) _data._size);
exit(0);
}
}
tmp[i] = _data._items[index];
}
return lst;
}
List opIndex(List!int indexes) {
return opIndex(indexes._view());
}
List filter(bool delegate(ref T) nothrow func) {
auto lst = List();
for(int i = 0; i < _data._size; i++) {
if(func(_data._items[i])) {
lst.add(_data._items[i]);
}
}
return lst;
}
List filter(bool delegate(T) nothrow func) {
auto lst = List();
for(int i = 0; i < _data._size; i++) {
if(func(_data._items[i])) {
lst.add(_data._items[i]);
}
}
return lst;
}
List!U map(U)(U delegate(T) nothrow f) {
auto lst = List!U();
lst.resize(size());
for(int i = 0; i < _data._size; i++)
{
lst._data._items[i] = f(_data._items[i]);
}
return lst;
}
Dict!(U, List!T) groupBy(U)(U delegate(ref T) nothrow f) {
auto groups = Dict!(U, List!T)();
List null_lst;
for(int i = 0; i < _data._size; i++) {
auto key = f(_data._items[i]);
auto group = groups.getOrDefault(key, null_lst);
if(!group.isInitialized()) {
group = List!T();
groups[key] = group;
}
group.add(_data._items[i]);
}
return groups;
}
Dict!(U, List!T) groupBy(U)(U delegate(T) nothrow f) {
auto groups = Dict!(U, List!T)();
List null_lst;
for(int i = 0; i < _data._size; i++) {
auto key = f(_data._items[i]);
auto group = groups.getOrDefault(key, null_lst);
if(!group.isInitialized()) {
group = List!T();
groups[key] = group;
}
group.add(_data._items[i]);
}
return groups;
}
T reduce(T delegate(T, T) nothrow f, T init=T.init) {
T acc = init;
for(int i = 0; i < _data._size; i++) {
acc = f(acc, _data._items[i]);
}
return acc;
}
}
private T[] _view() {
return _data._items[0.._data._size];
}
int opApply(int delegate(ref T) nothrow operations) {
int result = 0;
for(int i = 0; i < _data._size; i++) {
result = operations(_data._items[i]);
if(result) break;
}
return result;
}
int opApply(int delegate(size_t i, ref T) nothrow operations) {
int result = 0;
for(int i = 0; i < _data._size; i++) {
result = operations(i, _data._items[i]);
if(result) break;
}
return result;
}
int count(bool delegate(ref T) nothrow func) {
int total = 0;
for(int i = 0; i < _data._size; i++) {
if(func(_data._items[i])) {
total += 1;
}
}
return total;
}
List!U map(U)(U delegate(ref T) nothrow f) {
auto lst = List!U();
lst.resize(size());
for(int i = 0; i < _data._size; i++)
{
lst._data._items[i] = f(_data._items[i]);
}
return lst;
}
static if(isOrderingComparable!T) {
void sort(alias lt= "a < b")() {
_view().sort!lt();
}
private void _swap(int* indexes, int i, int j) {
int tmp = indexes[i];
indexes[i] = indexes[j];
indexes[j] = tmp;
}
private int _partition(int* indexes, T* values, bool delegate(T, T) nothrow lt_func, int low, int high) {
int pivot = values[indexes[high]];
int i = (low - 1);
for (int j = low; j <= high - 1; j++) {
bool lt = lt_func != null? lt_func(values[indexes[j]], pivot) : (values[indexes[j]] < pivot);
if (lt) {
i++;
_swap(indexes, i, j);
}
}
_swap(indexes, i + 1, high);
return (i + 1);
}
private void _qsort(int* indexes, T* values, bool delegate(T, T) nothrow lt_func, int low, int high) {
if(low < high) {
int pi = _partition(indexes, values, lt_func, low, high);
_qsort(indexes, values, lt_func, low, pi - 1);
_qsort(indexes, values, lt_func, pi + 1, high);
}
}
List!int argsort(bool delegate(T, T) nothrow lt_func=null) {
auto indexes = List!int(_data._size);
auto indexes_ptr = indexes._data._items;
for(int i = 0; i < _data._size; i++) {
indexes_ptr[i] = i;
}
_qsort(indexes_ptr, _data._items, lt_func, 0, cast(int)(_data._size - 1));
return indexes;
}
}
String toString() {
auto result = String("[");
char[1024] tmp;
char* cptr = cast(char*) tmp;
for(int i = 0; i < _data._size; i++)
{
static if(is(typeof(_data._items[0]) == String)) {
result += "'";
result += _data._items[i] + "'";
}else static if (is(typeof(_data._items[0].toString()) == String)) {
result += _data._items[i].toString();
}else {
format!T(cptr, _data._items[i]);
size_t len = strlen(cptr);
result += cast(string) tmp[0..len];
}
if(i + 1 < _data._size) result += ", ";
}
result += "]";
return result;
}
}
unittest {
int[5] arr = [2,3,1,5,0];
auto lst = List!int(arr);
auto indexes = lst.argsort();
assert(indexes[0] == 4 && indexes[1] == 2 && indexes[2] == 0 && indexes[3] == 1 && indexes[4] == 3);
lst.sort();
assert(lst[0] == 0 && lst[1] == 1 && lst[2] == 2 && lst[3] == 3 && lst[4] == 5);
auto sum = lst.reduce((x, y) => x + y);
assert(sum == 11);
lst = lst.filter(x => x > 1).map(x => x*x);
auto llst = List!(List!int)();
llst.add(lst);
foreach(ref x; llst[0]) {
x += 1;
}
foreach(i, x; llst[0]) {
if(i == 0) assert(x == 5);
if(i == 1) assert(x == 10);
if(i == 2) assert(x == 26);
}
}
unittest {
auto arr = List!int();
for(int i = 0; i < 100; i++) {
arr.add(i);
}
auto groups = arr.groupBy(x => x%4);
foreach(entry; groups) {
auto key = entry.key;
auto value = entry.value;
if(key == 0) {
assert(value[0] == 0);
assert(value[1] == 4);
assert(value[23] == 92);
assert(value[24] == 96);
}
if(key == 1) {
assert(value[0] == 1);
assert(value[1] == 5);
assert(value[23] == 93);
assert(value[24] == 97);
}
if(key == 2) {
assert(value[0] == 2);
assert(value[1] == 6);
assert(value[23] == 94);
assert(value[24] == 98);
}
if(key == 3) {
assert(value[0] == 3);
assert(value[1] == 7);
assert(value[23] == 95);
assert(value[24] == 99);
}
}
}
struct DictItem(K,V) {
K key;
V value;
DictItem* next;
}
DictItem!(K,V)* newItem(K,V)() {
int allocSize = DictItem!(K,V).sizeof;
auto ptr = cast(DictItem!(K,V)*) malloc(allocSize);
memset(cast(char*) ptr, 0, allocSize);
ptr.next = null;
return ptr;
}
private struct _DictData(K, V) {
nothrow:
DictItem!(K,V)** _table;
size_t _bucketSize;
size_t _size;
@disable this(this); // not copyable
~this() {
if(_table) {
//printf("Free Dict\n");
for(int i = 0; i < _bucketSize; i++) {
auto ptr = _table[i];
while(ptr != null) {
auto tmp = ptr;
ptr = ptr.next;
destroy(tmp.key);
destroy(tmp.value);
free(tmp);
}
}
free(_table);
}
_table = null;
_bucketSize = _size = 0;
}
}
public struct Dict(K, V) {
nothrow:
private RefCounted!(_DictData!(K,V), RefCountedAutoInitialize.no) _data;
@disable hash_t toHash();
bool isInitialized() {
return _data.refCountedStore().isInitialized();
}
static Dict opCall() {
Dict dict;
auto data = _DictData!(K,V)(null, 0, 0);
dict._data = refCounted(move(data));
dict._data._size = 0;
dict._data._bucketSize = 16;
size_t allocSize = (DictItem!(K,V)*).sizeof * dict._data._bucketSize;
dict._data._table = cast(DictItem!(K,V)**) malloc(allocSize);
memset(cast(char*) dict._data._table, 0, allocSize);
return dict;
}
void opIndexAssign(V value, K key) {
if(_data._size >= _data._bucketSize >> 1) {
_doubleSize();
}
size_t hash = key.hashOf();
size_t index = hash % _data._bucketSize;
auto ptr = _data._table[index];
while(ptr && ptr.next && ptr.key != key) {
ptr = ptr.next;
}
if(ptr && ptr.key == key) {
static if(isCopyable!V) {
ptr.value = value;
}else {
ptr.value = move(value);
}
}else {
auto new_ptr = newItem!(K,V)();
new_ptr.key = key;
static if(isCopyable!V) {
new_ptr.value = value;
}else {
new_ptr.value = move(value);
}
_data._size += 1;
if(ptr) {
ptr.next = new_ptr;
}else {
_data._table[index] = new_ptr;
}
}
}
private void _printKeyNotFoundError(K)(K key) {
char[1024] tmp;
char* cptr = cast(char*) tmp;
printf("Dict key not found error: ");
static if(is(typeof(key) == String)) {
key.print();
}
else static if (is(typeof(key.toString()) == String)) {
key.toString().print();
}else {
format!K(cptr, key);
printf("%s", cptr);
}
printf("\n");
}
ref V opIndex(K key) {
size_t hash = key.hashOf();
size_t index = hash % _data._bucketSize;
auto ptr = _data._table[index];
while(ptr != null && ptr.key != key) {
ptr = ptr.next;
}
if(!ptr) {
_printKeyNotFoundError!K(key);
exit(0);
}
return ptr.value;
}
bool containsKey(K key) {
size_t hash = key.hashOf();
size_t index = hash % _data._bucketSize;
auto ptr = _data._table[index];
while(ptr != null && ptr.key != key) {
ptr = ptr.next;
}
return ptr != null;
}
void remove(K key) {
size_t hash = key.hashOf();
size_t index = hash % _data._bucketSize;
bool result;
if(_data._table[index] == null) return;
auto ptr = _data._table[index];
DictItem!(K,V)* prev = null;
while(ptr.next != null && ptr.key != key) {
prev = ptr;
ptr = ptr.next;
}
if(ptr.key == key) {
if(prev != null) {
prev.next = ptr.next;
}else {
_data._table[index] = ptr.next;
}
destroy(ptr.key);
destroy(ptr.value);
free(ptr);
_data._size -= 1;
}
}
private void _doubleSize() {
int itemSize = (DictItem!(K,V)*).sizeof;
_data._table = cast(DictItem!(K,V)**) realloc(_data._table, 2 * itemSize * _data._bucketSize);
memset(cast (char*) _data._table + _data._bucketSize * itemSize, 0, _data._bucketSize * itemSize);
for(int i = 0; i < _data._bucketSize; i++) {
auto ptr = _data._table[i];
DictItem!(K,V)* prev = null;
DictItem!(K,V)* new_ptr = null;
while(ptr != null) {
size_t hash = ptr.key.hashOf();
size_t index = hash % (2* _data._bucketSize);
auto next = ptr.next;
if(index == i + _data._bucketSize) {
if(new_ptr == null) {
_data._table[index] = new_ptr = newItem!(K,V)();
}else {
new_ptr.next = newItem!(K,V)();
new_ptr = new_ptr.next;
}
new_ptr.key = ptr.key;
static if(isCopyable!V) {
new_ptr.value = ptr.value;
}else{
new_ptr.value = move(ptr.value);
}
if(prev == null) {
_data._table[i] = next;
}else {
prev.next = next;
}
destroy(ptr.key);
static if(isCopyable!V) {
destroy(ptr.value);
}
free(ptr);
}else {
prev = ptr;
}
ptr = next;
}
}
_data._bucketSize *= 2;
}
List!K getKeys() {
auto lst = List!K();
for(int i = 0; i < _data._bucketSize;i++) {
auto ptr = _data._table[i];
while(ptr != null) {
lst.add(ptr.key);
ptr = ptr.next;
}
}
return lst;
}
static if(isCopyable!V) {
List!V getValues() {
auto lst = List!V();
for(int i = 0; i < _data._bucketSize;i++) {
auto ptr = _data._table[i];
while(ptr != null) {
lst.add(ptr.value);
ptr = ptr.next;
}
}
return lst;
}
List!(DictItem!(K,V)) getItems() {
auto lst = List!(DictItem!(K,V))();
for(int i = 0; i < _data._bucketSize;i++) {
auto ptr = _data._table[i];
while(ptr != null) {
lst.add(*ptr);
ptr = ptr.next;
}
}
return lst;
}
V getOrDefault(K key, V defaultValue) {
size_t hash = key.hashOf();
size_t index = hash % _data._bucketSize;
auto ptr = _data._table[index];
while(ptr != null && ptr.key != key) {
ptr = ptr.next;
}
return ptr? ptr.value : defaultValue;
}
V getOrInsert(K key, V defaultValue) {
size_t hash = key.hashOf();
size_t index = hash % _data._bucketSize;
auto ptr = _data._table[index];
while(ptr && ptr.key != key && ptr.next != null) {
ptr = ptr.next;
}
if(ptr && ptr.key == key) {
return ptr.value;
}else {
auto new_ptr = newItem!(K,V)();
new_ptr.key = key;
new_ptr.value = defaultValue;
if(ptr) {
ptr.next = new_ptr;
}else{
_data._table[index] = new_ptr;
}
_data._size += 1;
return defaultValue;
}
}
}
int opApply(int delegate(ref DictItem!(K,V)) nothrow operations) {
int result = 0;
for(int i = 0; i < _data._bucketSize;i++) {
auto ptr = _data._table[i];
while(ptr != null) {
result = operations(*ptr);
ptr = ptr.next;
}
}
return result;
}
size_t size() {
return _data._size;
}
String toString() {
auto result = String("{");
int count = 0;
char[1024] tmp;
char* cptr = cast(char*) tmp;
size_t len;
for(int i = 0; i < _data._bucketSize;i++) {
auto ptr = _data._table[i];
while(ptr != null) {
static if(is(typeof(ptr.key) == String)) {
result += "'";
result += ptr.key;
result += "'";
}
else static if (is(typeof(ptr.key.toString()) == String)) {
result += ptr.key.toString();
}else {
format!K(cptr, ptr.key);
len = strlen(cptr);
result += cast(string) tmp[0..len];
}
result += ": ";
static if(is(typeof(ptr.value) == String)) {
result += "'";
result += ptr.value;
result += "'";
}
else static if (is(typeof(ptr.value.toString()) == String)) {
result += ptr.value.toString();
}else {
format!V(cptr, ptr.value);
len = strlen(cptr);
result += cast(string) tmp[0..len];
}
if(count + 1 < _data._size) result += ", ";
count += 1;
ptr = ptr.next;
}
}
result += "}";
return result;
}
}
unittest {
auto m = Dict!(int, int)();
for(int i = 50; i < 70; i++) {
m[2*i] = i;
}
m[256] = 128;
assert(m[100] == 50 && m[110] == 55 && m[120] == 60 && m[128] == 64 && m[256] == 128);
}
unittest {
auto m = Dict!(String, int)();
m[String("12")] = 100;
auto s = String("1");
assert(m[s + "2"] == 100);
}
public struct Set(T) {
nothrow:
private Dict!(T, int) _dict;
@disable hash_t toHash();
bool isInitialized() {
return _dict.isInitialized();
}
static Set opCall() {
Set set;
set._dict = Dict!(T, int)();
return set;
}
static Set opCall(T[] arr) {
auto set = Set();
foreach(x; arr) {
set._dict[x] = 1;
}
return set;
}
static Set opCall(List!T lst) {
auto set = Set();
foreach(x; lst) {
set._dict[x] = 1;
}
return set;
}
void add(T value) {
_dict[value] = 1;
}
bool contains(T value) {
return _dict.containsKey(value);
}
void remove(T value) {
_dict.remove(value);
}
List!T toList() {
return _dict.getKeys();
}
int opApply(int delegate(ref T) nothrow operations) {
int result = 0;
foreach(ref item; _dict) {
result = operations(item.key);
}
return result;
}
size_t size() {
return _dict.size();
}
String toString() {
char[1024] tmp;
auto result = String("{");
int count = 0;
char* cptr = cast(char*) tmp;
auto sz = size();
foreach(ref item; _dict) {
static if(is(typeof(item.key) == String)) {
result += "'";
result += item.key;
result += "'";
}else static if (is(typeof(item.key.toString()) == String)) {
result += item.key.toString();
}else {
format!T(cptr, item.key);
size_t len = strlen(cptr);
result += cast(string) tmp[0..len];
}
if(count + 1 < sz) result += ", ";
count += 1;
}
result += "}";
return result;
}
}
unittest {
int[5] arr = [1, 5, 6, 7, 8];
auto s = Set!int(arr);
s.add(1);
s.add(2);
s.add(3);
s.add(2);
s.add(1);
assert(s.size() == 7);
assert(s.contains(1) && s.contains(2) && s.contains(3) && s.contains(5)
&& s.contains(6) && s.contains(7) && s.contains(8));
assert(!s.contains(4));
}
private void format(T)(char* ptr, ref T x) {
static if(is(T == int) || is(T == short) || is (T == byte)) {
sprintf(ptr, "%d", cast (int) x);
return;
}else static if(is(T == uint) || is(T == ushort) || is (T == ubyte)) {
sprintf(ptr, "%u", cast (uint) x);
return;
}else static if(is(T == long)) {
sprintf(ptr, "%ld", x);
return;
}else static if(is(T == ulong)) {
sprintf(ptr, "%lu", x);
return;
}else static if(is(T == float)) {
sprintf(ptr, "%f", x);
return;
}else static if(is(T == double)) {
sprintf(ptr, "%lf", x);
return;
}
sprintf(ptr, "[Object]");
}
|
D
|
/*
* This file generated automatically from shm.xml by c-client.xsl using XSLT.
* Edit at your peril.
*/
/**
* @defgroup XCB_Shm_API XCB Shm API
* @brief Shm XCB Protocol Implementation.
* @{
**/
module std.c.linux.X11.xcb.shm;
version(USE_XCB):
import std.c.linux.X11.xcb.xcb;
import std.c.linux.X11.xcb.xproto;
const int XCB_SHM_MAJOR_VERSION =1;
const int XCB_SHM_MINOR_VERSION =1;
extern(C) extern xcb_extension_t xcb_shm_id;
alias uint xcb_shm_seg_t;
/**
* @brief xcb_shm_seg_iterator_t
**/
struct xcb_shm_seg_iterator_t {
xcb_shm_seg_t *data; /**< */
int rem; /**< */
int index; /**< */
} ;
/** Opcode for xcb_shm_completion. */
const uint XCB_SHM_COMPLETION = 0;
/**
* @brief xcb_shm_completion_event_t
**/
struct xcb_shm_completion_event_t {
ubyte response_type; /**< */
ubyte pad0; /**< */
ushort sequence; /**< */
xcb_drawable_t drawable; /**< */
xcb_shm_seg_t shmseg; /**< */
ushort minor_event; /**< */
ubyte major_event; /**< */
ubyte pad1; /**< */
uint offset; /**< */
} ;
/** Opcode for xcb_shm_bad_seg. */
const uint XCB_SHM_BAD_SEG = 0;
alias xcb_value_error_t xcb_shm_bad_seg_error_t;
/**
* @brief xcb_shm_query_version_cookie_t
**/
struct xcb_shm_query_version_cookie_t {
uint sequence; /**< */
} ;
/** Opcode for xcb_shm_query_version. */
const uint XCB_SHM_QUERY_VERSION = 0;
/**
* @brief xcb_shm_query_version_request_t
**/
struct xcb_shm_query_version_request_t {
ubyte major_opcode; /**< */
ubyte minor_opcode; /**< */
ushort length; /**< */
} ;
/**
* @brief xcb_shm_query_version_reply_t
**/
struct xcb_shm_query_version_reply_t {
ubyte response_type; /**< */
bool shared_pixmaps; /**< */
ushort sequence; /**< */
uint length; /**< */
ushort major_version; /**< */
ushort minor_version; /**< */
ushort uid; /**< */
ushort gid; /**< */
ubyte pixmap_format; /**< */
} ;
/** Opcode for xcb_shm_attach. */
const uint XCB_SHM_ATTACH = 1;
/**
* @brief xcb_shm_attach_request_t
**/
struct xcb_shm_attach_request_t {
ubyte major_opcode; /**< */
ubyte minor_opcode; /**< */
ushort length; /**< */
xcb_shm_seg_t shmseg; /**< */
uint shmid; /**< */
bool read_only; /**< */
} ;
/** Opcode for xcb_shm_detach. */
const uint XCB_SHM_DETACH = 2;
/**
* @brief xcb_shm_detach_request_t
**/
struct xcb_shm_detach_request_t {
ubyte major_opcode; /**< */
ubyte minor_opcode; /**< */
ushort length; /**< */
xcb_shm_seg_t shmseg; /**< */
} ;
/** Opcode for xcb_shm_put_image. */
const uint XCB_SHM_PUT_IMAGE = 3;
/**
* @brief xcb_shm_put_image_request_t
**/
struct xcb_shm_put_image_request_t {
ubyte major_opcode; /**< */
ubyte minor_opcode; /**< */
ushort length; /**< */
xcb_drawable_t drawable; /**< */
xcb_gcontext_t gc; /**< */
ushort total_width; /**< */
ushort total_height; /**< */
ushort src_x; /**< */
ushort src_y; /**< */
ushort src_width; /**< */
ushort src_height; /**< */
short dst_x; /**< */
short dst_y; /**< */
ubyte depth; /**< */
ubyte format; /**< */
ubyte send_event; /**< */
ubyte pad0; /**< */
xcb_shm_seg_t shmseg; /**< */
uint offset; /**< */
} ;
/**
* @brief xcb_shm_get_image_cookie_t
**/
struct xcb_shm_get_image_cookie_t {
uint sequence; /**< */
} ;
/** Opcode for xcb_shm_get_image. */
const uint XCB_SHM_GET_IMAGE = 4;
/**
* @brief xcb_shm_get_image_request_t
**/
struct xcb_shm_get_image_request_t {
ubyte major_opcode; /**< */
ubyte minor_opcode; /**< */
ushort length; /**< */
xcb_drawable_t drawable; /**< */
short x; /**< */
short y; /**< */
ushort width; /**< */
ushort height; /**< */
uint plane_mask; /**< */
ubyte format; /**< */
ubyte pad0[3]; /**< */
xcb_shm_seg_t shmseg; /**< */
uint offset; /**< */
} ;
/**
* @brief xcb_shm_get_image_reply_t
**/
struct xcb_shm_get_image_reply_t {
ubyte response_type; /**< */
ubyte depth; /**< */
ushort sequence; /**< */
uint length; /**< */
xcb_visualid_t visual; /**< */
uint size; /**< */
} ;
/** Opcode for xcb_shm_create_pixmap. */
const uint XCB_SHM_CREATE_PIXMAP = 5;
/**
* @brief xcb_shm_create_pixmap_request_t
**/
struct xcb_shm_create_pixmap_request_t {
ubyte major_opcode; /**< */
ubyte minor_opcode; /**< */
ushort length; /**< */
xcb_pixmap_t pid; /**< */
xcb_drawable_t drawable; /**< */
ushort width; /**< */
ushort height; /**< */
ubyte depth; /**< */
ubyte pad0[3]; /**< */
xcb_shm_seg_t shmseg; /**< */
uint offset; /**< */
} ;
/*****************************************************************************
**
** void xcb_shm_seg_next
**
** @param xcb_shm_seg_iterator_t *i
** @returns void
**
*****************************************************************************/
extern(C) void
xcb_shm_seg_next (xcb_shm_seg_iterator_t *i /**< */);
/*****************************************************************************
**
** xcb_generic_iterator_t xcb_shm_seg_end
**
** @param xcb_shm_seg_iterator_t i
** @returns xcb_generic_iterator_t
**
*****************************************************************************/
extern(C) xcb_generic_iterator_t
xcb_shm_seg_end (xcb_shm_seg_iterator_t i /**< */);
/*****************************************************************************
**
** xcb_shm_query_version_cookie_t xcb_shm_query_version
**
** @param xcb_connection_t *c
** @returns xcb_shm_query_version_cookie_t
**
*****************************************************************************/
extern(C) xcb_shm_query_version_cookie_t
xcb_shm_query_version (xcb_connection_t *c /**< */);
/*****************************************************************************
**
** xcb_shm_query_version_cookie_t xcb_shm_query_version_unchecked
**
** @param xcb_connection_t *c
** @returns xcb_shm_query_version_cookie_t
**
*****************************************************************************/
extern(C) xcb_shm_query_version_cookie_t
xcb_shm_query_version_unchecked (xcb_connection_t *c /**< */);
/*****************************************************************************
**
** xcb_shm_query_version_reply_t * xcb_shm_query_version_reply
**
** @param xcb_connection_t *c
** @param xcb_shm_query_version_cookie_t cookie
** @param xcb_generic_error_t **e
** @returns xcb_shm_query_version_reply_t *
**
*****************************************************************************/
extern(C) xcb_shm_query_version_reply_t *
xcb_shm_query_version_reply (xcb_connection_t *c /**< */,
xcb_shm_query_version_cookie_t cookie /**< */,
xcb_generic_error_t **e /**< */);
/*****************************************************************************
**
** xcb_void_cookie_t xcb_shm_attach_checked
**
** @param xcb_connection_t *c
** @param xcb_shm_seg_t shmseg
** @param uint shmid
** @param bool read_only
** @returns xcb_void_cookie_t
**
*****************************************************************************/
extern(C) xcb_void_cookie_t
xcb_shm_attach_checked (xcb_connection_t *c /**< */,
xcb_shm_seg_t shmseg /**< */,
uint shmid /**< */,
bool read_only /**< */);
/*****************************************************************************
**
** xcb_void_cookie_t xcb_shm_attach
**
** @param xcb_connection_t *c
** @param xcb_shm_seg_t shmseg
** @param uint shmid
** @param bool read_only
** @returns xcb_void_cookie_t
**
*****************************************************************************/
extern(C) xcb_void_cookie_t
xcb_shm_attach (xcb_connection_t *c /**< */,
xcb_shm_seg_t shmseg /**< */,
uint shmid /**< */,
bool read_only /**< */);
/*****************************************************************************
**
** xcb_void_cookie_t xcb_shm_detach_checked
**
** @param xcb_connection_t *c
** @param xcb_shm_seg_t shmseg
** @returns xcb_void_cookie_t
**
*****************************************************************************/
extern(C) xcb_void_cookie_t
xcb_shm_detach_checked (xcb_connection_t *c /**< */,
xcb_shm_seg_t shmseg /**< */);
/*****************************************************************************
**
** xcb_void_cookie_t xcb_shm_detach
**
** @param xcb_connection_t *c
** @param xcb_shm_seg_t shmseg
** @returns xcb_void_cookie_t
**
*****************************************************************************/
extern(C) xcb_void_cookie_t
xcb_shm_detach (xcb_connection_t *c /**< */,
xcb_shm_seg_t shmseg /**< */);
/*****************************************************************************
**
** xcb_void_cookie_t xcb_shm_put_image_checked
**
** @param xcb_connection_t *c
** @param xcb_drawable_t drawable
** @param xcb_gcontext_t gc
** @param ushort total_width
** @param ushort total_height
** @param ushort src_x
** @param ushort src_y
** @param ushort src_width
** @param ushort src_height
** @param short dst_x
** @param short dst_y
** @param ubyte depth
** @param ubyte format
** @param ubyte send_event
** @param xcb_shm_seg_t shmseg
** @param uint offset
** @returns xcb_void_cookie_t
**
*****************************************************************************/
extern(C) xcb_void_cookie_t
xcb_shm_put_image_checked (xcb_connection_t *c /**< */,
xcb_drawable_t drawable /**< */,
xcb_gcontext_t gc /**< */,
ushort total_width /**< */,
ushort total_height /**< */,
ushort src_x /**< */,
ushort src_y /**< */,
ushort src_width /**< */,
ushort src_height /**< */,
short dst_x /**< */,
short dst_y /**< */,
ubyte depth /**< */,
ubyte format /**< */,
ubyte send_event /**< */,
xcb_shm_seg_t shmseg /**< */,
uint offset /**< */);
/*****************************************************************************
**
** xcb_void_cookie_t xcb_shm_put_image
**
** @param xcb_connection_t *c
** @param xcb_drawable_t drawable
** @param xcb_gcontext_t gc
** @param ushort total_width
** @param ushort total_height
** @param ushort src_x
** @param ushort src_y
** @param ushort src_width
** @param ushort src_height
** @param short dst_x
** @param short dst_y
** @param ubyte depth
** @param ubyte format
** @param ubyte send_event
** @param xcb_shm_seg_t shmseg
** @param uint offset
** @returns xcb_void_cookie_t
**
*****************************************************************************/
extern(C) xcb_void_cookie_t
xcb_shm_put_image (xcb_connection_t *c /**< */,
xcb_drawable_t drawable /**< */,
xcb_gcontext_t gc /**< */,
ushort total_width /**< */,
ushort total_height /**< */,
ushort src_x /**< */,
ushort src_y /**< */,
ushort src_width /**< */,
ushort src_height /**< */,
short dst_x /**< */,
short dst_y /**< */,
ubyte depth /**< */,
ubyte format /**< */,
ubyte send_event /**< */,
xcb_shm_seg_t shmseg /**< */,
uint offset /**< */);
/*****************************************************************************
**
** xcb_shm_get_image_cookie_t xcb_shm_get_image
**
** @param xcb_connection_t *c
** @param xcb_drawable_t drawable
** @param short x
** @param short y
** @param ushort width
** @param ushort height
** @param uint plane_mask
** @param ubyte format
** @param xcb_shm_seg_t shmseg
** @param uint offset
** @returns xcb_shm_get_image_cookie_t
**
*****************************************************************************/
extern(C) xcb_shm_get_image_cookie_t
xcb_shm_get_image (xcb_connection_t *c /**< */,
xcb_drawable_t drawable /**< */,
short x /**< */,
short y /**< */,
ushort width /**< */,
ushort height /**< */,
uint plane_mask /**< */,
ubyte format /**< */,
xcb_shm_seg_t shmseg /**< */,
uint offset /**< */);
/*****************************************************************************
**
** xcb_shm_get_image_cookie_t xcb_shm_get_image_unchecked
**
** @param xcb_connection_t *c
** @param xcb_drawable_t drawable
** @param short x
** @param short y
** @param ushort width
** @param ushort height
** @param uint plane_mask
** @param ubyte format
** @param xcb_shm_seg_t shmseg
** @param uint offset
** @returns xcb_shm_get_image_cookie_t
**
*****************************************************************************/
extern(C) xcb_shm_get_image_cookie_t
xcb_shm_get_image_unchecked (xcb_connection_t *c /**< */,
xcb_drawable_t drawable /**< */,
short x /**< */,
short y /**< */,
ushort width /**< */,
ushort height /**< */,
uint plane_mask /**< */,
ubyte format /**< */,
xcb_shm_seg_t shmseg /**< */,
uint offset /**< */);
/*****************************************************************************
**
** xcb_shm_get_image_reply_t * xcb_shm_get_image_reply
**
** @param xcb_connection_t *c
** @param xcb_shm_get_image_cookie_t cookie
** @param xcb_generic_error_t **e
** @returns xcb_shm_get_image_reply_t *
**
*****************************************************************************/
extern(C) xcb_shm_get_image_reply_t *
xcb_shm_get_image_reply (xcb_connection_t *c /**< */,
xcb_shm_get_image_cookie_t cookie /**< */,
xcb_generic_error_t **e /**< */);
/*****************************************************************************
**
** xcb_void_cookie_t xcb_shm_create_pixmap_checked
**
** @param xcb_connection_t *c
** @param xcb_pixmap_t pid
** @param xcb_drawable_t drawable
** @param ushort width
** @param ushort height
** @param ubyte depth
** @param xcb_shm_seg_t shmseg
** @param uint offset
** @returns xcb_void_cookie_t
**
*****************************************************************************/
extern(C) xcb_void_cookie_t
xcb_shm_create_pixmap_checked (xcb_connection_t *c /**< */,
xcb_pixmap_t pid /**< */,
xcb_drawable_t drawable /**< */,
ushort width /**< */,
ushort height /**< */,
ubyte depth /**< */,
xcb_shm_seg_t shmseg /**< */,
uint offset /**< */);
/*****************************************************************************
**
** xcb_void_cookie_t xcb_shm_create_pixmap
**
** @param xcb_connection_t *c
** @param xcb_pixmap_t pid
** @param xcb_drawable_t drawable
** @param ushort width
** @param ushort height
** @param ubyte depth
** @param xcb_shm_seg_t shmseg
** @param uint offset
** @returns xcb_void_cookie_t
**
*****************************************************************************/
extern(C) xcb_void_cookie_t
xcb_shm_create_pixmap (xcb_connection_t *c /**< */,
xcb_pixmap_t pid /**< */,
xcb_drawable_t drawable /**< */,
ushort width /**< */,
ushort height /**< */,
ubyte depth /**< */,
xcb_shm_seg_t shmseg /**< */,
uint offset /**< */);
/**
* @}
*/
|
D
|
module voxelman.blockentity.plugininfo;
enum id = "voxelman.blockentity";
enum semver = "0.7.0";
enum deps = [];
enum clientdeps = [];
enum serverdeps = [];
shared static this()
{
import pluginlib;
import voxelman.blockentity.plugin;
pluginRegistry.regClientPlugin(new BlockEntityClient);
pluginRegistry.regServerPlugin(new BlockEntityServer);
}
|
D
|
/Users/cansoykarafakili/Desktop/Hello/build/Intermediates/Hello.build/Debug/Fluent.build/Objects-normal/x86_64/QueryError.o : /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Utilities/UUID.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/Database+Schema.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/Blob.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/Field.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/ComputedField.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Filter/NodeUtilities/Method+Node.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Filter/NodeUtilities/Filter+Node.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Pagination/Query+Page.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Pagination/Page.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Entity/Storage.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Entity/Timestampable.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Pagination/Paginatable.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Database/Transactable.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Entity/SoftDeletable.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/QueryRepresentable.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Row/RowConvertible.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Filter/Filter+Scope.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/IdentifierType.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Database/Database.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Aggregate.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Filter/NodeUtilities/Scope+String.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Filter/NodeUtilities/Relation+String.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Filter/NodeUtilities/Comparison+String.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Log.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Chunk.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Pivot/PivotProtocol.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Database/ThreadConnectionPool.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Relations/Children.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Join.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Preparation/Database+Preparation.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Preparation/Preparation.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Preparation/Migration.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Action.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Database/Connection.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Entity/KeyNamingConvention.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Filter/Comparison.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Filter/Query+Group.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/Builder.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/Modifier.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Filter/Query+Filter.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Filter/Filter.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Database/Driver.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/SQLite/SQLiteDriver.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/SQL/SQLSerializer.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/SQL/GeneralSQLSerializer.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/SQLite/SQLiteSerializer.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Relations/RelationError.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Pagination/PaginationError.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Preparation/PreparationError.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Pivot/PivotError.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/QueryError.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Entity/EntityError.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/Creator.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Database/Executor.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Relations/Siblings.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Utilities/Exports.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Distinct.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Limit.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Relations/Parent.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Pivot/Pivot.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Pivot/DoublePivot.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Sort.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Row/RowContext.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Raw.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Row/Row.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/Index.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/ForeignKey.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Query.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Entity/Entity.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Entity/Dirty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/libc.framework/Modules/libc.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Node.framework/Modules/Node.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/PathIndexable.framework/Modules/PathIndexable.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Core.framework/Modules/Core.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/SQLite.framework/Modules/SQLite.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Debugging.framework/Modules/Debugging.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Random.framework/Modules/Random.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Bits.framework/Modules/Bits.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/sqlite.git--8232814251736334455/Sources/CSQLite/include/sqlite3.h /Users/cansoykarafakili/Desktop/Hello/Hello.xcodeproj/GeneratedModuleMap/CSQLite/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/cansoykarafakili/Desktop/Hello/build/Intermediates/Hello.build/Debug/Fluent.build/Objects-normal/x86_64/QueryError~partial.swiftmodule : /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Utilities/UUID.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/Database+Schema.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/Blob.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/Field.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/ComputedField.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Filter/NodeUtilities/Method+Node.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Filter/NodeUtilities/Filter+Node.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Pagination/Query+Page.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Pagination/Page.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Entity/Storage.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Entity/Timestampable.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Pagination/Paginatable.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Database/Transactable.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Entity/SoftDeletable.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/QueryRepresentable.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Row/RowConvertible.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Filter/Filter+Scope.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/IdentifierType.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Database/Database.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Aggregate.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Filter/NodeUtilities/Scope+String.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Filter/NodeUtilities/Relation+String.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Filter/NodeUtilities/Comparison+String.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Log.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Chunk.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Pivot/PivotProtocol.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Database/ThreadConnectionPool.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Relations/Children.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Join.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Preparation/Database+Preparation.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Preparation/Preparation.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Preparation/Migration.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Action.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Database/Connection.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Entity/KeyNamingConvention.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Filter/Comparison.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Filter/Query+Group.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/Builder.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/Modifier.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Filter/Query+Filter.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Filter/Filter.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Database/Driver.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/SQLite/SQLiteDriver.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/SQL/SQLSerializer.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/SQL/GeneralSQLSerializer.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/SQLite/SQLiteSerializer.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Relations/RelationError.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Pagination/PaginationError.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Preparation/PreparationError.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Pivot/PivotError.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/QueryError.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Entity/EntityError.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/Creator.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Database/Executor.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Relations/Siblings.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Utilities/Exports.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Distinct.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Limit.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Relations/Parent.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Pivot/Pivot.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Pivot/DoublePivot.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Sort.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Row/RowContext.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Raw.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Row/Row.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/Index.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/ForeignKey.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Query.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Entity/Entity.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Entity/Dirty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/libc.framework/Modules/libc.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Node.framework/Modules/Node.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/PathIndexable.framework/Modules/PathIndexable.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Core.framework/Modules/Core.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/SQLite.framework/Modules/SQLite.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Debugging.framework/Modules/Debugging.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Random.framework/Modules/Random.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Bits.framework/Modules/Bits.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/sqlite.git--8232814251736334455/Sources/CSQLite/include/sqlite3.h /Users/cansoykarafakili/Desktop/Hello/Hello.xcodeproj/GeneratedModuleMap/CSQLite/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/cansoykarafakili/Desktop/Hello/build/Intermediates/Hello.build/Debug/Fluent.build/Objects-normal/x86_64/QueryError~partial.swiftdoc : /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Utilities/UUID.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/Database+Schema.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/Blob.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/Field.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/ComputedField.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Filter/NodeUtilities/Method+Node.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Filter/NodeUtilities/Filter+Node.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Pagination/Query+Page.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Pagination/Page.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Entity/Storage.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Entity/Timestampable.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Pagination/Paginatable.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Database/Transactable.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Entity/SoftDeletable.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/QueryRepresentable.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Row/RowConvertible.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Filter/Filter+Scope.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/IdentifierType.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Database/Database.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Aggregate.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Filter/NodeUtilities/Scope+String.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Filter/NodeUtilities/Relation+String.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Filter/NodeUtilities/Comparison+String.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Log.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Chunk.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Pivot/PivotProtocol.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Database/ThreadConnectionPool.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Relations/Children.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Join.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Preparation/Database+Preparation.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Preparation/Preparation.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Preparation/Migration.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Action.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Database/Connection.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Entity/KeyNamingConvention.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Filter/Comparison.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Filter/Query+Group.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/Builder.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/Modifier.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Filter/Query+Filter.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Filter/Filter.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Database/Driver.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/SQLite/SQLiteDriver.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/SQL/SQLSerializer.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/SQL/GeneralSQLSerializer.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/SQLite/SQLiteSerializer.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Relations/RelationError.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Pagination/PaginationError.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Preparation/PreparationError.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Pivot/PivotError.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/QueryError.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Entity/EntityError.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/Creator.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Database/Executor.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Relations/Siblings.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Utilities/Exports.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Distinct.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Limit.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Relations/Parent.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Pivot/Pivot.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Pivot/DoublePivot.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Sort.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Row/RowContext.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Raw.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Row/Row.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/Index.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/ForeignKey.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/Query.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Entity/Entity.swift /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Entity/Dirty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/libc.framework/Modules/libc.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Node.framework/Modules/Node.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/PathIndexable.framework/Modules/PathIndexable.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Core.framework/Modules/Core.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/SQLite.framework/Modules/SQLite.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Debugging.framework/Modules/Debugging.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Random.framework/Modules/Random.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Bits.framework/Modules/Bits.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/sqlite.git--8232814251736334455/Sources/CSQLite/include/sqlite3.h /Users/cansoykarafakili/Desktop/Hello/Hello.xcodeproj/GeneratedModuleMap/CSQLite/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
|
D
|
/// Copyright: Copyright (c) 2017-2019 Andrey Penechko.
/// License: $(WEB boost.org/LICENSE_1_0.txt, Boost License 1.0).
/// Authors: Andrey Penechko.
module fe.ast.stmt.block_stmt;
import all;
@(AstType.stmt_block)
struct BlockStmtNode {
mixin AstNodeData!(AstType.stmt_block, AstFlags.isStatement, AstNodeState.name_register_self_done);
/// Each node can be expression, declaration or expression
AstNodes statements;
}
void name_register_nested_block(BlockStmtNode* node, ref NameRegisterState state) {
node.state = AstNodeState.name_register_nested;
require_name_register(node.statements, state);
node.state = AstNodeState.name_register_nested_done;
}
void name_resolve_block(BlockStmtNode* node, ref NameResolveState state) {
node.state = AstNodeState.name_resolve;
require_name_resolve(node.statements, state);
node.state = AstNodeState.name_resolve_done;
}
void type_check_block(BlockStmtNode* node, ref TypeCheckState state)
{
node.state = AstNodeState.type_check;
require_type_check(node.statements, state);
node.state = AstNodeState.type_check_done;
}
|
D
|
import std.algorithm;
import std.stdio;
import core.stdc.stdio;
import std.conv;
import std.string;
void main() {
auto file = File("in.txt");
int curGuard = 0;
int lastSleep = -1;
char[] buf;
int[60][int] guards;
int[60] zs;
for (int i = 0; i < 60; i++) {
zs[i] = 0;
}
while (file.readln(buf)) {
if (canFind(buf, ['s', 'h', 'i'])) {
sscanf(toStringz(buf), toStringz("[%*d-%*d-%*d %*d:%*d] Guard #%d"), &curGuard);
guards.require(curGuard, zs);
lastSleep = -1;
}
int timestamp;
sscanf(toStringz(buf), toStringz("[%*d-%*d-%*d %*d:%d]"), ×tamp);
if (canFind(buf, ['a', 's', 'l', 'e'])) {
lastSleep = timestamp;
}
if (canFind(buf, ['w', 'a', 'k', 'e'])) {
for (int i = lastSleep; i < timestamp; i++) {
guards[curGuard][i]++;
}
}
}
int mx = 0;
int mi = -1;
foreach (guard, pattern; guards) {
int sm = 0;
for (int i = 0; i < 60; i++) {
sm += pattern[i];
}
if (sm > mx) {
mi = guard;
mx = sm;
}
}
int mx2 = 0;
int mi2 = 0;
for (int i = 0; i < 60; i++) {
int v = guards[mi][i];
if (v > mx2) {
mi2 = i;
mx2 = v;
}
}
writefln("%d", mi * mi2);
}
|
D
|
/Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Async.build/Future+Transform.swift.o : /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Async+NIO.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Future+Variadic.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Deprecated.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Future+Void.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/FutureType.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Collection+Future.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Future+DoCatch.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Future+Global.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Future+Transform.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Future+Flatten.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Future+Map.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Worker.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/QueueHandler.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/AsyncError.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Exports.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes
/Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Async.build/Future+Transform~partial.swiftmodule : /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Async+NIO.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Future+Variadic.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Deprecated.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Future+Void.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/FutureType.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Collection+Future.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Future+DoCatch.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Future+Global.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Future+Transform.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Future+Flatten.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Future+Map.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Worker.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/QueueHandler.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/AsyncError.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Exports.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes
/Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/Async.build/Future+Transform~partial.swiftdoc : /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Async+NIO.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Future+Variadic.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Deprecated.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Future+Void.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/FutureType.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Collection+Future.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Future+DoCatch.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Future+Global.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Future+Transform.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Future+Flatten.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Future+Map.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Worker.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/QueueHandler.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/AsyncError.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/core/Sources/Async/Exports.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes
|
D
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.