Ejemplo n.º 1
0
        public override void WritePage(UdnManifest Manifest, string OutputPath)
        {
            using (UdnWriter Writer = new UdnWriter(OutputPath))
            {
                Writer.WritePageHeader("Unreal Engine API Reference", PageCrumbs, "Unreal Engine API Reference");

                Writer.WriteHeading(2, "Disclaimer");

                Writer.WriteLine("The API reference is an early work in progress, and some information may be missing or out of date. It serves mainly as a low level index of Engine classes and functions.");
                Writer.WriteLine("For tutorials, walkthroughs and detailed guides to programming with Unreal, please see the [Unreal Engine Programming](http://docs.unrealengine.com/latest/INT/Programming/index.html) home on the web.");
                Writer.WriteLine();
                Writer.WriteLine("To explore the API from some of the most frequently encountered Unreal concepts and types, see the API __[getting started](" + GettingStarted.LinkPath + ")__ page.");

                Writer.WriteHeading(2, "Contents");

                Writer.EnterRegion("memberindexlinks");
                Writer.WriteLine("[Getting started]({0}) · [All constants]({1}) · [All functions]({2}) · [All enums]({3}) · [All classes]({4}) · [Class hierarchy]({5})", GettingStarted.LinkPath, ConstantIndex.LinkPath, FunctionIndex.LinkPath, EnumIndex.LinkPath, RecordIndex.LinkPath, RecordHierarchy.LinkPath);
                Writer.LeaveRegion();

                foreach (APIModuleIndex ChildModuleIndex in ChildModuleIndexes)
                {
                    Writer.WriteHeading(2, ChildModuleIndex.Name);
                    Writer.EnterRegion("modules-list");
                    ChildModuleIndex.WriteModuleList(Writer, 3);
                    Writer.LeaveRegion();
                }

                Writer.WriteLine("<br>");
            }
        }
Ejemplo n.º 2
0
        public void Write(UdnWriter Writer, int Depth)
        {
            if (!IsEmpty)
            {
                // CSS region for indenting
                Writer.EnterRegion("module-sections-list");

                // Find all the modules in this category
                if (Modules.Count > 0)
                {
                    Writer.WriteList(Modules.OrderBy(x => x.Name).Select(x => x.GetListItem()));
                }

                // Write all the subcategories
                foreach (APIModuleCategory Category in Categories.OrderBy(x => x.Name))
                {
                    Writer.WriteHeading(Depth, Category.Name);
                    Writer.WriteLine();
                    Category.Write(Writer, Depth + 1);
                }

                // End of CSS region
                Writer.LeaveRegion();
            }
        }
Ejemplo n.º 3
0
        public override void WritePage(UdnManifest Manifest, string OutputPath)
        {
            using (UdnWriter Writer = new UdnWriter(OutputPath))
            {
                Writer.WritePageHeader(Name, PageCrumbs, Name);

                // Tooltip/description
                Writer.WriteLine(Tooltip);

                if (Pins != null && Pins.Count() > 0)
                {
                    // Visualization of the node
                    Writer.EnterRegion("graph");
                    Writer.EnterObject("BlueprintNode");
                    if (CompactName != null)
                    {
                        Writer.WriteParamLiteral("type", "compact");
                        Writer.WriteParamLiteral("title", CompactName);
                    }
                    else
                    {
                        Writer.WriteParamLiteral("type", NodeType);
                        Writer.WriteParamLiteral("title", Name);
                    }
                    Writer.EnterParam("inputs");
                    WritePinObjects(Writer, Pins.Where(x => x.bInputPin));
                    Writer.LeaveParam();
                    Writer.EnterParam("outputs");
                    WritePinObjects(Writer, Pins.Where(x => !x.bInputPin && x.GetTypeText() != "delegate"));

                    if (bShowAddPin)
                    {
                        Writer.EnterObject("BlueprintPin");
                        Writer.WriteParamLiteral("type", "addpin");
                        Writer.WriteParamLiteral("id", "AddPin");
                        Writer.WriteParamLiteral("title", "Add pin");
                        Writer.LeaveObject();
                    }

                    Writer.LeaveParam();
                    Writer.LeaveObject();
                    Writer.LeaveRegion();

                    // Inputs
                    Writer.EnterSection("inputs", "Inputs");
                    Writer.WriteObject("MemberIconListHeadBlank");
                    WritePins(Writer, Pins.Where(x => x.bInputPin));
                    Writer.WriteObject("MemberIconListTail");
                    Writer.LeaveSection();

                    // Outputs
                    Writer.EnterSection("outputs", "Outputs");
                    Writer.WriteObject("MemberIconListHeadBlank");
                    WritePins(Writer, Pins.Where(x => !x.bInputPin));
                    Writer.WriteObject("MemberIconListTail");
                    Writer.LeaveSection();
                }
            }
        }
