Re: [gtk-list] Interface declarations



On Tue, 16 Jun 1998, Andreas Kostyrka wrote:

> Hi!
> 
> I've been just wondering if it would be possible, to add the following
> definitions:
> #define PUBLICRO  /* denotes a public member that may be read */
> #define PUBLICRW  /* denotes a public member that may be read and set
>                      directly. */
> 
> Then use it as in:
> struct _GtkLabel
> {
>   GtkMisc misc;
> 
>   PUBLICRO char *label;
>   GSList *row;
>   guint jtype : 2;
>   gint  needs_clear : 1;
> };
> 
> assuming, that only the label field in a GtkLabel field may be read.

Agreed, yes, this sort of information would be very useful, although it
might make sense to go a little bit further, to the item of specifying if
a function can be used to modify the data, maybe something like this:

  #define PUBLICRO
  #define PUBLICRW
  #define SET(func)
  #define GET(func)
  // If SET() or GET() isn't specified, defaults to the member itself

 struct _GtkLabel
 {
   GtkMisc misc;
 
   PUBLICRW char *label SET(gtk_label_set_text);
   GSList *row;
   guint jtype : 2;
   gint  needs_clear : 1;
 };


> -) It makes the lifes of language binding authors (like myself) easier,
>    as one knows in an instant which members need to be wrapped.

Ideally, this information should come from (or go into) the .defs files.

-- 
Kenneth Albanowski (kjahds@kjahds.com, CIS: 70705,126)




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