[webkit-dev] GObject Code Generator constants handling code to be added

Luke Kenneth Casson Leighton lkcl at lkcl.net
Wed Jun 10 10:13:03 PDT 2009


On 6/10/09, Leon Winter <lwi at ring0.de> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
>  Hash: SHA1
>
>  Hi,
>
> >>  >  so if you delete the .lo then the build process happily recreates
>  the .o
>  >
>  >>  Actually it was "rm DerivedSources/JS*.lo". Thanks for all your help
>  >>  so far.
>  >
>  >  yaay.
>  >
>  >>  Here is a working XPath sample:
>  >
>  >  yaay!
>  >
>  >
>  >>     res = gdom_document_evaluate(doc, exp, body, resolver, 0, NULL);
>  >
>  >>  Next thing interesting thing would be knowing how to set fifth arg for
>  >>  gdom_document_evaluate which is an enum that controls the output
>  >>  order. As far as I know the enum is not exported via binding so at the
>  >>  moment we have to set this value by hand.
>  >
>  >  ahh, yerrs... hmmm... that will require adding more code to #16401,
>  > which will result in yet more objections as the size of the patch will
>  > increase.  well, tough: it should have been landed months ago.
>  >
>  >  i'll look at a way to find and create some enums.
>  >
>  >  l.
>
> Just for the record, the values can be found here:
>  http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/WebKitDOMRef/XPathResult_idl/Classes/XPathResult/index.html#//apple_ref/js/clconst/XPathResult/ORDERED_NODE_ITERATOR_TYPE

 thank you for helping, leon :)

 they're in the IDL file (in this case, WebCore/xml/XPathResult.idl) :

  module xpath {

    interface [GenerateConstructor, Conditional=XPATH] XPathResult {
        const unsigned short ANY_TYPE                       = 0;
        const unsigned short NUMBER_TYPE                    = 1;
        const unsigned short STRING_TYPE                    = 2;
        const unsigned short BOOLEAN_TYPE                   = 3;
        const unsigned short UNORDERED_NODE_ITERATOR_TYPE   = 4;
        const unsigned short ORDERED_NODE_ITERATOR_TYPE     = 5;
        const unsigned short UNORDERED_NODE_SNAPSHOT_TYPE   = 6;
        const unsigned short ORDERED_NODE_SNAPSHOT_TYPE     = 7;
        const unsigned short ANY_UNORDERED_NODE_TYPE        = 8;
        const unsigned short FIRST_ORDERED_NODE_TYPE        = 9;

        ....

so what is needed is just some quick modifications to the
CodeGeneratorGObject.pm which spits the constants out into the header
file.

does anyone have any suggestions as to the best way to proceed? any
conventions of prefixes that should be added to the constants?  is
there a webkit-preferred convention that should be followed?  is there
a glib / gobject convention that should be followed?

l.


More information about the webkit-dev mailing list