Skip to content

kosl90/gschema-to-godbus

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages