Re: [gtk-list] Re: Interface declarations




I don't think making a mess of the headers is the solution.  I'd 
like to see plain readable C code when I'm looking at the header 
files. 

Previously it was suggested that too much of the data is exported
and this creates problems with binary compatibility, etc.  (No good
way to hide new things, etc.)  It was suggested we do something 
like:

struct _GtkLabel
{
  GtkMisc parent;
 
  /* Read Only Attributes */
  ...

  gpointer private; /* Internal, non exported data structure */
}

In the *.c files then private would be defined and the struct
it points to would not be exported.

struct _GtkLabelPrivate {
    ...
}

The only things which we sould see in the structs would be status 
information.  Setting and some reading of things should be done 
via functions.  This doesn't seem like a big stretch from what
we have now...

Mostly this would be to allow better compatibility between future
versions, but plays into this area as well I think.

-Shawn

On 16 Jun 1998, Marius Vollmer wrote:

> Kenneth Albanowski <kjahds@kjahds.com> writes:
> 
> > 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:
> 
> Before this gets out of hand and I'd like to suggest to first come up
> with a robust and extensible syntax, like the GCC __attribute__
> mechanism.  Of course, I'm thinking primarily about LISP here:
> 
>     #define GTK_ATTRIBUTE(x)
> 
>     struct _GtkLabel
>     {
>       GtkMisc misc;
> 
>       char *label GTK_ATTRIBUTE ((public)
>                                  (mode read-write)
>                                  (set gtk_label_set_text));
>       GSList *row;
>       guint jtype : 2;
>       gint  needs_clear : 1;
>     };
> 
> > Ideally, this information should come from (or go into) the .defs files.
> 
> My original plan was of course that it comes *from* the .defs file.
> But I now see the adavantages of maintaining that information in the C
> sources itself.  People will be more aware of it and are more likely
> to keep it correct.  Hmm...
> 
> -- 
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null
> 
> 

--
Shawn T. Amundson               
amundson@gimp.org               http://www.gimp.org/~amundson

"The assumption that the universe looks the same in every
 direction is clearly not true in reality." - Stephen Hawking



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