[Vala] [PATCH] Moving functions between Classes in Metadata files
- From: Sam Thursfield <ssssam gmail com>
- To: vala-list gnome org, tecywiz121 <tecywiz121 hotmail com>
- Subject: [Vala] [PATCH] Moving functions between Classes in Metadata files
- Date: Fri, 20 Aug 2010 01:25:59 +0100
On Sun, Jul 11, 2010 at 10:46 PM, tecywiz121 <tecywiz121 hotmail com> wrote:
Hey!
I've been working on binding chipmunk, a physics engine, for the past
week and I've run into a bunch of snags. Chipmunk is not a glib
library, and it doesn't exactly get parsed well by gen-introspect but it
does a enough of a good job to get to generating a vapi file.
The naming convention used by chipmunk does not match with the glib
convention, so my biggest problem is that not a single method was put in
a class.
My solution was to add a new property to vapigen called "belongs_to" It
allows a function to be moved into a different class/struct/enum. It
also tries to fix up the vala name by removing the name of the new type.
Attached is a rather hacky patch to implement the property. I would
really appreciate some feedback, and I'd eventually like to get the
property included in vapigen.
I would find this feature useful as well. In the Seed bindings, for example
seed_simple_evaluate() should really become
SeedContext.simple_evaluate() in my opinion, but there's no way to
specify that in the .metadata file currently.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]