Ejemplo n.º 4
0
        private void WriteSourceSection(UdnWriter Writer)
        {
            if (Entity.BodyFile != null)
            {
                DoxygenSourceFile SourceFile = Entity.Module.FindSourceFile(Entity.BodyFile);
                if (SourceFile != null)
                {
                    int BodyStart = Math.Min(Math.Max(Entity.BodyStart - 1, 0), SourceFile.Lines.Count - 1);
                    int BodyEnd   = Math.Min(Math.Max(Entity.BodyEnd, BodyStart), SourceFile.Lines.Count);
                    if (BodyEnd > BodyStart)
                    {
                        Writer.EnterSection("source", "Source");
                        Writer.EnterRegion("simplecode");

                        List <string> Lines     = new List <string>();
                        int           MinPrefix = int.MaxValue;

                        for (int LineIdx = BodyStart; LineIdx < BodyEnd; LineIdx++)
                        {
                            XmlNode Node         = SourceFile.Lines[LineIdx];
                            string  MarkdownLine = (Node == null)? "" : Markdown.ParseXmlCodeLine(Node, ResolveDoxygenLink);

                            int Prefix = 0;
                            while (Prefix < MarkdownLine.Length && MarkdownLine[Prefix] == ' ')
                            {
                                Prefix++;
                            }

                            if (Prefix < MarkdownLine.Length && Prefix < MinPrefix)
                            {
                                MinPrefix = Prefix;
                            }

                            Lines.Add(MarkdownLine);
                        }

                        for (int Idx = 0; Idx < Lines.Count; Idx++)
                        {
                            int TextIdx = Math.Min(MinPrefix, Lines[Idx].Length);
                            if (TextIdx == Lines[Idx].Length)
                            {
                                Writer.Write("&nbsp;");
                            }
                            while (TextIdx < Lines[Idx].Length && Lines[Idx][TextIdx] == ' ')
                            {
                                Writer.Write("&nbsp;");
                                TextIdx++;
                            }
                            Writer.WriteLine(Lines[Idx].Substring(TextIdx) + "  ");
                        }

                        Writer.LeaveRegion();
                        Writer.LeaveSection();
                    }
                }
            }
        }
Ejemplo n.º 5
0
 public override void WritePage(UdnManifest Manifest, string OutputPath)
 {
     using (UdnWriter Writer = new UdnWriter(OutputPath))
     {
         Writer.WritePageHeader(Name, PageCrumbs, "Module Index");
         Writer.EnterRegion("modules-list");
         WriteModuleList(Writer, 2);
         Writer.LeaveRegion();
     }
 }
Ejemplo n.º 6
0
		public override void WritePage(UdnManifest Manifest, string OutputPath)
		{
			using (UdnWriter Writer = new UdnWriter(OutputPath))
			{
				Writer.WritePageHeader(Name, PageCrumbs, Name);

				// Tooltip/description - Write this as interleaved text and notes
				foreach (TooltipLine TTL in TooltipData)
				{
					switch (TTL.Type)
					{
						case TooltipLine.LineType.Normal:
							Writer.WriteLine(TTL.Text);
							break;
						case TooltipLine.LineType.Note:
							Writer.EnterRegion("note");
							Writer.WriteLine(TTL.Text);
							Writer.LeaveRegion();
							break;
						default:
							//Error? Ignore this entry for now.
							break;
					}
				}

				if (Pins != null && Pins.Count() > 0)
				{
					// Visualization of the node
					Writer.EnterRegion("graph");
					Writer.EnterObject("BlueprintNode");
					if (CompactName != null)
					{
						Writer.WriteParamLiteral("type", "compact");
						Writer.WriteParamLiteral("title", CompactName);
					}
					else
					{
						Writer.WriteParamLiteral("type", NodeType);
						Writer.WriteParamLiteral("title", Name);
					}
					Writer.EnterParam("inputs");
					WritePinObjects(Writer, Pins.Where(x => x.bInputPin));
					Writer.LeaveParam();
					Writer.EnterParam("outputs");
					WritePinObjects(Writer, Pins.Where(x => !x.bInputPin && x.GetTypeText() != "delegate"));

					if (bShowAddPin)
					{
						Writer.EnterObject("BlueprintPin");
						Writer.WriteParamLiteral("type", "addpin");
						Writer.WriteParamLiteral("id", "AddPin");
						Writer.WriteParamLiteral("title", "Add pin");
						Writer.LeaveObject();
					}

					Writer.LeaveParam();
					Writer.LeaveObject();
					Writer.LeaveRegion();

					// Inputs
					Writer.EnterSection("inputs", "Inputs");
					Writer.WriteObject("MemberIconListHeadBlank");
					WritePins(Writer, Pins.Where(x => x.bInputPin));
					Writer.WriteObject("MemberIconListTail");
					Writer.LeaveSection();

					// Outputs
					Writer.EnterSection("outputs", "Outputs");
					Writer.WriteObject("MemberIconListHeadBlank");
					WritePins(Writer, Pins.Where(x => !x.bInputPin));
					Writer.WriteObject("MemberIconListTail");
					Writer.LeaveSection();
				}
			}
		}
