On 24 Apr 2001, Owen Taylor wrote:

> One possibility would be to have libglade support both DTDs. Since
> libglade has ~8300 lines of source, the amount of total bloat wouldn't
> be huge.
>
> (Of course, if libglade is part of the GNOME-2.0 devel platform, and
> it definitely should be, then it also need to meet the end-of-July
> freeze..)

Sounds good to me.  The SAX parser that actually reads the .glade files is
even shorter than that:
    786 ../libglade/glade/glade-sax.c

I assume that if we are going to change the file format, then it will have
a similar format, which should make it fairly easy to switch between two
formats.

As for a new format, my opinion is that the format should be simple (ie.
its DTD should not need to encode the attributes of every widget ever
created).  This is similar to I said during the last DTD debate on this
list :)

It might look something like this:

  <glade-interface xmlns="http://glade.gnome.org/glade-interface-2.0.dtd";>
    <!-- widget class and name are attributes of the widget element.
         id is an ID attr, so must be unique in the interface -->
    <widget class="GtkWindow" id="the-name-of-this-window">
      <!-- widget properties look like this.  Do we want the type attr? -->
      <property name="x" type="gint">60</property>

      <!-- signals look similar to before, but using attributes -->
      <signal name="delete-event"
              handler="on_delete_event"
              object="some-other-object" />
      <!-- object is IDREF, so it must match a widget name.  I don't
           know if you can do IDREF and #implied together though, which
           is what we would want, since object isn't always wanted -->

      <children>
        <widget class="..." id="...">
        </widget>
        ...
      </children>
    </widget>
  </glade-interface>

I am not quite sure what format <property> elements should take.  Is it
worth including type information?  Would the following be better?
  <property name="x"><int val="42" /></property>

I can write a DTD for this format if it would help.  Since we talked about
switching over to libxml2 for glade, I could also write a SAX parser for
the format (if we agree on it).  The parser could then be used in both
glade and libglade.

James.

-- 
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/



_______________________________________________
Glade-devel maillist  -  [EMAIL PROTECTED]
http://lists.helixcode.com/mailman/listinfo/glade-devel

Reply via email to