Example #1
0
func (this *binding_generator) process_constant_info(ci *gi.ConstantInfo) {
	p := printer_to(&this.go_bindings)

	name := ci.Name()
	if config.namespace == "Gdk" && strings.HasPrefix(name, "KEY_") {
		// KEY_ constants deserve a special treatment
		p("const Key_%s = %#v\n", name[4:], ci.Value())
		return
	}
	p("const %s = %#v\n", lower_case_to_camel_case(strings.ToLower(name)), ci.Value())
}
func ProcessConstantInfo(ci *gi.ConstantInfo) {
	// done
	name := ci.Name()
	if Config.Namespace == "Gdk" && strings.HasPrefix(name, "KEY_") {
		// KEY_ constants deserve a special treatment
		printf("const Key_%s = %#v\n", name[4:], ci.Value())
		return
	}
	printf("const %s = %#v\n",
		LowerCaseToCamelCase(strings.ToLower(name)),
		ci.Value())
}