Ejemplo n.º 7
0
		public override void WritePage(UdnManifest Manifest, string OutputPath)
        {
			using (UdnWriter Writer = new UdnWriter(OutputPath))
			{
				Writer.WritePageHeader(Name, PageCrumbs, BriefDescription);

				// Write the hierarchy
				if (HierarchyNode != null)
				{
					Writer.EnterSection("hierarchy", "Inheritance Hierarchy");
					Writer.EnterTag("[REGION:hierarchy]");
					APIHierarchy.WriteHierarchy(Writer, HierarchyNode, "hrch");
					Writer.LeaveTag("[/REGION]");
					Writer.LeaveSection();
				}

				// Write the record definition
				if (!Utility.IsNullOrWhitespace(Definition))
				{
					Writer.EnterSection("syntax", "Syntax");
					WriteDefinition(Writer);
					Writer.LeaveSection();
				}

				// Write the class description
				if (!Utility.IsNullOrWhitespace(FullDescription))
				{
					Writer.EnterSection("description", "Remarks");
					Writer.WriteLine(FullDescription.Replace("<", "&lt;").Replace(">", "&gt;"));
					Writer.LeaveSection();
				}

				// Write the main body section
				Writer.EnterRegion("syntax");

				// Build a list of all the functions
				List<APIFunction> AllFunctions = new List<APIFunction>();
				AllFunctions.AddRange(Children.OfType<APIFunction>().Where(x => x.Protection != APIProtection.Private && !x.IsDeprecated()));
				AllFunctions.AddRange(Children.OfType<APIFunctionGroup>().SelectMany(x => x.Children.OfType<APIFunction>()).Where(x => x.Protection != APIProtection.Private && !x.IsDeprecated()));
				AllFunctions.Sort((x, y) => String.Compare(x.Name, y.Name));

				// Write all the specializations
				if (TemplateSpecializations.Count > 0)
				{
					Writer.EnterSection("specializations", "Specializations");
					foreach (APIRecord Specialization in TemplateSpecializations)
					{
						Writer.WriteLine("[{0}]({1})  ", Specialization.Name, Specialization.LinkPath);
					}
					Writer.LeaveSection();
				}

				// Write all the variables
				APIVariable.WriteListSection(Writer, "variables", "Variables", Children.OfType<APIVariable>().Where(x => x.Protection != APIProtection.Private && !x.IsDeprecated()).OrderBy(x => x.Name));

				// Write all the constructors
				if (!APIFunction.WriteListSection(Writer, "constructor", "Constructors", AllFunctions.Where(x => x.FunctionType == APIFunctionType.Constructor).OrderBy(x => x.LinkPath), false) && HasAnyPrivateFunction(Name))
				{
					Writer.EnterSection("constructor", "Constructors");
					Writer.WriteLine("No constructors are accessible with public or protected access.");
					Writer.LeaveSection();
				}

				// Write all the destructors
				if (!APIFunction.WriteListSection(Writer, "destructor", "Destructors", AllFunctions.Where(x => x.FunctionType == APIFunctionType.Destructor), false) && HasAnyPrivateFunction("~" + Name))
				{
					Writer.EnterSection("destructors", "Destructors");
					Writer.WriteLine("No destructors are accessible with public or protected access.");
					Writer.LeaveSection();
				}

				// Find a list of base classes
				List<APIRecord> AllBaseRecords = new List<APIRecord>();
				FindAllBaseRecords(AllBaseRecords);

				// Build a list of functions for each base record
				List<APIFunction>[] AllBaseFunctions = AllBaseRecords.Select(x => new List<APIFunction>()).ToArray();
				foreach(APIFunction Function in AllFunctions.Where(x =>x.FunctionType == APIFunctionType.Normal && !x.IsExecFunction()))
				{
					int BaseRecordIdx = AllBaseRecords.IndexOf(Function.GetBaseImplementation().FindParent<APIRecord>());
					AllBaseFunctions[Math.Max(0, BaseRecordIdx)].Add(Function);
				}

				// Write the functions
				for (int Idx = 0; Idx < AllBaseFunctions.Length; Idx++)
				{
					List<APIFunction> BaseFunctions = AllBaseFunctions[Idx];
					if (BaseFunctions.Count > 0)
					{
						string Id = String.Format("functions_{0}", Idx);
						string Label = (Idx == 0) ? "Functions" : String.Format("Overridden from {0}", AllBaseRecords[Idx].Name);
						APIFunction.WriteListSection(Writer, Id, Label, AllBaseFunctions[Idx], true);
					}
				}

				// Write the operator list
				APIFunction.WriteListSection(Writer, "operators", "Operators", AllFunctions.Where(x => x.FunctionType == APIFunctionType.UnaryOperator || x.FunctionType == APIFunctionType.BinaryOperator), true);

				// Write all the inner structures
				Writer.WriteListSection("classes", "Classes", "Name", "Description", Children.OfType<APIRecord>().Where(x => x.Protection != APIProtection.Private).OrderBy(x => x.Name).Select(x => x.GetListItem()));

				// Write all the enums
				Writer.WriteListSection("enums", "Enums", "Name", "Description", Children.OfType<APIEnum>().OrderBy(x => x.Name).Select(x => x.GetListItem()));

				// Write all the typedefs
				Writer.WriteListSection("typedefs", "Typedefs", "Name", "Description", Children.OfType<APITypeDef>().Select(x => x.GetListItem()));

				// Write all the constants
				Writer.WriteListSection("constants", "Constants", "Name", "Description", Children.OfType<APIConstant>().Select(x => x.GetListItem()));

				// Leave the body
				Writer.LeaveRegion();

				// Write the marshalling parameters
				if (DelegateEventParameters != null)
				{
					Writer.EnterSection("marshalling", "Marshalling");
					Writer.WriteLine("Parameters are marshalled using [{0}]({1})", DelegateEventParameters.FullName, DelegateEventParameters.LinkPath);
					Writer.LeaveSection();
				}

				// Write the @see directives
				WriteSeeAlsoSection(Writer, SeeAlso);

				// Write the references
				WriteReferencesSection(Writer, Entity);
			}
        }
