Sign up

Using gtkwrap with libsecret

I'm looking at using gtkwrap included with GtkD to wrap libsecret since it has a GIR file and I figured this would save me a lot of time over creating an interface to it manually. I'm having a problem though with SchemaAttribute that I'm stumped on that I'll like to ask for advice on. To start with here's my APILookupSecret.txt file:

# must start with wrap
wrap: secret
file: /usr/share/gir-1.0/Secret-1.gir

addAliases: start
	public import gtkc.gtktypes;
addAliases: end

move: password_clear Secret
move: password_clear_finish Secret
move: password_clear_sync Secret
move: password_clearv Secret
move: password_clearv_sync Secret
move: password_free Secret
move: password_lookup Secret
move: password_lookup_finish Secret
move: password_lookup_nonpageable_finish Secret
move: password_lookup_nonpageable_sync Secret
move: password_lookup_sync Secret
move: password_lookupv Secret
move: password_lookupv_nonpageable_sync Secret
move: password_lookupv_sync Secret
move: password_store Secret
move: password_store_finish Secret
move: password_store_sync Secret
move: password_storev Secret
move: password_storev_sync Secret
move: password_wipe Secret

My expectation is that SchemaAttribute would be created as a class similar to RGBA is in the GDK. Looking at them in their respective GIR files they look like they use the same structure as far as I can tell with the exception that RGBA has some methods. However when I run the gtkwrap I see SchemaAttribute is declared as a struct and is missing it's attributes as per the example below:

/**
 * An attribute in a #SecretSchema.
 */
public struct SchemaAttribute
{

	/** */
	public static GType getType()
	{
		return secret_schema_attribute_get_type();
	}
}

Any idea what I'm missing here?

Re: Using gtkwrap with libsecret

Never mind, as soon as I posted I stumbled across the answer. I have to explicitly declare SchemaAttribute as a class rather then a struct. Interestingly though RGBA doesn't seem to need to do this.

Re: Using gtkwrap with libsecret

On 08/28/2016 11:49 PM, Gerald Nunn wrote:

Never mind, as soon as I posted I stumbled across the answer. I have to explicitly declare SchemaAttribute as a class rather then a struct. Interestingly though RGBA doesn't seem to need to do this.

Structs (Records) with methods, signals or constructors are
automatically changed to Classes.