@Override
	public ListingField getField(ProxyObj<?> proxy, int varWidth) {
		Object obj = proxy.getObject();
		if (!enabled || !(obj instanceof Function)) {
			return null;
		}

		Function function = (Function) obj;
		Parameter[] params = function.getParameters();
		ArrayList<FieldElement> textElements = new ArrayList<>();
		int elementIndex = 0;
		AttributedString as;
		int startCol = 0; // Column in the function signature where the current element will start.

		// inline
		if (function.isInline()) {
			as = new AttributedString(Function.INLINE + " ", FunctionColors.RETURN_TYPE,
				getMetrics());
			textElements.add(new FunctionInlineFieldElement(as, elementIndex, 0, startCol));
			startCol += as.length();
			elementIndex++;
		}

		// thunk
		if (function.isThunk()) {
			as = new AttributedString(Function.THUNK + " ", FunctionColors.RETURN_TYPE,
				getMetrics());
			textElements.add(new FunctionThunkFieldElement(as, elementIndex, 0, startCol));
			startCol += as.length();
			elementIndex++;
		}

		// no return
		if (function.hasNoReturn()) {
			as = new AttributedString(Function.NORETURN + " ", FunctionColors.RETURN_TYPE,
				getMetrics());
			textElements.add(new FunctionNoReturnFieldElement(as, elementIndex, 0, startCol));
			startCol += as.length();
			elementIndex++;
		}

		// return type
		String returnTypeName = function.getReturn().getFormalDataType().getDisplayName();
		returnTypeName = simplifyTemplates(returnTypeName);
		as = new AttributedString(returnTypeName + " ",
			FunctionColors.RETURN_TYPE, getMetrics());
		textElements.add(new FunctionReturnTypeFieldElement(as, elementIndex, 0, startCol));
		startCol += as.length();
		elementIndex++;

		// calling convention
		String callingConvention = function.getCallingConventionName();
		if (callingConvention.equals(Function.DEFAULT_CALLING_CONVENTION_STRING)) {
			callingConvention = function.getCallingConvention().getName();
		}
		if (!callingConvention.equals(Function.UNKNOWN_CALLING_CONVENTION_STRING)) {
			as = new AttributedString(callingConvention + " ", FunctionColors.RETURN_TYPE,
				getMetrics());
			textElements
					.add(new FunctionCallingConventionFieldElement(as, elementIndex, 0, startCol));
			startCol += as.length();
			elementIndex++;
		}

		// function name
		String functionName = simplifyTemplates(function.getName(displayFunctionScope));
		as = new AttributedString(functionName, getFunctionNameColor(function), getMetrics());
		textElements.add(new FunctionNameFieldElement(as, elementIndex, 0, startCol));
		startCol += as.length();
		elementIndex++;

		// opening parenthesis
		as = new AttributedString("(", ListingColors.SEPARATOR, getMetrics());
		textElements.add(new FunctionStartParametersFieldElement(as, elementIndex, 0, startCol));
		startCol += as.length();
		elementIndex++;

		// parameters
		int paramOffset = 0;
		AttributedString commaSeparator =
			new AttributedString(", ", ListingColors.SEPARATOR, getMetrics());
		int lastParam = params.length - 1;
		for (int i = 0; i < params.length; i++) {

			// do not display auto-params in signature
//			if (params[i].isAutoParameter()) {
//				continue;
//			}

			Color pcolor =
				params[i].isAutoParameter() ? FunctionColors.PARAM_AUTO : FunctionColors.PARAM;

			String dtName = simplifyTemplates(params[i].getFormalDataType().getDisplayName() + " ");
			as = new AttributedString(dtName, pcolor, getMetrics());
			textElements.add(
				new FunctionParameterFieldElement(as, elementIndex, paramOffset, startCol, i));
			startCol += as.length();
			paramOffset += as.length();
			elementIndex++;

			String text = params[i].getName();
			as = new AttributedString(text, pcolor, getMetrics());
			textElements.add(
				new FunctionParameterNameFieldElement(as, elementIndex, paramOffset, startCol, i));
			startCol += as.length();
			paramOffset += as.length();
			elementIndex++;

			if (i != lastParam) { // separator
				textElements.add(
					new FunctionSignatureFieldElement(commaSeparator, elementIndex, 0, startCol));
				startCol += commaSeparator.length();
				paramOffset += commaSeparator.length();
				elementIndex++;
			}
		}

		// varargs
		if (function.hasVarArgs()) {
			if (params.length > 0) {
				textElements.add(
					new FunctionSignatureFieldElement(commaSeparator, elementIndex, 0, startCol));
				startCol += commaSeparator.length();
				paramOffset += commaSeparator.length();
				elementIndex++;
			}
			as = new AttributedString(FunctionSignature.VAR_ARGS_DISPLAY_STRING,
				FunctionColors.PARAM, getMetrics());
			textElements.add(new FunctionSignatureFieldElement(as, elementIndex, 0, startCol));
			startCol += as.length();
			elementIndex++;
		}
		else if (lastParam < 0 && function.getSignatureSource() != SourceType.DEFAULT) {
			// void parameter list
			as = new AttributedString(FunctionSignature.VOID_PARAM_DISPLAY_STRING,
				FunctionColors.PARAM, getMetrics());
			textElements.add(new FunctionSignatureFieldElement(as, elementIndex, 0, startCol));
			startCol += as.length();
			elementIndex++;
		}

		// closing parenthesis
		as = new AttributedString(")", ListingColors.SEPARATOR, getMetrics());
		textElements.add(new FunctionEndParametersFieldElement(as, elementIndex, 0, startCol));

		return ListingTextField.createSingleLineTextField(this, proxy,
			new CompositeFieldElement(textElements), startX + varWidth, width, hlProvider);
	}
Constructor
@param model the model that the field belongs to.
@param hlProvider the HightLightProvider.
@param displayOptions the Options for display properties.
@param fieldOptions the Options for field specific properties.
Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/FunctionSignatureFieldFactory.java