Ejemplo n.º 8
0
        public override void WritePage(UdnManifest Manifest, string OutputPath)
        {
            using (UdnWriter Writer = new UdnWriter(OutputPath))
            {
                Writer.WritePageHeader(FullName, PageCrumbs, BriefDescription);

                // Write the warnings
                if (Warnings.Count > 0)
                {
                    Writer.EnterTag("[REGION:warning]");
                    Writer.WriteLine("**Warnings**");
                    foreach (string Warning in Warnings)
                    {
                        Writer.WriteLine("* " + Warning);
                    }
                    Writer.LeaveTag("[/REGION]");
                }

                // Write the virtual hierarchy
                if (HierarchyNode != null)
                {
                    Writer.EnterSection("overrides", "Override Hierarchy");
                    Writer.EnterTag("[REGION:hierarchy]");
                    APIHierarchy.WriteHierarchy(Writer, HierarchyNode, "hrch");
                    Writer.LeaveTag("[/REGION]");
                    Writer.LeaveSection();
                }

                // Write the syntax
                Writer.EnterSection("syntax", "Syntax");
                WriteSyntax(Writer);
                Writer.LeaveSection();

                // Write the description
                if (!Utility.IsNullOrWhitespace(FullDescription))
                {
                    Writer.EnterSection("description", "Remarks");
                    Writer.WriteLine(FullDescription);
                    Writer.LeaveSection();
                }

                // Enter the body
                Writer.EnterRegion("syntax");

                // Write the return type
                if(!Utility.IsNullOrWhitespace(ReturnDescription))
                {
                    Writer.EnterSection("returns", "Returns");
                    Writer.WriteLine(ReturnDescription);
                    Writer.LeaveSection();
                }

                // Write the parameters
                if (ParameterSummaries.Count > 0)
                {
                    Writer.WriteListSection("params", "Parameters", "Parameter", "Description", ParameterSummaries.Select(x => x.GetListItem()));
                }

                // Leave the body
                Writer.LeaveRegion();

                // Write the marshalling struct
                if (EventParameters != null)
                {
                    Writer.EnterSection("marshalling", "Marshalling");
                    Writer.WriteLine("May be called as an event using [{0}]({1}) as parameter frame.", EventParameters.Name, EventParameters.LinkPath);
                    Writer.LeaveSection();
                }

                // Write the template specializations
                if(TemplateSpecializations.Count > 0)
                {
                    Writer.EnterSection("specializations", "Specializations");
                    foreach (APIFunction Specialization in TemplateSpecializations)
                    {
                        Writer.WriteLine("[{0}]({1})  ", Specialization.Name, Specialization.LinkPath);
                    }
                    Writer.LeaveSection();
                }

                //Write code snippets
                WriteSnippetSection(Writer, SnippetText);

                // Write the @see directives
                WriteSeeAlsoSection(Writer, SeeAlso);

                // Write the reference info
                WriteReferencesSection(Writer, Entity);
            }
        }
Ejemplo n.º 9
0
        public override void WritePage(UdnManifest Manifest, string OutputPath)
        {
            using (UdnWriter Writer = new UdnWriter(OutputPath))
            {
                Writer.WritePageHeader(Name, PageCrumbs, Name);

                // Tooltip/description
                Writer.WriteLine(Tooltip);

                if (Pins != null && Pins.Count() > 0)
                {
                    // Visualization of the node
                    Writer.EnterRegion("graph");
                    Writer.EnterObject("BlueprintNode");
                    if (CompactName != null)
                    {
                        Writer.WriteParamLiteral("type", "compact");
                        Writer.WriteParamLiteral("title", CompactName);
                    }
                    else
                    {
                        Writer.WriteParamLiteral("type", NodeType);
                        Writer.WriteParamLiteral("title", Name);
                    }
                    Writer.EnterParam("inputs");
                    WritePinObjects(Writer, Pins.Where(x => x.bInputPin));
                    Writer.LeaveParam();
                    Writer.EnterParam("outputs");
                    WritePinObjects(Writer, Pins.Where(x => !x.bInputPin));

                    if (bShowAddPin)
                    {
                        Writer.EnterObject("BlueprintPin");
                        Writer.WriteParamLiteral("type", "addpin");
                        Writer.WriteParamLiteral("id", "AddPin");
                        Writer.WriteParamLiteral("title", "Add pin");
                        Writer.LeaveObject();
                    }

                    Writer.LeaveParam();
                    Writer.LeaveObject();
                    Writer.LeaveRegion();

                    // Inputs
                    Writer.EnterSection("inputs", "Inputs");
                    Writer.WriteObject("MemberIconListHeadBlank");
                    WritePins(Writer, Pins.Where(x => x.bInputPin));
                    Writer.WriteObject("MemberIconListTail");
                    Writer.LeaveSection();

                    // Outputs
                    Writer.EnterSection("outputs", "Outputs");
                    Writer.WriteObject("MemberIconListHeadBlank");
                    WritePins(Writer, Pins.Where(x => !x.bInputPin));
                    Writer.WriteObject("MemberIconListTail");
                    Writer.LeaveSection();
                }
            }
        }
Ejemplo n.º 10
0
        public override void WritePage(UdnManifest Manifest, string OutputPath)
        {
            using (UdnWriter Writer = new UdnWriter(OutputPath))
            {
                Writer.WritePageHeader(FullName, PageCrumbs, BriefDescription);

                // Write the warnings
                if (Warnings.Count > 0)
                {
                    Writer.EnterTag("[REGION:warning]");
                    Writer.WriteLine("**Warnings**");
                    foreach (string Warning in Warnings)
                    {
                        Writer.WriteLine("* " + Warning);
                    }
                    Writer.LeaveTag("[/REGION]");
                }

                // Write the virtual hierarchy
                if (HierarchyNode != null)
                {
                    Writer.EnterSection("overrides", "Override Hierarchy");
                    Writer.EnterTag("[REGION:hierarchy]");
                    APIHierarchy.WriteHierarchy(Writer, HierarchyNode, "hrch");
                    Writer.LeaveTag("[/REGION]");
                    Writer.LeaveSection();
                }

                // Write the syntax
                Writer.EnterSection("syntax", "Syntax");
                WriteSyntax(Writer);
                Writer.LeaveSection();

                // Write the description
                if (!Utility.IsNullOrWhitespace(FullDescription))
                {
                    Writer.EnterSection("description", "Remarks");
                    Writer.WriteLine(FullDescription);
                    Writer.LeaveSection();
                }

                // Enter the body
                Writer.EnterRegion("syntax");

                // Write the return type
                if (!Utility.IsNullOrWhitespace(ReturnDescription))
                {
                    Writer.EnterSection("returns", "Returns");
                    Writer.WriteLine(ReturnDescription);
                    Writer.LeaveSection();
                }

                // Write the parameters
                if (ParameterSummaries.Count > 0)
                {
                    Writer.WriteListSection("params", "Parameters", "Parameter", "Description", ParameterSummaries.Select(x => x.GetListItem()));
                }

                // Leave the body
                Writer.LeaveRegion();

                // Write the marshalling struct
                if (EventParameters != null)
                {
                    Writer.EnterSection("marshalling", "Marshalling");
                    Writer.WriteLine("May be called as an event using [{0}]({1}) as parameter frame.", EventParameters.Name, EventParameters.LinkPath);
                    Writer.LeaveSection();
                }

                // Write the template specializations
                if (TemplateSpecializations.Count > 0)
                {
                    Writer.EnterSection("specializations", "Specializations");
                    foreach (APIFunction Specialization in TemplateSpecializations)
                    {
                        Writer.WriteLine("[{0}]({1})  ", Specialization.Name, Specialization.LinkPath);
                    }
                    Writer.LeaveSection();
                }

                //Write code snippets
                WriteSnippetSection(Writer, SnippetText);

                // Write the @see directives
                WriteSeeAlsoSection(Writer, SeeAlso);

                // Write the reference info
                WriteReferencesSection(Writer, Entity);
            }
        }
