Matias, with your typ, I had the idea to make my lower_case_cprefix be
upper case text which worked for me;
so you could try my tip; put your constants in your namespace but put
your methods in a class as static methods, then you can have a
different prefix - or maybe another namespace if you really have to?
So now I managed to get away with this (ok, it's not a glx example)
[CCode (cheader_file = "ntstatus.h", lower_case_cprefix="NT_STATUS_")]
namespace NT_STATUS {
public static NTSTATUS OK;
public static NTSTATUS NO_MEMORY;
public static NTSTATUS INVALID_PARAMETER;
public static NTSTATUS UNSUCCESSFUL;
[SimpleType][Compact]
[CCode (cname="NTSTATUS", cprefix="NT_STATUS_",
default_value="NT_STATUS_OK")]
public struct NTSTATUS {
protected bool IS_OK();
}
}
Sam
* Sam Liddicott wrote, On 15/08/08 15:17:
* Matías De la Puente wrote, On 15/08/08 14:12:
Hi Xavier
I have two ways to put the constants and the functions in the binding:
The first one is put the constants and the functions as they appear in
the header file, GLX_SOMETHING for constants and glXSomenthing for
functions. This can be done if I put this attibute in the namespace:
[CCode (lower_case_cprefix ="", cheader_filename="GL/glx.h")] // No
prefix
The second one is the way you say, but for doing that i have to group
the constants because I can't put in the namespace attribute
lower_case_cprefix="GLX_" because the functions will appear like this:
GLX_glXSomething or GLX_Somenthing and if I put
lower_case_cprefix="glX" the constants will appear like this:
glXSOMETHING or glXGLX_SOMETHING.
The solution for this is to group de constants, but there's a lot of
constants and the documentation that I found don't tell me how can I
groups this contants (including the constants in GL and GLU).
I have the same problem:
[CCode (cheader_file = "ntstatus.h", cprefix="NT_STATUS_")]
namespace NT_STATUS {
[CCode (cname="NT_STATUS_OK")]
public static NTSTATUS OK;
[CCode (cname="NT_STATUS_NO_MEMORY")]
public static NTSTATUS NO_MEMORY;
[CCode (cname="NT_STATUS_INVALID_PARAMETER")]
public static NTSTATUS INVALID_PARAMETER;
[CCode (cname="NT_STATUS_UNSUCCESSFUL")]
public static NTSTATUS UNSUCCESSFUL;
[SimpleType][Compact]
[CCode (cname="NTSTATUS", cprefix="NTSTATUS_",
default_value="NT_STATUS_OK")]
public struct NTSTATUS {
[CCode (cname="NT_STATUS_IS_OK")]
protected bool IS_OK();
}
}
I have to specify a cname for each NTSTATUS value, or it gets a dumb
prefix and comes out as:
nt__status_INVALID_PARAMETER
instead of
NT_STATUS_INVALID_PARAMETER
Sam
_______________________________________________
Vala-list mailing list
Vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list
|