gschema-to-godbus

command module
v0.0.0-...-f4c8263 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2016 License: MIT Imports: 12 Imported by: 0

README

Intro

Generate dbus code for golang according to gschema file. A little convenient tool for working in Deepin.

Request

  1. kingpin for commandline parse.
  2. pkg.deepin.io/lib/dbus
  3. gir

Usage

$ gschema-to-godbus --help
usage: gschema-to-godbus --schema=SCHEMA --dest=DEST --path=PATH [<flags>]

Flags:
      --help               Show context-sensitive help (also try --help-long and --help-man).
  -s, --schema=SCHEMA    schema which is going to be translated.
  -n, --pkg_name="main"  package name used for golang package, default is main.
  -d, --dest=DEST        dbus dest used for dbus.
  -p, --path=PATH        dbus path used for dbus.
  -o, --output_dir=.     output directory to save generated files, default is current directory.

autogen_gsettings.go and autogen_gsettings_type.go will be generated, a setter, a getter and a changed signal will be generated for each key. If the range tag is specific, a GetRangeOfX method will be generated too, like GetRangeOfZoomLevel.

A function named NewX and a function named NewXWithHook, like NewDesktopPreferences and NewDesktopPreferencesWithHook, will be generated for each schema. The hook is nullable which should follow SettingHook interface, and if you want to implement your own hook, DefaultSettingHook can be embeded for convenient.

References

  1. gschema.dtd.
  2. GVariant doc
  3. GVariant format strings
  4. GSettings doc

License

MIT License

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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