Ejemplo n.º 11
0
        public void Write(UdnWriter Writer, int Depth)
        {
            if (!IsEmpty)
            {
                // CSS region for indenting
                Writer.EnterRegion("module-sections-list");

                // Find all the modules in this category
                if(Modules.Count > 0)
                {
                    Writer.WriteList(Modules.OrderBy(x => x.Name).Select(x => x.GetListItem()));
                }

                // Write all the subcategories
                foreach (APIModuleCategory Category in Categories.OrderBy(x => x.Name))
                {
                    Writer.WriteHeading(Depth, Category.Name);
                    Writer.WriteLine();
                    Category.Write(Writer, Depth + 1);
                }

                // End of CSS region
                Writer.LeaveRegion();
            }
        }
Ejemplo n.º 12
0
 public override void WritePage(UdnManifest Manifest, string OutputPath)
 {
     using (UdnWriter Writer = new UdnWriter(OutputPath))
     {
         Writer.WritePageHeader(Name, PageCrumbs, "Module Index");
         Writer.EnterRegion("modules-list");
         WriteModuleList(Writer, 2);
         Writer.LeaveRegion();
     }
 }
Ejemplo n.º 13
0
        public override void WritePage(UdnManifest Manifest, string OutputPath)
        {
            using (UdnWriter Writer = new UdnWriter(OutputPath))
            {
                Writer.WritePageHeader(Name, PageCrumbs, Name);

                // Tooltip/description - Write this as interleaved text and notes
                foreach (TooltipLine TTL in TooltipData)
                {
                    switch (TTL.Type)
                    {
                    case TooltipLine.LineType.Normal:
                        Writer.WriteLine(TTL.Text);
                        break;

                    case TooltipLine.LineType.Note:
                        Writer.EnterRegion("note");
                        Writer.WriteLine(TTL.Text);
                        Writer.LeaveRegion();
                        break;

                    default:
                        //Error? Ignore this entry for now.
                        break;
                    }
                }

                if (Pins != null && Pins.Count() > 0)
                {
                    // Visualization of the node
                    Writer.EnterRegion("graph");
                    Writer.EnterObject("BlueprintNode");
                    if (CompactName != null)
                    {
                        Writer.WriteParamLiteral("type", "compact");
                        Writer.WriteParamLiteral("title", CompactName);
                    }
                    else
                    {
                        Writer.WriteParamLiteral("type", NodeType);
                        Writer.WriteParamLiteral("title", Name);
                    }
                    Writer.EnterParam("inputs");
                    WritePinObjects(Writer, Pins.Where(x => x.bInputPin));
                    Writer.LeaveParam();
                    Writer.EnterParam("outputs");
                    WritePinObjects(Writer, Pins.Where(x => !x.bInputPin && x.GetTypeText() != "delegate"));

                    if (bShowAddPin)
                    {
                        Writer.EnterObject("BlueprintPin");
                        Writer.WriteParamLiteral("type", "addpin");
                        Writer.WriteParamLiteral("id", "AddPin");
                        Writer.WriteParamLiteral("title", "Add pin");
                        Writer.LeaveObject();
                    }

                    Writer.LeaveParam();
                    Writer.LeaveObject();
                    Writer.LeaveRegion();

                    // Inputs
                    Writer.EnterSection("inputs", "Inputs");
                    Writer.WriteObject("MemberIconListHeadBlank");
                    WritePins(Writer, Pins.Where(x => x.bInputPin));
                    Writer.WriteObject("MemberIconListTail");
                    Writer.LeaveSection();

                    // Outputs
                    Writer.EnterSection("outputs", "Outputs");
                    Writer.WriteObject("MemberIconListHeadBlank");
                    WritePins(Writer, Pins.Where(x => !x.bInputPin));
                    Writer.WriteObject("MemberIconListTail");
                    Writer.LeaveSection();
                }
            }
        }
