[Vala] Read only members for wrapped libraries



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.

Best regards,

mfg



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]