├── .gitignore ├── LICENSE ├── README.md ├── bin ├── tutorial0.lua ├── tutorial0.py ├── tutorial1.lua ├── tutorial1.py ├── tutorial2.lua ├── tutorial2.py ├── tutorial3.lua ├── tutorial3.py ├── tutorial4.lua ├── tutorial4.py ├── tutorial5.lua ├── tutorial5.py ├── tutorial6.lua ├── tutorial6.py ├── tutorial7.lua ├── tutorial7.py ├── tutorial8.lua ├── tutorial8.py ├── tutorial9.lua └── tutorial9.py ├── crt ├── File.cpp ├── File.i ├── crt.cpp ├── crt.props ├── crt.sln ├── crt.vcxproj └── crt.vcxproj.filters ├── idlcpp ├── build │ └── vs2015 │ │ ├── idlcpp.sln │ │ ├── idlcpp.vcxproj │ │ └── idlcpp.vcxproj.filters └── src │ ├── AttributeListNode.cpp │ ├── AttributeListNode.h │ ├── AttributeNode.cpp │ ├── AttributeNode.h │ ├── ClassNode.cpp │ ├── ClassNode.h │ ├── CommonFuncs.cpp │ ├── CommonFuncs.h │ ├── Compiler.cpp │ ├── Compiler.h │ ├── DelegateNode.cpp │ ├── DelegateNode.h │ ├── EnumNode.cpp │ ├── EnumNode.h │ ├── EnumeratorListNode.cpp │ ├── EnumeratorListNode.h │ ├── EnumeratorNode.cpp │ ├── EnumeratorNode.h │ ├── ErrorList.cpp │ ├── ErrorList.h │ ├── FieldNode.cpp │ ├── FieldNode.h │ ├── GetterSetterNode.cpp │ ├── GetterSetterNode.h │ ├── HeaderFileGenerator.cpp │ ├── HeaderFileGenerator.h │ ├── IdentifyListNode.cpp │ ├── IdentifyListNode.h │ ├── IdentifyNode.cpp │ ├── IdentifyNode.h │ ├── ImportDirectory.cpp │ ├── ImportDirectory.h │ ├── MemberListNode.cpp │ ├── MemberListNode.h │ ├── MemberNode.cpp │ ├── MemberNode.h │ ├── MetaHeaderFileGenerator.cpp │ ├── MetaHeaderFileGenerator.h │ ├── MetaSourceFileGenerator.cpp │ ├── MetaSourceFileGenerator.h │ ├── MethodNode.cpp │ ├── MethodNode.h │ ├── NamespaceNode.cpp │ ├── NamespaceNode.h │ ├── OperatorNode.cpp │ ├── OperatorNode.h │ ├── Options.cpp │ ├── Options.h │ ├── ParameterListNode.cpp │ ├── ParameterListNode.h │ ├── ParameterNode.cpp │ ├── ParameterNode.h │ ├── Platform.cpp │ ├── Platform.h │ ├── ProgramNode.cpp │ ├── ProgramNode.h │ ├── PropertyNode.cpp │ ├── PropertyNode.h │ ├── RaiseError.cpp │ ├── RaiseError.h │ ├── ScopeNameListNode.cpp │ ├── ScopeNameListNode.h │ ├── ScopeNameNode.cpp │ ├── ScopeNameNode.h │ ├── ScopeNode.h │ ├── SourceFile.cpp │ ├── SourceFile.h │ ├── SourceFileGenerator.cpp │ ├── SourceFileGenerator.h │ ├── SyntaxNodeImpl.cpp │ ├── SyntaxNodeImpl.h │ ├── TemplateArguments.cpp │ ├── TemplateArguments.h │ ├── TemplateClassInstanceNode.cpp │ ├── TemplateClassInstanceNode.h │ ├── TemplateParameterListNode.cpp │ ├── TemplateParameterListNode.h │ ├── TemplateParametersNode.cpp │ ├── TemplateParametersNode.h │ ├── TokenListNode.cpp │ ├── TokenListNode.h │ ├── TokenNode.cpp │ ├── TokenNode.h │ ├── TypeDeclarationNode.cpp │ ├── TypeDeclarationNode.h │ ├── TypeNameListNode.cpp │ ├── TypeNameListNode.h │ ├── TypeNameNode.cpp │ ├── TypeNameNode.h │ ├── TypeTree.cpp │ ├── TypeTree.h │ ├── TypedefNode.cpp │ ├── TypedefNode.h │ ├── Utility.cpp │ ├── Utility.h │ ├── idlcpp.cpp │ ├── idlcpp.h │ ├── idlcpp.l │ ├── idlcpp.l.c │ ├── idlcpp.y │ ├── idlcpp.y.c │ ├── idlcpp.y.h │ ├── targetver.h │ ├── yyfuncs.cpp │ └── yyfuncs.h ├── paf ├── build │ └── vs2015 │ │ ├── paf.sln │ │ ├── pafcore │ │ ├── pafcore.props │ │ ├── pafcore.vcxproj │ │ └── pafcore.vcxproj.filters │ │ ├── paflua │ │ ├── paflua.vcxproj │ │ └── paflua.vcxproj.filters │ │ └── pafpython │ │ ├── pafpython.vcxproj │ │ └── pafpython.vcxproj.filters └── src │ ├── pafcore │ ├── Argument.cpp │ ├── Argument.h │ ├── Argument.i │ ├── Argument.ic │ ├── Argument.mc │ ├── Argument.mh │ ├── AutoRun.h │ ├── ClassType.cpp │ ├── ClassType.h │ ├── ClassType.i │ ├── ClassType.ic │ ├── ClassType.mc │ ├── ClassType.mh │ ├── Debug.h │ ├── Delegate.cpp │ ├── Delegate.h │ ├── Delegate.i │ ├── Delegate.ic │ ├── Delegate.mc │ ├── Delegate.mh │ ├── EnumType.cpp │ ├── EnumType.h │ ├── EnumType.i │ ├── EnumType.ic │ ├── EnumType.mc │ ├── EnumType.mh │ ├── Enumerator.cpp │ ├── Enumerator.h │ ├── Enumerator.i │ ├── Enumerator.ic │ ├── Enumerator.mc │ ├── Enumerator.mh │ ├── FlexiblePropertySource.cpp │ ├── FlexiblePropertySource.h │ ├── FlexiblePropertySource.i │ ├── FlexiblePropertySource.ic │ ├── FlexiblePropertySource.mc │ ├── FlexiblePropertySource.mh │ ├── InstanceField.cpp │ ├── InstanceField.h │ ├── InstanceField.i │ ├── InstanceField.ic │ ├── InstanceField.mc │ ├── InstanceField.mh │ ├── InstanceMethod.cpp │ ├── InstanceMethod.h │ ├── InstanceMethod.i │ ├── InstanceMethod.ic │ ├── InstanceMethod.mc │ ├── InstanceMethod.mh │ ├── InstanceProperty.cpp │ ├── InstanceProperty.h │ ├── InstanceProperty.i │ ├── InstanceProperty.ic │ ├── InstanceProperty.mc │ ├── InstanceProperty.mh │ ├── Iterator.cpp │ ├── Iterator.h │ ├── Iterator.i │ ├── Iterator.ic │ ├── Iterator.mc │ ├── Iterator.mh │ ├── Metadata.cpp │ ├── Metadata.h │ ├── Metadata.i │ ├── Metadata.ic │ ├── Metadata.mc │ ├── Metadata.mh │ ├── NameSpace.cpp │ ├── NameSpace.h │ ├── NameSpace.i │ ├── NameSpace.ic │ ├── NameSpace.mc │ ├── NameSpace.mh │ ├── NotifyHandler.cpp │ ├── NotifyHandler.h │ ├── NotifyHandler.i │ ├── NotifyHandler.ic │ ├── NotifyHandler.mc │ ├── NotifyHandler.mh │ ├── NotifyHandlerList.cpp │ ├── NotifyHandlerList.h │ ├── NotifyHandlerList.i │ ├── NotifyHandlerList.ic │ ├── NotifyHandlerList.mc │ ├── NotifyHandlerList.mh │ ├── Object.cpp │ ├── Object.h │ ├── Object.i │ ├── Object.ic │ ├── Object.mc │ ├── Object.mh │ ├── Overload.cpp │ ├── Overload.h │ ├── PrimitiveType.cpp │ ├── PrimitiveType.h │ ├── PrimitiveType.i │ ├── PrimitiveType.ic │ ├── PrimitiveType.mc │ ├── PrimitiveType.mh │ ├── RefCount.h │ ├── RefCountImpl.h │ ├── RefPtr.h │ ├── Reference.cpp │ ├── Reference.h │ ├── Reference.i │ ├── Reference.ic │ ├── Reference.mc │ ├── Reference.mh │ ├── Reflection.cpp │ ├── Reflection.h │ ├── Reflection.i │ ├── Reflection.ic │ ├── Reflection.mc │ ├── Reflection.mh │ ├── Result.cpp │ ├── Result.h │ ├── Result.i │ ├── Result.ic │ ├── Result.mc │ ├── Result.mh │ ├── StaticField.cpp │ ├── StaticField.h │ ├── StaticField.i │ ├── StaticField.ic │ ├── StaticField.mc │ ├── StaticField.mh │ ├── StaticMethod.cpp │ ├── StaticMethod.h │ ├── StaticMethod.i │ ├── StaticMethod.ic │ ├── StaticMethod.mc │ ├── StaticMethod.mh │ ├── StaticProperty.cpp │ ├── StaticProperty.h │ ├── StaticProperty.i │ ├── StaticProperty.ic │ ├── StaticProperty.mc │ ├── StaticProperty.mh │ ├── String.cpp │ ├── String.h │ ├── String.i │ ├── String.ic │ ├── String.mc │ ├── String.mh │ ├── SubclassInvoker.h │ ├── System.cpp │ ├── System.h │ ├── System.i │ ├── System.ic │ ├── System.mc │ ├── System.mh │ ├── Type.cpp │ ├── Type.h │ ├── Type.i │ ├── Type.ic │ ├── Type.mc │ ├── Type.mh │ ├── TypeAlias.cpp │ ├── TypeAlias.h │ ├── TypeAlias.i │ ├── TypeAlias.ic │ ├── TypeAlias.mc │ ├── TypeAlias.mh │ ├── Typedef.cpp │ ├── Typedef.h │ ├── Typedef.i │ ├── Typedef.ic │ ├── Typedef.mc │ ├── Typedef.mh │ ├── Utility.cpp │ ├── Utility.h │ ├── Variant.cpp │ ├── Variant.h │ ├── VoidType.cpp │ ├── VoidType.h │ ├── VoidType.i │ ├── VoidType.ic │ ├── VoidType.mc │ ├── VoidType.mh │ └── dllmain.cpp │ ├── paflua │ ├── LuaCallBack.cpp │ ├── LuaCallBack.i │ ├── LuaSubclassInvoker.cpp │ ├── LuaSubclassInvoker.h │ ├── LuaSubclassInvoker2.cpp │ ├── LuaSubclassInvoker2.h │ ├── LuaWrapper.cpp │ ├── LuaWrapper.h │ ├── LuaWrapper2.cpp │ ├── LuaWrapper2.h │ ├── Utility.h │ ├── paflua.cpp │ └── paflua.h │ ├── pafpython │ ├── PythonSubclassInvoker.cpp │ ├── PythonSubclassInvoker.h │ ├── PythonWrapper.cpp │ ├── PythonWrapper.h │ └── Utility.h │ └── pafstd │ ├── Base64.cpp │ ├── Base64.h │ ├── BinaryXml.cpp │ ├── BinaryXml.i │ ├── Blob.cpp │ ├── Blob.i │ ├── FixedString.cpp │ ├── FixedString.i │ ├── List.h │ ├── Noncopyable.h │ ├── OrderedArray.h │ ├── Set.h │ ├── StringPool.cpp │ ├── StringPool.h │ ├── TempBuffer.h │ ├── UniqueOrderedArray.h │ ├── Utility.h │ ├── XmlSerializer.cpp │ ├── XmlSerializer.i │ └── dllmain.cpp ├── tutorials ├── Common │ ├── Tutorial0.i │ ├── Tutorial1.i │ ├── Tutorial2.i │ ├── Tutorial3.i │ ├── Tutorial4.cpp │ ├── Tutorial4.i │ ├── Tutorial5.cpp │ ├── Tutorial5.i │ ├── Tutorial6.cpp │ ├── Tutorial6.i │ ├── Tutorial7.cpp │ └── Tutorial7.i ├── LuaTutorials │ ├── LuaTutorial.props │ ├── LuaTutorial0 │ │ ├── LuaTutorial0.cpp │ │ ├── LuaTutorial0.vcxproj │ │ └── LuaTutorial0.vcxproj.filters │ ├── LuaTutorial1 │ │ ├── LuaTutorial1.cpp │ │ ├── LuaTutorial1.vcxproj │ │ └── LuaTutorial1.vcxproj.filters │ ├── LuaTutorial2 │ │ ├── LuaTutorial2.cpp │ │ ├── LuaTutorial2.vcxproj │ │ └── LuaTutorial2.vcxproj.filters │ ├── LuaTutorial3 │ │ ├── LuaTutorial3.cpp │ │ ├── LuaTutorial3.vcxproj │ │ └── LuaTutorial3.vcxproj.filters │ ├── LuaTutorial4 │ │ ├── LuaTutorial4.cpp │ │ ├── LuaTutorial4.vcxproj │ │ └── LuaTutorial4.vcxproj.filters │ ├── LuaTutorial5 │ │ ├── LuaTutorial5.cpp │ │ ├── LuaTutorial5.vcxproj │ │ └── LuaTutorial5.vcxproj.filters │ ├── LuaTutorial6 │ │ ├── LuaTutorial6.cpp │ │ ├── LuaTutorial6.vcxproj │ │ └── LuaTutorial6.vcxproj.filters │ ├── LuaTutorial7 │ │ ├── LuaTutorial7.cpp │ │ ├── LuaTutorial7.vcxproj │ │ └── LuaTutorial7.vcxproj.filters │ ├── LuaTutorial8 │ │ ├── LuaTutorial8.cpp │ │ ├── LuaTutorial8.vcxproj │ │ └── LuaTutorial8.vcxproj.filters │ ├── LuaTutorial9 │ │ ├── LuaTutorial9.cpp │ │ ├── LuaTutorial9.vcxproj │ │ └── LuaTutorial9.vcxproj.filters │ └── LuaTutorials.sln └── PythonTutorials │ ├── PythonTutorial.props │ ├── PythonTutorial0 │ ├── PythonTutorial0.cpp │ ├── PythonTutorial0.vcxproj │ └── PythonTutorial0.vcxproj.filters │ ├── PythonTutorial1 │ ├── PythonTutorial1.cpp │ ├── PythonTutorial1.vcxproj │ └── PythonTutorial1.vcxproj.filters │ ├── PythonTutorial2 │ ├── PythonTutorial2.cpp │ ├── PythonTutorial2.vcxproj │ └── PythonTutorial2.vcxproj.filters │ ├── PythonTutorial3 │ ├── PythonTutorial3.cpp │ ├── PythonTutorial3.vcxproj │ └── PythonTutorial3.vcxproj.filters │ ├── PythonTutorial4 │ ├── PythonTutorial4.cpp │ ├── PythonTutorial4.vcxproj │ └── PythonTutorial4.vcxproj.filters │ ├── PythonTutorial5 │ ├── PythonTutorial5.cpp │ ├── PythonTutorial5.vcxproj │ └── PythonTutorial5.vcxproj.filters │ ├── PythonTutorial6 │ ├── PythonTutorial6.cpp │ ├── PythonTutorial6.vcxproj │ └── PythonTutorial6.vcxproj.filters │ ├── PythonTutorial7 │ ├── PythonTutorial7.cpp │ ├── PythonTutorial7.vcxproj │ └── PythonTutorial7.vcxproj.filters │ ├── PythonTutorial8 │ ├── PythonTutorial8.cpp │ ├── PythonTutorial8.vcxproj │ └── PythonTutorial8.vcxproj.filters │ ├── PythonTutorial9 │ ├── PythonTutorial9.cpp │ ├── PythonTutorial9.vcxproj │ └── PythonTutorial9.vcxproj.filters │ └── PythonTutorials.sln └── win32gui ├── MessageBox.cpp ├── MessageBox.i ├── win32gui.cpp ├── win32gui.props ├── win32gui.sln ├── win32gui.vcxproj └── win32gui.vcxproj.filters /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | *.obj 6 | 7 | # Precompiled Headers 8 | *.gch 9 | *.pch 10 | 11 | # Compiled Dynamic libraries 12 | *.so 13 | *.dylib 14 | *.dll 15 | 16 | # Fortran module files 17 | *.mod 18 | 19 | # Compiled Static libraries 20 | *.lai 21 | *.la 22 | *.a 23 | *.lib 24 | 25 | # Executables 26 | *.exe 27 | *.out 28 | *.app 29 | 30 | # visual studio 31 | *.suo 32 | *.sdf 33 | *.user 34 | *.exp 35 | *.pdb 36 | *.log 37 | *.tlog 38 | *.idb 39 | *.ilk 40 | *.ipdb 41 | *.iobj 42 | *.opensdf 43 | *.pyc 44 | 45 | # idlcpp 46 | *.mh 47 | *.ic 48 | *.mc -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Peng Aifeng 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # idlcpp 2 | An interface description language compiler, which generates c++ source code for easily embedding script language like python, lua, etc. 3 | -------------------------------------------------------------------------------- /bin/tutorial0.lua: -------------------------------------------------------------------------------- 1 | 2 | paf.tutorial.Test.Run(); 3 | -------------------------------------------------------------------------------- /bin/tutorial0.py: -------------------------------------------------------------------------------- 1 | import pafpython; 2 | paf = pafpython.paf; 3 | 4 | paf.tutorial.Test.Run(); 5 | -------------------------------------------------------------------------------- /bin/tutorial1.lua: -------------------------------------------------------------------------------- 1 | 2 | pt = paf.tutorial.Point.New(); 3 | pt.x = 1; 4 | pt.y = 2; 5 | 6 | x = paf.float.New(); 7 | pt:getX(x); 8 | 9 | print(x[0]); 10 | print(pt.x); 11 | print(pt.y); 12 | print(pt:test()); -------------------------------------------------------------------------------- /bin/tutorial1.py: -------------------------------------------------------------------------------- 1 | import pafpython; 2 | paf = pafpython.paf; 3 | 4 | pt = paf.tutorial.Point.New(); 5 | pt.x = 1; 6 | pt.y = 2; 7 | print(pt.x); 8 | print(pt.y); 9 | print(pt.x._); 10 | print(pt.y._); 11 | -------------------------------------------------------------------------------- /bin/tutorial2.lua: -------------------------------------------------------------------------------- 1 | 2 | rect1 = paf.tutorial.Rectangle(); 3 | rect1.m_min.x = 1; 4 | rect1.m_min.y = 2; 5 | 6 | print(rect1.left); 7 | print(rect1.bottom); 8 | 9 | rect1.right = 3; 10 | rect1.top = 4; 11 | 12 | print(rect1.m_max.x); 13 | print(rect1.m_max.y); 14 | 15 | print(rect1.area); 16 | 17 | rect2 = paf.tutorial.Rectangle(rect1.m_min, paf.tutorial.Point(5,5)); 18 | print(rect2:getArea()); 19 | 20 | rect3 = paf.tutorial.Rectangle.New(rect2); 21 | print(rect3:getArea()); 22 | -------------------------------------------------------------------------------- /bin/tutorial2.py: -------------------------------------------------------------------------------- 1 | import pafpython; 2 | paf = pafpython.paf; 3 | 4 | rect1 = paf.tutorial.Rectangle(); 5 | rect1.m_min.x = 1; 6 | rect1.m_min.y = 2; 7 | 8 | print(rect1.left._); 9 | print(rect1.bottom._); 10 | 11 | rect1.right = 3; 12 | rect1.top = 4; 13 | 14 | print(rect1.m_max.x._); 15 | print(rect1.m_max.y._); 16 | 17 | print(rect1.area._); 18 | 19 | rect2 = paf.tutorial.Rectangle(rect1.m_min, paf.tutorial.Point(5,5)); 20 | print(rect2.getArea()._); 21 | 22 | rect3 = paf.tutorial.Rectangle.Clone(rect2); 23 | print(rect3.getArea()._); 24 | -------------------------------------------------------------------------------- /bin/tutorial3.lua: -------------------------------------------------------------------------------- 1 | 2 | triangle = paf.tutorial.Triangle(); 3 | triangle.m_vertices[0] = paf.tutorial.Point(0,0); 4 | triangle.m_vertices[1] = paf.tutorial.Point(0,1); 5 | triangle.m_vertices[2] = paf.tutorial.Point(1,1); 6 | 7 | print(triangle:getArea()); 8 | -------------------------------------------------------------------------------- /bin/tutorial3.py: -------------------------------------------------------------------------------- 1 | import pafpython; 2 | paf = pafpython.paf; 3 | 4 | triangle = paf.tutorial.Triangle(); 5 | triangle.m_vertices[0] = paf.tutorial.Point(0,0); 6 | triangle.m_vertices[1] = paf.tutorial.Point(0,1); 7 | triangle.m_vertices[2] = paf.tutorial.Point(1,1); 8 | 9 | print(triangle.getArea()._); 10 | -------------------------------------------------------------------------------- /bin/tutorial4.lua: -------------------------------------------------------------------------------- 1 | 2 | triangle = paf.tutorial.Triangle(); 3 | triangle.m_vertices[0] = paf.tutorial.Point(0,0); 4 | triangle.m_vertices[1] = paf.tutorial.Point(0,1); 5 | triangle.m_vertices[2] = paf.tutorial.Point(1,1); 6 | 7 | shapeManager = paf.tutorial.ShapeManager.GetInstance(); 8 | shapeManager:addShape(triangle); 9 | print(shapeManager:getTotalArea()); 10 | -------------------------------------------------------------------------------- /bin/tutorial4.py: -------------------------------------------------------------------------------- 1 | import pafpython; 2 | paf = pafpython.paf; 3 | 4 | triangle = paf.tutorial.Triangle(); 5 | triangle.m_vertices[0] = paf.tutorial.Point(0,0); 6 | triangle.m_vertices[1] = paf.tutorial.Point(0,1); 7 | triangle.m_vertices[2] = paf.tutorial.Point(1,1); 8 | 9 | shapeManager = paf.tutorial.ShapeManager.GetInstance(); 10 | shapeManager.addShape(triangle); 11 | print(shapeManager.getTotalArea()._); 12 | -------------------------------------------------------------------------------- /bin/tutorial5.lua: -------------------------------------------------------------------------------- 1 | 2 | Circle = {} 3 | Circle.__index = Circle; 4 | 5 | function Circle.New() 6 | circle= {radius = 1.0} 7 | setmetatable(circle, Circle); 8 | circle.shape = paf.tutorial.Shape._Derive_(circle); 9 | return circle; 10 | end 11 | 12 | function Circle:getArea2(area) 13 | area[0] = self.radius * self.radius * 3.1415926; 14 | end 15 | 16 | circle = Circle.New(); 17 | circle.radius = 2.0; 18 | shapeManager = paf.tutorial.ShapeManager.GetInstance(); 19 | 20 | aa = paf.float(0); 21 | circle:getArea2(aa); 22 | print(aa[0]); 23 | 24 | triangle = paf.tutorial.Triangle(); 25 | triangle.m_vertices[0] = paf.tutorial.Point(0,0); 26 | triangle.m_vertices[1] = paf.tutorial.Point(0,1); 27 | triangle.m_vertices[2] = paf.tutorial.Point(1,1); 28 | shapeManager:addShape(triangle); 29 | print(shapeManager:getTotalArea()); 30 | 31 | 32 | 33 | shapeManager:addShape(circle.shape); 34 | print(shapeManager:getTotalArea()); 35 | 36 | -------------------------------------------------------------------------------- /bin/tutorial5.py: -------------------------------------------------------------------------------- 1 | import pafpython; 2 | paf = pafpython.paf; 3 | 4 | class Circle: 5 | def __init__(self): 6 | self.radius = 1.0 7 | self.shape = paf.tutorial.Shape._Derive_(self); 8 | def getArea(self): 9 | return 3.1415926 * self.radius * self.radius; 10 | 11 | circle = Circle(); 12 | circle.radius = 2.0; 13 | 14 | shapeManager = paf.tutorial.ShapeManager.GetInstance(); 15 | shapeManager.addShape(circle.shape); 16 | print(shapeManager.getTotalArea()._); 17 | 18 | triangle = paf.tutorial.Triangle(); 19 | triangle.m_vertices[0] = paf.tutorial.Point(0,0); 20 | triangle.m_vertices[1] = paf.tutorial.Point(0,1); 21 | triangle.m_vertices[2] = paf.tutorial.Point(1,1); 22 | shapeManager.addShape(triangle); 23 | print(shapeManager.getTotalArea()._); 24 | -------------------------------------------------------------------------------- /bin/tutorial6.lua: -------------------------------------------------------------------------------- 1 | v1 = paf.tutorial.Vector3f(1,1,2); 2 | v1.z = 1; 3 | print(v1.length); 4 | 5 | v2 = paf.tutorial.Vector3d(2,2,1); 6 | v2.v[2] = 2; 7 | print(v2:getLength()); 8 | -------------------------------------------------------------------------------- /bin/tutorial6.py: -------------------------------------------------------------------------------- 1 | import pafpython; 2 | paf = pafpython.paf; 3 | 4 | v1 = paf.tutorial.Vector3f.New(1,1,2); 5 | v1.z = 1; 6 | print(v1.length._); 7 | 8 | v2 = paf.tutorial.Vector3d(2,2,1); 9 | v2.v[2] = 2; 10 | print(v2.getLength()._); 11 | -------------------------------------------------------------------------------- /bin/tutorial7.lua: -------------------------------------------------------------------------------- 1 | Window = {} 2 | Window.__index = Window; 3 | 4 | function Window.New() 5 | window = {} 6 | setmetatable(window, Window); 7 | window.button = paf.tutorial.Button(); 8 | window.callback = window.button.click._add_(window, "onClick"); 9 | return window; 10 | end 11 | 12 | function Window:onClick(sender) 13 | print("Window:onClick()" ); 14 | end 15 | 16 | test = paf.tutorial.Test(); 17 | test.mp["a"] = 1; 18 | test.mp["b"] = 2; 19 | 20 | print(test.mp["a"]); 21 | print(test.mp["b"]); 22 | 23 | window = Window.New(); 24 | window.button:raiseClick(); 25 | --window.button.click._remove_(window, "onClick"); 26 | --window.button:raiseClick(); 27 | -------------------------------------------------------------------------------- /bin/tutorial7.py: -------------------------------------------------------------------------------- 1 | import pafpython; 2 | paf = pafpython.paf; 3 | 4 | ray = paf.tutorial.Ray3f(paf.tutorial.Vector3f(0,0,0), paf.tutorial.Vector3f(1,2,3)); 5 | pt = paf.tutorial.Vector3f(0,0,0); 6 | ray.getPoint(pt, 2); 7 | print(pt.x._); 8 | print(pt.y._); 9 | print(pt.z._); 10 | pt = ray.getPoint(3); 11 | print(pt.x._); 12 | print(pt.y._); 13 | print(pt.z._); 14 | -------------------------------------------------------------------------------- /bin/tutorial9.lua: -------------------------------------------------------------------------------- 1 | 2 | File = paf.crt.File; 3 | file = File.New("D:\\GitHub\\idlcpp\\bin\\tutorial9.lua", "rb"); 4 | if file then 5 | file:seek(0, File.SeekFlag.seek_end); 6 | size = file:tell(); 7 | file:seek(0, File.SeekFlag.seek_set); 8 | buf = paf.char.NewArray(size + 1); 9 | file:read(buf, size); 10 | buf[size] = 0; 11 | print(buf._); 12 | end -------------------------------------------------------------------------------- /bin/tutorial9.py: -------------------------------------------------------------------------------- 1 | import pafpython; 2 | paf = pafpython.paf; 3 | File = paf.crt.File; 4 | 5 | file = File.New("D:\\GitHub\\idlcpp\\bin\\tutorial9.py", "rb"); 6 | if (not file._isNullPtr_._) : 7 | file.seek(0, File.SeekFlag.seek_end); 8 | size = file.tell(); 9 | file.seek(0, File.SeekFlag.seek_set); 10 | buf = paf.char.NewArray(size + 1); 11 | file.read(buf, size); 12 | buf[size] = 0; 13 | print(buf._); -------------------------------------------------------------------------------- /crt/File.cpp: -------------------------------------------------------------------------------- 1 | #include "File.h" 2 | #include "File.mh" 3 | #include "File.ic" 4 | #include "File.mc" 5 | #include 6 | 7 | namespace crt 8 | { 9 | 10 | File* File::New(const char * path, const char * mode) 11 | { 12 | FILE* file = fopen(path, mode); 13 | return (File*)file; 14 | } 15 | 16 | void File::Delete(File* file) 17 | { 18 | fclose((FILE*)file); 19 | } 20 | 21 | File* File::Open(const char * path, const char * mode) 22 | { 23 | FILE* file = fopen(path, mode); 24 | return (File*)file; 25 | } 26 | 27 | void File::Close(File* file) 28 | { 29 | fclose((FILE*)file); 30 | } 31 | 32 | //void File::__destroyInstance__(File* file) 33 | //{ 34 | // fclose((FILE*)file); 35 | //} 36 | 37 | size_t File::read(void * buffer, size_t size) 38 | { 39 | return fread(buffer, size, 1, (FILE*)this); 40 | } 41 | 42 | int File::seek(long offset, SeekFlag flag) 43 | { 44 | return fseek((FILE*)this, offset, flag); 45 | } 46 | 47 | long File::tell() 48 | { 49 | return ftell((FILE*)this); 50 | } 51 | 52 | } -------------------------------------------------------------------------------- /crt/File.i: -------------------------------------------------------------------------------- 1 | #import "typedef.i" 2 | 3 | namespace crt 4 | { 5 | struct File 6 | { 7 | enum SeekFlag 8 | { 9 | seek_set, 10 | seek_cur, 11 | seek_end, 12 | }; 13 | static File^ New(const char* path, const char* mode); 14 | static void Delete(File* file); 15 | static File* Open(const char* path, const char* mode); 16 | static void Close(File* file); 17 | static void __destroyInstance__(File* file) = "Close"; 18 | size_t read(void* buffer, size_t size); 19 | int seek(long offset, SeekFlag flag); 20 | long tell(); 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /crt/crt.cpp: -------------------------------------------------------------------------------- 1 | 2 | #if defined(_DEBUG) 3 | #pragma comment(lib,"pafcore_d.lib") 4 | #else 5 | #pragma comment(lib,"pafcore.lib") 6 | #endif 7 | 8 | -------------------------------------------------------------------------------- /crt/crt.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | idlcpp -ld -pc../paf/src/pafcore/ -I"..\paf\src\pafcore" %(FullPath) 9 | 10 | 11 | 12 | 13 | %(RootDir)%(Directory)%(Filename).h 14 | 15 | 16 | ../bin/ 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /crt/crt.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.23107.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "crt", "crt.vcxproj", "{DF50BC17-D54B-4641-833A-02C569413A7A}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {DF50BC17-D54B-4641-833A-02C569413A7A}.Debug|x64.ActiveCfg = Debug|x64 17 | {DF50BC17-D54B-4641-833A-02C569413A7A}.Debug|x64.Build.0 = Debug|x64 18 | {DF50BC17-D54B-4641-833A-02C569413A7A}.Debug|x86.ActiveCfg = Debug|Win32 19 | {DF50BC17-D54B-4641-833A-02C569413A7A}.Debug|x86.Build.0 = Debug|Win32 20 | {DF50BC17-D54B-4641-833A-02C569413A7A}.Release|x64.ActiveCfg = Release|x64 21 | {DF50BC17-D54B-4641-833A-02C569413A7A}.Release|x64.Build.0 = Release|x64 22 | {DF50BC17-D54B-4641-833A-02C569413A7A}.Release|x86.ActiveCfg = Release|Win32 23 | {DF50BC17-D54B-4641-833A-02C569413A7A}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /crt/crt.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | -------------------------------------------------------------------------------- /idlcpp/build/vs2015/idlcpp.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.23107.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "idlcpp", "idlcpp.vcxproj", "{1DA507C2-6B81-4E76-A1F2-4E6AABA43175}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x86 = Debug|x86 11 | Release|x86 = Release|x86 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {1DA507C2-6B81-4E76-A1F2-4E6AABA43175}.Debug|x86.ActiveCfg = Debug|Win32 15 | {1DA507C2-6B81-4E76-A1F2-4E6AABA43175}.Debug|x86.Build.0 = Debug|Win32 16 | {1DA507C2-6B81-4E76-A1F2-4E6AABA43175}.Release|x86.ActiveCfg = Release|Win32 17 | {1DA507C2-6B81-4E76-A1F2-4E6AABA43175}.Release|x86.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /idlcpp/src/AttributeListNode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "SyntaxNodeImpl.h" 4 | #include 5 | 6 | struct AttributeNode; 7 | 8 | struct AttributeListNode : SyntaxNodeImpl 9 | { 10 | AttributeListNode* m_attributeList; 11 | AttributeNode* m_attribute; 12 | public: 13 | AttributeListNode(AttributeListNode* attributeList, AttributeNode* attribute); 14 | void collectAttributeNodes(std::vector& attributeNodes); 15 | void checkSemantic(); 16 | }; 17 | 18 | void checkAttributeNames(std::vector& attributeNodes); 19 | -------------------------------------------------------------------------------- /idlcpp/src/AttributeNode.cpp: -------------------------------------------------------------------------------- 1 | #include "AttributeNode.h" 2 | #include "IdentifyNode.h" 3 | 4 | AttributeNode::AttributeNode(IdentifyNode* name, IdentifyNode* content, bool u8content) 5 | { 6 | m_nodeType = snt_attribute; 7 | m_name = name; 8 | m_content = content; 9 | m_u8content = u8content; 10 | } 11 | 12 | bool CompareAttributePtr::operator()(const AttributeNode* arg1, const AttributeNode* arg2) const 13 | { 14 | return arg1->m_name->m_str < arg2->m_name->m_str; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /idlcpp/src/AttributeNode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "SyntaxNodeImpl.h" 4 | 5 | struct IdentifyNode; 6 | 7 | struct AttributeNode : SyntaxNodeImpl 8 | { 9 | IdentifyNode* m_name; 10 | IdentifyNode* m_content; 11 | bool m_u8content; 12 | public: 13 | AttributeNode(IdentifyNode* name, IdentifyNode* content, bool u8content); 14 | }; 15 | 16 | struct CompareAttributePtr 17 | { 18 | bool operator()(const AttributeNode* arg1, const AttributeNode* arg2) const; 19 | }; 20 | 21 | -------------------------------------------------------------------------------- /idlcpp/src/CommonFuncs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | struct MemberNode; 7 | struct TypeNameNode; 8 | enum TypeCategory; 9 | struct TemplateArguments; 10 | struct TypeNode; 11 | struct ClassNode; 12 | 13 | inline bool isNotIdentifyChar(char c) 14 | { 15 | return !(('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z') || ('0' <= c && c <= '9') || '_' == c); 16 | } 17 | 18 | 19 | void GetMetaTypeFullName(std::string& metaTypeName, MemberNode* memberNode, TemplateArguments* templateArguments); 20 | void GetMetaTypeFullName(std::string& metaTypeName, TypeNode* typeNode); 21 | void GetSubclassProxyFullName(std::string& subclassProxyName, ClassNode* typeNode, TemplateArguments* templateArguments); 22 | TypeCategory CalcTypeNativeName(std::string& typeName, TypeNameNode* typeNameNode, TemplateArguments* templateArguments); 23 | void CollectTypeNodes(std::vector& typeNodes, MemberNode* memberNode); 24 | 25 | //void CollectExportedTypeInfos(std::vector& typeInfos, MemberNode* memberNode); 26 | -------------------------------------------------------------------------------- /idlcpp/src/DelegateNode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "MemberNode.h" 3 | 4 | struct SyntaxNodeImpl; 5 | struct TokenNode; 6 | struct ParameterListNode; 7 | struct ParameterNode; 8 | struct TypeNameNode; 9 | struct ClassNode; 10 | 11 | struct DelegateNode : MemberNode 12 | { 13 | public: 14 | TokenNode* m_keyword; 15 | TokenNode* m_resultConst; 16 | TypeNameNode* m_resultTypeName; 17 | TokenNode* m_passing;//& * + 18 | TokenNode* m_leftParenthesis; 19 | ParameterListNode* m_parameterList; 20 | TokenNode* m_rightParenthesis; 21 | TokenNode* m_semicolon; 22 | bool m_resultArray; 23 | mutable size_t m_parameterCount; 24 | ClassNode* m_classNode; 25 | public: 26 | bool byValue(); 27 | bool byRef(); 28 | bool byPtr(); 29 | bool byNew(); 30 | DelegateNode(IdentifyNode* name, TokenNode* leftParenthesis, ParameterListNode* parameterList, TokenNode* rightParenthesis, TokenNode* semicolon); 31 | size_t getParameterCount() const; 32 | void extendInternalCode(TypeNode* enclosingTypeNode, TemplateArguments* templateArguments); 33 | virtual void collectTypes(TypeNode* enclosingTypeNode, TemplateArguments* templateArguments); 34 | virtual void checkTypeNames(TypeNode* enclosingTypeNode, TemplateArguments* templateArguments); 35 | virtual void checkSemantic(TemplateArguments* templateArguments); 36 | }; 37 | -------------------------------------------------------------------------------- /idlcpp/src/EnumNode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "MemberNode.h" 3 | 4 | struct TokenNode; 5 | struct EnumeratorListNode; 6 | struct EnumTypeNode; 7 | 8 | struct EnumNode : MemberNode 9 | { 10 | TokenNode* m_keyword; 11 | TokenNode* m_keyword2; 12 | TokenNode* m_leftBrace; 13 | EnumeratorListNode* m_enumeratorList; 14 | TokenNode* m_rightBrace; 15 | TokenNode* m_semicolon; 16 | EnumTypeNode* m_typeNode; 17 | public: 18 | EnumNode(TokenNode* keyword, TokenNode* keyword2, IdentifyNode* name, TokenNode* leftBrace, EnumeratorListNode* enumeratorList, TokenNode* rightBrace); 19 | virtual TypeNode* getTypeNode(); 20 | virtual void collectTypes(TypeNode* enclosingTypeNode, TemplateArguments* templateArguments); 21 | virtual void checkSemantic(TemplateArguments* templateArguments); 22 | bool isStronglyTypedEnum(); 23 | }; 24 | 25 | -------------------------------------------------------------------------------- /idlcpp/src/EnumeratorListNode.cpp: -------------------------------------------------------------------------------- 1 | #include "EnumeratorListNode.h" 2 | 3 | EnumeratorListNode::EnumeratorListNode(EnumeratorListNode* enumeratorList, TokenNode* delimiter, EnumeratorNode* enumerator) 4 | { 5 | m_nodeType = snt_enumerator_list; 6 | m_enumeratorList = enumeratorList; 7 | m_delimiter = delimiter; 8 | m_enumerator = enumerator; 9 | } 10 | 11 | void EnumeratorListNode::collectEnumeratorNodes(std::vector>& enumeratorNodes) 12 | { 13 | EnumeratorListNode* list = this; 14 | while(0 != list) 15 | { 16 | enumeratorNodes.push_back(std::make_pair(list->m_delimiter, list->m_enumerator)); 17 | list = list->m_enumeratorList; 18 | } 19 | std::reverse(enumeratorNodes.begin(), enumeratorNodes.end()); 20 | } 21 | 22 | void EnumeratorListNode::collectEnumeratorNodes(std::vector& enumeratorNodes) 23 | { 24 | EnumeratorListNode* list = this; 25 | while (0 != list) 26 | { 27 | enumeratorNodes.push_back(list->m_enumerator); 28 | list = list->m_enumeratorList; 29 | } 30 | std::reverse(enumeratorNodes.begin(), enumeratorNodes.end()); 31 | } 32 | -------------------------------------------------------------------------------- /idlcpp/src/EnumeratorListNode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "SyntaxNodeImpl.h" 4 | #include 5 | 6 | struct TokenNode; 7 | struct EnumeratorNode; 8 | 9 | struct EnumeratorListNode : SyntaxNodeImpl 10 | { 11 | EnumeratorListNode* m_enumeratorList; 12 | TokenNode* m_delimiter; 13 | EnumeratorNode* m_enumerator; 14 | public: 15 | EnumeratorListNode(EnumeratorListNode* enumeratorList, TokenNode* delimiter, EnumeratorNode* enumerator); 16 | void collectEnumeratorNodes(std::vector>& enumeratorNodes); 17 | void collectEnumeratorNodes(std::vector& enumeratorNodes); 18 | }; 19 | 20 | -------------------------------------------------------------------------------- /idlcpp/src/EnumeratorNode.cpp: -------------------------------------------------------------------------------- 1 | #include "EnumeratorNode.h" 2 | #include "IdentifyNode.h" 3 | #include "AttributeListNode.h" 4 | #include 5 | 6 | EnumeratorNode::EnumeratorNode(AttributeListNode* attributeList, IdentifyNode* name) 7 | { 8 | m_nodeType = snt_enumerator; 9 | m_attributeList = attributeList; 10 | m_name = name; 11 | } 12 | 13 | void EnumeratorNode::checkSemantic() 14 | { 15 | if (m_attributeList) 16 | { 17 | m_attributeList->checkSemantic(); 18 | } 19 | } 20 | 21 | bool CompareEnumeratorPtr::operator()(const EnumeratorNode* arg1, const EnumeratorNode* arg2) const 22 | { 23 | return arg1->m_name->m_str < arg2->m_name->m_str; 24 | } 25 | 26 | -------------------------------------------------------------------------------- /idlcpp/src/EnumeratorNode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "MemberNode.h" 4 | 5 | struct TokenNode; 6 | struct TypeNameNode; 7 | 8 | struct EnumeratorNode : SyntaxNodeImpl 9 | { 10 | AttributeListNode* m_attributeList; 11 | IdentifyNode* m_name; 12 | public: 13 | EnumeratorNode(AttributeListNode* attributeList, IdentifyNode* name); 14 | void checkSemantic(); 15 | }; 16 | 17 | struct CompareEnumeratorPtr 18 | { 19 | bool operator()(const EnumeratorNode* arg1, const EnumeratorNode* arg2) const; 20 | }; 21 | -------------------------------------------------------------------------------- /idlcpp/src/FieldNode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "MemberNode.h" 4 | 5 | struct TokenNode; 6 | struct TypeNameNode; 7 | 8 | struct FieldNode : MemberNode 9 | { 10 | TokenNode* m_static; 11 | TokenNode* m_constant; 12 | TypeNameNode* m_typeName; 13 | TokenNode* m_pointer; 14 | TokenNode* m_leftBracket; 15 | TokenNode* m_rightBracket; 16 | TokenNode* m_semicolon; 17 | public: 18 | FieldNode(TypeNameNode* typeName, TokenNode* pointer, IdentifyNode* name, TokenNode* leftBracket, TokenNode* rightBracket); 19 | bool isStatic(); 20 | bool isConstant(); 21 | bool isPointer(); 22 | bool isArray(); 23 | virtual void checkTypeNames(TypeNode* enclosingTypeNode, TemplateArguments* templateArguments); 24 | virtual void checkSemantic(TemplateArguments* templateArguments); 25 | }; 26 | -------------------------------------------------------------------------------- /idlcpp/src/GetterSetterNode.cpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "GetterSetterNode.h" 4 | #include "TokenNode.h" 5 | 6 | GetterSetterNode::GetterSetterNode(TokenNode* keyword) 7 | { 8 | m_nodeType = snt_getter_setter; 9 | m_keyword = keyword; 10 | m_nativeName = 0; 11 | m_getterIncRef = false; 12 | m_setterDecRef = false; 13 | m_setterAllowNull = false; 14 | } 15 | 16 | bool GetterSetterNode::isGetterIncRef() 17 | { 18 | return m_getterIncRef; 19 | } 20 | 21 | bool GetterSetterNode::isSetterDecRef() 22 | { 23 | return m_setterDecRef; 24 | } 25 | 26 | bool GetterSetterNode::isSetterAllowNull() 27 | { 28 | return m_setterAllowNull; 29 | } 30 | -------------------------------------------------------------------------------- /idlcpp/src/GetterSetterNode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "SyntaxNodeImpl.h" 4 | 5 | struct TokenNode; 6 | struct TypeNameNode; 7 | struct IdentifyNode; 8 | 9 | struct GetterSetterNode : SyntaxNodeImpl 10 | { 11 | TokenNode* m_keyword; 12 | IdentifyNode* m_nativeName; 13 | bool m_getterIncRef; 14 | bool m_setterDecRef; 15 | bool m_setterAllowNull; 16 | public: 17 | GetterSetterNode(TokenNode* keyword); 18 | bool isGetterIncRef(); 19 | bool isSetterDecRef(); 20 | bool isSetterAllowNull(); 21 | }; 22 | -------------------------------------------------------------------------------- /idlcpp/src/HeaderFileGenerator.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fdyjfd/idlcpp/d0bd13d96d546b06074062fb3984b42569e71fae/idlcpp/src/HeaderFileGenerator.cpp -------------------------------------------------------------------------------- /idlcpp/src/IdentifyListNode.cpp: -------------------------------------------------------------------------------- 1 | #include "IdentifyListNode.h" 2 | 3 | IdentifyListNode::IdentifyListNode(IdentifyListNode* identifyList, TokenNode* delimiter, IdentifyNode* identify) 4 | { 5 | m_nodeType = snt_identify_list; 6 | m_identifyList = identifyList; 7 | m_delimiter = delimiter; 8 | m_identify = identify; 9 | } 10 | 11 | void IdentifyListNode::collectIdentifyNodes(std::vector>& identifyNodes) 12 | { 13 | IdentifyListNode* list = this; 14 | while(0 != list) 15 | { 16 | identifyNodes.push_back(std::make_pair(list->m_delimiter, list->m_identify)); 17 | list = list->m_identifyList; 18 | } 19 | std::reverse(identifyNodes.begin(), identifyNodes.end()); 20 | } 21 | 22 | void IdentifyListNode::collectIdentifyNodes(std::vector& identifyNodes) 23 | { 24 | IdentifyListNode* list = this; 25 | while (0 != list) 26 | { 27 | identifyNodes.push_back(list->m_identify); 28 | list = list->m_identifyList; 29 | } 30 | std::reverse(identifyNodes.begin(), identifyNodes.end()); 31 | } 32 | -------------------------------------------------------------------------------- /idlcpp/src/IdentifyListNode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "SyntaxNodeImpl.h" 4 | #include 5 | 6 | struct TokenNode; 7 | struct IdentifyNode; 8 | 9 | struct IdentifyListNode : SyntaxNodeImpl 10 | { 11 | IdentifyListNode* m_identifyList; 12 | TokenNode* m_delimiter; 13 | IdentifyNode* m_identify; 14 | public: 15 | IdentifyListNode(IdentifyListNode* identifyList, TokenNode* delimiter, IdentifyNode* identify); 16 | void collectIdentifyNodes(std::vector>& identifyNodes); 17 | void collectIdentifyNodes(std::vector& identifyNodes); 18 | }; 19 | 20 | -------------------------------------------------------------------------------- /idlcpp/src/IdentifyNode.cpp: -------------------------------------------------------------------------------- 1 | #include "IdentifyNode.h" 2 | 3 | 4 | IdentifyNode::IdentifyNode(const char* str, int tokenNo, int lineNo, int columnNo) 5 | : TokenNode(snt_identify, tokenNo, lineNo, columnNo), m_str(str) 6 | {} 7 | 8 | 9 | IdentifyNode::IdentifyNode(const char* str, size_t len, int tokenNo, int lineNo, int columnNo) 10 | : TokenNode(snt_identify, tokenNo, lineNo, columnNo), m_str(str, len) 11 | {} 12 | -------------------------------------------------------------------------------- /idlcpp/src/IdentifyNode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "TokenNode.h" 4 | #include 5 | 6 | struct IdentifyNode : TokenNode 7 | { 8 | std::string m_str; 9 | public: 10 | IdentifyNode(const char* str, int tokenNo, int lineNo, int columnNo); 11 | IdentifyNode(const char* str, size_t len, int tokenNo, int lineNo, int columnNo); 12 | }; 13 | 14 | struct CompareIdentifyPtr 15 | { 16 | bool operator()(const IdentifyNode* arg1, const IdentifyNode* arg2) const 17 | { 18 | return arg1->m_str < arg2->m_str; 19 | } 20 | }; 21 | 22 | -------------------------------------------------------------------------------- /idlcpp/src/ImportDirectory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | class ImportDirectories 6 | { 7 | public: 8 | ImportDirectories(); 9 | public: 10 | void addImportDirectory(const char* dir); 11 | void calcImportDirectories(const char* fileName); 12 | void setCurrentDirectory(const char* dir); 13 | public: 14 | typedef std::vector DirectoryContainer; 15 | DirectoryContainer m_directories; 16 | bool m_hasCurrentDirectory; 17 | }; 18 | 19 | extern ImportDirectories g_importDirectories; 20 | -------------------------------------------------------------------------------- /idlcpp/src/MemberListNode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "SyntaxNodeImpl.h" 3 | #include 4 | 5 | struct MemberNode; 6 | struct ScopeNode; 7 | struct TypeNode; 8 | struct TemplateArguments; 9 | 10 | struct MemberListNode : SyntaxNodeImpl 11 | { 12 | MemberListNode* m_memberList; 13 | MemberNode* m_member; 14 | public: 15 | MemberListNode(MemberListNode* memberList, MemberNode* member); 16 | void initializeMembersEnclosing(ScopeNode* parent); 17 | void collectMemberNodes(std::vector& memberNodes); 18 | void collectTypes(TypeNode* enclosingTypeNode, TemplateArguments* templateArguments); 19 | void checkTypeNames(TypeNode* enclosingTypeNode, TemplateArguments* templateArguments); 20 | void checkSemantic(TemplateArguments* templateArguments); 21 | }; 22 | -------------------------------------------------------------------------------- /idlcpp/src/MethodNode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "MemberNode.h" 3 | 4 | struct SyntaxNodeImpl; 5 | struct TokenNode; 6 | struct ParameterListNode; 7 | struct ParameterNode; 8 | struct TypeNameNode; 9 | 10 | struct MethodNode : MemberNode 11 | { 12 | public: 13 | TokenNode* m_modifier; 14 | TokenNode* m_resultConst; 15 | TypeNameNode* m_resultTypeName; 16 | TokenNode* m_passing;//& * + 17 | TokenNode* m_leftParenthesis; 18 | ParameterListNode* m_parameterList; 19 | TokenNode* m_rightParenthesis; 20 | TokenNode* m_constant; 21 | TokenNode* m_semicolon; 22 | bool m_resultArray; 23 | bool m_override; 24 | mutable size_t m_parameterCount; 25 | public: 26 | MethodNode(IdentifyNode* name, TokenNode* leftParenthesis, ParameterListNode* parameterList, TokenNode* rightParenthesis, TokenNode* constant); 27 | bool isStatic(); 28 | bool isConstant(); 29 | bool isVirtual(); 30 | bool isAbstract(); 31 | bool byValue(); 32 | bool byRef(); 33 | bool byPtr(); 34 | bool byNew(); 35 | size_t getParameterCount() const; 36 | void calcManglingName(std::string& name, TemplateArguments* templateArguments); 37 | virtual void checkTypeNames(TypeNode* enclosingTypeNode, TemplateArguments* templateArguments); 38 | virtual void checkSemantic(TemplateArguments* templateArguments); 39 | }; 40 | -------------------------------------------------------------------------------- /idlcpp/src/NamespaceNode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ScopeNode.h" 3 | 4 | struct TokenNode; 5 | struct IdentifyNode; 6 | struct MemberListNode; 7 | struct NamespaceTypeNode; 8 | 9 | struct NamespaceNode : ScopeNode 10 | { 11 | TokenNode* m_keyword; 12 | TokenNode* m_leftBrace; 13 | TokenNode* m_rightBrace; 14 | NamespaceTypeNode* m_typeNode; 15 | public: 16 | NamespaceNode(TokenNode* keyword, IdentifyNode* name, TokenNode* leftBrace, MemberListNode* memberList, TokenNode* rightBrace); 17 | virtual TypeNode* getTypeNode(); 18 | virtual void collectTypes(TypeNode* enclosingTypeNode, TemplateArguments* templateArguments); 19 | virtual void checkTypeNames(TypeNode* enclosingTypeNode, TemplateArguments* templateArguments); 20 | virtual void checkSemantic(TemplateArguments* templateArguments); 21 | bool isGlobalNamespace(); 22 | void extendInternalCode(TypeNode* enclosingTypeNode, TemplateArguments* templateArguments); 23 | }; -------------------------------------------------------------------------------- /idlcpp/src/OperatorNode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "MethodNode.h" 3 | #include 4 | 5 | struct OperatorNode : MethodNode 6 | { 7 | public: 8 | TokenNode* m_keyword; 9 | TokenNode* m_sign; 10 | public: 11 | OperatorNode(TokenNode* keyword, TokenNode* sign, TokenNode* leftParenthesis, 12 | ParameterListNode* parameterList, TokenNode* rightParenthesis, TokenNode* constant, TokenNode* semicolon); 13 | void getOperatorString(std::string& str); 14 | virtual void checkSemantic(TemplateArguments* templateArguments); 15 | private: 16 | void calcName(); 17 | }; 18 | -------------------------------------------------------------------------------- /idlcpp/src/Options.cpp: -------------------------------------------------------------------------------- 1 | #include "Options.h" 2 | #include 3 | 4 | Options::Options() 5 | { 6 | m_metaTypePostfix = "_Type"; 7 | m_subclassProxyPostfix = "_Proxy"; 8 | m_internalSourceFilePostfix = ".ic"; 9 | m_metaHeaderFilePostfix = ".mh"; 10 | m_metaSourceFilePostfix = ".mc"; 11 | m_outputLineDirective = false; 12 | m_strictArgumentsCount = false; 13 | m_checkConstant = false; 14 | //m_forceU8AttributeContent = true; 15 | } 16 | 17 | 18 | void Options::setPafcorePath(const char* path) 19 | { 20 | m_pafcorePath = path; 21 | std::replace(m_pafcorePath.begin(), m_pafcorePath.end(), '/', '\\'); 22 | if(m_pafcorePath.length() > 0 && m_pafcorePath.back() != '\\') 23 | { 24 | m_pafcorePath += '\\'; 25 | } 26 | } 27 | 28 | Options g_options; -------------------------------------------------------------------------------- /idlcpp/src/Options.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | class Options 7 | { 8 | public: 9 | Options(); 10 | public: 11 | std::string m_metaTypePostfix; 12 | std::string m_subclassProxyPostfix; 13 | std::string m_internalSourceFilePostfix; 14 | std::string m_metaHeaderFilePostfix; 15 | std::string m_metaSourceFilePostfix; 16 | std::string m_pafcorePath; 17 | std::string m_exportMacro; 18 | bool m_outputLineDirective; 19 | bool m_strictArgumentsCount; 20 | bool m_checkConstant; 21 | //bool m_forceU8AttributeContent; 22 | public: 23 | void setPafcorePath(const char* path); 24 | }; 25 | 26 | extern Options g_options; 27 | -------------------------------------------------------------------------------- /idlcpp/src/ParameterListNode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "SyntaxNodeImpl.h" 4 | #include 5 | 6 | struct TokenNode; 7 | struct ParameterNode; 8 | 9 | struct ParameterListNode : SyntaxNodeImpl 10 | { 11 | ParameterListNode* m_parameterList; 12 | TokenNode* m_delimiter; 13 | ParameterNode* m_parameter; 14 | public: 15 | ParameterListNode(ParameterListNode* parameterList, TokenNode* delimiter, ParameterNode* parameter); 16 | void collectParameterNodes(std::vector>& parameterNodes); 17 | void collectParameterNodes(std::vector& parameterNodes); 18 | }; 19 | 20 | void checkParameterNames(std::vector& parameterNodes); 21 | 22 | -------------------------------------------------------------------------------- /idlcpp/src/ParameterNode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "SyntaxNodeImpl.h" 4 | 5 | struct TokenNode; 6 | struct TypeNameNode; 7 | struct IdentifyNode; 8 | struct MethodNode; 9 | struct TemplateArguments; 10 | 11 | struct ParameterNode : SyntaxNodeImpl 12 | { 13 | TokenNode* m_constant; 14 | TypeNameNode* m_typeName; 15 | TokenNode* m_out; 16 | TokenNode* m_passing; 17 | IdentifyNode* m_name; 18 | bool m_array; 19 | bool m_allowNull; 20 | public: 21 | ParameterNode(TypeNameNode* typeName, TokenNode* out, TokenNode* passing, IdentifyNode* name); 22 | bool isConstant(); 23 | bool isByValue(); 24 | bool isByRef(); 25 | bool isByPtr(); 26 | bool isByNonRefPtr(); 27 | bool isByDecRefPtr(); 28 | bool isByIncRefPtr(); 29 | bool isInput(); 30 | bool isOutput(); 31 | bool isOutputPtr(); 32 | bool isOutputRef(); 33 | bool isArray(); 34 | bool isAllowNull(); 35 | void checkSemantic(TemplateArguments* templateArguments); 36 | }; 37 | -------------------------------------------------------------------------------- /idlcpp/src/Platform.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | bool fileExisting(const char* fileName); 6 | bool isAbsolutePath(const char* fileName); 7 | void normalizeFileName(std::string& str, const char* fileName); 8 | const char* getExtNameBegin(const char* normalizedFileName); 9 | const char* getDirNameEnd(const char* normalizedFileName); 10 | void GetRelativePath(std::string& str, const char* fileFrom, const char* fileTo); 11 | void FormatPathForInclude(std::string& str); 12 | void FormatPathForLine(std::string& str); 13 | bool compareFileName(const std::string& str1, const std::string& str2); 14 | -------------------------------------------------------------------------------- /idlcpp/src/ProgramNode.cpp: -------------------------------------------------------------------------------- 1 | #include "ProgramNode.h" 2 | #include "MemberListNode.h" 3 | #include "NamespaceNode.h" 4 | #include "IdentifyNode.h" 5 | #include "ClassNode.h" 6 | #include "TypeTree.h" 7 | 8 | #include "Options.h" 9 | #include "Platform.h" 10 | #include 11 | #include 12 | 13 | const char g_pragmaOnce[] = {"#pragma once\n\n"}; 14 | 15 | ProgramNode::ProgramNode(MemberListNode* memberList) 16 | : NamespaceNode(0, 0, 0, memberList, 0) 17 | { 18 | m_sourceFile = 0; 19 | } 20 | 21 | void ProgramNode::getLocalName(std::string& name, TemplateArguments* templateArguments) 22 | { 23 | name = ""; 24 | } 25 | 26 | void ProgramNode::collectTypes(TypeNode* enclosingTypeNode, TemplateArguments* templateArguments) 27 | { 28 | assert(0 == enclosingTypeNode && 0 == m_typeNode && 0 == templateArguments); 29 | m_typeNode = g_typeTree.getRootNamespaceTypeNode(); 30 | m_memberList->collectTypes(m_typeNode, templateArguments); 31 | } 32 | 33 | -------------------------------------------------------------------------------- /idlcpp/src/ProgramNode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "NamespaceNode.h" 3 | 4 | struct MemberListNode; 5 | class SourceFile; 6 | struct ProgramNode : NamespaceNode 7 | { 8 | public: 9 | ProgramNode(MemberListNode* memberList); 10 | virtual void getLocalName(std::string& name, TemplateArguments* templateArguments); 11 | virtual void collectTypes(TypeNode* enclosingTypeNode, TemplateArguments* templateArguments); 12 | public: 13 | SourceFile* m_sourceFile; 14 | }; 15 | -------------------------------------------------------------------------------- /idlcpp/src/PropertyNode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "MemberNode.h" 4 | 5 | struct GetterSetterNode; 6 | struct TypeNameNode; 7 | 8 | struct PropertyNode : MemberNode 9 | { 10 | TokenNode* m_modifier; 11 | TypeNameNode* m_typeName; 12 | TokenNode* m_passing;//* 13 | GetterSetterNode* m_get; 14 | GetterSetterNode* m_set; 15 | PropertyCategory m_propertyCategory; 16 | bool m_candidate; 17 | TypeNameNode* m_keyTypeName; 18 | TokenNode* m_keyPassing;//* 19 | public: 20 | PropertyNode(IdentifyNode* name, PropertyCategory category); 21 | PropertyCategory getCategory(); 22 | bool isStatic(); 23 | bool isSimple(); 24 | bool isFixedArray(); 25 | bool isDynamicArray(); 26 | bool isList(); 27 | bool isMap(); 28 | bool hasCandidate(); 29 | bool isKeyByPtr(); 30 | bool isKeyByValue(); 31 | 32 | bool isByValue(); 33 | bool isByPtr(); 34 | bool isByRef(); 35 | 36 | void setGetter(GetterSetterNode* getter); 37 | void setSetter(GetterSetterNode* setter); 38 | void setCandidate(); 39 | 40 | virtual void checkTypeNames(TypeNode* enclosingTypeNode, TemplateArguments* templateArguments); 41 | virtual void checkSemantic(TemplateArguments* templateArguments); 42 | }; -------------------------------------------------------------------------------- /idlcpp/src/ScopeNameListNode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "SyntaxNodeImpl.h" 3 | #include 4 | #include 5 | 6 | struct ScopeNameNode; 7 | struct TypeNode; 8 | struct TemplateArguments; 9 | 10 | struct ScopeNameListNode : SyntaxNodeImpl 11 | { 12 | ScopeNameListNode* m_scopeNameList; 13 | ScopeNameNode* m_scopeName; 14 | bool m_global; 15 | public: 16 | ScopeNameListNode(ScopeNameListNode* scopeNameList, ScopeNameNode* scopeName); 17 | void collectIdentifyNodes(std::vector& scopeNameNodes); 18 | bool calcTemplateParametersTypeNodes(TypeNode* enclosingTypeTreeNode, TemplateArguments* templateArguments); 19 | void getString(std::string& str); 20 | 21 | bool isGlobal() 22 | { 23 | return m_global; 24 | } 25 | }; 26 | 27 | -------------------------------------------------------------------------------- /idlcpp/src/ScopeNameNode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "SyntaxNodeImpl.h" 3 | #include 4 | #include 5 | 6 | 7 | struct IdentifyNode; 8 | struct TokenNode; 9 | struct TypeNameListNode; 10 | struct TypeNode; 11 | struct TemplateArguments; 12 | 13 | struct ScopeNameNode : SyntaxNodeImpl 14 | { 15 | IdentifyNode* m_name; 16 | TokenNode* m_leftBracket; 17 | TypeNameListNode* m_parameterList; 18 | TokenNode* m_rightBracket; 19 | public: 20 | ScopeNameNode(IdentifyNode* name, TokenNode* leftBracket, TypeNameListNode* parameterList, TokenNode* rightBracket); 21 | bool calcTemplateParametersTypeNodes(TypeNode* enclosingTypeTreeNode, TemplateArguments* templateArguments); 22 | void getString(std::string& str); 23 | bool isTemplateForm(); 24 | }; 25 | 26 | -------------------------------------------------------------------------------- /idlcpp/src/ScopeNode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "MemberNode.h" 4 | 5 | struct MemberListNode; 6 | 7 | struct ScopeNode : MemberNode 8 | { 9 | MemberListNode* m_memberList; 10 | public: 11 | ScopeNode() 12 | { 13 | m_memberList = 0; 14 | } 15 | }; 16 | -------------------------------------------------------------------------------- /idlcpp/src/SourceFile.cpp: -------------------------------------------------------------------------------- 1 | #include "Utility.h" 2 | #include "SourceFile.h" 3 | 4 | SourceFile::~SourceFile() 5 | { 6 | size_t count = m_embededCodes.size(); 7 | for (size_t i = 0; i < count; ++i) 8 | { 9 | delete m_embededCodes[i]; 10 | } 11 | } 12 | 13 | void SourceFile::addEmbededCodeBlock(const char* str, int tokenNo) 14 | { 15 | EmbededCode* embededCode = new EmbededCode; 16 | embededCode->m_code = str; 17 | embededCode->m_tokenNo = tokenNo; 18 | m_embededCodes.push_back(embededCode); 19 | } 20 | 21 | void SourceFile::outputEmbededCodes(FILE* file, int tokenNo) 22 | { 23 | for (; m_currentEmbededCode < m_embededCodes.size(); ++m_currentEmbededCode) 24 | { 25 | EmbededCode* embededCode = m_embededCodes[m_currentEmbededCode]; 26 | if (embededCode->m_tokenNo <= tokenNo) 27 | { 28 | if (!embededCode->m_code.empty()) 29 | { 30 | if (isNumAlpha_(GetLastWrittenChar()) 31 | && isNumAlpha_(embededCode->m_code.c_str()[0])) 32 | { 33 | writeSpaceToFile(file); 34 | } 35 | writeStringToFile(embededCode->m_code.c_str(), embededCode->m_code.length(), file); 36 | } 37 | } 38 | else 39 | { 40 | break; 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /idlcpp/src/SourceFile.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | struct ProgramNode; 6 | 7 | struct EmbededCode 8 | { 9 | int m_tokenNo; 10 | std::string m_code; 11 | }; 12 | 13 | class SourceFile 14 | { 15 | public: 16 | SourceFile() 17 | { 18 | m_syntaxTree = 0; 19 | m_currentEmbededCode = 0; 20 | m_hasArrayProperty = false; 21 | m_hasListProperty = false; 22 | m_hasMapProperty = false; 23 | m_hasDelegate = false; 24 | } 25 | ~SourceFile(); 26 | public: 27 | void addEmbededCodeBlock(const char* str, int tokenNo); 28 | void outputEmbededCodes(FILE* file, int tokenNo); 29 | public: 30 | std::string m_fileName; 31 | ProgramNode* m_syntaxTree; 32 | std::vector m_embededCodes; 33 | size_t m_currentEmbededCode; 34 | std::vector m_importSourceFiles; 35 | bool m_hasArrayProperty; 36 | bool m_hasListProperty; 37 | bool m_hasMapProperty; 38 | bool m_hasDelegate; 39 | }; 40 | 41 | -------------------------------------------------------------------------------- /idlcpp/src/SyntaxNodeImpl.cpp: -------------------------------------------------------------------------------- 1 | #include "SyntaxNodeImpl.h" 2 | 3 | -------------------------------------------------------------------------------- /idlcpp/src/SyntaxNodeImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "yyfuncs.h" 4 | 5 | struct SyntaxNodeImpl : SyntaxNode 6 | {}; 7 | 8 | -------------------------------------------------------------------------------- /idlcpp/src/TemplateArguments.cpp: -------------------------------------------------------------------------------- 1 | #include "TemplateArguments.h" 2 | #include "IdentifyNode.h" 3 | 4 | TypeNode* TemplateArguments::findTypeNode(const std::string& name) 5 | { 6 | auto it = m_arguments.begin(); 7 | auto end = m_arguments.end(); 8 | for (; it != end; ++it) 9 | { 10 | if (it->m_name == name) 11 | { 12 | return it->m_typeNode; 13 | } 14 | } 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /idlcpp/src/TemplateArguments.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | struct TypeNode; 7 | struct ClassTypeNode; 8 | 9 | struct TemplateArgument 10 | { 11 | std::string m_name; 12 | TypeNode* m_typeNode; 13 | }; 14 | 15 | struct TemplateArguments 16 | { 17 | std::string m_className; 18 | TypeNode* m_classTypeNode; 19 | std::vector m_arguments; 20 | public: 21 | TypeNode* findTypeNode(const std::string& name); 22 | }; 23 | -------------------------------------------------------------------------------- /idlcpp/src/TemplateClassInstanceNode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "MemberNode.h" 4 | #include "TemplateArguments.h" 5 | #include 6 | 7 | struct TypeNameListNode; 8 | struct TokenListNode; 9 | struct TemplateClassInstanceTypeNode; 10 | struct ClassTypeNode; 11 | 12 | struct TemplateClassInstanceNode : MemberNode 13 | { 14 | TypeNameListNode* m_parameterList; 15 | TokenListNode* m_tokenList; 16 | TemplateClassInstanceTypeNode* m_typeNode; 17 | ClassTypeNode* m_classTypeNode; 18 | TemplateArguments m_templateArguments; 19 | public: 20 | TemplateClassInstanceNode(IdentifyNode* name, TypeNameListNode* parameterList); 21 | virtual TypeNode* getTypeNode(); 22 | virtual void getLocalName(std::string& name, TemplateArguments* templateArguments); 23 | virtual void collectTypes(TypeNode* enclosingTypeNode, TemplateArguments* templateArguments); 24 | virtual void checkSemantic(TemplateArguments* templateArguments); 25 | size_t getParameterCount(); 26 | void getReservedMembers(std::vector& reservedNames,std::vector& reservedOperators); 27 | }; 28 | -------------------------------------------------------------------------------- /idlcpp/src/TemplateParameterListNode.cpp: -------------------------------------------------------------------------------- 1 | #include "TemplateParameterListNode.h" 2 | 3 | TemplateParameterListNode::TemplateParameterListNode(TemplateParameterListNode* parameterList, TokenNode* delimiter, IdentifyNode* parameter) 4 | { 5 | m_nodeType = snt_template_parameter_list; 6 | m_parameterList = parameterList; 7 | m_delimiter = delimiter; 8 | m_parameter = parameter; 9 | } 10 | -------------------------------------------------------------------------------- /idlcpp/src/TemplateParameterListNode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "SyntaxNodeImpl.h" 4 | 5 | struct TokenNode; 6 | struct IdentifyNode; 7 | struct TemplateParameterListNode : SyntaxNodeImpl 8 | { 9 | TemplateParameterListNode* m_parameterList; 10 | TokenNode* m_delimiter; 11 | IdentifyNode* m_parameter; 12 | public: 13 | TemplateParameterListNode(TemplateParameterListNode* parameterList, TokenNode* delimiter, IdentifyNode* parameter); 14 | }; -------------------------------------------------------------------------------- /idlcpp/src/TemplateParametersNode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "SyntaxNodeImpl.h" 4 | #include 5 | 6 | struct TokenNode; 7 | struct IdentifyNode; 8 | struct TemplateParameterListNode; 9 | 10 | struct TemplateParametersNode : SyntaxNodeImpl 11 | { 12 | TokenNode* m_keyword; 13 | TokenNode* m_leftBracket; 14 | TemplateParameterListNode* m_parameterList; 15 | TokenNode* m_rightBracket; 16 | public: 17 | TemplateParametersNode(TokenNode* keyword, TokenNode* leftBracket, TemplateParameterListNode* parameterList, TokenNode* rightBracket); 18 | void collectParameterNodes(std::vector>& parameterNodes); 19 | void collectParameterNodes(std::vector& parameterNodes); 20 | size_t getParameterCount(); 21 | bool checkSemantic(); 22 | }; 23 | -------------------------------------------------------------------------------- /idlcpp/src/TokenListNode.cpp: -------------------------------------------------------------------------------- 1 | #include "TokenListNode.h" 2 | 3 | TokenListNode::TokenListNode(TokenListNode* tokenList, TokenNode* token) 4 | { 5 | m_nodeType = snt_token_list; 6 | m_tokenList = tokenList; 7 | m_token = token; 8 | } 9 | 10 | void TokenListNode::collectTokenNodes(std::vector& tokenNodes) 11 | { 12 | TokenListNode* list = this; 13 | while (0 != list) 14 | { 15 | tokenNodes.push_back(list->m_token); 16 | list = list->m_tokenList; 17 | } 18 | std::reverse(tokenNodes.begin(), tokenNodes.end()); 19 | } 20 | -------------------------------------------------------------------------------- /idlcpp/src/TokenListNode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "SyntaxNodeImpl.h" 4 | #include 5 | 6 | struct TokenNode; 7 | 8 | struct TokenListNode : SyntaxNodeImpl 9 | { 10 | TokenListNode* m_tokenList; 11 | TokenNode* m_token; 12 | public: 13 | TokenListNode(TokenListNode* tokenList, TokenNode* token); 14 | void collectTokenNodes(std::vector& tokenNodes); 15 | }; 16 | 17 | -------------------------------------------------------------------------------- /idlcpp/src/TokenNode.cpp: -------------------------------------------------------------------------------- 1 | #include "TokenNode.h" 2 | 3 | #include "Utility.h" 4 | #include "Compiler.h" 5 | #include 6 | 7 | const char* g_keywordTokens[] = 8 | { 9 | "::", 10 | "+=", 11 | "-=", 12 | "*=", 13 | "/=", 14 | "%=", 15 | "^=", 16 | "&=", 17 | "|=", 18 | "<<", 19 | ">>", 20 | "<<=", 21 | ">>=", 22 | "==", 23 | "!=", 24 | "<=", 25 | ">=", 26 | "&&", 27 | "||", 28 | "++", 29 | "--", 30 | "++", 31 | "--", 32 | 33 | "namespace ", 34 | "enum ", 35 | "class ", 36 | "struct ", 37 | "template ", 38 | "virtual ", 39 | "virtual ", 40 | "static ", 41 | "const ", 42 | "operator ", 43 | "get_", 44 | "void set_", 45 | "typedef ", 46 | "struct ", 47 | }; 48 | 49 | TokenNode::TokenNode(int nodeType, int tokenNo, int lineNo, int columnNo) 50 | { 51 | m_nodeType = nodeType; 52 | m_tokenNo = tokenNo; 53 | m_lineNo = lineNo; 54 | m_columnNo = columnNo; 55 | } 56 | 57 | void TokenNode::outputEmbededCodes(FILE* file, bool addSpace) 58 | { 59 | g_compiler.outputEmbededCodes(file, this); 60 | if(isNumAlpha_(GetLastWrittenChar()) && addSpace) 61 | { 62 | writeSpaceToFile(file); 63 | } 64 | } 65 | 66 | -------------------------------------------------------------------------------- /idlcpp/src/TokenNode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "SyntaxNodeImpl.h" 4 | #include 5 | 6 | struct TokenNode : SyntaxNodeImpl 7 | { 8 | int m_tokenNo; 9 | int m_lineNo; 10 | int m_columnNo; 11 | public: 12 | TokenNode(int nodeType, int tokenNo, int lineNo, int columnNo); 13 | void outputEmbededCodes(FILE* file, bool addSpace); 14 | }; 15 | 16 | struct CompareTokenPtr 17 | { 18 | bool operator()(const TokenNode* arg1, const TokenNode* arg2) const 19 | { 20 | return arg1->m_nodeType < arg2->m_nodeType; 21 | } 22 | }; 23 | 24 | extern const char* g_keywordTokens[]; 25 | -------------------------------------------------------------------------------- /idlcpp/src/TypeDeclarationNode.cpp: -------------------------------------------------------------------------------- 1 | #include "TypeDeclarationNode.h" 2 | #include "TypeNameNode.h" 3 | #include "RaiseError.h" 4 | #include "Compiler.h" 5 | #include "TypeTree.h" 6 | #include 7 | 8 | TypeDeclarationNode::TypeDeclarationNode(IdentifyNode* name, TypeCategory typeCategory) 9 | { 10 | m_nodeType = snt_type_declaration; 11 | m_name = name; 12 | m_typeCategory = typeCategory; 13 | m_typeNode = 0; 14 | } 15 | 16 | TypeNode* TypeDeclarationNode::getTypeNode() 17 | { 18 | return m_typeNode; 19 | } 20 | 21 | void TypeDeclarationNode::collectTypes(TypeNode* enclosingTypeNode, TemplateArguments* templateArguments) 22 | { 23 | //assert(enclosingTypeNode->isNamespace() || enclosingTypeNode->isClass()); 24 | assert(0 == m_typeNode); 25 | 26 | switch (enclosingTypeNode->m_category) 27 | { 28 | case tc_namespace: 29 | m_typeNode = static_cast(enclosingTypeNode)->addTypeDeclaration(this); 30 | break; 31 | case tc_class_type: 32 | m_typeNode = static_cast(enclosingTypeNode)->addTypeDeclaration(this); 33 | break; 34 | default: 35 | assert(false); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /idlcpp/src/TypeDeclarationNode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "MemberNode.h" 3 | 4 | struct TokenNode; 5 | struct ScopeNameListNode; 6 | struct TypeNameNode; 7 | struct TypeDeclarationTypeNode; 8 | 9 | struct TypeDeclarationNode : MemberNode 10 | { 11 | TypeCategory m_typeCategory; 12 | TypeDeclarationTypeNode* m_typeNode; 13 | public: 14 | TypeDeclarationNode(IdentifyNode* name, TypeCategory typeCategory); 15 | virtual TypeNode* getTypeNode(); 16 | virtual void collectTypes(TypeNode* enclosingTypeNode, TemplateArguments* templateArguments); 17 | }; 18 | 19 | -------------------------------------------------------------------------------- /idlcpp/src/TypeNameListNode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "SyntaxNodeImpl.h" 4 | #include 5 | 6 | struct TokenNode; 7 | struct TypeNameNode; 8 | 9 | struct TypeNameListNode : SyntaxNodeImpl 10 | { 11 | TypeNameListNode* m_typeNameList; 12 | TokenNode* m_delimiter; 13 | TypeNameNode* m_typeName; 14 | public: 15 | TypeNameListNode(TypeNameListNode* typeNameList, TokenNode* delimiter, TypeNameNode* typeName); 16 | void collectTypeNameNodes(std::vector& typeNameNodes); 17 | void collectTypeNameNodes(std::vector>& typeNameNodes); 18 | void collectTypeNameNodesNotNoCode(std::vector>& typeNameNodes); 19 | void collectTypeNameNodesNotNoMeta(std::vector>& typeNameNodes); 20 | }; -------------------------------------------------------------------------------- /idlcpp/src/TypeNameNode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "SyntaxNodeImpl.h" 4 | #include 5 | #include 6 | #include 7 | 8 | struct TokenNode; 9 | struct IdentifyNode; 10 | struct ScopeNameListNode; 11 | struct TypeNameListNode; 12 | struct ScopeNode; 13 | struct TypeInfo; 14 | struct TypeNameNode; 15 | struct TemplateClassInstanceNode; 16 | struct TypeNode; 17 | struct TemplateArguments; 18 | 19 | enum TypeCategory; 20 | 21 | struct TypeNameNode : SyntaxNodeImpl 22 | { 23 | TokenNode* m_keyword; 24 | ScopeNameListNode* m_scopeNameList; 25 | TokenNode* m_filterNode; 26 | TypeNode* m_startTypeNode; 27 | TypeNode* m_typeNode; 28 | public: 29 | TypeNameNode(TokenNode* keyword, PredefinedType primitiveType); 30 | TypeNameNode(ScopeNameListNode* scopeNameList); 31 | bool isNoCode(); 32 | bool isNoMeta(); 33 | bool calcTypeNodes(TypeNode* enclosingTypeTreeNode, TemplateArguments* templateArguments); 34 | TypeNode* getTypeNode(TemplateArguments* templateArguments); 35 | TypeNode* getActualTypeNode(TemplateArguments* templateArguments); 36 | void getString(std::string& str); 37 | void getRelativeName(std::string& typeName, ScopeNode* scopeNode); 38 | bool underTemplateParameter(); 39 | }; 40 | 41 | -------------------------------------------------------------------------------- /idlcpp/src/TypedefNode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "MemberNode.h" 3 | 4 | struct TokenNode; 5 | struct ScopeNameListNode; 6 | struct TypeNameNode; 7 | struct TypedefTypeNode; 8 | 9 | struct TypedefNode : MemberNode 10 | { 11 | TokenNode* m_keyword; 12 | TypeNameNode* m_typeName; 13 | TypedefTypeNode* m_typeNode; 14 | TypeNode* m_srcTypeNode; 15 | public: 16 | TypedefNode(TokenNode* keyword, IdentifyNode* name, TypeNameNode* typeName); 17 | TypeNode* getActualTypeNode(TemplateArguments* templateArguments); 18 | virtual TypeNode* getTypeNode(); 19 | virtual void collectTypes(TypeNode* enclosingTypeNode, TemplateArguments* templateArguments); 20 | virtual void checkSemantic(TemplateArguments* templateArguments); 21 | }; 22 | 23 | -------------------------------------------------------------------------------- /idlcpp/src/Utility.cpp: -------------------------------------------------------------------------------- 1 | #include "Utility.h" 2 | #include 3 | 4 | 5 | const char g_tabs[] = { "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" }; 6 | const char g_strSpaces[] = { " " }; 7 | 8 | char g_lastWrittenChar = 0; 9 | 10 | bool isNumAlpha_(char c) 11 | { 12 | return (('0' <= c && c <= '9') || ('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z') || '_' == c); 13 | } 14 | 15 | void writeStringToFile(const char* str, size_t length, FILE* file, int indentation) 16 | { 17 | if (file) 18 | { 19 | if (indentation > 0) 20 | { 21 | fwrite(g_tabs, indentation, 1, file); 22 | g_lastWrittenChar = '\t'; 23 | } 24 | fwrite(str, length, 1, file); 25 | if (length > 0) 26 | { 27 | g_lastWrittenChar = str[length - 1]; 28 | } 29 | } 30 | } 31 | 32 | void writeStringToFile(const char* str, FILE* file, int indentation) 33 | { 34 | writeStringToFile(str, strlen(str), file, indentation); 35 | } 36 | 37 | void writeSpaceToFile(FILE* file) 38 | { 39 | writeStringToFile(" ", 1, file, 0); 40 | } 41 | 42 | char GetLastWrittenChar() 43 | { 44 | return g_lastWrittenChar; 45 | } -------------------------------------------------------------------------------- /idlcpp/src/Utility.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | bool isNumAlpha_(char c); 6 | void writeStringToFile(const char* str, FILE* file, int indentation = 0); 7 | void writeStringToFile(const char* str, size_t length, FILE* file, int indentation = 0); 8 | void writeSpaceToFile(FILE* file); 9 | char GetLastWrittenChar(); -------------------------------------------------------------------------------- /idlcpp/src/idlcpp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #ifdef __cplusplus 10 | extern "C" 11 | { 12 | #endif 13 | 14 | #ifdef __cplusplus 15 | } 16 | #endif 17 | -------------------------------------------------------------------------------- /idlcpp/src/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /paf/build/vs2015/pafcore/pafcore.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | idlcpp -emPAFCORE_EXPORT %(FullPath) 9 | 10 | 11 | 12 | 13 | %(RootDir)%(Directory)%(Filename).h 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /paf/src/pafcore/Argument.h: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "./Metadata.h" 7 | namespace pafcore{ class Type; } 8 | namespace pafcore{ class ClassType; } 9 | 10 | namespace pafcore 11 | { 12 | class PAFCORE_EXPORT Argument : public Metadata 13 | { 14 | public: 15 | static ::pafcore::ClassType* GetType(); 16 | virtual ::pafcore::ClassType* getType(); 17 | virtual size_t getAddress(); 18 | 19 | Type* get_type() const; 20 | bool get_byValue() const; 21 | bool get_byRef() const; 22 | bool get_byPtr() const; 23 | bool get_byOutPtr() const; 24 | bool get_byOutRef() const; 25 | bool get_byNewPtr() const; 26 | bool get_byNewRef() const; 27 | bool get_byNewArrayPtr() const; 28 | bool get_byNewArrayRef() const; 29 | bool get_isConstant() const; 30 | 31 | public: 32 | Argument(const char* name, Type* type, Passing passing, bool constant); 33 | public: 34 | Type* m_type; 35 | Passing m_passing; 36 | bool m_constant; 37 | 38 | }; 39 | } -------------------------------------------------------------------------------- /paf/src/pafcore/Argument.i: -------------------------------------------------------------------------------- 1 | #import "Type.i" 2 | 3 | namespace pafcore 4 | { 5 | abstract class(function_argument)#PAFCORE_EXPORT Argument : Metadata 6 | { 7 | Type* type { get }; 8 | bool byValue { get }; 9 | bool byRef { get }; 10 | bool byPtr { get }; 11 | bool byOutPtr { get }; 12 | bool byOutRef { get }; 13 | bool byNewPtr { get }; 14 | bool byNewRef { get }; 15 | bool byNewArrayPtr { get }; 16 | bool byNewArrayRef { get }; 17 | bool isConstant { get }; 18 | #{ 19 | public: 20 | Argument(const char* name, Type* type, Passing passing, bool constant); 21 | public: 22 | Type* m_type; 23 | Passing m_passing; 24 | bool m_constant; 25 | #} 26 | }; 27 | } -------------------------------------------------------------------------------- /paf/src/pafcore/Argument.ic: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "Argument.h" 7 | #include "Argument.mh" 8 | #include "RefCountImpl.h" 9 | 10 | namespace pafcore 11 | { 12 | 13 | ::pafcore::ClassType* Argument::GetType() 14 | { 15 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 16 | } 17 | 18 | ::pafcore::ClassType* Argument::getType() 19 | { 20 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 21 | } 22 | 23 | size_t Argument::getAddress() 24 | { 25 | return (size_t)this; 26 | } 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /paf/src/pafcore/AutoRun.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Utility.h" 4 | 5 | template 6 | struct AutoRegisterType 7 | { 8 | }; 9 | 10 | #define AUTO_REGISTER_TYPE(T) \ 11 | template<> \ 12 | struct AutoRegisterType \ 13 | { \ 14 | AutoRegisterType() \ 15 | { \ 16 | T::GetSingleton(); \ 17 | } \ 18 | static AutoRegisterType s_instance; \ 19 | }; \ 20 | AutoRegisterType AutoRegisterType::s_instance; 21 | 22 | 23 | template 24 | struct AutoRegisterTypeAlias 25 | { 26 | public: 27 | AutoRegisterTypeAlias() 28 | { 29 | T::GetSingleton(); 30 | } 31 | }; 32 | 33 | #define AUTO_REGISTER_TYPEALIAS(T) AutoRegisterTypeAlias g_auto_register_##T; 34 | 35 | #define BEGIN_AUTO_RUN(T) \ 36 | struct AutoRun_##T \ 37 | { \ 38 | AutoRun_##T() \ 39 | { 40 | 41 | #define END_AUTO_RUN(T) \ 42 | } \ 43 | }; \ 44 | static AutoRun_##T s_autoRun_##T; -------------------------------------------------------------------------------- /paf/src/pafcore/ClassType.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fdyjfd/idlcpp/d0bd13d96d546b06074062fb3984b42569e71fae/paf/src/pafcore/ClassType.cpp -------------------------------------------------------------------------------- /paf/src/pafcore/ClassType.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fdyjfd/idlcpp/d0bd13d96d546b06074062fb3984b42569e71fae/paf/src/pafcore/ClassType.h -------------------------------------------------------------------------------- /paf/src/pafcore/ClassType.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fdyjfd/idlcpp/d0bd13d96d546b06074062fb3984b42569e71fae/paf/src/pafcore/ClassType.i -------------------------------------------------------------------------------- /paf/src/pafcore/ClassType.ic: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "ClassType.h" 7 | #include "ClassType.mh" 8 | #include "RefCountImpl.h" 9 | 10 | namespace pafcore 11 | { 12 | 13 | ::pafcore::ClassType* ClassTypeIterator::GetType() 14 | { 15 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 16 | } 17 | 18 | ::pafcore::ClassType* ClassType::GetType() 19 | { 20 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 21 | } 22 | 23 | ::pafcore::ClassType* ClassType::getType() 24 | { 25 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 26 | } 27 | 28 | size_t ClassType::getAddress() 29 | { 30 | return (size_t)this; 31 | } 32 | 33 | } 34 | 35 | -------------------------------------------------------------------------------- /paf/src/pafcore/Debug.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Utility.h" 3 | #include 4 | #include 5 | 6 | BEGIN_PAFCORE 7 | 8 | template 9 | class LiveObjects 10 | { 11 | public: 12 | LiveObjects() : m_serialNumber(0) 13 | { 14 | InitializeCriticalSection(&m_mutex); 15 | } 16 | ~LiveObjects() 17 | { 18 | DeleteCriticalSection(&m_mutex); 19 | } 20 | public: 21 | void addPtr(T* p) 22 | { 23 | EnterCriticalSection(&m_mutex); 24 | m_objects.insert(std::make_pair(p, m_serialNumber++)); 25 | LeaveCriticalSection(&m_mutex); 26 | } 27 | void removePtr(T* p) 28 | { 29 | EnterCriticalSection(&m_mutex); 30 | m_objects.erase(p); 31 | LeaveCriticalSection(&m_mutex); 32 | } 33 | void lock() 34 | { 35 | EnterCriticalSection(&m_mutex); 36 | } 37 | void unlock() 38 | { 39 | LeaveCriticalSection(&m_mutex); 40 | } 41 | public: 42 | std::unordered_map m_objects; 43 | CRITICAL_SECTION m_mutex; 44 | size_t m_serialNumber; 45 | }; 46 | 47 | 48 | END_PAFCORE 49 | -------------------------------------------------------------------------------- /paf/src/pafcore/EnumType.h: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "./Type.h" 7 | namespace pafcore{ class Enumerator; } 8 | namespace pafcore{ class ClassType; } 9 | 10 | 11 | namespace pafcore 12 | { 13 | 14 | class Variant; 15 | class InstanceProperty; 16 | 17 | 18 | class PAFCORE_EXPORT EnumType : public Type 19 | { 20 | public: 21 | static ::pafcore::ClassType* GetType(); 22 | virtual ::pafcore::ClassType* getType(); 23 | virtual size_t getAddress(); 24 | 25 | size_t _getEnumeratorCount_(); 26 | Enumerator* _getEnumerator_(size_t index); 27 | Enumerator* _getEnumeratorByValue_(int value); 28 | Enumerator* _getEnumeratorByName_(string_t name); 29 | 30 | public: 31 | EnumType(const char* name, const char* declarationFile); 32 | public: 33 | Enumerator* findEnumerator(const char* name); 34 | Metadata* findMember(const char* name); 35 | public: 36 | static pafcore::ErrorCode Enum_get__name_(pafcore::InstanceProperty* instanceProperty, pafcore::Variant* that, pafcore::Variant* value); 37 | public: 38 | Enumerator* m_enumerators; 39 | size_t m_enumeratorCount; 40 | InstanceProperty* m_instanceProperties; 41 | size_t m_instancePropertyCount; 42 | 43 | }; 44 | } -------------------------------------------------------------------------------- /paf/src/pafcore/EnumType.i: -------------------------------------------------------------------------------- 1 | #import "Type.i" 2 | #import "Enumerator.i" 3 | 4 | 5 | namespace pafcore 6 | { 7 | #{ 8 | class Variant; 9 | class InstanceProperty; 10 | #} 11 | 12 | abstract class(enum_type)#PAFCORE_EXPORT EnumType : Type 13 | { 14 | size_t _getEnumeratorCount_(); 15 | Enumerator* _getEnumerator_(size_t index); 16 | Enumerator* _getEnumeratorByValue_(int value); 17 | Enumerator* _getEnumeratorByName_(string_t name); 18 | #{ 19 | public: 20 | EnumType(const char* name, const char* declarationFile); 21 | public: 22 | Enumerator* findEnumerator(const char* name); 23 | Metadata* findMember(const char* name); 24 | public: 25 | static pafcore::ErrorCode Enum_get__name_(pafcore::InstanceProperty* instanceProperty, pafcore::Variant* that, pafcore::Variant* value); 26 | public: 27 | Enumerator* m_enumerators; 28 | size_t m_enumeratorCount; 29 | InstanceProperty* m_instanceProperties; 30 | size_t m_instancePropertyCount; 31 | #} 32 | }; 33 | } -------------------------------------------------------------------------------- /paf/src/pafcore/EnumType.ic: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "EnumType.h" 7 | #include "EnumType.mh" 8 | #include "RefCountImpl.h" 9 | 10 | namespace pafcore 11 | { 12 | 13 | ::pafcore::ClassType* EnumType::GetType() 14 | { 15 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 16 | } 17 | 18 | ::pafcore::ClassType* EnumType::getType() 19 | { 20 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 21 | } 22 | 23 | size_t EnumType::getAddress() 24 | { 25 | return (size_t)this; 26 | } 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /paf/src/pafcore/Enumerator.cpp: -------------------------------------------------------------------------------- 1 | #include "Enumerator.h" 2 | #include "Enumerator.mh" 3 | #include "Enumerator.ic" 4 | #include "Enumerator.mc" 5 | 6 | BEGIN_PAFCORE 7 | 8 | Enumerator::Enumerator(const char* name, Attributes* attributes, Type* type, int value) 9 | : Metadata(name, attributes) 10 | { 11 | m_type = type; 12 | m_value = value; 13 | } 14 | 15 | Type* Enumerator::get__type_() const 16 | { 17 | return m_type; 18 | } 19 | 20 | int Enumerator::get__value_() const 21 | { 22 | return m_value; 23 | } 24 | 25 | END_PAFCORE 26 | -------------------------------------------------------------------------------- /paf/src/pafcore/Enumerator.h: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "./Metadata.h" 7 | namespace pafcore{ class Type; } 8 | namespace pafcore{ class ClassType; } 9 | 10 | namespace pafcore 11 | { 12 | 13 | class PAFCORE_EXPORT Enumerator : public Metadata 14 | { 15 | public: 16 | static ::pafcore::ClassType* GetType(); 17 | virtual ::pafcore::ClassType* getType(); 18 | virtual size_t getAddress(); 19 | 20 | Type* get__type_() const; 21 | int get__value_() const; 22 | 23 | public: 24 | Type* m_type; 25 | int m_value; 26 | public: 27 | Enumerator(const char* name, Attributes* attributes, Type* type, int value); 28 | 29 | }; 30 | 31 | } -------------------------------------------------------------------------------- /paf/src/pafcore/Enumerator.i: -------------------------------------------------------------------------------- 1 | #import "Type.i" 2 | 3 | namespace pafcore 4 | { 5 | 6 | abstract class(enumerator)#PAFCORE_EXPORT Enumerator : Metadata 7 | { 8 | Type* _type_ { get }; 9 | int _value_ { get }; 10 | #{ 11 | public: 12 | Type* m_type; 13 | int m_value; 14 | public: 15 | Enumerator(const char* name, Attributes* attributes, Type* type, int value); 16 | #} 17 | }; 18 | 19 | } -------------------------------------------------------------------------------- /paf/src/pafcore/Enumerator.ic: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "Enumerator.h" 7 | #include "Enumerator.mh" 8 | #include "RefCountImpl.h" 9 | 10 | namespace pafcore 11 | { 12 | 13 | ::pafcore::ClassType* Enumerator::GetType() 14 | { 15 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 16 | } 17 | 18 | ::pafcore::ClassType* Enumerator::getType() 19 | { 20 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 21 | } 22 | 23 | size_t Enumerator::getAddress() 24 | { 25 | return (size_t)this; 26 | } 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /paf/src/pafcore/Enumerator.mh: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "Enumerator.h" 7 | #include "ClassType.h" 8 | #include "EnumType.h" 9 | #include "TypeAlias.h" 10 | #include "Variant.h" 11 | #include "SubclassInvoker.h" 12 | 13 | namespace idlcpp 14 | { 15 | 16 | class __pafcore__Enumerator_Type : public ::pafcore::ClassType 17 | { 18 | public: 19 | __pafcore__Enumerator_Type(); 20 | public: 21 | virtual void destroyInstance(void* address); 22 | virtual void destroyArray(void* address); 23 | virtual bool assign(void* dst, const void* src); 24 | public: 25 | static ::pafcore::ErrorCode Enumerator_get__type_(::pafcore::InstanceProperty* instanceProperty, ::pafcore::Variant* that, ::pafcore::Variant* value); 26 | static ::pafcore::ErrorCode Enumerator_get__value_(::pafcore::InstanceProperty* instanceProperty, ::pafcore::Variant* that, ::pafcore::Variant* value); 27 | public: 28 | PAFCORE_EXPORT static __pafcore__Enumerator_Type* GetSingleton(); 29 | }; 30 | 31 | } 32 | 33 | template<> 34 | struct RuntimeTypeOf<::pafcore::Enumerator> 35 | { 36 | typedef ::idlcpp::__pafcore__Enumerator_Type RuntimeType; 37 | enum {type_category = ::pafcore::reference_object}; 38 | }; 39 | 40 | -------------------------------------------------------------------------------- /paf/src/pafcore/FlexiblePropertySource.cpp: -------------------------------------------------------------------------------- 1 | #include "FlexiblePropertySource.h" 2 | #include "FlexiblePropertySource.mh" 3 | #include "FlexiblePropertySource.ic" 4 | #include "FlexiblePropertySource.mc" 5 | 6 | BEGIN_PAFCORE 7 | 8 | END_PAFCORE 9 | -------------------------------------------------------------------------------- /paf/src/pafcore/FlexiblePropertySource.h: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "./Object.h" 7 | namespace pafcore{ class ClassType; } 8 | 9 | namespace pafcore 10 | { 11 | 12 | class PAFCORE_EXPORT FlexiblePropertySource : public Object 13 | { 14 | public: 15 | static ::pafcore::ClassType* GetType(); 16 | virtual ::pafcore::ClassType* getType(); 17 | virtual size_t getAddress(); 18 | 19 | 20 | public: 21 | virtual bool propertyAvailabilityTest(string_t propertyName) const 22 | { 23 | return true; 24 | } 25 | 26 | virtual uint32_t dynamicInstancePropertyCount() const 27 | { 28 | return 0; 29 | } 30 | 31 | virtual InstanceProperty* dynamicInstanceProperty(uint32_t index) const 32 | { 33 | return 0; 34 | } 35 | 36 | 37 | }; 38 | } -------------------------------------------------------------------------------- /paf/src/pafcore/FlexiblePropertySource.i: -------------------------------------------------------------------------------- 1 | #import "Object.i" 2 | 3 | namespace pafcore 4 | { 5 | 6 | class(noncopyable) #PAFCORE_EXPORT FlexiblePropertySource : Object 7 | { 8 | #{ 9 | public: 10 | virtual bool propertyAvailabilityTest(string_t propertyName) const 11 | { 12 | return true; 13 | } 14 | 15 | virtual uint32_t dynamicInstancePropertyCount() const 16 | { 17 | return 0; 18 | } 19 | 20 | virtual InstanceProperty* dynamicInstanceProperty(uint32_t index) const 21 | { 22 | return 0; 23 | } 24 | 25 | #} 26 | }; 27 | } -------------------------------------------------------------------------------- /paf/src/pafcore/FlexiblePropertySource.ic: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "FlexiblePropertySource.h" 7 | #include "FlexiblePropertySource.mh" 8 | #include "RefCountImpl.h" 9 | 10 | namespace pafcore 11 | { 12 | 13 | ::pafcore::ClassType* FlexiblePropertySource::GetType() 14 | { 15 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 16 | } 17 | 18 | ::pafcore::ClassType* FlexiblePropertySource::getType() 19 | { 20 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 21 | } 22 | 23 | size_t FlexiblePropertySource::getAddress() 24 | { 25 | return (size_t)this; 26 | } 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /paf/src/pafcore/FlexiblePropertySource.mh: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "FlexiblePropertySource.h" 7 | #include "ClassType.h" 8 | #include "EnumType.h" 9 | #include "TypeAlias.h" 10 | #include "Variant.h" 11 | #include "SubclassInvoker.h" 12 | 13 | namespace idlcpp 14 | { 15 | 16 | class __pafcore__FlexiblePropertySource_Type : public ::pafcore::ClassType 17 | { 18 | public: 19 | __pafcore__FlexiblePropertySource_Type(); 20 | public: 21 | virtual void destroyInstance(void* address); 22 | virtual void destroyArray(void* address); 23 | virtual bool assign(void* dst, const void* src); 24 | public: 25 | PAFCORE_EXPORT static __pafcore__FlexiblePropertySource_Type* GetSingleton(); 26 | }; 27 | 28 | } 29 | 30 | template<> 31 | struct RuntimeTypeOf<::pafcore::FlexiblePropertySource> 32 | { 33 | typedef ::idlcpp::__pafcore__FlexiblePropertySource_Type RuntimeType; 34 | enum {type_category = ::pafcore::reference_object}; 35 | }; 36 | 37 | -------------------------------------------------------------------------------- /paf/src/pafcore/InstanceField.cpp: -------------------------------------------------------------------------------- 1 | #include "InstanceField.h" 2 | #include "InstanceField.mh" 3 | #include "InstanceField.ic" 4 | #include "InstanceField.mc" 5 | 6 | BEGIN_PAFCORE 7 | 8 | InstanceField::InstanceField(const char* name, Attributes* attributes, ClassType* objectType, Type* type, size_t offset, size_t arraySize, bool constant, TypeCompound tc) 9 | : Metadata(name, attributes) 10 | { 11 | m_objectType = objectType; 12 | m_type = type; 13 | m_offset = offset; 14 | m_arraySize = arraySize; 15 | m_constant = constant; 16 | m_typeCompound = tc; 17 | } 18 | 19 | Type* InstanceField::get_type() const 20 | { 21 | return m_type; 22 | } 23 | 24 | ClassType* InstanceField::get_objectType() const 25 | { 26 | return m_objectType; 27 | } 28 | 29 | bool InstanceField::get_isArray() const 30 | { 31 | return tc_array == m_typeCompound; 32 | } 33 | 34 | bool InstanceField::get_isPointer() const 35 | { 36 | return tc_pointer == m_typeCompound; 37 | } 38 | 39 | bool InstanceField::get_isConstant() const 40 | { 41 | return m_constant; 42 | } 43 | 44 | size_t InstanceField::get_offset() const 45 | { 46 | return m_offset; 47 | } 48 | 49 | 50 | END_PAFCORE 51 | -------------------------------------------------------------------------------- /paf/src/pafcore/InstanceField.h: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "./Metadata.h" 7 | namespace pafcore{ class Type; } 8 | namespace pafcore{ class ClassType; } 9 | namespace pafcore{ class ClassType; } 10 | 11 | namespace pafcore 12 | { 13 | 14 | 15 | struct Attributes; 16 | 17 | 18 | class PAFCORE_EXPORT InstanceField : public Metadata 19 | { 20 | public: 21 | static ::pafcore::ClassType* GetType(); 22 | virtual ::pafcore::ClassType* getType(); 23 | virtual size_t getAddress(); 24 | 25 | Type* get_type() const; 26 | ClassType* get_objectType() const; 27 | size_t get_offset() const; 28 | bool get_isArray() const; 29 | bool get_isPointer() const; 30 | bool get_isConstant() const; 31 | 32 | public: 33 | InstanceField(const char* name, Attributes* attributes, ClassType* objectType, Type* type, size_t offset, size_t arraySize, bool constant, TypeCompound tc); 34 | public: 35 | bool isArray() 36 | { 37 | return tc_array == m_typeCompound; 38 | } 39 | bool isPointer() 40 | { 41 | return tc_pointer == m_typeCompound; 42 | } 43 | bool isConstant() 44 | { 45 | return m_constant; 46 | } 47 | public: 48 | Type* m_type; 49 | ClassType* m_objectType; 50 | size_t m_offset; 51 | size_t m_arraySize; 52 | bool m_constant; 53 | byte_t m_typeCompound; 54 | 55 | }; 56 | 57 | } -------------------------------------------------------------------------------- /paf/src/pafcore/InstanceField.i: -------------------------------------------------------------------------------- 1 | #import "ClassType.i" 2 | 3 | namespace pafcore 4 | { 5 | 6 | #{ 7 | struct Attributes; 8 | #} 9 | 10 | abstract class(instance_field)#PAFCORE_EXPORT InstanceField : Metadata 11 | { 12 | Type* type { get }; 13 | ClassType* objectType { get }; 14 | size_t offset { get }; 15 | bool isArray { get }; 16 | bool isPointer { get }; 17 | bool isConstant { get }; 18 | #{ 19 | public: 20 | InstanceField(const char* name, Attributes* attributes, ClassType* objectType, Type* type, size_t offset, size_t arraySize, bool constant, TypeCompound tc); 21 | public: 22 | bool isArray() 23 | { 24 | return tc_array == m_typeCompound; 25 | } 26 | bool isPointer() 27 | { 28 | return tc_pointer == m_typeCompound; 29 | } 30 | bool isConstant() 31 | { 32 | return m_constant; 33 | } 34 | public: 35 | Type* m_type; 36 | ClassType* m_objectType; 37 | size_t m_offset; 38 | size_t m_arraySize; 39 | bool m_constant; 40 | byte_t m_typeCompound; 41 | #} 42 | }; 43 | 44 | } -------------------------------------------------------------------------------- /paf/src/pafcore/InstanceField.ic: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "InstanceField.h" 7 | #include "InstanceField.mh" 8 | #include "RefCountImpl.h" 9 | 10 | namespace pafcore 11 | { 12 | 13 | ::pafcore::ClassType* InstanceField::GetType() 14 | { 15 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 16 | } 17 | 18 | ::pafcore::ClassType* InstanceField::getType() 19 | { 20 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 21 | } 22 | 23 | size_t InstanceField::getAddress() 24 | { 25 | return (size_t)this; 26 | } 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /paf/src/pafcore/InstanceMethod.h: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "./Metadata.h" 7 | namespace pafcore{ class Result; } 8 | namespace pafcore{ class Argument; } 9 | namespace pafcore{ class ClassType; } 10 | 11 | #include "Overload.h" 12 | 13 | namespace pafcore 14 | { 15 | 16 | 17 | struct Attributes; 18 | 19 | 20 | class PAFCORE_EXPORT InstanceMethod : public Metadata 21 | { 22 | public: 23 | static ::pafcore::ClassType* GetType(); 24 | virtual ::pafcore::ClassType* getType(); 25 | virtual size_t getAddress(); 26 | 27 | size_t get_overloadCount() const; 28 | Result* getResult(size_t overloadIndex); 29 | size_t getArgumentCount(size_t overloadIndex); 30 | Argument* getArgument(size_t overloadIndex,size_t index); 31 | bool isConstant(size_t overloadIndex); 32 | 33 | public: 34 | InstanceMethod(const char* name, Attributes* attributes, FunctionInvoker invoker, Overload* overloads, size_t overloadCount); 35 | public: 36 | FunctionInvoker m_invoker; 37 | Overload* m_overloads; 38 | size_t m_overloadCount; 39 | 40 | }; 41 | 42 | } -------------------------------------------------------------------------------- /paf/src/pafcore/InstanceMethod.i: -------------------------------------------------------------------------------- 1 | #import "Argument.i" 2 | #import "Result.i" 3 | 4 | ###include "Overload.h" 5 | 6 | namespace pafcore 7 | { 8 | 9 | #{ 10 | struct Attributes; 11 | #} 12 | 13 | abstract class(instance_method)#PAFCORE_EXPORT InstanceMethod : Metadata 14 | { 15 | size_t overloadCount { get }; 16 | Result* getResult(size_t overloadIndex); 17 | size_t getArgumentCount(size_t overloadIndex); 18 | Argument* getArgument(size_t overloadIndex, size_t index); 19 | bool isConstant(size_t overloadIndex); 20 | #{ 21 | public: 22 | InstanceMethod(const char* name, Attributes* attributes, FunctionInvoker invoker, Overload* overloads, size_t overloadCount); 23 | public: 24 | FunctionInvoker m_invoker; 25 | Overload* m_overloads; 26 | size_t m_overloadCount; 27 | #} 28 | }; 29 | 30 | } -------------------------------------------------------------------------------- /paf/src/pafcore/InstanceMethod.ic: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "InstanceMethod.h" 7 | #include "InstanceMethod.mh" 8 | #include "RefCountImpl.h" 9 | 10 | namespace pafcore 11 | { 12 | 13 | ::pafcore::ClassType* InstanceMethod::GetType() 14 | { 15 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 16 | } 17 | 18 | ::pafcore::ClassType* InstanceMethod::getType() 19 | { 20 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 21 | } 22 | 23 | size_t InstanceMethod::getAddress() 24 | { 25 | return (size_t)this; 26 | } 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /paf/src/pafcore/InstanceProperty.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fdyjfd/idlcpp/d0bd13d96d546b06074062fb3984b42569e71fae/paf/src/pafcore/InstanceProperty.h -------------------------------------------------------------------------------- /paf/src/pafcore/InstanceProperty.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fdyjfd/idlcpp/d0bd13d96d546b06074062fb3984b42569e71fae/paf/src/pafcore/InstanceProperty.i -------------------------------------------------------------------------------- /paf/src/pafcore/InstanceProperty.ic: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "InstanceProperty.h" 7 | #include "InstanceProperty.mh" 8 | #include "RefCountImpl.h" 9 | 10 | namespace pafcore 11 | { 12 | 13 | ::pafcore::ClassType* InstanceProperty::GetType() 14 | { 15 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 16 | } 17 | 18 | ::pafcore::ClassType* InstanceProperty::getType() 19 | { 20 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 21 | } 22 | 23 | size_t InstanceProperty::getAddress() 24 | { 25 | return (size_t)this; 26 | } 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /paf/src/pafcore/Iterator.cpp: -------------------------------------------------------------------------------- 1 | #include "Iterator.h" 2 | #include "Iterator.mh" 3 | #include "Iterator.ic" 4 | #include "Iterator.mc" 5 | 6 | BEGIN_PAFCORE 7 | 8 | bool Iterator::isEnd() const 9 | { 10 | return true; 11 | } 12 | 13 | void Iterator::moveNext() 14 | { 15 | } 16 | 17 | void Iterator::reset() 18 | { 19 | } 20 | 21 | bool Iterator::equal(Iterator* other) const 22 | { 23 | return false; 24 | } 25 | 26 | long_t Iterator::addRef() 27 | { 28 | return ++m_refCount; 29 | } 30 | 31 | long_t Iterator::release() 32 | { 33 | long_t refCount = --m_refCount; 34 | if (0 == refCount) 35 | { 36 | delete this; 37 | } 38 | return refCount; 39 | } 40 | 41 | END_PAFCORE 42 | -------------------------------------------------------------------------------- /paf/src/pafcore/Iterator.ic: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "Iterator.h" 7 | #include "Iterator.mh" 8 | #include "RefCountImpl.h" 9 | 10 | namespace pafcore 11 | { 12 | 13 | ::pafcore::ClassType* Iterator::GetType() 14 | { 15 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 16 | } 17 | 18 | ::pafcore::ClassType* Iterator::getType() 19 | { 20 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 21 | } 22 | 23 | size_t Iterator::getAddress() 24 | { 25 | return (size_t)this; 26 | } 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /paf/src/pafcore/Metadata.ic: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "Metadata.h" 7 | #include "Metadata.mh" 8 | #include "RefCountImpl.h" 9 | 10 | namespace pafcore 11 | { 12 | 13 | ::pafcore::ClassType* Metadata::GetType() 14 | { 15 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 16 | } 17 | 18 | ::pafcore::ClassType* Metadata::getType() 19 | { 20 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 21 | } 22 | 23 | size_t Metadata::getAddress() 24 | { 25 | return (size_t)this; 26 | } 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /paf/src/pafcore/NameSpace.h: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "./Metadata.h" 7 | namespace pafcore{ class ClassType; } 8 | 9 | 10 | #include 11 | 12 | 13 | namespace pafcore 14 | { 15 | 16 | class PAFCORE_EXPORT NameSpace : public Metadata 17 | { 18 | public: 19 | static ::pafcore::ClassType* GetType(); 20 | virtual ::pafcore::ClassType* getType(); 21 | virtual size_t getAddress(); 22 | 23 | size_t _getMemberCount_(); 24 | Metadata* _getMember_(size_t index); 25 | Metadata* _findMember_(string_t name); 26 | 27 | private: 28 | struct Hash_Metadata 29 | { 30 | size_t operator ()(const Metadata* metadata) const; 31 | }; 32 | struct Equal_Metadata 33 | { 34 | bool operator() (const Metadata* lhs, const Metadata* rhs) const; 35 | }; 36 | public: 37 | NameSpace(const char* name); 38 | ~NameSpace(); 39 | public: 40 | NameSpace* getNameSpace(const char* name); 41 | ErrorCode registerMember(Metadata* metadata); 42 | Metadata* findMember(const char* name); 43 | void unregisterMember(Metadata* metadata); 44 | public: 45 | typedef std::unordered_set MetadataContainer; 46 | MetadataContainer m_members; 47 | Metadata* m_enclosing; 48 | public: 49 | static NameSpace* GetGlobalNameSpace(); 50 | 51 | }; 52 | 53 | } -------------------------------------------------------------------------------- /paf/src/pafcore/NameSpace.i: -------------------------------------------------------------------------------- 1 | #import "Metadata.i" 2 | 3 | #{ 4 | #include 5 | #} 6 | 7 | namespace pafcore 8 | { 9 | 10 | abstract class(name_space)#PAFCORE_EXPORT NameSpace : Metadata 11 | { 12 | size_t _getMemberCount_(); 13 | Metadata* _getMember_(size_t index); 14 | Metadata* _findMember_(string_t name); 15 | #{ 16 | private: 17 | struct Hash_Metadata 18 | { 19 | size_t operator ()(const Metadata* metadata) const; 20 | }; 21 | struct Equal_Metadata 22 | { 23 | bool operator() (const Metadata* lhs, const Metadata* rhs) const; 24 | }; 25 | public: 26 | NameSpace(const char* name); 27 | ~NameSpace(); 28 | public: 29 | NameSpace* getNameSpace(const char* name); 30 | ErrorCode registerMember(Metadata* metadata); 31 | Metadata* findMember(const char* name); 32 | void unregisterMember(Metadata* metadata); 33 | public: 34 | typedef std::unordered_set MetadataContainer; 35 | MetadataContainer m_members; 36 | Metadata* m_enclosing; 37 | public: 38 | static NameSpace* GetGlobalNameSpace(); 39 | #} 40 | }; 41 | 42 | } -------------------------------------------------------------------------------- /paf/src/pafcore/NameSpace.ic: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "NameSpace.h" 7 | #include "NameSpace.mh" 8 | #include "RefCountImpl.h" 9 | 10 | namespace pafcore 11 | { 12 | 13 | ::pafcore::ClassType* NameSpace::GetType() 14 | { 15 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 16 | } 17 | 18 | ::pafcore::ClassType* NameSpace::getType() 19 | { 20 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 21 | } 22 | 23 | size_t NameSpace::getAddress() 24 | { 25 | return (size_t)this; 26 | } 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /paf/src/pafcore/NameSpace.mh: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "NameSpace.h" 7 | #include "ClassType.h" 8 | #include "EnumType.h" 9 | #include "TypeAlias.h" 10 | #include "Variant.h" 11 | #include "SubclassInvoker.h" 12 | 13 | namespace idlcpp 14 | { 15 | 16 | class __pafcore__NameSpace_Type : public ::pafcore::ClassType 17 | { 18 | public: 19 | __pafcore__NameSpace_Type(); 20 | public: 21 | virtual void destroyInstance(void* address); 22 | virtual void destroyArray(void* address); 23 | virtual bool assign(void* dst, const void* src); 24 | public: 25 | static ::pafcore::ErrorCode NameSpace__findMember_(::pafcore::Variant* result, ::pafcore::Variant** args, int numArgs); 26 | static ::pafcore::ErrorCode NameSpace__getMemberCount_(::pafcore::Variant* result, ::pafcore::Variant** args, int numArgs); 27 | static ::pafcore::ErrorCode NameSpace__getMember_(::pafcore::Variant* result, ::pafcore::Variant** args, int numArgs); 28 | public: 29 | PAFCORE_EXPORT static __pafcore__NameSpace_Type* GetSingleton(); 30 | }; 31 | 32 | } 33 | 34 | template<> 35 | struct RuntimeTypeOf<::pafcore::NameSpace> 36 | { 37 | typedef ::idlcpp::__pafcore__NameSpace_Type RuntimeType; 38 | enum {type_category = ::pafcore::reference_object}; 39 | }; 40 | 41 | -------------------------------------------------------------------------------- /paf/src/pafcore/NotifyHandler.cpp: -------------------------------------------------------------------------------- 1 | #include "NotifyHandler.h" 2 | #include "NotifyHandler.mh" 3 | #include "NotifyHandler.ic" 4 | #include "NotifyHandler.mc" 5 | 6 | BEGIN_PAFCORE 7 | 8 | void PropertyChangedNotifyHandler::onPropertyChanged(Reference* sender, string_t propertyName, PropertyChangedFlag flag, Iterator* iterator) 9 | { 10 | 11 | } 12 | 13 | void PropertyChangedNotifyHandler::onPropertyAvailabilityChanged(Reference* sender, string_t propertyName) 14 | { 15 | 16 | } 17 | 18 | void PropertyChangedNotifyHandler::onDynamicPropertyChanged(Reference* sender, string_t propertyName, PropertyChangedFlag flag, Iterator* iterator) 19 | { 20 | 21 | } 22 | 23 | void PropertyChangedNotifyHandler::onUpdateDynamicProperty(Reference* sender) 24 | { 25 | } 26 | 27 | END_PAFCORE 28 | -------------------------------------------------------------------------------- /paf/src/pafcore/NotifyHandler.h: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "./Reference.h" 7 | namespace pafcore{ class Iterator; } 8 | namespace pafcore{ class ClassType; } 9 | 10 | 11 | #include "Utility.h" 12 | 13 | 14 | namespace pafcore 15 | { 16 | enum class PropertyChangedFlag 17 | { 18 | update, 19 | remove, 20 | add, 21 | reset, 22 | candidate_list 23 | }; 24 | 25 | class PAFCORE_EXPORT NotifyHandler : public Reference 26 | { 27 | public: 28 | static ::pafcore::ClassType* GetType(); 29 | virtual ::pafcore::ClassType* getType(); 30 | virtual size_t getAddress(); 31 | 32 | 33 | 34 | 35 | }; 36 | 37 | class PAFCORE_EXPORT PropertyChangedNotifyHandler : public NotifyHandler 38 | { 39 | public: 40 | static ::pafcore::ClassType* GetType(); 41 | virtual ::pafcore::ClassType* getType(); 42 | virtual size_t getAddress(); 43 | 44 | virtual void onPropertyChanged(Reference* sender,string_t propertyName,PropertyChangedFlag flag,Iterator* iterator); 45 | virtual void onPropertyAvailabilityChanged(Reference* sender,string_t propertyName); 46 | virtual void onDynamicPropertyChanged(Reference* sender,string_t propertyName,PropertyChangedFlag flag,Iterator* iterator); 47 | virtual void onUpdateDynamicProperty(Reference* sender); 48 | }; 49 | } 50 | -------------------------------------------------------------------------------- /paf/src/pafcore/NotifyHandler.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fdyjfd/idlcpp/d0bd13d96d546b06074062fb3984b42569e71fae/paf/src/pafcore/NotifyHandler.i -------------------------------------------------------------------------------- /paf/src/pafcore/NotifyHandler.ic: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "NotifyHandler.h" 7 | #include "NotifyHandler.mh" 8 | #include "RefCountImpl.h" 9 | 10 | namespace pafcore 11 | { 12 | 13 | ::pafcore::ClassType* NotifyHandler::GetType() 14 | { 15 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 16 | } 17 | 18 | ::pafcore::ClassType* NotifyHandler::getType() 19 | { 20 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 21 | } 22 | 23 | size_t NotifyHandler::getAddress() 24 | { 25 | return (size_t)this; 26 | } 27 | 28 | ::pafcore::ClassType* PropertyChangedNotifyHandler::GetType() 29 | { 30 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 31 | } 32 | 33 | ::pafcore::ClassType* PropertyChangedNotifyHandler::getType() 34 | { 35 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 36 | } 37 | 38 | size_t PropertyChangedNotifyHandler::getAddress() 39 | { 40 | return (size_t)this; 41 | } 42 | 43 | } 44 | 45 | -------------------------------------------------------------------------------- /paf/src/pafcore/NotifyHandlerList.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fdyjfd/idlcpp/d0bd13d96d546b06074062fb3984b42569e71fae/paf/src/pafcore/NotifyHandlerList.cpp -------------------------------------------------------------------------------- /paf/src/pafcore/NotifyHandlerList.ic: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "NotifyHandlerList.h" 7 | #include "NotifyHandlerList.mh" 8 | #include "RefCountImpl.h" 9 | 10 | namespace pafcore 11 | { 12 | 13 | ::pafcore::ClassType* NotifyHandlerLink::GetType() 14 | { 15 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 16 | } 17 | 18 | ::pafcore::ClassType* NotifyHandlerLink::getType() 19 | { 20 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 21 | } 22 | 23 | size_t NotifyHandlerLink::getAddress() 24 | { 25 | return (size_t)this; 26 | } 27 | 28 | ::pafcore::ClassType* NotifyHandlerList::GetType() 29 | { 30 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 31 | } 32 | 33 | ::pafcore::ClassType* PropertyChangedNotifySource::GetType() 34 | { 35 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 36 | } 37 | 38 | ::pafcore::ClassType* PropertyChangedNotifySource::getType() 39 | { 40 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 41 | } 42 | 43 | size_t PropertyChangedNotifySource::getAddress() 44 | { 45 | return (size_t)this; 46 | } 47 | 48 | } 49 | 50 | -------------------------------------------------------------------------------- /paf/src/pafcore/Object.cpp: -------------------------------------------------------------------------------- 1 | #include "Object.h" 2 | #include "Object.mh" 3 | #include "Object.ic" 4 | #include "Object.mc" 5 | 6 | BEGIN_PAFCORE 7 | 8 | END_PAFCORE 9 | -------------------------------------------------------------------------------- /paf/src/pafcore/Object.h: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "./Reference.h" 7 | namespace pafcore{ class ClassType; } 8 | 9 | namespace pafcore 10 | { 11 | class PAFCORE_EXPORT Object : public Reference 12 | { 13 | public: 14 | static ::pafcore::ClassType* GetType(); 15 | virtual ::pafcore::ClassType* getType(); 16 | virtual size_t getAddress(); 17 | 18 | 19 | public: 20 | virtual bool serializable() const 21 | { 22 | return true; 23 | } 24 | 25 | }; 26 | } -------------------------------------------------------------------------------- /paf/src/pafcore/Object.i: -------------------------------------------------------------------------------- 1 | #import "Reference.i" 2 | 3 | namespace pafcore 4 | { 5 | class(noncopyable) #PAFCORE_EXPORT Object : Reference 6 | { 7 | #{ 8 | public: 9 | virtual bool serializable() const 10 | { 11 | return true; 12 | } 13 | #} 14 | }; 15 | } -------------------------------------------------------------------------------- /paf/src/pafcore/Object.ic: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "Object.h" 7 | #include "Object.mh" 8 | #include "RefCountImpl.h" 9 | 10 | namespace pafcore 11 | { 12 | 13 | ::pafcore::ClassType* Object::GetType() 14 | { 15 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 16 | } 17 | 18 | ::pafcore::ClassType* Object::getType() 19 | { 20 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 21 | } 22 | 23 | size_t Object::getAddress() 24 | { 25 | return (size_t)this; 26 | } 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /paf/src/pafcore/Object.mh: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "Object.h" 7 | #include "ClassType.h" 8 | #include "EnumType.h" 9 | #include "TypeAlias.h" 10 | #include "Variant.h" 11 | #include "SubclassInvoker.h" 12 | 13 | namespace idlcpp 14 | { 15 | 16 | class __pafcore__Object_Type : public ::pafcore::ClassType 17 | { 18 | public: 19 | __pafcore__Object_Type(); 20 | public: 21 | virtual void destroyInstance(void* address); 22 | virtual void destroyArray(void* address); 23 | virtual bool assign(void* dst, const void* src); 24 | public: 25 | PAFCORE_EXPORT static __pafcore__Object_Type* GetSingleton(); 26 | }; 27 | 28 | } 29 | 30 | template<> 31 | struct RuntimeTypeOf<::pafcore::Object> 32 | { 33 | typedef ::idlcpp::__pafcore__Object_Type RuntimeType; 34 | enum {type_category = ::pafcore::reference_object}; 35 | }; 36 | 37 | -------------------------------------------------------------------------------- /paf/src/pafcore/Overload.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Utility.h" 4 | #include "Metadata.h" 5 | 6 | BEGIN_PAFCORE 7 | 8 | class Result; 9 | class Argument; 10 | class Variant; 11 | 12 | struct PAFCORE_EXPORT Overload 13 | { 14 | Result* m_result; 15 | Argument* m_args; 16 | uint16_t m_argCount; 17 | bool m_isStatic; 18 | bool m_isConstant; 19 | public: 20 | Overload(Result* result, Argument* args, size_t argCount, bool isStatic, bool isConstant); 21 | bool matchArguments(char* matches, Variant** variants); 22 | static size_t Resolution(Overload* overloads, Variant** variants, size_t argCount, size_t overloadCount, size_t* candidates, char* argMatches); 23 | }; 24 | 25 | 26 | typedef ErrorCode(*FunctionInvoker)(Variant* result, Variant** args, int_t numArgs); 27 | 28 | END_PAFCORE -------------------------------------------------------------------------------- /paf/src/pafcore/PrimitiveType.ic: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "PrimitiveType.h" 7 | #include "PrimitiveType.mh" 8 | #include "RefCountImpl.h" 9 | 10 | namespace pafcore 11 | { 12 | 13 | ::pafcore::ClassType* PrimitiveType::GetType() 14 | { 15 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 16 | } 17 | 18 | ::pafcore::ClassType* PrimitiveType::getType() 19 | { 20 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 21 | } 22 | 23 | size_t PrimitiveType::getAddress() 24 | { 25 | return (size_t)this; 26 | } 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /paf/src/pafcore/PrimitiveType.mh: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "PrimitiveType.h" 7 | #include "ClassType.h" 8 | #include "EnumType.h" 9 | #include "TypeAlias.h" 10 | #include "Variant.h" 11 | #include "SubclassInvoker.h" 12 | 13 | namespace idlcpp 14 | { 15 | 16 | class __pafcore__PrimitiveType_Type : public ::pafcore::ClassType 17 | { 18 | public: 19 | __pafcore__PrimitiveType_Type(); 20 | public: 21 | virtual void destroyInstance(void* address); 22 | virtual void destroyArray(void* address); 23 | virtual bool assign(void* dst, const void* src); 24 | public: 25 | static ::pafcore::ErrorCode PrimitiveType__findMember_(::pafcore::Variant* result, ::pafcore::Variant** args, int numArgs); 26 | static ::pafcore::ErrorCode PrimitiveType__getMemberCount_(::pafcore::Variant* result, ::pafcore::Variant** args, int numArgs); 27 | static ::pafcore::ErrorCode PrimitiveType__getMember_(::pafcore::Variant* result, ::pafcore::Variant** args, int numArgs); 28 | public: 29 | PAFCORE_EXPORT static __pafcore__PrimitiveType_Type* GetSingleton(); 30 | }; 31 | 32 | } 33 | 34 | template<> 35 | struct RuntimeTypeOf<::pafcore::PrimitiveType> 36 | { 37 | typedef ::idlcpp::__pafcore__PrimitiveType_Type RuntimeType; 38 | enum {type_category = ::pafcore::reference_object}; 39 | }; 40 | 41 | -------------------------------------------------------------------------------- /paf/src/pafcore/Reference.i: -------------------------------------------------------------------------------- 1 | #import "Typedef.i" 2 | 3 | #{ 4 | #include "RefCount.h" 5 | #} 6 | 7 | namespace pafcore 8 | { 9 | #{ 10 | class ClassType; 11 | class InstanceProperty; 12 | #} 13 | class(noncopyable) #PAFCORE_EXPORT Reference ## : public RefCount 14 | { 15 | #{ 16 | #ifdef _DEBUG 17 | public: 18 | Reference(); 19 | Reference(const Reference&); 20 | ~Reference(); 21 | #endif 22 | // Reference() = default; 23 | // Reference(const Reference&) = delete; 24 | // Reference& operator=(const Reference&) = delete; 25 | public: 26 | bool isTypeOf(ClassType* classType); 27 | 28 | template 29 | bool isTypeOf() 30 | { 31 | return isTypeOf(T::GetType()); 32 | } 33 | 34 | bool isStrictTypeOf(ClassType* classType) 35 | { 36 | return getType() == classType; 37 | } 38 | 39 | template 40 | bool isStrictTypeOf() 41 | { 42 | return isStrictTypeOf(T::GetType()); 43 | } 44 | 45 | void* castTo(ClassType* classType); 46 | 47 | template 48 | T* castTo() 49 | { 50 | return reinterpret_cast(castTo(T::GetType())); 51 | } 52 | 53 | void deleteThis() 54 | { 55 | delete this; 56 | } 57 | 58 | #} 59 | }; 60 | } -------------------------------------------------------------------------------- /paf/src/pafcore/Reference.ic: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "Reference.h" 7 | #include "Reference.mh" 8 | #include "RefCountImpl.h" 9 | 10 | namespace pafcore 11 | { 12 | 13 | ::pafcore::ClassType* Reference::GetType() 14 | { 15 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 16 | } 17 | 18 | ::pafcore::ClassType* Reference::getType() 19 | { 20 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 21 | } 22 | 23 | size_t Reference::getAddress() 24 | { 25 | return (size_t)this; 26 | } 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /paf/src/pafcore/Reference.mh: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "Reference.h" 7 | #include "ClassType.h" 8 | #include "EnumType.h" 9 | #include "TypeAlias.h" 10 | #include "Variant.h" 11 | #include "SubclassInvoker.h" 12 | 13 | namespace idlcpp 14 | { 15 | 16 | class __pafcore__Reference_Type : public ::pafcore::ClassType 17 | { 18 | public: 19 | __pafcore__Reference_Type(); 20 | public: 21 | virtual void destroyInstance(void* address); 22 | virtual void destroyArray(void* address); 23 | virtual bool assign(void* dst, const void* src); 24 | public: 25 | PAFCORE_EXPORT static __pafcore__Reference_Type* GetSingleton(); 26 | }; 27 | 28 | } 29 | 30 | template<> 31 | struct RuntimeTypeOf<::pafcore::Reference> 32 | { 33 | typedef ::idlcpp::__pafcore__Reference_Type RuntimeType; 34 | enum {type_category = ::pafcore::reference_object}; 35 | }; 36 | 37 | -------------------------------------------------------------------------------- /paf/src/pafcore/Reflection.ic: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "Reflection.h" 7 | #include "Reflection.mh" 8 | #include "RefCountImpl.h" 9 | 10 | namespace pafcore 11 | { 12 | 13 | ::pafcore::ClassType* Reflection::GetType() 14 | { 15 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 16 | } 17 | 18 | } 19 | 20 | -------------------------------------------------------------------------------- /paf/src/pafcore/Reflection.mh: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "Reflection.h" 7 | #include "ClassType.h" 8 | #include "EnumType.h" 9 | #include "TypeAlias.h" 10 | #include "Variant.h" 11 | #include "SubclassInvoker.h" 12 | 13 | namespace idlcpp 14 | { 15 | 16 | class __pafcore__Reflection_Type : public ::pafcore::ClassType 17 | { 18 | public: 19 | __pafcore__Reflection_Type(); 20 | public: 21 | virtual void destroyInstance(void* address); 22 | virtual void destroyArray(void* address); 23 | virtual bool assign(void* dst, const void* src); 24 | public: 25 | static ::pafcore::ErrorCode Reflection_GetTypeAliasFullName(::pafcore::Variant* result, ::pafcore::Variant** args, int numArgs); 26 | static ::pafcore::ErrorCode Reflection_GetTypeFromFullName(::pafcore::Variant* result, ::pafcore::Variant** args, int numArgs); 27 | static ::pafcore::ErrorCode Reflection_GetTypeFullName(::pafcore::Variant* result, ::pafcore::Variant** args, int numArgs); 28 | public: 29 | PAFCORE_EXPORT static __pafcore__Reflection_Type* GetSingleton(); 30 | }; 31 | 32 | } 33 | 34 | template<> 35 | struct RuntimeTypeOf<::pafcore::Reflection> 36 | { 37 | typedef ::idlcpp::__pafcore__Reflection_Type RuntimeType; 38 | enum {type_category = ::pafcore::value_object}; 39 | }; 40 | 41 | -------------------------------------------------------------------------------- /paf/src/pafcore/Result.cpp: -------------------------------------------------------------------------------- 1 | #include "Result.h" 2 | #include "Result.mh" 3 | #include "Result.ic" 4 | #include "Result.mc" 5 | 6 | BEGIN_PAFCORE 7 | 8 | Result::Result(Type* type, bool constant, Passing passing) 9 | : Metadata(0) 10 | { 11 | m_type = type; 12 | m_constant = constant; 13 | m_passing = passing; 14 | } 15 | 16 | bool Result::get_isConstant() const 17 | { 18 | return m_constant; 19 | } 20 | 21 | Type* Result::get_type() const 22 | { 23 | return m_type; 24 | } 25 | 26 | bool Result::get_byValue() const 27 | { 28 | return by_value == m_passing; 29 | } 30 | bool Result::get_byRef() const 31 | { 32 | return by_ref == m_passing; 33 | } 34 | bool Result::get_byPtr() const 35 | { 36 | return by_ptr == m_passing; 37 | } 38 | 39 | bool Result::get_byNew() const 40 | { 41 | return by_new == m_passing; 42 | } 43 | 44 | bool Result::get_byNewArray() const 45 | { 46 | return by_new_array == m_passing; 47 | } 48 | 49 | END_PAFCORE -------------------------------------------------------------------------------- /paf/src/pafcore/Result.h: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "./Metadata.h" 7 | namespace pafcore{ class Type; } 8 | namespace pafcore{ class ClassType; } 9 | 10 | namespace pafcore 11 | { 12 | class Variant; 13 | 14 | class PAFCORE_EXPORT Result : public Metadata 15 | { 16 | public: 17 | static ::pafcore::ClassType* GetType(); 18 | virtual ::pafcore::ClassType* getType(); 19 | virtual size_t getAddress(); 20 | 21 | Type* get_type() const; 22 | bool get_byValue() const; 23 | bool get_byRef() const; 24 | bool get_byPtr() const; 25 | bool get_byNew() const; 26 | bool get_byNewArray() const; 27 | bool get_isConstant() const; 28 | 29 | public: 30 | Result(Type* type, bool constant, Passing passing); 31 | public: 32 | Type* m_type; 33 | bool m_constant; 34 | byte_t m_passing; 35 | 36 | }; 37 | 38 | } -------------------------------------------------------------------------------- /paf/src/pafcore/Result.i: -------------------------------------------------------------------------------- 1 | #import "Type.i" 2 | 3 | namespace pafcore 4 | { 5 | ##class Variant; 6 | 7 | abstract class(function_result)#PAFCORE_EXPORT Result : Metadata 8 | { 9 | Type* type { get }; 10 | bool byValue { get }; 11 | bool byRef { get }; 12 | bool byPtr { get }; 13 | bool byNew { get }; 14 | bool byNewArray { get }; 15 | bool isConstant { get }; 16 | #{ 17 | public: 18 | Result(Type* type, bool constant, Passing passing); 19 | public: 20 | Type* m_type; 21 | bool m_constant; 22 | byte_t m_passing; 23 | #} 24 | }; 25 | 26 | } -------------------------------------------------------------------------------- /paf/src/pafcore/Result.ic: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "Result.h" 7 | #include "Result.mh" 8 | #include "RefCountImpl.h" 9 | 10 | namespace pafcore 11 | { 12 | 13 | ::pafcore::ClassType* Result::GetType() 14 | { 15 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 16 | } 17 | 18 | ::pafcore::ClassType* Result::getType() 19 | { 20 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 21 | } 22 | 23 | size_t Result::getAddress() 24 | { 25 | return (size_t)this; 26 | } 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /paf/src/pafcore/StaticField.cpp: -------------------------------------------------------------------------------- 1 | #include "StaticField.h" 2 | #include "StaticField.mh" 3 | #include "StaticField.ic" 4 | #include "StaticField.mc" 5 | 6 | BEGIN_PAFCORE 7 | 8 | StaticField::StaticField(const char* name, Attributes* attributes, Type* type, size_t offset, size_t arraySize, bool constant, TypeCompound tc) 9 | : Metadata(name, attributes) 10 | { 11 | m_type = type; 12 | m_address = offset; 13 | m_arraySize = arraySize; 14 | m_constant = constant; 15 | m_typeCompound = tc; 16 | } 17 | 18 | Type* StaticField::get_type() const 19 | { 20 | return m_type; 21 | } 22 | 23 | bool StaticField::get_isArray() const 24 | { 25 | return tc_array == m_typeCompound; 26 | } 27 | 28 | bool StaticField::get_isPointer() const 29 | { 30 | return tc_pointer == m_typeCompound; 31 | } 32 | 33 | bool StaticField::get_isConstant() const 34 | { 35 | return m_constant; 36 | } 37 | 38 | size_t StaticField::get_address() const 39 | { 40 | return m_address; 41 | } 42 | 43 | 44 | END_PAFCORE 45 | -------------------------------------------------------------------------------- /paf/src/pafcore/StaticField.h: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "./Metadata.h" 7 | namespace pafcore{ class Type; } 8 | namespace pafcore{ class ClassType; } 9 | 10 | namespace pafcore 11 | { 12 | 13 | 14 | struct Attributes; 15 | 16 | 17 | class PAFCORE_EXPORT StaticField : public Metadata 18 | { 19 | public: 20 | static ::pafcore::ClassType* GetType(); 21 | virtual ::pafcore::ClassType* getType(); 22 | virtual size_t getAddress(); 23 | 24 | Type* get_type() const; 25 | size_t get_address() const; 26 | bool get_isConstant() const; 27 | bool get_isArray() const; 28 | bool get_isPointer() const; 29 | 30 | public: 31 | StaticField(const char* name, Attributes* attributes, Type* type, size_t address, size_t arraySize, bool constant, TypeCompound tc); 32 | public: 33 | bool isArray() 34 | { 35 | return tc_array == m_typeCompound; 36 | } 37 | bool isPointer() 38 | { 39 | return tc_pointer == m_typeCompound; 40 | } 41 | bool isConstant() 42 | { 43 | return m_constant; 44 | } 45 | public: 46 | Type* m_type; 47 | size_t m_address; 48 | size_t m_arraySize; 49 | bool m_constant; 50 | byte_t m_typeCompound; 51 | 52 | }; 53 | 54 | } -------------------------------------------------------------------------------- /paf/src/pafcore/StaticField.i: -------------------------------------------------------------------------------- 1 | #import "Type.i" 2 | 3 | namespace pafcore 4 | { 5 | 6 | #{ 7 | struct Attributes; 8 | #} 9 | 10 | abstract class(static_field)#PAFCORE_EXPORT StaticField : Metadata 11 | { 12 | Type* type { get }; 13 | size_t address { get }; 14 | bool isConstant { get }; 15 | bool isArray { get }; 16 | bool isPointer { get }; 17 | #{ 18 | public: 19 | StaticField(const char* name, Attributes* attributes, Type* type, size_t address, size_t arraySize, bool constant, TypeCompound tc); 20 | public: 21 | bool isArray() 22 | { 23 | return tc_array == m_typeCompound; 24 | } 25 | bool isPointer() 26 | { 27 | return tc_pointer == m_typeCompound; 28 | } 29 | bool isConstant() 30 | { 31 | return m_constant; 32 | } 33 | public: 34 | Type* m_type; 35 | size_t m_address; 36 | size_t m_arraySize; 37 | bool m_constant; 38 | byte_t m_typeCompound; 39 | #} 40 | }; 41 | 42 | } -------------------------------------------------------------------------------- /paf/src/pafcore/StaticField.ic: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "StaticField.h" 7 | #include "StaticField.mh" 8 | #include "RefCountImpl.h" 9 | 10 | namespace pafcore 11 | { 12 | 13 | ::pafcore::ClassType* StaticField::GetType() 14 | { 15 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 16 | } 17 | 18 | ::pafcore::ClassType* StaticField::getType() 19 | { 20 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 21 | } 22 | 23 | size_t StaticField::getAddress() 24 | { 25 | return (size_t)this; 26 | } 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /paf/src/pafcore/StaticMethod.cpp: -------------------------------------------------------------------------------- 1 | #include "StaticMethod.h" 2 | #include "StaticMethod.mh" 3 | #include "StaticMethod.ic" 4 | #include "StaticMethod.mc" 5 | #include "Argument.h" 6 | 7 | BEGIN_PAFCORE 8 | 9 | StaticMethod::StaticMethod(const char* name, Attributes* attributes, FunctionInvoker invoker, Overload* overloads, size_t overloadCount) 10 | : Metadata(name, attributes) 11 | { 12 | m_invoker = invoker; 13 | m_overloads = overloads; 14 | m_overloadCount = overloadCount; 15 | } 16 | 17 | size_t StaticMethod::get_overloadCount() const 18 | { 19 | return m_overloadCount; 20 | } 21 | 22 | Result* StaticMethod::getResult(size_t overloadIndex) 23 | { 24 | if(overloadIndex < m_overloadCount) 25 | { 26 | return m_overloads[overloadIndex].m_result; 27 | } 28 | return 0; 29 | } 30 | 31 | size_t StaticMethod::getArgumentCount(size_t overloadIndex) 32 | { 33 | if(overloadIndex < m_overloadCount) 34 | { 35 | return m_overloads[overloadIndex].m_argCount; 36 | } 37 | return 0; 38 | } 39 | 40 | Argument* StaticMethod::getArgument(size_t overloadIndex, size_t index) 41 | { 42 | if(overloadIndex < m_overloadCount) 43 | { 44 | if(index < m_overloads[overloadIndex].m_argCount) 45 | { 46 | return &m_overloads[overloadIndex].m_args[index]; 47 | } 48 | } 49 | return 0; 50 | } 51 | 52 | END_PAFCORE -------------------------------------------------------------------------------- /paf/src/pafcore/StaticMethod.h: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "./Metadata.h" 7 | namespace pafcore{ class Result; } 8 | namespace pafcore{ class Argument; } 9 | namespace pafcore{ class ClassType; } 10 | 11 | #include "Overload.h" 12 | 13 | namespace pafcore 14 | { 15 | 16 | 17 | struct Attributes; 18 | 19 | 20 | class PAFCORE_EXPORT StaticMethod : public Metadata 21 | { 22 | public: 23 | static ::pafcore::ClassType* GetType(); 24 | virtual ::pafcore::ClassType* getType(); 25 | virtual size_t getAddress(); 26 | 27 | size_t get_overloadCount() const; 28 | Result* getResult(size_t overloadIndex); 29 | size_t getArgumentCount(size_t overloadIndex); 30 | Argument* getArgument(size_t overloadIndex,size_t index); 31 | 32 | public: 33 | StaticMethod(const char* name, Attributes* attributes, FunctionInvoker invoker, Overload* overloads, size_t overloadCount); 34 | public: 35 | FunctionInvoker m_invoker; 36 | Overload* m_overloads; 37 | size_t m_overloadCount; 38 | 39 | }; 40 | 41 | } -------------------------------------------------------------------------------- /paf/src/pafcore/StaticMethod.i: -------------------------------------------------------------------------------- 1 | #import "Argument.i" 2 | #import "Result.i" 3 | 4 | ###include "Overload.h" 5 | 6 | namespace pafcore 7 | { 8 | 9 | #{ 10 | struct Attributes; 11 | #} 12 | 13 | abstract class(static_method)#PAFCORE_EXPORT StaticMethod : Metadata 14 | { 15 | size_t overloadCount { get }; 16 | Result* getResult(size_t overloadIndex); 17 | size_t getArgumentCount(size_t overloadIndex); 18 | Argument* getArgument(size_t overloadIndex, size_t index); 19 | #{ 20 | public: 21 | StaticMethod(const char* name, Attributes* attributes, FunctionInvoker invoker, Overload* overloads, size_t overloadCount); 22 | public: 23 | FunctionInvoker m_invoker; 24 | Overload* m_overloads; 25 | size_t m_overloadCount; 26 | #} 27 | }; 28 | 29 | } -------------------------------------------------------------------------------- /paf/src/pafcore/StaticMethod.ic: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "StaticMethod.h" 7 | #include "StaticMethod.mh" 8 | #include "RefCountImpl.h" 9 | 10 | namespace pafcore 11 | { 12 | 13 | ::pafcore::ClassType* StaticMethod::GetType() 14 | { 15 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 16 | } 17 | 18 | ::pafcore::ClassType* StaticMethod::getType() 19 | { 20 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 21 | } 22 | 23 | size_t StaticMethod::getAddress() 24 | { 25 | return (size_t)this; 26 | } 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /paf/src/pafcore/StaticProperty.ic: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "StaticProperty.h" 7 | #include "StaticProperty.mh" 8 | #include "RefCountImpl.h" 9 | 10 | namespace pafcore 11 | { 12 | 13 | ::pafcore::ClassType* StaticProperty::GetType() 14 | { 15 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 16 | } 17 | 18 | ::pafcore::ClassType* StaticProperty::getType() 19 | { 20 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 21 | } 22 | 23 | size_t StaticProperty::getAddress() 24 | { 25 | return (size_t)this; 26 | } 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /paf/src/pafcore/String.ic: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "String.h" 7 | #include "String.mh" 8 | #include "RefCountImpl.h" 9 | 10 | namespace pafcore 11 | { 12 | 13 | ::pafcore::ClassType* String::GetType() 14 | { 15 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 16 | } 17 | 18 | String* String::New() 19 | { 20 | return paf_new String(); 21 | } 22 | 23 | String* String::New(const String& arg) 24 | { 25 | return paf_new String(arg); 26 | } 27 | 28 | String* String::New(const char* str) 29 | { 30 | return paf_new String(str); 31 | } 32 | 33 | String* String::NewArray(unsigned int count) 34 | { 35 | return paf_new_array(count); 36 | } 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /paf/src/pafcore/SubclassInvoker.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Variant.h" 4 | #include "Metadata.h" 5 | 6 | BEGIN_PAFCORE 7 | 8 | class SubclassInvoker 9 | { 10 | public: 11 | virtual ~SubclassInvoker(){} 12 | virtual ErrorCode invoke(const char* name, Variant* result, Variant* self, Variant* args, size_t numArgs) = 0; 13 | }; 14 | 15 | END_PAFCORE -------------------------------------------------------------------------------- /paf/src/pafcore/System.cpp: -------------------------------------------------------------------------------- 1 | #include "System.h" 2 | #include "System.ic" 3 | #include "System.mh" 4 | #include "System.mc" 5 | 6 | #ifdef _WINDOWS 7 | 8 | #include 9 | 10 | namespace pafcore 11 | { 12 | string_t System::GetProgramPath() 13 | { 14 | static char* s_buffer = 0; 15 | if (0 == s_buffer) 16 | { 17 | DWORD size = GetModuleFileNameA(0, 0, 0); 18 | s_buffer = new char[size + 1]; 19 | s_buffer[0] = 0; 20 | GetModuleFileNameA(0, s_buffer, size + 1); 21 | } 22 | return s_buffer; 23 | } 24 | 25 | void System::LoadDLL(string_t fileName) 26 | { 27 | LoadLibraryA(fileName); 28 | } 29 | 30 | void System::OutputDebug(string_t str) 31 | { 32 | ::OutputDebugStringA(str); 33 | } 34 | 35 | void System::DebugBreak() 36 | { 37 | ::DebugBreak(); 38 | } 39 | 40 | } 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /paf/src/pafcore/System.h: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | namespace pafcore{ class ClassType; } 7 | 8 | #include "Utility.h" 9 | 10 | 11 | namespace pafcore 12 | { 13 | struct PAFCORE_EXPORT System 14 | { 15 | public: 16 | static ::pafcore::ClassType* GetType(); 17 | 18 | static string_t GetProgramPath(); 19 | static void LoadDLL(string_t fileName); 20 | static void OutputDebug(string_t str); 21 | static void DebugBreak(); 22 | }; 23 | } 24 | 25 | -------------------------------------------------------------------------------- /paf/src/pafcore/System.i: -------------------------------------------------------------------------------- 1 | #{ 2 | #include "Utility.h" 3 | #} 4 | 5 | namespace pafcore 6 | { 7 | struct #PAFCORE_EXPORT System 8 | { 9 | static string_t GetProgramPath(); 10 | static void LoadDLL(string_t fileName); 11 | static void OutputDebug(string_t str); 12 | static void DebugBreak(); 13 | }; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /paf/src/pafcore/System.ic: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "System.h" 7 | #include "System.mh" 8 | #include "RefCountImpl.h" 9 | 10 | namespace pafcore 11 | { 12 | 13 | ::pafcore::ClassType* System::GetType() 14 | { 15 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 16 | } 17 | 18 | } 19 | 20 | -------------------------------------------------------------------------------- /paf/src/pafcore/Type.cpp: -------------------------------------------------------------------------------- 1 | #include "Type.h" 2 | #include "Type.mh" 3 | #include "Type.ic" 4 | #include "Type.mc" 5 | #include "NameSpace.h" 6 | 7 | BEGIN_PAFCORE 8 | 9 | Type::Type(const char* name, Category category, const char* declarationFile) : 10 | Metadata(name), 11 | m_category(category), 12 | m_size(0), 13 | m_enclosing(0), 14 | m_declarationFile(declarationFile) 15 | { 16 | } 17 | 18 | Type::~Type() 19 | { 20 | if (m_enclosing && name_space == m_enclosing->get__category_()) 21 | { 22 | static_cast(m_enclosing)->unregisterMember(this); 23 | } 24 | } 25 | 26 | void Type::destroyInstance(void* address) 27 | { 28 | } 29 | 30 | void Type::destroyArray(void* address) 31 | { 32 | } 33 | 34 | bool Type::assign(void* dst, const void* src) 35 | { 36 | return false; 37 | } 38 | 39 | //Metadata* Type::findMember(const char* name) 40 | //{ 41 | // return 0; 42 | //} 43 | 44 | //Metadata* Type::findTypeMember(const char* name) 45 | //{ 46 | // return 0; 47 | //} 48 | 49 | END_PAFCORE -------------------------------------------------------------------------------- /paf/src/pafcore/Type.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fdyjfd/idlcpp/d0bd13d96d546b06074062fb3984b42569e71fae/paf/src/pafcore/Type.h -------------------------------------------------------------------------------- /paf/src/pafcore/Type.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fdyjfd/idlcpp/d0bd13d96d546b06074062fb3984b42569e71fae/paf/src/pafcore/Type.i -------------------------------------------------------------------------------- /paf/src/pafcore/Type.ic: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "Type.h" 7 | #include "Type.mh" 8 | #include "RefCountImpl.h" 9 | 10 | namespace pafcore 11 | { 12 | 13 | ::pafcore::ClassType* Type::GetType() 14 | { 15 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 16 | } 17 | 18 | ::pafcore::ClassType* Type::getType() 19 | { 20 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 21 | } 22 | 23 | size_t Type::getAddress() 24 | { 25 | return (size_t)this; 26 | } 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /paf/src/pafcore/Type.mh: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "Type.h" 7 | #include "ClassType.h" 8 | #include "EnumType.h" 9 | #include "TypeAlias.h" 10 | #include "Variant.h" 11 | #include "SubclassInvoker.h" 12 | 13 | namespace idlcpp 14 | { 15 | 16 | class __pafcore__Type_Type : public ::pafcore::ClassType 17 | { 18 | public: 19 | __pafcore__Type_Type(); 20 | public: 21 | virtual void destroyInstance(void* address); 22 | virtual void destroyArray(void* address); 23 | virtual bool assign(void* dst, const void* src); 24 | public: 25 | static ::pafcore::ErrorCode Type_get__size_(::pafcore::InstanceProperty* instanceProperty, ::pafcore::Variant* that, ::pafcore::Variant* value); 26 | public: 27 | PAFCORE_EXPORT static __pafcore__Type_Type* GetSingleton(); 28 | }; 29 | 30 | } 31 | 32 | template<> 33 | struct RuntimeTypeOf<::pafcore::Type> 34 | { 35 | typedef ::idlcpp::__pafcore__Type_Type RuntimeType; 36 | enum {type_category = ::pafcore::reference_object}; 37 | }; 38 | 39 | -------------------------------------------------------------------------------- /paf/src/pafcore/TypeAlias.cpp: -------------------------------------------------------------------------------- 1 | #include "TypeAlias.h" 2 | #include "TypeAlias.mh" 3 | #include "TypeAlias.ic" 4 | #include "TypeAlias.mc" 5 | #include "NameSpace.h" 6 | 7 | BEGIN_PAFCORE 8 | 9 | TypeAlias::TypeAlias(const char* name, Type* type, const char* declarationFile) : 10 | Metadata(name), 11 | m_type(type), 12 | m_enclosing(0), 13 | m_declarationFile(declarationFile) 14 | { 15 | } 16 | 17 | TypeAlias::~TypeAlias() 18 | { 19 | if (m_enclosing && name_space == m_enclosing->get__category_()) 20 | { 21 | static_cast(m_enclosing)->unregisterMember(this); 22 | } 23 | } 24 | 25 | 26 | Type* TypeAlias::get_type() const 27 | { 28 | return m_type; 29 | } 30 | 31 | 32 | END_PAFCORE 33 | -------------------------------------------------------------------------------- /paf/src/pafcore/TypeAlias.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fdyjfd/idlcpp/d0bd13d96d546b06074062fb3984b42569e71fae/paf/src/pafcore/TypeAlias.h -------------------------------------------------------------------------------- /paf/src/pafcore/TypeAlias.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fdyjfd/idlcpp/d0bd13d96d546b06074062fb3984b42569e71fae/paf/src/pafcore/TypeAlias.i -------------------------------------------------------------------------------- /paf/src/pafcore/TypeAlias.ic: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "TypeAlias.h" 7 | #include "TypeAlias.mh" 8 | #include "RefCountImpl.h" 9 | 10 | namespace pafcore 11 | { 12 | 13 | ::pafcore::ClassType* TypeAlias::GetType() 14 | { 15 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 16 | } 17 | 18 | ::pafcore::ClassType* TypeAlias::getType() 19 | { 20 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 21 | } 22 | 23 | size_t TypeAlias::getAddress() 24 | { 25 | return (size_t)this; 26 | } 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /paf/src/pafcore/TypeAlias.mh: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "TypeAlias.h" 7 | #include "ClassType.h" 8 | #include "EnumType.h" 9 | #include "TypeAlias.h" 10 | #include "Variant.h" 11 | #include "SubclassInvoker.h" 12 | 13 | namespace idlcpp 14 | { 15 | 16 | class __pafcore__TypeAlias_Type : public ::pafcore::ClassType 17 | { 18 | public: 19 | __pafcore__TypeAlias_Type(); 20 | public: 21 | virtual void destroyInstance(void* address); 22 | virtual void destroyArray(void* address); 23 | virtual bool assign(void* dst, const void* src); 24 | public: 25 | static ::pafcore::ErrorCode TypeAlias_get_type(::pafcore::InstanceProperty* instanceProperty, ::pafcore::Variant* that, ::pafcore::Variant* value); 26 | public: 27 | PAFCORE_EXPORT static __pafcore__TypeAlias_Type* GetSingleton(); 28 | }; 29 | 30 | } 31 | 32 | template<> 33 | struct RuntimeTypeOf<::pafcore::TypeAlias> 34 | { 35 | typedef ::idlcpp::__pafcore__TypeAlias_Type RuntimeType; 36 | enum {type_category = ::pafcore::reference_object}; 37 | }; 38 | 39 | -------------------------------------------------------------------------------- /paf/src/pafcore/Typedef.cpp: -------------------------------------------------------------------------------- 1 | #include "Typedef.h" 2 | #include "Typedef.mh" 3 | #include "Typedef.ic" 4 | #include "Typedef.mc" 5 | 6 | -------------------------------------------------------------------------------- /paf/src/pafcore/Typedef.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fdyjfd/idlcpp/d0bd13d96d546b06074062fb3984b42569e71fae/paf/src/pafcore/Typedef.i -------------------------------------------------------------------------------- /paf/src/pafcore/Typedef.ic: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "Typedef.h" 7 | #include "Typedef.mh" 8 | #include "RefCountImpl.h" 9 | 10 | ::pafcore::ClassType* Nil::GetType() 11 | { 12 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 13 | } 14 | 15 | namespace pafcore 16 | { 17 | 18 | ::pafcore::ClassType* Buffer::GetType() 19 | { 20 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 21 | } 22 | 23 | ::pafcore::ClassType* MethodAsProperty::GetType() 24 | { 25 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 26 | } 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /paf/src/pafcore/VoidType.cpp: -------------------------------------------------------------------------------- 1 | #include "VoidType.h" 2 | #include "VoidType.mh" 3 | #include "VoidType.ic" 4 | #include "VoidType.mc" 5 | #include "NameSpace.h" 6 | #include "AutoRun.h" 7 | 8 | BEGIN_PAFCORE 9 | 10 | VoidType::VoidType() : Type("void", void_object, "") 11 | { 12 | m_size = 1; 13 | NameSpace::GetGlobalNameSpace()->registerMember(this); 14 | } 15 | 16 | Metadata* VoidType::findMember(const char* name) 17 | { 18 | return 0; 19 | } 20 | 21 | VoidType VoidType::s_instance; 22 | 23 | END_PAFCORE 24 | 25 | AUTO_REGISTER_TYPE(pafcore::VoidType) 26 | 27 | -------------------------------------------------------------------------------- /paf/src/pafcore/VoidType.h: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "./Type.h" 7 | namespace pafcore{ class ClassType; } 8 | 9 | namespace pafcore 10 | { 11 | class PAFCORE_EXPORT VoidType : public Type 12 | { 13 | public: 14 | static ::pafcore::ClassType* GetType(); 15 | virtual ::pafcore::ClassType* getType(); 16 | virtual size_t getAddress(); 17 | 18 | static void* AddressToPtr(size_t address); 19 | static void* get_NullPtr(); 20 | 21 | public: 22 | VoidType(); 23 | public: 24 | virtual Metadata* findMember(const char* name); 25 | public: 26 | static VoidType s_instance; 27 | static VoidType* GetSingleton() 28 | { 29 | return &s_instance; 30 | } 31 | 32 | }; 33 | 34 | inline void* VoidType::AddressToPtr(size_t address) 35 | { 36 | return (void*)address; 37 | } 38 | 39 | inline void* VoidType::get_NullPtr() 40 | { 41 | return 0; 42 | } 43 | 44 | } 45 | 46 | 47 | template<> 48 | struct RuntimeTypeOf 49 | { 50 | typedef ::pafcore::VoidType RuntimeType; 51 | enum { type_category = ::pafcore::void_object }; 52 | }; 53 | 54 | -------------------------------------------------------------------------------- /paf/src/pafcore/VoidType.i: -------------------------------------------------------------------------------- 1 | #import "Type.i" 2 | 3 | namespace pafcore 4 | { 5 | abstract class(void_type)#PAFCORE_EXPORT VoidType : Type 6 | { 7 | static void* AddressToPtr(size_t address); 8 | static void* NullPtr { get }; 9 | #{ 10 | public: 11 | VoidType(); 12 | public: 13 | virtual Metadata* findMember(const char* name); 14 | public: 15 | static VoidType s_instance; 16 | static VoidType* GetSingleton() 17 | { 18 | return &s_instance; 19 | } 20 | #} 21 | }; 22 | #{ 23 | inline void* VoidType::AddressToPtr(size_t address) 24 | { 25 | return (void*)address; 26 | } 27 | 28 | inline void* VoidType::get_NullPtr() 29 | { 30 | return 0; 31 | } 32 | #} 33 | } 34 | 35 | #{ 36 | template<> 37 | struct RuntimeTypeOf 38 | { 39 | typedef ::pafcore::VoidType RuntimeType; 40 | enum { type_category = ::pafcore::void_object }; 41 | }; 42 | #} 43 | -------------------------------------------------------------------------------- /paf/src/pafcore/VoidType.ic: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "VoidType.h" 7 | #include "VoidType.mh" 8 | #include "RefCountImpl.h" 9 | 10 | namespace pafcore 11 | { 12 | 13 | ::pafcore::ClassType* VoidType::GetType() 14 | { 15 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 16 | } 17 | 18 | ::pafcore::ClassType* VoidType::getType() 19 | { 20 | return ::RuntimeTypeOf::RuntimeType::GetSingleton(); 21 | } 22 | 23 | size_t VoidType::getAddress() 24 | { 25 | return (size_t)this; 26 | } 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /paf/src/pafcore/VoidType.mh: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT THIS FILE, it is generated by idlcpp 2 | //http://www.idlcpp.org 3 | 4 | #pragma once 5 | 6 | #include "VoidType.h" 7 | #include "ClassType.h" 8 | #include "EnumType.h" 9 | #include "TypeAlias.h" 10 | #include "Variant.h" 11 | #include "SubclassInvoker.h" 12 | 13 | namespace idlcpp 14 | { 15 | 16 | class __pafcore__VoidType_Type : public ::pafcore::ClassType 17 | { 18 | public: 19 | __pafcore__VoidType_Type(); 20 | public: 21 | virtual void destroyInstance(void* address); 22 | virtual void destroyArray(void* address); 23 | virtual bool assign(void* dst, const void* src); 24 | public: 25 | static ::pafcore::ErrorCode VoidType_get_NullPtr(::pafcore::Variant* value); 26 | public: 27 | static ::pafcore::ErrorCode VoidType_AddressToPtr(::pafcore::Variant* result, ::pafcore::Variant** args, int numArgs); 28 | public: 29 | PAFCORE_EXPORT static __pafcore__VoidType_Type* GetSingleton(); 30 | }; 31 | 32 | } 33 | 34 | template<> 35 | struct RuntimeTypeOf<::pafcore::VoidType> 36 | { 37 | typedef ::idlcpp::__pafcore__VoidType_Type RuntimeType; 38 | enum {type_category = ::pafcore::reference_object}; 39 | }; 40 | 41 | -------------------------------------------------------------------------------- /paf/src/pafcore/dllmain.cpp: -------------------------------------------------------------------------------- 1 | #include "Utility.h" 2 | #include 3 | 4 | BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) 5 | { 6 | if (DLL_PROCESS_ATTACH == dwReason) 7 | { 8 | OutputDebugStringA("pafcore Process Attach\n"); 9 | } 10 | else if (DLL_PROCESS_DETACH == dwReason) 11 | { 12 | OutputDebugStringA("pafcore Process Detach\n"); 13 | } 14 | return TRUE; 15 | } 16 | -------------------------------------------------------------------------------- /paf/src/paflua/LuaCallBack.i: -------------------------------------------------------------------------------- 1 | #import "../pafcore/Delegate.i" 2 | 3 | #{ 4 | #include "Utility.h" 5 | #include "lua.hpp" 6 | #include 7 | #} 8 | 9 | namespace paflua 10 | { 11 | class #PAFLUA_EXPORT LuaCallBack : CallBack 12 | { 13 | #{ 14 | public: 15 | LuaCallBack(lua_State* luaState, const char* funcName); 16 | ~LuaCallBack(); 17 | public: 18 | virtual void invoke(pafcore::Variant* result, pafcore::Variant** args, int_t numArgs); 19 | virtual bool equal(pafcore::CallBack* arg); 20 | public: 21 | lua_State* m_luaState; 22 | std::string m_funcName; 23 | #} 24 | }; 25 | 26 | class #PAFLUA_EXPORT LuaCallBack2 : CallBack 27 | { 28 | #{ 29 | public: 30 | LuaCallBack2(lua_State* luaState); 31 | ~LuaCallBack2(); 32 | public: 33 | virtual void invoke(pafcore::Variant* result, pafcore::Variant** args, int_t numArgs); 34 | virtual bool equal(pafcore::CallBack* arg); 35 | public: 36 | lua_State* m_luaState; 37 | #} 38 | }; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /paf/src/paflua/LuaSubclassInvoker.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Utility.h" 4 | #include "../pafcore/SubclassInvoker.h" 5 | #include "lua.hpp" 6 | 7 | BEGIN_PAFLUA 8 | 9 | struct LuaSubclassInvoker : public pafcore::SubclassInvoker 10 | { 11 | public: 12 | LuaSubclassInvoker(lua_State* luaState); 13 | ~LuaSubclassInvoker(); 14 | public: 15 | virtual pafcore::ErrorCode invoke(const char* name, pafcore::Variant* result, pafcore::Variant* self, pafcore::Variant* args, size_t numArgs); 16 | public: 17 | lua_State* m_luaState; 18 | }; 19 | 20 | END_PAFLUA 21 | -------------------------------------------------------------------------------- /paf/src/paflua/LuaSubclassInvoker2.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Utility.h" 4 | #include "../pafcore/SubclassInvoker.h" 5 | #include "lua.hpp" 6 | 7 | BEGIN_PAFLUA2 8 | 9 | struct LuaSubclassInvoker : public pafcore::SubclassInvoker 10 | { 11 | public: 12 | LuaSubclassInvoker(lua_State* luaState); 13 | ~LuaSubclassInvoker(); 14 | public: 15 | virtual pafcore::ErrorCode invoke(const char* name, pafcore::Variant* result, pafcore::Variant* self, pafcore::Variant* args, size_t numArgs); 16 | public: 17 | lua_State* m_luaState; 18 | }; 19 | 20 | END_PAFLUA2 21 | -------------------------------------------------------------------------------- /paf/src/paflua/LuaWrapper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Utility.h" 4 | #include "lua.hpp" 5 | 6 | BEGIN_PAFLUA 7 | 8 | extern const char* variant_metatable_name; 9 | extern const char* instanceArrayProperty_metatable_name; 10 | extern const char* staticArrayProperty_metatable_name; 11 | extern const char* instanceMapProperty_metatable_name; 12 | extern const char* staticMapProperty_metatable_name; 13 | 14 | extern struct luaL_Reg g_instanceArrayPropertyInstance_reg[]; 15 | extern struct luaL_Reg g_staticArrayPropertyInstance_reg[]; 16 | extern struct luaL_Reg g_instanceMapPropertyInstance_reg[]; 17 | extern struct luaL_Reg g_staticMapPropertyInstance_reg[]; 18 | extern struct luaL_Reg g_variant_reg[]; 19 | 20 | END_PAFLUA 21 | 22 | 23 | -------------------------------------------------------------------------------- /paf/src/paflua/LuaWrapper2.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Utility.h" 4 | #include "lua.hpp" 5 | 6 | BEGIN_PAFLUA2 7 | 8 | extern const char* variant_metatable_name; 9 | extern const char* instanceArrayProperty_metatable_name; 10 | extern const char* staticArrayProperty_metatable_name; 11 | 12 | extern struct luaL_Reg g_instanceArrayPropertyInstance_reg[]; 13 | extern struct luaL_Reg g_staticArrayPropertyInstance_reg[]; 14 | extern struct luaL_Reg g_variant_reg[]; 15 | 16 | END_PAFLUA2 17 | 18 | -------------------------------------------------------------------------------- /paf/src/paflua/Utility.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../pafcore/Utility.h" 4 | 5 | #if defined PAFLUA_EXPORTS 6 | #define PAFLUA_EXPORT __declspec(dllexport) 7 | #else 8 | #define PAFLUA_EXPORT __declspec(dllimport) 9 | #endif 10 | 11 | #define BEGIN_PAFLUA namespace paflua { 12 | #define END_PAFLUA } 13 | 14 | #define BEGIN_PAFLUA2 namespace paflua2 { 15 | #define END_PAFLUA2 } 16 | -------------------------------------------------------------------------------- /paf/src/paflua/paflua.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Utility.h" 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | typedef struct lua_State lua_State; 10 | 11 | int PAFLUA_EXPORT luaopen_paflua(lua_State *L); 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /paf/src/pafpython/PythonSubclassInvoker.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Utility.h" 4 | #include "../pafcore/SubclassInvoker.h" 5 | #include "Python.h" 6 | 7 | BEGIN_PAFPYTHON 8 | 9 | struct PythonSubclassInvoker : public pafcore::SubclassInvoker 10 | { 11 | public: 12 | PythonSubclassInvoker(PyObject* pyObject); 13 | ~PythonSubclassInvoker(); 14 | public: 15 | virtual pafcore::ErrorCode invoke(const char* name, pafcore::Variant* result, pafcore::Variant* self, pafcore::Variant* args, size_t numArgs); 16 | public: 17 | PyObject* m_pyObject; 18 | }; 19 | 20 | END_PAFPYTHON 21 | -------------------------------------------------------------------------------- /paf/src/pafpython/PythonWrapper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | PyMODINIT_FUNC PyInit_PafPython(void); 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | -------------------------------------------------------------------------------- /paf/src/pafpython/Utility.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../pafcore/Utility.h" 4 | 5 | #if defined PAFPYTHON_EXPORTS 6 | #define PAFPYTHON_EXPORT __declspec(dllexport) 7 | #else 8 | #define PAFPYTHON_EXPORT __declspec(dllimport) 9 | #endif 10 | 11 | #define BEGIN_PAFPYTHON namespace pafpython { 12 | #define END_PAFPYTHON } 13 | -------------------------------------------------------------------------------- /paf/src/pafstd/Base64.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Utility.h" 4 | 5 | BEGIN_PAFSTD 6 | 7 | class PAFSTD_EXPORT Base64 8 | { 9 | public: 10 | static size_t Encode(void* dst, const void* src, size_t srcLen); 11 | static size_t Decode(void* dst, const void* src, size_t srcLen); 12 | static size_t EncodeBufferLength(size_t srcLen); 13 | static size_t DecodeBufferLength(size_t srcLen); 14 | }; 15 | 16 | //------------------------------------------------------------------------------ 17 | inline size_t Base64::EncodeBufferLength(size_t srcLen) 18 | { 19 | size_t dstLen = (srcLen + 2) / 3 * 4; 20 | dstLen += dstLen / 76; 21 | return dstLen; 22 | } 23 | 24 | inline size_t Base64::DecodeBufferLength(size_t srcLen) 25 | { 26 | return srcLen / 4 * 3; 27 | } 28 | 29 | END_PAFSTD 30 | -------------------------------------------------------------------------------- /paf/src/pafstd/Blob.i: -------------------------------------------------------------------------------- 1 | #import "Reference.i" 2 | 3 | #{ 4 | #include "Utility.h" 5 | #} 6 | 7 | namespace pafstd 8 | { 9 | class #PAFSTD_EXPORT Blob : Reference 10 | { 11 | void* getData(); 12 | uint32_t getLength() const; 13 | static Blob+ New(uint32_t length); 14 | #{ 15 | public: 16 | static Blob* SubBlob_(Blob* blob, uint32_t offset, uint32_t length); 17 | static Blob* PointerToBlob_(void* pointer, uint32_t length); 18 | public: 19 | Blob(void* data, uint32_t length); 20 | public: 21 | const void* getData() const 22 | { 23 | return m_data; 24 | } 25 | public: 26 | void* m_data; 27 | uint32_t m_length; 28 | #} 29 | }; 30 | 31 | #{ 32 | inline void* Blob::getData() 33 | { 34 | return m_data; 35 | } 36 | 37 | inline uint32_t Blob::getLength() const 38 | { 39 | return m_length; 40 | } 41 | #} 42 | } 43 | 44 | -------------------------------------------------------------------------------- /paf/src/pafstd/FixedString.cpp: -------------------------------------------------------------------------------- 1 | #include "FixedString.h" 2 | #include "FixedString.mh" 3 | #include "FixedString.ic" 4 | #include "FixedString.mc" 5 | #include 6 | 7 | BEGIN_PAFSTD 8 | 9 | static char* s_emptyString = ""; 10 | 11 | FixedString::FixedString(const char* str) 12 | { 13 | if (str && str[0]) 14 | { 15 | m_length = strlen(str); 16 | size_t len = m_length + 1; 17 | m_str = paf_new char[len]; 18 | memcpy(m_str, str, len * sizeof(char)); 19 | } 20 | else 21 | { 22 | m_str = s_emptyString; 23 | m_length = 0; 24 | } 25 | } 26 | 27 | FixedString::~FixedString() 28 | { 29 | if (s_emptyString != m_str) 30 | { 31 | delete[]m_str; 32 | } 33 | } 34 | 35 | END_PAFSTD 36 | 37 | -------------------------------------------------------------------------------- /paf/src/pafstd/FixedString.i: -------------------------------------------------------------------------------- 1 | #{ 2 | #include "Utility.h" 3 | #} 4 | 5 | namespace pafstd 6 | { 7 | class(value_object) #PAFSTD_EXPORT FixedString 8 | { 9 | #{ 10 | public: 11 | FixedString(const char* str); 12 | ~FixedString(); 13 | const char* c_str() const; 14 | size_t length() const; 15 | private: 16 | FixedString(const FixedString& arg); 17 | public: 18 | char* m_str; 19 | size_t m_length; 20 | #} 21 | }; 22 | 23 | #{ 24 | inline const char* FixedString::c_str() const 25 | { 26 | return m_str; 27 | } 28 | 29 | inline size_t FixedString::length() const 30 | { 31 | return m_length; 32 | } 33 | #} 34 | 35 | } 36 | -------------------------------------------------------------------------------- /paf/src/pafstd/List.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fdyjfd/idlcpp/d0bd13d96d546b06074062fb3984b42569e71fae/paf/src/pafstd/List.h -------------------------------------------------------------------------------- /paf/src/pafstd/Noncopyable.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Utility.h" 4 | 5 | BEGIN_PAFSTD 6 | 7 | namespace Noncopyable_ // protection from unintended ADL 8 | { 9 | class Noncopyable 10 | { 11 | protected: 12 | Noncopyable() {} 13 | ~Noncopyable() {} 14 | private: // emphasize the following members are private 15 | Noncopyable(const Noncopyable&); 16 | const Noncopyable& operator=(const Noncopyable&); 17 | }; 18 | } 19 | 20 | typedef Noncopyable_::Noncopyable Noncopyable; 21 | 22 | END_PAFSTD 23 | -------------------------------------------------------------------------------- /paf/src/pafstd/Set.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Utility.h" 4 | #include 5 | 6 | BEGIN_PAFSTD 7 | 8 | END_PAFSTD 9 | -------------------------------------------------------------------------------- /paf/src/pafstd/StringPool.cpp: -------------------------------------------------------------------------------- 1 | #include "StringPool.h" 2 | #include 3 | 4 | BEGIN_PAFSTD 5 | 6 | static char* s_emptyString = ""; 7 | 8 | StringPool::StringPool() 9 | { 10 | } 11 | 12 | StringPool::~StringPool() 13 | { 14 | auto it = m_strings.begin(); 15 | auto end = m_strings.end(); 16 | while (it != end) 17 | { 18 | const char* str = *it; 19 | it = m_strings.erase(it); 20 | delete[]str; 21 | } 22 | } 23 | 24 | const char* StringPool::getString(const char* str) 25 | { 26 | if (0 == str || 0 == *str) 27 | { 28 | return s_emptyString; 29 | } 30 | auto it = m_strings.find(str); 31 | if (it != m_strings.end()) 32 | { 33 | return *it; 34 | } 35 | else 36 | { 37 | size_t len = strlen(str) + 1; 38 | char* p = paf_new char[len]; 39 | memcpy(p, str, len); 40 | m_strings.insert(p); 41 | return p; 42 | } 43 | } 44 | 45 | const char* StringPool::findString(const char* str) 46 | { 47 | if (0 == str || 0 == *str) 48 | { 49 | return s_emptyString; 50 | } 51 | auto it = m_strings.find(str); 52 | if (it != m_strings.end()) 53 | { 54 | return *it; 55 | } 56 | else 57 | { 58 | return 0; 59 | } 60 | } 61 | 62 | END_PAFSTD 63 | -------------------------------------------------------------------------------- /paf/src/pafstd/StringPool.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Utility.h" 4 | #include 5 | 6 | BEGIN_PAFSTD 7 | 8 | class PAFSTD_EXPORT StringPool 9 | { 10 | private: 11 | struct Hash_String 12 | { 13 | size_t operator ()(const char* str) const 14 | { 15 | size_t seed = 0; 16 | for (const char* p = str; 0 != *p; ++p) 17 | { 18 | seed ^= size_t(*p) + 0x9e3779b9 + (seed << 6) + (seed >> 2); 19 | } 20 | return seed; 21 | } 22 | }; 23 | struct Equal_String 24 | { 25 | bool operator() (const char* lhs, const char* rhs) const 26 | { 27 | return (0 == strcmp(lhs, rhs)); 28 | } 29 | }; 30 | public: 31 | StringPool(); 32 | ~StringPool(); 33 | private: 34 | StringPool(const StringPool&); 35 | StringPool& operator = (const StringPool&); 36 | public: 37 | typedef std::unordered_set StringContainer; 38 | typedef StringContainer::iterator iterator; 39 | public: 40 | iterator begin() 41 | { 42 | return m_strings.begin(); 43 | } 44 | iterator end() 45 | { 46 | return m_strings.end(); 47 | } 48 | size_t size() 49 | { 50 | return m_strings.size(); 51 | } 52 | iterator find(const char* str) 53 | { 54 | return m_strings.find(str); 55 | } 56 | const char* getString(const char* str); 57 | const char* findString(const char* str); 58 | private: 59 | StringContainer m_strings; 60 | }; 61 | 62 | END_PAFSTD 63 | -------------------------------------------------------------------------------- /paf/src/pafstd/TempBuffer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Utility.h" 4 | 5 | BEGIN_PAFSTD 6 | 7 | template 8 | class PAFSTD_TEMPLATE TempBuffer 9 | { 10 | private: 11 | TempBuffer(const TempBuffer&); 12 | public: 13 | TempBuffer() 14 | { 15 | m_pointer = m_localBuffer; 16 | } 17 | explicit TempBuffer(size_t size) 18 | { 19 | if (local_size < size) 20 | { 21 | m_pointer = paf_new T[size]; 22 | } 23 | else 24 | { 25 | m_pointer = m_localBuffer; 26 | } 27 | } 28 | ~TempBuffer() 29 | { 30 | if(m_localBuffer != m_pointer) 31 | { 32 | delete[] m_pointer; 33 | } 34 | } 35 | void initialize(size_t size) 36 | { 37 | PAF_ASSERT(m_localBuffer == m_pointer); 38 | if(local_size < size) 39 | { 40 | m_pointer = paf_new T[size]; 41 | } 42 | } 43 | T* getBuffer() 44 | { 45 | return m_pointer; 46 | } 47 | private: 48 | T m_localBuffer[local_size]; 49 | T* m_pointer; 50 | }; 51 | 52 | END_PAFSTD 53 | 54 | 55 | -------------------------------------------------------------------------------- /paf/src/pafstd/Utility.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../pafcore/Utility.h" 4 | 5 | #if defined PAFSTD_EXPORTS 6 | #define PAFSTD_EXPORT __declspec(dllexport) 7 | #define PAFSTD_TEMPLATE __declspec(dllexport) 8 | #else 9 | #define PAFSTD_EXPORT __declspec(dllimport) 10 | #define PAFSTD_TEMPLATE 11 | #endif 12 | 13 | #define BEGIN_PAFSTD namespace pafstd { 14 | #define END_PAFSTD } 15 | -------------------------------------------------------------------------------- /paf/src/pafstd/XmlSerializer.i: -------------------------------------------------------------------------------- 1 | #import "Reference.i" 2 | #import "../stdport/string_port.i" 3 | #import "Blob.i" 4 | 5 | #{ 6 | #include "Utility.h" 7 | #include "Xml.h" 8 | #} 9 | 10 | #{ 11 | namespace pafcore 12 | { 13 | class Type; 14 | class Reference; 15 | class Variant; 16 | } 17 | #} 18 | 19 | namespace pafstd 20 | { 21 | class(value_object) #PAFSTD_EXPORT XmlSerializer 22 | { 23 | #{ 24 | public: 25 | static xml_node* Serialize(pafcore::Reference* reference, const char* name, xml_document& doc); 26 | static xml_node* Serialize(void* object, pafcore::Type* type, const char* name, xml_document& doc); 27 | static void Unserialize(pafcore::Reference* reference, xml_node* node); 28 | static void Unserialize(void* object, pafcore::Type* type, xml_node* xmlNode); 29 | static void Unserialize(pafcore::Variant& object, xml_node* xmlNode, pafcore::Type* type = 0); 30 | #} 31 | }; 32 | } 33 | 34 | -------------------------------------------------------------------------------- /paf/src/pafstd/dllmain.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) 4 | { 5 | if (DLL_PROCESS_ATTACH == dwReason) 6 | { 7 | OutputDebugStringA("pafstd Process Attach\n"); 8 | } 9 | else if (DLL_PROCESS_DETACH == dwReason) 10 | { 11 | OutputDebugStringA("pafstd Process Detach\n"); 12 | } 13 | return TRUE; 14 | } 15 | -------------------------------------------------------------------------------- /tutorials/Common/Tutorial0.i: -------------------------------------------------------------------------------- 1 | //tutorial 2 | 3 | ###include 4 | 5 | namespace tutorial 6 | { 7 | struct Test 8 | { 9 | static void Run(); 10 | }; 11 | #{ 12 | inline void Test::Run() 13 | { 14 | printf("Hello World!"); 15 | } 16 | #} 17 | } 18 | -------------------------------------------------------------------------------- /tutorials/Common/Tutorial1.i: -------------------------------------------------------------------------------- 1 | 2 | namespace tutorial 3 | { 4 | struct Point 5 | { 6 | float x; 7 | float y; 8 | nocode Point(); 9 | nocode void getX(float* f) const; 10 | nocode string_t test(); 11 | #{ 12 | void getX(float* f) const 13 | { 14 | *f = x; 15 | } 16 | string_t test() 17 | { 18 | return "test"; 19 | } 20 | #} 21 | }; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /tutorials/Common/Tutorial3.i: -------------------------------------------------------------------------------- 1 | 2 | namespace tutorial 3 | { 4 | struct Point 5 | { 6 | float x; 7 | float y; 8 | nocode Point(); 9 | nocode Point(float a, float b); 10 | nocode Point(const Point& pt); 11 | 12 | #{ 13 | Point() 14 | {} 15 | Point(float a, float b) 16 | { 17 | x = a; 18 | y = b; 19 | } 20 | #} 21 | }; 22 | 23 | struct Shape 24 | { 25 | abstract float getArea(); 26 | ## virtual ~Shape() {} 27 | }; 28 | 29 | struct Triangle : Shape 30 | { 31 | Point m_vertices[#3]; 32 | nocode static Triangle^ New(); 33 | #{ 34 | virtual float getArea() 35 | { 36 | return fabs(m_vertices[0].x * m_vertices[1].y 37 | + m_vertices[1].x * m_vertices[2].y 38 | + m_vertices[2].x * m_vertices[0].y 39 | - m_vertices[0].x * m_vertices[2].y 40 | - m_vertices[1].x * m_vertices[0].y 41 | - m_vertices[2].x * m_vertices[1].y) * 0.5; 42 | } 43 | static Triangle* New() 44 | { 45 | return new Triangle; 46 | } 47 | #} 48 | }; 49 | 50 | } 51 | -------------------------------------------------------------------------------- /tutorials/Common/Tutorial4.cpp: -------------------------------------------------------------------------------- 1 | #include "Tutorial4.h" 2 | #include "Tutorial4.mh" 3 | #include "Tutorial4.ic" 4 | #include "Tutorial4.mc" 5 | 6 | 7 | namespace tutorial 8 | { 9 | 10 | Point::Point() 11 | {} 12 | 13 | Point::Point(float a, float b) 14 | { 15 | x = a; 16 | y = b; 17 | } 18 | 19 | ShapeManager* ShapeManager::GetInstance() 20 | { 21 | static ShapeManager s_instance; 22 | return &s_instance; 23 | } 24 | ShapeManager::~ShapeManager() 25 | { 26 | auto it = m_shapes.begin(); 27 | auto end = m_shapes.end(); 28 | for (; it != end; ++it) 29 | { 30 | Shape* shape = (*it); 31 | shape->release(); 32 | } 33 | } 34 | void ShapeManager::addShape(Shape* shape) 35 | { 36 | shape->addRef(); 37 | m_shapes.push_back(shape); 38 | } 39 | 40 | float ShapeManager::getTotalArea() 41 | { 42 | float area = 0; 43 | auto it = m_shapes.begin(); 44 | auto end = m_shapes.end(); 45 | for (; it != end; ++it) 46 | { 47 | Shape* shape = (*it); 48 | area += shape->getArea(); 49 | } 50 | return area; 51 | } 52 | 53 | 54 | float Triangle::getArea() 55 | { 56 | return fabs(m_vertices[0].x * m_vertices[1].y + m_vertices[1].x * m_vertices[2].y + m_vertices[2].x * m_vertices[0].y 57 | - m_vertices[0].x * m_vertices[2].y - m_vertices[1].x * m_vertices[0].y - m_vertices[2].x * m_vertices[1].y) * 0.5; 58 | } 59 | 60 | } -------------------------------------------------------------------------------- /tutorials/Common/Tutorial4.i: -------------------------------------------------------------------------------- 1 | #import "../../paf/src/pafcore/Reference.i" 2 | ###include 3 | 4 | namespace tutorial 5 | { 6 | struct Point 7 | { 8 | float x; 9 | float y; 10 | Point(); 11 | Point(float a, float b); 12 | nocode Point(const Point& pt); 13 | }; 14 | 15 | class Shape : Reference 16 | { 17 | abstract float getArea(); 18 | ## virtual ~Shape() {} 19 | }; 20 | 21 | class(value_object)ShapeManager 22 | { 23 | void addShape(Shape* shape); 24 | float getTotalArea(); 25 | static ShapeManager* GetInstance(); 26 | #{ 27 | ~ShapeManager(); 28 | private: 29 | std::vector m_shapes; 30 | #} 31 | }; 32 | 33 | 34 | class Triangle : Shape 35 | { 36 | Point m_vertices[#3]; 37 | nocode Triangle(); 38 | ## virtual float getArea(); 39 | }; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /tutorials/Common/Tutorial5.i: -------------------------------------------------------------------------------- 1 | #import "../../paf/src/pafcore/Reference.i" 2 | ###include 3 | 4 | namespace tutorial 5 | { 6 | struct Point 7 | { 8 | float x; 9 | float y; 10 | Point(); 11 | Point(float a, float b); 12 | nocode Point(const Point& pt); 13 | }; 14 | 15 | override class Shape : Reference 16 | { 17 | override abstract void getArea2(float* area); 18 | ## virtual ~Shape() {} 19 | }; 20 | 21 | class(value_object)ShapeManager 22 | { 23 | void addShape(Shape* shape); 24 | float getTotalArea(); 25 | static ShapeManager* GetInstance(); 26 | #{ 27 | ~ShapeManager(); 28 | private: 29 | std::vector m_shapes; 30 | #} 31 | }; 32 | 33 | 34 | class Triangle : Shape 35 | { 36 | Point m_vertices[#3]; 37 | nocode Triangle(); 38 | ##virtual float getArea(); 39 | ##virtual void getArea2(float* area); 40 | 41 | }; 42 | 43 | } 44 | -------------------------------------------------------------------------------- /tutorials/Common/Tutorial6.cpp: -------------------------------------------------------------------------------- 1 | #include "Tutorial6.h" 2 | #include "Tutorial6.mh" 3 | #include "Tutorial6.ic" 4 | #include "Tutorial6.mc" 5 | -------------------------------------------------------------------------------- /tutorials/Common/Tutorial7.i: -------------------------------------------------------------------------------- 1 | #import "../../paf/src/pafcore/Delegate.i" 2 | 3 | #{ 4 | #include 5 | #} 6 | 7 | namespace tutorial 8 | { 9 | struct AA 10 | { 11 | int a; 12 | }; 13 | 14 | class Test 15 | { 16 | int* m_a; 17 | public: 18 | void useIntPtr(int* p) 19 | { 20 | *m_a = *p; 21 | } 22 | void setIntPtr(int* p) 23 | { 24 | m_a = p; 25 | } 26 | void deleteIntPtr(int* p) 27 | { 28 | delete p; 29 | } 30 | }; 31 | 32 | class Test : Reference 33 | { 34 | static AA* abc{ get+ set - }; 35 | //void test0(AA a); 36 | void test1(AA& a); 37 | void test2(AA* a); 38 | void test3(AA- a); 39 | void test4(AA** a); 40 | void test5(AA*& a); 41 | void test6(AA + *a); 42 | void test7(AA + &a); 43 | void test8(AA + [] *a); 44 | void test9(AA + [] &a); 45 | #{ 46 | std::map m_test; 47 | #} 48 | }; 49 | 50 | class Button : Reference 51 | { 52 | nocode Button(); 53 | EventHandler click; 54 | void raiseClick(); 55 | }; 56 | 57 | #{ 58 | inline void Button::raiseClick() 59 | { 60 | click.invoke(this); 61 | } 62 | #} 63 | } 64 | 65 | 66 | -------------------------------------------------------------------------------- /tutorials/LuaTutorials/LuaTutorial.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ..\..\..\bin\ 7 | 8 | 9 | 10 | D:\lua-5.3.2\src 11 | 12 | 13 | ..\..\..\bin 14 | 15 | 16 | idlcpp -ld -pc../../paf/src/pafcore/ %(FullPath) 17 | 18 | 19 | %(RootDir)%(Directory)%(Filename).h 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /tutorials/LuaTutorials/LuaTutorial0/LuaTutorial0.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /tutorials/LuaTutorials/LuaTutorial1/LuaTutorial1.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "lua.hpp" 6 | #include "../../../paf/src/paflua/paflua.h" 7 | #include "../../Common/Tutorial1.h" 8 | #include "../../Common/Tutorial1.mh" 9 | #include "../../Common/Tutorial1.ic" 10 | #include "../../Common/Tutorial1.mc" 11 | 12 | #if defined(_DEBUG) 13 | #pragma comment(lib,"pafcore_d.lib") 14 | #pragma comment(lib,"paflua_d.lib") 15 | #pragma comment(lib,"lua53_d.lib") 16 | #else 17 | #pragma comment(lib,"pafcore.lib") 18 | #pragma comment(lib,"paflua.lib") 19 | #pragma comment(lib,"lua53.lib") 20 | #endif 21 | 22 | 23 | void GetExePath(std::string& path) 24 | { 25 | char fileName[MAX_PATH]; 26 | GetModuleFileName(0, fileName, sizeof(fileName)); 27 | const char* end = _tcsrchr(fileName, '\\'); 28 | path.assign(fileName, end + 1); 29 | } 30 | 31 | int _tmain(int argc, _TCHAR* argv[]) 32 | { 33 | int error; 34 | lua_State *L = luaL_newstate(); 35 | luaL_openlibs(L); 36 | luaopen_paflua(L); 37 | std::string path; 38 | GetExePath(path); 39 | path += "tutorial1.lua"; 40 | error = luaL_loadfile(L, path.c_str()) || lua_pcall(L, 0, 0, 0); 41 | if (error) 42 | { 43 | fprintf(stderr, "%s\n", lua_tostring(L, -1)); 44 | lua_pop(L, 1); 45 | } 46 | lua_close(L); 47 | return 0; 48 | } 49 | 50 | -------------------------------------------------------------------------------- /tutorials/LuaTutorials/LuaTutorial1/LuaTutorial1.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /tutorials/LuaTutorials/LuaTutorial2/LuaTutorial2.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "lua.hpp" 6 | #include "../../../paf/src/paflua/paflua.h" 7 | #include "../../Common/Tutorial2.h" 8 | #include "../../Common/Tutorial2.mh" 9 | #include "../../Common/Tutorial2.ic" 10 | #include "../../Common/Tutorial2.mc" 11 | 12 | 13 | #if defined(_DEBUG) 14 | #pragma comment(lib,"pafcore_d.lib") 15 | #pragma comment(lib,"paflua_d.lib") 16 | #pragma comment(lib,"lua53_d.lib") 17 | #else 18 | #pragma comment(lib,"pafcore.lib") 19 | #pragma comment(lib,"paflua.lib") 20 | #pragma comment(lib,"lua53.lib") 21 | #endif 22 | 23 | 24 | void GetExePath(std::string& path) 25 | { 26 | char fileName[MAX_PATH]; 27 | GetModuleFileName(0, fileName, sizeof(fileName)); 28 | const char* end = _tcsrchr(fileName, '\\'); 29 | path.assign(fileName, end + 1); 30 | } 31 | 32 | int _tmain(int argc, _TCHAR* argv[]) 33 | { 34 | int error; 35 | lua_State *L = luaL_newstate(); 36 | luaL_openlibs(L); 37 | luaopen_paflua(L); 38 | std::string path; 39 | GetExePath(path); 40 | path += "tutorial2.lua"; 41 | error = luaL_loadfile(L, path.c_str()) || lua_pcall(L, 0, 0, 0); 42 | if (error) 43 | { 44 | fprintf(stderr, "%s\n", lua_tostring(L, -1)); 45 | lua_pop(L, 1); 46 | } 47 | lua_close(L); 48 | return 0; 49 | } 50 | 51 | -------------------------------------------------------------------------------- /tutorials/LuaTutorials/LuaTutorial2/LuaTutorial2.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /tutorials/LuaTutorials/LuaTutorial3/LuaTutorial3.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "lua.hpp" 6 | #include "../../../paf/src/paflua/paflua.h" 7 | #include "../../Common/Tutorial3.h" 8 | #include "../../Common/Tutorial3.mh" 9 | #include "../../Common/Tutorial3.ic" 10 | #include "../../Common/Tutorial3.mc" 11 | 12 | 13 | #if defined(_DEBUG) 14 | #pragma comment(lib,"pafcore_d.lib") 15 | #pragma comment(lib,"paflua_d.lib") 16 | #pragma comment(lib,"lua53_d.lib") 17 | #else 18 | #pragma comment(lib,"pafcore.lib") 19 | #pragma comment(lib,"paflua.lib") 20 | #pragma comment(lib,"lua53.lib") 21 | #endif 22 | 23 | 24 | void GetExePath(std::string& path) 25 | { 26 | char fileName[MAX_PATH]; 27 | GetModuleFileName(0, fileName, sizeof(fileName)); 28 | const char* end = _tcsrchr(fileName, '\\'); 29 | path.assign(fileName, end + 1); 30 | } 31 | 32 | int _tmain(int argc, _TCHAR* argv[]) 33 | { 34 | int error; 35 | lua_State *L = luaL_newstate(); 36 | luaL_openlibs(L); 37 | luaopen_paflua(L); 38 | std::string path; 39 | GetExePath(path); 40 | path += "tutorial3.lua"; 41 | error = luaL_loadfile(L, path.c_str()) || lua_pcall(L, 0, 0, 0); 42 | if (error) 43 | { 44 | fprintf(stderr, "%s\n", lua_tostring(L, -1)); 45 | lua_pop(L, 1); 46 | } 47 | lua_close(L); 48 | return 0; 49 | } 50 | 51 | -------------------------------------------------------------------------------- /tutorials/LuaTutorials/LuaTutorial3/LuaTutorial3.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /tutorials/LuaTutorials/LuaTutorial4/LuaTutorial4.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "lua.hpp" 6 | #include "../../../paf/src/paflua/paflua.h" 7 | 8 | #if defined(_DEBUG) 9 | #pragma comment(lib,"pafcore_d.lib") 10 | #pragma comment(lib,"paflua_d.lib") 11 | #pragma comment(lib,"lua53_d.lib") 12 | #else 13 | #pragma comment(lib,"pafcore.lib") 14 | #pragma comment(lib,"paflua.lib") 15 | #pragma comment(lib,"lua53.lib") 16 | #endif 17 | 18 | 19 | void GetExePath(std::string& path) 20 | { 21 | char fileName[MAX_PATH]; 22 | GetModuleFileName(0, fileName, sizeof(fileName)); 23 | const char* end = _tcsrchr(fileName, '\\'); 24 | path.assign(fileName, end + 1); 25 | } 26 | 27 | int _tmain(int argc, _TCHAR* argv[]) 28 | { 29 | int error; 30 | lua_State *L = luaL_newstate(); 31 | luaL_openlibs(L); 32 | luaopen_paflua(L); 33 | std::string path; 34 | GetExePath(path); 35 | path += "tutorial4.lua"; 36 | error = luaL_loadfile(L, path.c_str()) || lua_pcall(L, 0, 0, 0); 37 | if (error) 38 | { 39 | fprintf(stderr, "%s\n", lua_tostring(L, -1)); 40 | lua_pop(L, 1); 41 | } 42 | lua_close(L); 43 | return 0; 44 | } 45 | 46 | -------------------------------------------------------------------------------- /tutorials/LuaTutorials/LuaTutorial4/LuaTutorial4.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /tutorials/LuaTutorials/LuaTutorial5/LuaTutorial5.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "lua.hpp" 6 | #include "../../../paf/src/paflua/paflua.h" 7 | 8 | #if defined(_DEBUG) 9 | #pragma comment(lib,"pafcore_d.lib") 10 | #pragma comment(lib,"paflua_d.lib") 11 | #pragma comment(lib,"lua53_d.lib") 12 | #else 13 | #pragma comment(lib,"pafcore.lib") 14 | #pragma comment(lib,"paflua.lib") 15 | #pragma comment(lib,"lua53.lib") 16 | #endif 17 | 18 | 19 | void GetExePath(std::string& path) 20 | { 21 | char fileName[MAX_PATH]; 22 | GetModuleFileName(0, fileName, sizeof(fileName)); 23 | const char* end = _tcsrchr(fileName, '\\'); 24 | path.assign(fileName, end + 1); 25 | } 26 | 27 | int _tmain(int argc, _TCHAR* argv[]) 28 | { 29 | int error; 30 | lua_State *L = luaL_newstate(); 31 | luaL_openlibs(L); 32 | luaopen_paflua(L); 33 | std::string path; 34 | GetExePath(path); 35 | path += "tutorial5.lua"; 36 | error = luaL_loadfile(L, path.c_str()) || lua_pcall(L, 0, 0, 0); 37 | if (error) 38 | { 39 | fprintf(stderr, "%s\n", lua_tostring(L, -1)); 40 | lua_pop(L, 1); 41 | } 42 | //lua_close(L); 43 | return 0; 44 | } 45 | 46 | -------------------------------------------------------------------------------- /tutorials/LuaTutorials/LuaTutorial5/LuaTutorial5.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /tutorials/LuaTutorials/LuaTutorial6/LuaTutorial6.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "lua.hpp" 6 | #include "../../../paf/src/paflua/paflua.h" 7 | 8 | #if defined(_DEBUG) 9 | #pragma comment(lib,"pafcore_d.lib") 10 | #pragma comment(lib,"paflua_d.lib") 11 | #pragma comment(lib,"lua53_d.lib") 12 | #else 13 | #pragma comment(lib,"pafcore.lib") 14 | #pragma comment(lib,"paflua.lib") 15 | #pragma comment(lib,"lua53.lib") 16 | #endif 17 | 18 | 19 | void GetExePath(std::string& path) 20 | { 21 | char fileName[MAX_PATH]; 22 | GetModuleFileName(0, fileName, sizeof(fileName)); 23 | const char* end = _tcsrchr(fileName, '\\'); 24 | path.assign(fileName, end + 1); 25 | } 26 | 27 | int _tmain(int argc, _TCHAR* argv[]) 28 | { 29 | int error; 30 | lua_State *L = luaL_newstate(); 31 | luaL_openlibs(L); 32 | luaopen_paflua(L); 33 | std::string path; 34 | GetExePath(path); 35 | path += "tutorial6.lua"; 36 | error = luaL_loadfile(L, path.c_str()) || lua_pcall(L, 0, 0, 0); 37 | if (error) 38 | { 39 | fprintf(stderr, "%s\n", lua_tostring(L, -1)); 40 | lua_pop(L, 1); 41 | } 42 | lua_close(L); 43 | return 0; 44 | } 45 | 46 | -------------------------------------------------------------------------------- /tutorials/LuaTutorials/LuaTutorial6/LuaTutorial6.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /tutorials/LuaTutorials/LuaTutorial7/LuaTutorial7.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "lua.hpp" 6 | #include "../../../paf/src/paflua/paflua.h" 7 | 8 | #if defined(_DEBUG) 9 | #pragma comment(lib,"pafcore_d.lib") 10 | #pragma comment(lib,"paflua_d.lib") 11 | #pragma comment(lib,"lua53_d.lib") 12 | #else 13 | #pragma comment(lib,"pafcore.lib") 14 | #pragma comment(lib,"paflua.lib") 15 | #pragma comment(lib,"lua53.lib") 16 | #endif 17 | 18 | 19 | void GetExePath(std::string& path) 20 | { 21 | char fileName[MAX_PATH]; 22 | GetModuleFileName(0, fileName, sizeof(fileName)); 23 | const char* end = _tcsrchr(fileName, '\\'); 24 | path.assign(fileName, end + 1); 25 | } 26 | 27 | int _tmain(int argc, _TCHAR* argv[]) 28 | { 29 | int error; 30 | lua_State *L = luaL_newstate(); 31 | luaL_openlibs(L); 32 | luaopen_paflua(L); 33 | std::string path; 34 | GetExePath(path); 35 | path += "tutorial7.lua"; 36 | error = luaL_loadfile(L, path.c_str()) || lua_pcall(L, 0, 0, 0); 37 | if (error) 38 | { 39 | fprintf(stderr, "%s\n", lua_tostring(L, -1)); 40 | lua_pop(L, 1); 41 | } 42 | lua_close(L); 43 | return 0; 44 | } 45 | 46 | -------------------------------------------------------------------------------- /tutorials/LuaTutorials/LuaTutorial7/LuaTutorial7.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /tutorials/LuaTutorials/LuaTutorial8/LuaTutorial8.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "lua.hpp" 6 | #include "../../../paf/src/paflua/paflua.h" 7 | 8 | #if defined(_DEBUG) 9 | #pragma comment(lib,"pafcore_d.lib") 10 | #pragma comment(lib,"paflua_d.lib") 11 | #pragma comment(lib,"lua53_d.lib") 12 | #else 13 | #pragma comment(lib,"pafcore.lib") 14 | #pragma comment(lib,"paflua.lib") 15 | #pragma comment(lib,"lua53.lib") 16 | #endif 17 | 18 | 19 | void GetExePath(std::string& path) 20 | { 21 | char fileName[MAX_PATH]; 22 | GetModuleFileName(0, fileName, sizeof(fileName)); 23 | const char* end = _tcsrchr(fileName, '\\'); 24 | path.assign(fileName, end + 1); 25 | } 26 | 27 | int _tmain(int argc, _TCHAR* argv[]) 28 | { 29 | int error; 30 | lua_State *L = luaL_newstate(); 31 | luaL_openlibs(L); 32 | luaopen_paflua(L); 33 | std::string path; 34 | GetExePath(path); 35 | path += "tutorial8.lua"; 36 | error = luaL_loadfile(L, path.c_str()) || lua_pcall(L, 0, 0, 0); 37 | if (error) 38 | { 39 | fprintf(stderr, "%s\n", lua_tostring(L, -1)); 40 | lua_pop(L, 1); 41 | } 42 | lua_close(L); 43 | return 0; 44 | } 45 | 46 | -------------------------------------------------------------------------------- /tutorials/LuaTutorials/LuaTutorial8/LuaTutorial8.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /tutorials/LuaTutorials/LuaTutorial9/LuaTutorial9.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "lua.hpp" 6 | #include "../../../paf/src/paflua/paflua.h" 7 | 8 | #if defined(_DEBUG) 9 | #pragma comment(lib,"pafcore_d.lib") 10 | #pragma comment(lib,"paflua_d.lib") 11 | #pragma comment(lib,"lua53_d.lib") 12 | #else 13 | #pragma comment(lib,"pafcore.lib") 14 | #pragma comment(lib,"paflua.lib") 15 | #pragma comment(lib,"lua53.lib") 16 | #endif 17 | 18 | 19 | void GetExePath(std::string& path) 20 | { 21 | char fileName[MAX_PATH]; 22 | GetModuleFileName(0, fileName, sizeof(fileName)); 23 | const char* end = _tcsrchr(fileName, '\\'); 24 | path.assign(fileName, end + 1); 25 | } 26 | 27 | int _tmain(int argc, _TCHAR* argv[]) 28 | { 29 | LoadLibrary("win32gui.dll"); 30 | LoadLibrary("crt.dll"); 31 | int error; 32 | lua_State *L = luaL_newstate(); 33 | luaL_openlibs(L); 34 | luaopen_paflua(L); 35 | std::string path; 36 | GetExePath(path); 37 | path += "tutorial9.lua"; 38 | error = luaL_loadfile(L, path.c_str()) || lua_pcall(L, 0, 0, 0); 39 | if (error) 40 | { 41 | fprintf(stderr, "%s\n", lua_tostring(L, -1)); 42 | lua_pop(L, 1); 43 | } 44 | lua_close(L); 45 | return 0; 46 | } 47 | 48 | -------------------------------------------------------------------------------- /tutorials/LuaTutorials/LuaTutorial9/LuaTutorial9.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /tutorials/PythonTutorials/PythonTutorial.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ..\..\..\bin\ 7 | 8 | 9 | 10 | D:\Python-3.6.0\Include 11 | 12 | 13 | ..\..\..\bin 14 | 15 | 16 | idlcpp -ld -pc../../paf/src/pafcore/ %(FullPath) 17 | 18 | 19 | %(RootDir)%(Directory)%(Filename).h 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /tutorials/PythonTutorials/PythonTutorial0/PythonTutorial0.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "Python.h" 4 | #include "../../../paf/src/pafpython/PythonWrapper.h" 5 | #include "../../Common/Tutorial0.h" 6 | #include "../../Common/Tutorial0.mh" 7 | #include "../../Common/Tutorial0.ic" 8 | #include "../../Common/Tutorial0.mc" 9 | 10 | 11 | #if defined(_DEBUG) 12 | #pragma comment(lib,"pafcore_d.lib") 13 | #pragma comment(lib,"pafpython_d.lib") 14 | #else 15 | #pragma comment(lib,"pafcore.lib") 16 | #pragma comment(lib,"pafpython.lib") 17 | #endif 18 | 19 | int _tmain(int argc, _TCHAR* argv[]) 20 | { 21 | const char* path = "tutorial0"; 22 | 23 | PyImport_AppendInittab("pafpython", &PyInit_PafPython); 24 | 25 | Py_Initialize(); 26 | PyObject* pName = PyUnicode_FromString(path); 27 | PyObject* pModule = PyImport_Import(pName); 28 | Py_DECREF(pName); 29 | if(pModule != NULL) 30 | { 31 | Py_DECREF(pModule); 32 | } 33 | else 34 | { 35 | PyErr_Print(); 36 | fprintf(stderr, "Failed to load \"%s\"\n", path); 37 | } 38 | Py_Finalize(); 39 | return 0; 40 | } 41 | 42 | 43 | -------------------------------------------------------------------------------- /tutorials/PythonTutorials/PythonTutorial0/PythonTutorial0.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /tutorials/PythonTutorials/PythonTutorial1/PythonTutorial1.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "Python.h" 4 | #include "../../../paf/src/pafpython/PythonWrapper.h" 5 | #include "../../Common/Tutorial1.h" 6 | #include "../../Common/Tutorial1.mh" 7 | #include "../../Common/Tutorial1.ic" 8 | #include "../../Common/Tutorial1.mc" 9 | 10 | 11 | #if defined(_DEBUG) 12 | #pragma comment(lib,"pafcore_d.lib") 13 | #pragma comment(lib,"pafpython_d.lib") 14 | #else 15 | #pragma comment(lib,"pafcore.lib") 16 | #pragma comment(lib,"pafpython.lib") 17 | #endif 18 | 19 | int _tmain(int argc, _TCHAR* argv[]) 20 | { 21 | const char* path = "tutorial1"; 22 | 23 | PyImport_AppendInittab("pafpython", &PyInit_PafPython); 24 | 25 | Py_Initialize(); 26 | PyObject* pName = PyUnicode_FromString(path); 27 | PyObject* pModule = PyImport_Import(pName); 28 | Py_DECREF(pName); 29 | if(pModule != NULL) 30 | { 31 | Py_DECREF(pModule); 32 | } 33 | else 34 | { 35 | PyErr_Print(); 36 | fprintf(stderr, "Failed to load \"%s\"\n", path); 37 | } 38 | Py_Finalize(); 39 | return 0; 40 | } 41 | 42 | 43 | -------------------------------------------------------------------------------- /tutorials/PythonTutorials/PythonTutorial1/PythonTutorial1.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /tutorials/PythonTutorials/PythonTutorial2/PythonTutorial2.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "Python.h" 4 | #include "../../../paf/src/pafpython/PythonWrapper.h" 5 | #include "../../Common/Tutorial2.h" 6 | #include "../../Common/Tutorial2.mh" 7 | #include "../../Common/Tutorial2.ic" 8 | #include "../../Common/Tutorial2.mc" 9 | 10 | 11 | #if defined(_DEBUG) 12 | #pragma comment(lib,"pafcore_d.lib") 13 | #pragma comment(lib,"pafpython_d.lib") 14 | #else 15 | #pragma comment(lib,"pafcore.lib") 16 | #pragma comment(lib,"pafpython.lib") 17 | #endif 18 | 19 | int _tmain(int argc, _TCHAR* argv[]) 20 | { 21 | const char* path = "tutorial2"; 22 | 23 | PyImport_AppendInittab("pafpython", &PyInit_PafPython); 24 | 25 | Py_Initialize(); 26 | PyObject* pName = PyUnicode_FromString(path); 27 | PyObject* pModule = PyImport_Import(pName); 28 | Py_DECREF(pName); 29 | if(pModule != NULL) 30 | { 31 | Py_DECREF(pModule); 32 | } 33 | else 34 | { 35 | PyErr_Print(); 36 | fprintf(stderr, "Failed to load \"%s\"\n", path); 37 | } 38 | Py_Finalize(); 39 | return 0; 40 | } 41 | 42 | 43 | -------------------------------------------------------------------------------- /tutorials/PythonTutorials/PythonTutorial2/PythonTutorial2.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /tutorials/PythonTutorials/PythonTutorial3/PythonTutorial3.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "Python.h" 4 | #include "../../../paf/src/pafpython/PythonWrapper.h" 5 | #include "../../Common/Tutorial3.h" 6 | #include "../../Common/Tutorial3.mh" 7 | #include "../../Common/Tutorial3.ic" 8 | #include "../../Common/Tutorial3.mc" 9 | 10 | 11 | #if defined(_DEBUG) 12 | #pragma comment(lib,"pafcore_d.lib") 13 | #pragma comment(lib,"pafpython_d.lib") 14 | #else 15 | #pragma comment(lib,"pafcore.lib") 16 | #pragma comment(lib,"pafpython.lib") 17 | #endif 18 | 19 | int _tmain(int argc, _TCHAR* argv[]) 20 | { 21 | const char* path = "tutorial3"; 22 | 23 | PyImport_AppendInittab("pafpython", &PyInit_PafPython); 24 | 25 | Py_Initialize(); 26 | PyObject* pName = PyUnicode_FromString(path); 27 | PyObject* pModule = PyImport_Import(pName); 28 | Py_DECREF(pName); 29 | if(pModule != NULL) 30 | { 31 | Py_DECREF(pModule); 32 | } 33 | else 34 | { 35 | PyErr_Print(); 36 | fprintf(stderr, "Failed to load \"%s\"\n", path); 37 | } 38 | Py_Finalize(); 39 | return 0; 40 | } 41 | 42 | 43 | -------------------------------------------------------------------------------- /tutorials/PythonTutorials/PythonTutorial3/PythonTutorial3.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /tutorials/PythonTutorials/PythonTutorial4/PythonTutorial4.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "Python.h" 4 | #include "../../../paf/src/pafpython/PythonWrapper.h" 5 | 6 | 7 | #if defined(_DEBUG) 8 | #pragma comment(lib,"pafcore_d.lib") 9 | #pragma comment(lib,"pafpython_d.lib") 10 | #else 11 | #pragma comment(lib,"pafcore.lib") 12 | #pragma comment(lib,"pafpython.lib") 13 | #endif 14 | 15 | int _tmain(int argc, _TCHAR* argv[]) 16 | { 17 | const char* path = "tutorial4"; 18 | 19 | PyImport_AppendInittab("pafpython", &PyInit_PafPython); 20 | 21 | Py_Initialize(); 22 | PyObject* pName = PyUnicode_FromString(path); 23 | PyObject* pModule = PyImport_Import(pName); 24 | Py_DECREF(pName); 25 | if(pModule != NULL) 26 | { 27 | Py_DECREF(pModule); 28 | } 29 | else 30 | { 31 | PyErr_Print(); 32 | fprintf(stderr, "Failed to load \"%s\"\n", path); 33 | } 34 | Py_Finalize(); 35 | return 0; 36 | } 37 | 38 | 39 | -------------------------------------------------------------------------------- /tutorials/PythonTutorials/PythonTutorial4/PythonTutorial4.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /tutorials/PythonTutorials/PythonTutorial5/PythonTutorial5.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "Python.h" 4 | #include "../../../paf/src/pafpython/PythonWrapper.h" 5 | 6 | 7 | #if defined(_DEBUG) 8 | #pragma comment(lib,"pafcore_d.lib") 9 | #pragma comment(lib,"pafpython_d.lib") 10 | #else 11 | #pragma comment(lib,"pafcore.lib") 12 | #pragma comment(lib,"pafpython.lib") 13 | #endif 14 | 15 | int _tmain(int argc, _TCHAR* argv[]) 16 | { 17 | const char* path = "tutorial5"; 18 | 19 | PyImport_AppendInittab("pafpython", &PyInit_PafPython); 20 | 21 | Py_Initialize(); 22 | PyObject* pName = PyUnicode_FromString(path); 23 | PyObject* pModule = PyImport_Import(pName); 24 | Py_DECREF(pName); 25 | if(pModule != NULL) 26 | { 27 | Py_DECREF(pModule); 28 | } 29 | else 30 | { 31 | PyErr_Print(); 32 | fprintf(stderr, "Failed to load \"%s\"\n", path); 33 | } 34 | Py_Finalize(); 35 | return 0; 36 | } 37 | 38 | 39 | -------------------------------------------------------------------------------- /tutorials/PythonTutorials/PythonTutorial5/PythonTutorial5.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /tutorials/PythonTutorials/PythonTutorial6/PythonTutorial6.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "Python.h" 4 | #include "../../../paf/src/pafpython/PythonWrapper.h" 5 | 6 | 7 | #if defined(_DEBUG) 8 | #pragma comment(lib,"pafcore_d.lib") 9 | #pragma comment(lib,"pafpython_d.lib") 10 | #else 11 | #pragma comment(lib,"pafcore.lib") 12 | #pragma comment(lib,"pafpython.lib") 13 | #endif 14 | 15 | int _tmain(int argc, _TCHAR* argv[]) 16 | { 17 | const char* path = "tutorial6"; 18 | 19 | PyImport_AppendInittab("pafpython", &PyInit_PafPython); 20 | 21 | Py_Initialize(); 22 | PyObject* pName = PyUnicode_FromString(path); 23 | PyObject* pModule = PyImport_Import(pName); 24 | Py_DECREF(pName); 25 | if(pModule != NULL) 26 | { 27 | Py_DECREF(pModule); 28 | } 29 | else 30 | { 31 | PyErr_Print(); 32 | fprintf(stderr, "Failed to load \"%s\"\n", path); 33 | } 34 | Py_Finalize(); 35 | return 0; 36 | } 37 | 38 | 39 | -------------------------------------------------------------------------------- /tutorials/PythonTutorials/PythonTutorial6/PythonTutorial6.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /tutorials/PythonTutorials/PythonTutorial7/PythonTutorial7.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "Python.h" 4 | #include "../../../paf/src/pafpython/PythonWrapper.h" 5 | 6 | 7 | #if defined(_DEBUG) 8 | #pragma comment(lib,"pafcore_d.lib") 9 | #pragma comment(lib,"pafpython_d.lib") 10 | #else 11 | #pragma comment(lib,"pafcore.lib") 12 | #pragma comment(lib,"pafpython.lib") 13 | #endif 14 | 15 | int _tmain(int argc, _TCHAR* argv[]) 16 | { 17 | const char* path = "tutorial7"; 18 | 19 | PyImport_AppendInittab("pafpython", &PyInit_PafPython); 20 | 21 | Py_Initialize(); 22 | PyObject* pName = PyUnicode_FromString(path); 23 | PyObject* pModule = PyImport_Import(pName); 24 | Py_DECREF(pName); 25 | if(pModule != NULL) 26 | { 27 | Py_DECREF(pModule); 28 | } 29 | else 30 | { 31 | PyErr_Print(); 32 | fprintf(stderr, "Failed to load \"%s\"\n", path); 33 | } 34 | Py_Finalize(); 35 | return 0; 36 | } 37 | 38 | 39 | -------------------------------------------------------------------------------- /tutorials/PythonTutorials/PythonTutorial8/PythonTutorial8.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "Python.h" 4 | #include "../../../paf/src/pafpython/PythonWrapper.h" 5 | 6 | 7 | #if defined(_DEBUG) 8 | #pragma comment(lib,"pafcore_d.lib") 9 | #pragma comment(lib,"pafpython_d.lib") 10 | #else 11 | #pragma comment(lib,"pafcore.lib") 12 | #pragma comment(lib,"pafpython.lib") 13 | #endif 14 | 15 | int _tmain(int argc, _TCHAR* argv[]) 16 | { 17 | const char* path = "tutorial8"; 18 | 19 | PyImport_AppendInittab("pafpython", &PyInit_PafPython); 20 | 21 | Py_Initialize(); 22 | PyObject* pName = PyUnicode_FromString(path); 23 | PyObject* pModule = PyImport_Import(pName); 24 | Py_DECREF(pName); 25 | if(pModule != NULL) 26 | { 27 | Py_DECREF(pModule); 28 | } 29 | else 30 | { 31 | PyErr_Print(); 32 | fprintf(stderr, "Failed to load \"%s\"\n", path); 33 | } 34 | Py_Finalize(); 35 | return 0; 36 | } 37 | 38 | 39 | -------------------------------------------------------------------------------- /tutorials/PythonTutorials/PythonTutorial8/PythonTutorial8.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /tutorials/PythonTutorials/PythonTutorial9/PythonTutorial9.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "Python.h" 4 | #include "../../../paf/src/pafpython/PythonWrapper.h" 5 | 6 | 7 | #if defined(_DEBUG) 8 | #pragma comment(lib,"pafcore_d.lib") 9 | #pragma comment(lib,"pafpython_d.lib") 10 | #else 11 | #pragma comment(lib,"pafcore.lib") 12 | #pragma comment(lib,"pafpython.lib") 13 | #endif 14 | 15 | int _tmain(int argc, _TCHAR* argv[]) 16 | { 17 | LoadLibraryA("crt.dll"); 18 | const char* path = "tutorial9"; 19 | 20 | PyImport_AppendInittab("ctypes", &PyInit_PafPython); 21 | PyImport_AppendInittab("pafpython", &PyInit_PafPython); 22 | 23 | Py_Initialize(); 24 | PyObject* pName = PyUnicode_FromString(path); 25 | PyObject* pModule = PyImport_Import(pName); 26 | Py_DECREF(pName); 27 | if(pModule != NULL) 28 | { 29 | Py_DECREF(pModule); 30 | } 31 | else 32 | { 33 | PyErr_Print(); 34 | fprintf(stderr, "Failed to load \"%s\"\n", path); 35 | } 36 | Py_Finalize(); 37 | return 0; 38 | } 39 | 40 | 41 | -------------------------------------------------------------------------------- /tutorials/PythonTutorials/PythonTutorial9/PythonTutorial9.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /win32gui/MessageBox.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "MessageBox.h" 3 | #include "MessageBox.ic" 4 | #include "MessageBox.mh" 5 | #include "MessageBox.mc" 6 | 7 | 8 | namespace win32gui 9 | { 10 | void MessageBox::Show(void* hwnd, const char* text, const char* caption, ::uint_t flag) 11 | { 12 | ::MessageBox(HWND(hwnd), text, caption, flag); 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /win32gui/MessageBox.i: -------------------------------------------------------------------------------- 1 | #import "typedef.i" 2 | 3 | namespace win32gui 4 | { 5 | enum MessageBoxButton 6 | { 7 | OK, 8 | OKCancel, 9 | AbortRetryIgnore, 10 | YesNoCancel, 11 | YesNo, 12 | RetryCancel, 13 | }; 14 | struct MessageBox 15 | { 16 | static void Show(void * hwnd, const char * text, const char * caption, uint32_t flag); 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /win32gui/win32gui.cpp: -------------------------------------------------------------------------------- 1 | 2 | #if defined(_DEBUG) 3 | #pragma comment(lib,"pafcore_d.lib") 4 | #else 5 | #pragma comment(lib,"pafcore.lib") 6 | #endif 7 | 8 | -------------------------------------------------------------------------------- /win32gui/win32gui.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | idlcpp -ld -pc../paf/src/pafcore/ -I"..\paf\src\pafcore" %(FullPath) 9 | 10 | 11 | 12 | 13 | %(RootDir)%(Directory)%(Filename).h 14 | 15 | 16 | ../bin/ 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /win32gui/win32gui.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.23107.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "win32gui", "win32gui.vcxproj", "{9A22B753-5360-4DF2-85E0-7E4BA1CFA0A2}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {9A22B753-5360-4DF2-85E0-7E4BA1CFA0A2}.Debug|x64.ActiveCfg = Debug|x64 17 | {9A22B753-5360-4DF2-85E0-7E4BA1CFA0A2}.Debug|x64.Build.0 = Debug|x64 18 | {9A22B753-5360-4DF2-85E0-7E4BA1CFA0A2}.Debug|x86.ActiveCfg = Debug|Win32 19 | {9A22B753-5360-4DF2-85E0-7E4BA1CFA0A2}.Debug|x86.Build.0 = Debug|Win32 20 | {9A22B753-5360-4DF2-85E0-7E4BA1CFA0A2}.Release|x64.ActiveCfg = Release|x64 21 | {9A22B753-5360-4DF2-85E0-7E4BA1CFA0A2}.Release|x64.Build.0 = Release|x64 22 | {9A22B753-5360-4DF2-85E0-7E4BA1CFA0A2}.Release|x86.ActiveCfg = Release|Win32 23 | {9A22B753-5360-4DF2-85E0-7E4BA1CFA0A2}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /win32gui/win32gui.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | 26 | 27 | 28 | --------------------------------------------------------------------------------