Re: [Vala] Read only members for wrapped libraries
- From: Raffaele Sandrini <raffaele sandrini ch>
- To: Andreas Sliwka <andreas sliwka gmail com>
- Cc: vala-list gnome org
- Subject: Re: [Vala] Read only members for wrapped libraries
- Date: Tue, 26 Feb 2008 19:28:55 +0100
On Tue, 2008-02-26 at 17:39 +0100, Andreas Sliwka wrote:
Greetings,
is it possible decorate a struct or class member in a vapi file so
that vala only allows read access to it?
For example take this excerpt from the SDL/SDL.h file (SDL being a
gamers library):
/* This structure should be treated as read-only, except for 'pixels',
which, if not NULL, contains the raw pixel data for the surface.
*/
typedef struct SDL_Surface {
Uint32 flags; /* Read-only */
SDL_PixelFormat *format; /* Read-only */
int w, h; /* Read-only */
/* etc */
}
I'd like to have vala issue a warning when a new value would be
assigned to any of these attributes.
That is not possible for fields atm.
It would be possible to add attributes to fields on which the compiler
would warn/abort on certain actions to that field.
cheers,
Raffaele
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]