Ejemplo n.º 14
0
		public override void WritePage(UdnManifest Manifest, string OutputPath)
		{
			using (UdnWriter Writer = new UdnWriter(OutputPath))
			{
				Writer.WritePageHeader(Name, PageCrumbs, Name);

				// Tooltip/description - Write this as interleaved text and notes
				foreach (TooltipLine TTL in TooltipData)
				{
					switch (TTL.Type)
					{
						case TooltipLine.LineType.Normal:
							Writer.WriteLine(TTL.Text);
							break;
						case TooltipLine.LineType.Note:
							Writer.EnterRegion("note");
							Writer.WriteLine(TTL.Text);
							Writer.LeaveRegion();
							break;
						default:
							//Error? Ignore this entry for now.
							break;
					}
				}

				if (Pins != null && Pins.Count() > 0)
				{
					// Visualization of the node
					Writer.EnterRegion("graph");
					Writer.EnterObject("BlueprintNode");
					if (CompactName != null)
					{
						Writer.WriteParamLiteral("type", "compact");
						Writer.WriteParamLiteral("title", CompactName);
					}
					else
					{
						Writer.WriteParamLiteral("type", NodeType);
						Writer.WriteParamLiteral("title", Name);
					}
					Writer.EnterParam("inputs");
					WritePinObjects(Writer, Pins.Where(x => x.bInputPin));
					Writer.LeaveParam();
					Writer.EnterParam("outputs");
					WritePinObjects(Writer, Pins.Where(x => !x.bInputPin && x.GetTypeText() != "delegate"));

					if (bShowAddPin)
					{
						Writer.EnterObject("BlueprintPin");
						Writer.WriteParamLiteral("type", "addpin");
						Writer.WriteParamLiteral("id", "AddPin");
						Writer.WriteParamLiteral("title", "Add pin");
						Writer.LeaveObject();
					}

					Writer.LeaveParam();
					Writer.LeaveObject();
					Writer.LeaveRegion();

					// Inputs
					Writer.EnterSection("inputs", "Inputs");
					Writer.WriteObject("MemberIconListHeadBlank");
					WritePins(Writer, Pins.Where(x => x.bInputPin));
					Writer.WriteObject("MemberIconListTail");
					Writer.LeaveSection();

					// Outputs
					Writer.EnterSection("outputs", "Outputs");
					Writer.WriteObject("MemberIconListHeadBlank");
					// TODO: Remove this hack and reinstate the one-line version once UE-16475 is resolved.
					bool bAlreadyWroteOutputDelegate = false;
					for (int i = 0; i < Pins.Count; ++i)
					{
						APIActionPin Pin = Pins[i];
						if (!Pin.bInputPin)
						{
							if (Pin.GetTypeText() == "delegate")
							{
								if (bAlreadyWroteOutputDelegate)
								{
									continue;
								}
								bAlreadyWroteOutputDelegate = true;
							}
							Pin.WritePin(Writer);
						}
					}
					//WritePins(Writer, Pins.Where(x => !x.bInputPin));
					Writer.WriteObject("MemberIconListTail");
					Writer.LeaveSection();
				}
			}
		}
Ejemplo n.º 15
0
		public override void WritePage(UdnManifest Manifest, string OutputPath)
		{
			using (UdnWriter Writer = new UdnWriter(OutputPath))
			{
				Writer.WritePageHeader("Unreal Engine API Reference", PageCrumbs, "Unreal Engine API Reference");

				Writer.WriteHeading(2, "Disclaimer");

				Writer.WriteLine("The API reference is an early work in progress, and some information may be missing or out of date. It serves mainly as a low level index of Engine classes and functions.");
				Writer.WriteLine("For tutorials, walkthroughs and detailed guides to programming with Unreal, please see the [Unreal Engine Programming](http://docs.unrealengine.com/latest/INT/Programming/index.html) home on the web.");
				Writer.WriteLine();
				Writer.WriteLine("To explore the API from some of the most frequently encountered Unreal concepts and types, see the API __[getting started](" + GettingStarted.LinkPath + ")__ page.");

				Writer.WriteHeading(2, "Contents");

				Writer.EnterRegion("memberindexlinks");
				Writer.WriteLine("[Getting started]({0}) &middot; [All constants]({1}) &middot; [All functions]({2}) &middot; [All enums]({3}) &middot; [All classes]({4}) &middot; [Class hierarchy]({5})", GettingStarted.LinkPath, ConstantIndex.LinkPath, FunctionIndex.LinkPath, EnumIndex.LinkPath, RecordIndex.LinkPath, RecordHierarchy.LinkPath);
				Writer.LeaveRegion();

				foreach(APIModuleIndex ChildModuleIndex in ChildModuleIndexes)
				{
					Writer.WriteHeading(2, ChildModuleIndex.Name);
					Writer.EnterRegion("modules-list");
					ChildModuleIndex.WriteModuleList(Writer, 3);
					Writer.LeaveRegion();
				}

				Writer.WriteLine("<br>");
			}
		}
Ejemplo n.º 16
0
        public override void WritePage(UdnManifest Manifest, string OutputPath)
        {
            using (UdnWriter Writer = new UdnWriter(OutputPath))
            {
                Writer.WritePageHeader(Name, PageCrumbs, BriefDescription);

                // Write the hierarchy
                if (HierarchyNode != null)
                {
                    Writer.EnterSection("hierarchy", "Inheritance Hierarchy");
                    Writer.EnterTag("[REGION:hierarchy]");
                    APIHierarchy.WriteHierarchy(Writer, HierarchyNode, "hrch");
                    Writer.LeaveTag("[/REGION]");
                    Writer.LeaveSection();
                }

                // Write the record definition
                if (!Utility.IsNullOrWhitespace(Definition))
                {
                    Writer.EnterSection("syntax", "Syntax");
                    WriteDefinition(Writer);
                    Writer.LeaveSection();
                }

                // Write the class description
                if (!Utility.IsNullOrWhitespace(FullDescription))
                {
                    Writer.EnterSection("description", "Remarks");
                    Writer.WriteLine(FullDescription.Replace("<", "&lt;").Replace(">", "&gt;"));
                    Writer.LeaveSection();
                }

                // Write the main body section
                Writer.EnterRegion("syntax");

                // Build a list of all the functions
                List <APIFunction> AllFunctions = new List <APIFunction>();
                AllFunctions.AddRange(Children.OfType <APIFunction>().Where(x => x.Protection != APIProtection.Private && !x.IsDeprecated()));
                AllFunctions.AddRange(Children.OfType <APIFunctionGroup>().SelectMany(x => x.Children.OfType <APIFunction>()).Where(x => x.Protection != APIProtection.Private && !x.IsDeprecated()));
                AllFunctions.Sort((x, y) => String.Compare(x.Name, y.Name));

                // Write all the specializations
                if (TemplateSpecializations.Count > 0)
                {
                    Writer.EnterSection("specializations", "Specializations");
                    foreach (APIRecord Specialization in TemplateSpecializations)
                    {
                        Writer.WriteLine("[{0}]({1})  ", Specialization.Name, Specialization.LinkPath);
                    }
                    Writer.LeaveSection();
                }

                // Write all the variables
                APIVariable.WriteListSection(Writer, "variables", "Variables", Children.OfType <APIVariable>().Where(x => x.Protection != APIProtection.Private && !x.IsDeprecated()).OrderBy(x => x.Name));

                // Write all the constructors
                if (!APIFunction.WriteListSection(Writer, "constructor", "Constructors", AllFunctions.Where(x => x.FunctionType == APIFunctionType.Constructor).OrderBy(x => x.LinkPath), false) && HasAnyPrivateFunction(Name))
                {
                    Writer.EnterSection("constructor", "Constructors");
                    Writer.WriteLine("No constructors are accessible with public or protected access.");
                    Writer.LeaveSection();
                }

                // Write all the destructors
                if (!APIFunction.WriteListSection(Writer, "destructor", "Destructors", AllFunctions.Where(x => x.FunctionType == APIFunctionType.Destructor), false) && HasAnyPrivateFunction("~" + Name))
                {
                    Writer.EnterSection("destructors", "Destructors");
                    Writer.WriteLine("No destructors are accessible with public or protected access.");
                    Writer.LeaveSection();
                }

                // Find a list of base classes
                List <APIRecord> AllBaseRecords = new List <APIRecord>();
                FindAllBaseRecords(AllBaseRecords);

                // Build a list of functions for each base record
                List <APIFunction>[] AllBaseFunctions = AllBaseRecords.Select(x => new List <APIFunction>()).ToArray();
                foreach (APIFunction Function in AllFunctions.Where(x => x.FunctionType == APIFunctionType.Normal && !x.IsExecFunction()))
                {
                    int BaseRecordIdx = AllBaseRecords.IndexOf(Function.GetBaseImplementation().FindParent <APIRecord>());
                    AllBaseFunctions[Math.Max(0, BaseRecordIdx)].Add(Function);
                }

                // Write the functions
                for (int Idx = 0; Idx < AllBaseFunctions.Length; Idx++)
                {
                    List <APIFunction> BaseFunctions = AllBaseFunctions[Idx];
                    if (BaseFunctions.Count > 0)
                    {
                        string Id    = String.Format("functions_{0}", Idx);
                        string Label = (Idx == 0) ? "Functions" : String.Format("Overridden from {0}", AllBaseRecords[Idx].Name);
                        APIFunction.WriteListSection(Writer, Id, Label, AllBaseFunctions[Idx], true);
                    }
                }

                // Write the operator list
                APIFunction.WriteListSection(Writer, "operators", "Operators", AllFunctions.Where(x => x.FunctionType == APIFunctionType.UnaryOperator || x.FunctionType == APIFunctionType.BinaryOperator), true);

                // Write all the inner structures
                Writer.WriteListSection("classes", "Classes", "Name", "Description", Children.OfType <APIRecord>().Where(x => x.Protection != APIProtection.Private).OrderBy(x => x.Name).Select(x => x.GetListItem()));

                // Write all the enums
                Writer.WriteListSection("enums", "Enums", "Name", "Description", Children.OfType <APIEnum>().OrderBy(x => x.Name).Select(x => x.GetListItem()));

                // Write all the typedefs
                Writer.WriteListSection("typedefs", "Typedefs", "Name", "Description", Children.OfType <APITypeDef>().Select(x => x.GetListItem()));

                // Write all the constants
                Writer.WriteListSection("constants", "Constants", "Name", "Description", Children.OfType <APIConstant>().Select(x => x.GetListItem()));

                // Leave the body
                Writer.LeaveRegion();

                // Write the marshalling parameters
                if (DelegateEventParameters != null)
                {
                    Writer.EnterSection("marshalling", "Marshalling");
                    Writer.WriteLine("Parameters are marshalled using [{0}]({1})", DelegateEventParameters.FullName, DelegateEventParameters.LinkPath);
                    Writer.LeaveSection();
                }

                // Write the @see directives
                WriteSeeAlsoSection(Writer, SeeAlso);

                // Write the references
                WriteReferencesSection(Writer, Entity);
            }
        }
Ejemplo n.º 17
0
        public void Write(UdnWriter Writer, int Depth, Dictionary<string, APIModule> Modules)
        {
            if (!IsEmpty)
            {
                // Find all the major modules in this category
                if (MajorModules.Count > 0)
                {
                    Writer.WriteList("Name", "Description", MajorModules.Select(x => Modules[x].GetListItem()));
                }

                // Write all the minor modules in this category
                if (MinorModules.Count > 0)
                {
                    Writer.EnterRegion("syntax");
                    Writer.WriteFilterList(MinorModules.Select(x => Modules[x].GetFilterListItem()).ToArray());
                    Writer.LeaveRegion();
                }

                // Write all the subcategories
                foreach (APIModuleCategory Category in Categories)
                {
                    Writer.WriteHeading(Depth, Category.Name);
                    Writer.WriteLine();
                    Category.Write(Writer, Depth + 1, Modules);
                }
            }
        }
