ir

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2026 License: GPL-3.0, MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Class

type Class struct {
	Name                string
	Signature           string
	RequiredImports     []*Import
	FullyQualifiedName  string
	ImplInterfaces      []*Interface
	ExclusiveInterfaces []*Interface
	HasEmptyConstructor bool
	IsAbstract          bool
}

Class represents a WinRT runtime class.

type Data

type Data struct {
	Package    string
	Imports    []string
	Classes    []*Class
	Enums      []*Enum
	Interfaces []*Interface
	Structs    []*Struct
	Delegates  []*Delegate
}

Data holds all types resolved for a single output file.

type DataFile

type DataFile struct {
	Filename string
	Data     Data
}

DataFile pairs a filename with its type data for code generation.

type DefaultValue

type DefaultValue struct {
	Value       string
	IsPrimitive bool
}

DefaultValue holds the default value expression for a type.

type Delegate

type Delegate struct {
	Name        string
	GUID        string
	Signature   string
	InParams    []*Param
	ReturnParam *Param
}

Delegate represents a WinRT delegate type.

type Enum

type Enum struct {
	Name      string
	Type      string
	Signature string
	Values    []*EnumValue
}

Enum represents a WinRT enumeration.

type EnumValue

type EnumValue struct {
	Name  string
	Value string
}

EnumValue holds a name–value pair for an enum constant.

type Func

type Func struct {
	Name               string
	RequiredImports    []*Import
	Implement          bool
	FuncOwner          string
	InParams           []*Param
	ReturnParams       []*Param
	ExclusiveTo        string
	RequiresActivation bool
	InheritedFrom      QualifiedID
}

Func represents a WinRT method.

type Import

type Import struct {
	Namespace, Name string
}

Import represents a dependency on another WinRT namespace.

type Interface

type Interface struct {
	Name      string
	GUID      string
	Signature string
	Funcs     []*Func
}

Interface represents a WinRT interface.

type Param

type Param struct {
	CallerPackage string
	VarName       string
	Type          *ParamType
	IsOut         bool
}

Param represents a method parameter or struct field.

func (*Param) GoDefaultValue

func (p *Param) GoDefaultValue() string

GoDefaultValue returns the Go zero/default expression for a parameter's type.

func (*Param) GoTypeName

func (p *Param) GoTypeName() string

GoTypeName returns the Go type expression for a parameter.

func (*Param) GoVarName

func (p *Param) GoVarName() string

GoVarName returns the Go-style variable name for a parameter.

type ParamType

type ParamType struct {
	Namespace string
	Name      string

	IsPointer          bool
	IsGeneric          bool
	IsArray            bool
	IsPrimitive        bool
	IsEnum             bool
	UnderlyingEnumType string

	DefaultValue DefaultValue
}

ParamType describes the type of a parameter.

type QualifiedID

type QualifiedID struct {
	Namespace, Name string
}

QualifiedID holds namespace and name of a qualified element.

type Struct

type Struct struct {
	Name      string
	Signature string
	Fields    []*Param
}

Struct represents a WinRT value type (struct).

type TypeKind

type TypeKind int

TypeKind identifies the category of a WinRT type.

const (
	KindInterface TypeKind = iota
	KindClass
	KindEnum
	KindStruct
	KindDelegate
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL