gtkdoc2ctk

package
v0.5.13 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CliCommand = &cli.Command{
	Name:   "gtk2doc",
	Usage:  "generate CTK boilerplate source code from GTK2 documentation",
	Action: gtk2doc,
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:  "page",
			Usage: "parse the GTK2 developers.gnome.org documentation and output go-ctk source code",
		},
		&cli.StringFlag{
			Name:  "path",
			Usage: "parse the GTK2 documentation and output go-ctk source code",
		},
		&cli.StringFlag{
			Name:        "package-name",
			Aliases:     []string{"package", "pkg"},
			Usage:       "specify the package name for the generated source code",
			Value:       "ctk",
			DefaultText: "ctk",
		},
		&cli.StringFlag{
			Name:  "output",
			Usage: "write generated source code to the file path given instead of stdout",
		},
		&cli.StringFlag{
			Name:  "output-path",
			Usage: "write generated source code to a new file at the path given instead of stdout",
		},
		&cli.BoolFlag{
			Name:    "force",
			Aliases: []string{"f"},
			Usage:   "overwrite output file if it exists",
		},
		&cli.BoolFlag{
			Name:    "include-deprecated",
			Aliases: []string{"D"},
			Usage:   "include deprecated methods",
		},
	},
}
View Source
var CtkInterfaceTemplate = `` /* 607-byte string literal not displayed */
View Source
var CtkSourceTemplate = `` /* 3283-byte string literal not displayed */

Functions

func GenerateCtkSource

func GenerateCtkSource(c *cli.Context, src *GtkSource) (output string, err error)

func ParseGtk2DocFile

func ParseGtk2DocFile(path string, c *cli.Context) (err error)

func ParseGtk2DocUrl

func ParseGtk2DocUrl(gtk2name string, c *cli.Context) (err error)

func ProcessDescription

func ProcessDescription(src *GtkSource, s *goquery.Selection)

func ProcessFunctionDetails

func ProcessFunctionDetails(src *GtkSource, s *goquery.Selection)

func ProcessImplementedInterfaces

func ProcessImplementedInterfaces(src *GtkSource, s *goquery.Selection)

func ProcessObjectHierarchy

func ProcessObjectHierarchy(src *GtkSource, s *goquery.Selection)

func ProcessPropertyDetails

func ProcessPropertyDetails(src *GtkSource, s *goquery.Selection)

func ProcessSignalDetails

func ProcessSignalDetails(src *GtkSource, s *goquery.Selection)

func ProduceOutput

func ProduceOutput(name string, code string, c *cli.Context) (err error)

func RewriteGtkThingsToCtkThings

func RewriteGtkThingsToCtkThings(class, input string) (output string)

func WriteToFile

func WriteToFile(c *cli.Context, targetFileName string, content []byte) (err error)

Types

type GtkFunc

type GtkFunc struct {
	Name string
	Docs string
	Argv []*GtkNamedType
	Retv GtkType
	Body string
}

func (*GtkFunc) InterfaceString

func (f *GtkFunc) InterfaceString() string

func (*GtkFunc) String

func (f *GtkFunc) String() string

type GtkNamedType

type GtkNamedType struct {
	Name  string
	Type  GtkType
	Value string
	Note  string
}

func NewNamedType

func NewNamedType(name string, t GtkType) *GtkNamedType

func (GtkNamedType) String

func (n GtkNamedType) String() string

type GtkProperty

type GtkProperty struct {
	Name    string
	Tag     string
	Decl    string
	Write   bool
	Type    GtkType
	Default string
	Docs    string
}

func (GtkProperty) Registration

func (s GtkProperty) Registration() string

func (GtkProperty) String

func (s GtkProperty) String() string

type GtkSignal

type GtkSignal struct {
	Name       string
	Tag        string
	Docs       string
	UserFnArgs []*GtkNamedType
}

func NewSignal

func NewSignal(name, tag string) *GtkSignal

func (GtkSignal) String

func (s GtkSignal) String() string

type GtkSource

type GtkSource struct {
	Name        string // CamelCase
	Flat        string // snake_case
	Tag         string // tag-case
	This        string // method this name
	Parent      string
	PackageName string
	Description string
	Hierarchy   []string
	Implements  []string
	Signals     []*GtkSignal
	Properties  []*GtkProperty
	Functions   []*GtkFunc
	Constructor *GtkFunc
	Factories   []*GtkFunc
	Context     *cli.Context
}

func ParseGtk2Doc

func ParseGtk2Doc(snakedName, contents string, c *cli.Context) (source *GtkSource, err error)

func (GtkSource) ObjectHierarchy

func (s GtkSource) ObjectHierarchy() (output string)

func (GtkSource) String

func (s GtkSource) String() string

type GtkType

type GtkType struct {
	C       string
	GoName  string
	GoLabel string
	GoType  interface{}
}

func NewType

func NewType(pkg, c string) GtkType

func TranslateGtkType

func TranslateGtkType(pkg, cType string) (t GtkType)

func TranslateNamedVariable

func TranslateNamedVariable(pkg, pType, pName string) (pn string, pt GtkType)

func (GtkType) String

func (t GtkType) String() string

Jump to

Keyboard shortcuts

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