Ejemplo n.º 18
0
        public override void WritePage(UdnManifest Manifest, string OutputPath)
        {
            using (UdnWriter Writer = new UdnWriter(OutputPath))
            {
                Writer.WritePageHeader(Name, PageCrumbs, Name);

                // Tooltip/description - Write this as interleaved text and notes
                foreach (TooltipLine TTL in TooltipData)
                {
                    switch (TTL.Type)
                    {
                    case TooltipLine.LineType.Normal:
                        Writer.WriteLine(TTL.Text);
                        break;

                    case TooltipLine.LineType.Note:
                        Writer.EnterRegion("note");
                        Writer.WriteLine(TTL.Text);
                        Writer.LeaveRegion();
                        break;

                    default:
                        //Error? Ignore this entry for now.
                        break;
                    }
                }

                if (Pins != null && Pins.Count() > 0)
                {
                    // Visualization of the node
                    Writer.EnterRegion("graph");
                    Writer.EnterObject("BlueprintNode");
                    if (CompactName != null)
                    {
                        Writer.WriteParamLiteral("type", "compact");
                        Writer.WriteParamLiteral("title", CompactName);
                    }
                    else
                    {
                        Writer.WriteParamLiteral("type", NodeType);
                        Writer.WriteParamLiteral("title", Name);
                    }
                    Writer.EnterParam("inputs");
                    WritePinObjects(Writer, Pins.Where(x => x.bInputPin));
                    Writer.LeaveParam();
                    Writer.EnterParam("outputs");
                    WritePinObjects(Writer, Pins.Where(x => !x.bInputPin && x.GetTypeText() != "delegate"));

                    if (bShowAddPin)
                    {
                        Writer.EnterObject("BlueprintPin");
                        Writer.WriteParamLiteral("type", "addpin");
                        Writer.WriteParamLiteral("id", "AddPin");
                        Writer.WriteParamLiteral("title", "Add pin");
                        Writer.LeaveObject();
                    }

                    Writer.LeaveParam();
                    Writer.LeaveObject();
                    Writer.LeaveRegion();

                    // Inputs
                    Writer.EnterSection("inputs", "Inputs");
                    Writer.WriteObject("MemberIconListHeadBlank");
                    WritePins(Writer, Pins.Where(x => x.bInputPin));
                    Writer.WriteObject("MemberIconListTail");
                    Writer.LeaveSection();

                    // Outputs
                    Writer.EnterSection("outputs", "Outputs");
                    Writer.WriteObject("MemberIconListHeadBlank");
                    // TODO: Remove this hack and reinstate the one-line version once UE-16475 is resolved.
                    bool bAlreadyWroteOutputDelegate = false;
                    for (int i = 0; i < Pins.Count; ++i)
                    {
                        APIActionPin Pin = Pins[i];
                        if (!Pin.bInputPin)
                        {
                            if (Pin.GetTypeText() == "delegate")
                            {
                                if (bAlreadyWroteOutputDelegate)
                                {
                                    continue;
                                }
                                bAlreadyWroteOutputDelegate = true;
                            }
                            Pin.WritePin(Writer);
                        }
                    }
                    //WritePins(Writer, Pins.Where(x => !x.bInputPin));
                    Writer.WriteObject("MemberIconListTail");
                    Writer.LeaveSection();
                }
            }
        }
Ejemplo n.º 19
0
        private void WriteSourceSection(UdnWriter Writer)
        {
            if(Entity.BodyFile != null)
            {
                DoxygenSourceFile SourceFile = Entity.Module.FindSourceFile(Entity.BodyFile);
                if(SourceFile != null)
                {
                    int BodyStart = Math.Min(Math.Max(Entity.BodyStart - 1, 0), SourceFile.Lines.Count - 1);
                    int BodyEnd = Math.Min(Math.Max(Entity.BodyEnd, BodyStart), SourceFile.Lines.Count);
                    if(BodyEnd > BodyStart)
                    {
                        Writer.EnterSection("source", "Source");
                        Writer.EnterRegion("simplecode");

                        List<string> Lines = new List<string>();
                        int MinPrefix = int.MaxValue;

                        for (int LineIdx = BodyStart; LineIdx < BodyEnd; LineIdx++)
                        {
                            XmlNode Node = SourceFile.Lines[LineIdx];
                            string MarkdownLine = (Node == null)? "" : Markdown.ParseXmlCodeLine(Node, ResolveDoxygenLink);

                            int Prefix = 0;
                            while (Prefix < MarkdownLine.Length && MarkdownLine[Prefix] == ' ') Prefix++;

                            if(Prefix < MarkdownLine.Length && Prefix < MinPrefix)
                            {
                                MinPrefix = Prefix;
                            }

                            Lines.Add(MarkdownLine);
                        }

                        for (int Idx = 0; Idx < Lines.Count; Idx++)
                        {
                            int TextIdx = Math.Min(MinPrefix, Lines[Idx].Length);
                            if(TextIdx == Lines[Idx].Length)
                            {
                                Writer.Write("&nbsp;");
                            }
                            while(TextIdx < Lines[Idx].Length && Lines[Idx][TextIdx] == ' ')
                            {
                                Writer.Write("&nbsp;");
                                TextIdx++;
                            }
                            Writer.WriteLine(Lines[Idx].Substring(TextIdx) + "  ");
                        }

                        Writer.LeaveRegion();
                        Writer.LeaveSection();
                    }
                }
            }
        }