Re: Introspecting Pango





On Thu, Sep 13, 2012 at 8:48 PM, John Ralls <jralls ceridwen us> wrote:

On Sep 13, 2012, at 10:56 AM, Mike  Dupont <jamesmikedupont googlemail com> wrote:

> see this example:
> https://mail.gnome.org/archives/commits-list/2012-August/msg00770.html
>  <type name="TestTypeGUInt64" c:type="RegressTestTypeGUInt64"/>
> it seems that you are missing the name attribute.
> mike
>

Correct. But foo.gir files aren't made by people, they're made by g-ir-scanner.

g-ir-scanner isn't creating the name attribute from the #defines. The question is, what hint (i.e. annotation) to I pass to g-ir-scanner to get it to do the right thing?


I have done some experiments using the latest git.
adapting the annottion.h, the only ones that are generated are those in the namespace and with types from the namespace. hope this helps.
mike

diff --git a/tests/scanner/annotation.h b/tests/scanner/annotation.h
index b3b4bd4..463a4e6 100644
--- a/tests/scanner/annotation.h
+++ b/tests/scanner/annotation.h
@@ -173,6 +173,23 @@ GObject * annotation_transfer_floating(void);
 
 /* This one we can handle properly */
 #define ANNOTATION_CALCULATED_DEFINE (10 * 10)
+#define ANNOTATION_G_GINT64_CONSTANT (INT (1000))
+#define ANNOTATION_G_INT_CONSTANT (INT (1001))
+#define ANNOTATION_G_SOMETHING (FLOAT (1002))
+#define ANNOTATION_G_SOMETHING (FLOAT (1002))
+#define ANNOTATION_G_SOMETHING2 (G_GINT64_CONSTANT (1002))
+
+#define ANNOTATION_G_JUSTDEF 
+#define ANNOTATION_PANGO_GLYPH_UNKNOWN_FLAG    ((PangoGlyph)0x10000000)
+
+struct AnnotationPangoGlyph3
+{
+  int funky;  
+};
+
+#define ANNOTATION_PANGO_GLYPH_UNKNOWN_FLAG3    ((AnnotationPangoGlyph3)0x10000000)
+#define ANNOTATION_PANGO_GLYPH_UNKNOWN_FLAG2    ((GPtrArray)0x10000000)
+
 
 /**
  * ANNOTATION_CALCULATED_LARGE:



mdupont@space-station:~/experiments/introspector/gobject-introspection/tests/scanner$ diff Annotation-1.0.gir Annotation-1.0-expected.gir 
67,71d66
<     <constant name="G_SOMETHING2"
<               value="1002"
<               c:type="ANNOTATION_G_SOMETHING2">
<       <type name="gint64" c:type="gint64"/>
<     </constant>
641,652d635
<       </field>
<     </record>
<     <constant name="PANGO_GLYPH_UNKNOWN_FLAG2"
<               value="268435456"
<               c:type="ANNOTATION_PANGO_GLYPH_UNKNOWN_FLAG2">
<       <array name="GLib.PtrArray" c:type="GPtrArray">
<         <type name="gpointer" c:type="gpointer"/>
<       </array>
<     </constant>
<     <record name="PangoGlyph3" c:type="AnnotationPangoGlyph3">
<       <field name="funky" writable="1">
<         <type name="gint" c:type="int"/>

 
Regards,
John Ralls

> On Tue, Sep 11, 2012 at 8:41 PM, John Ralls <jralls ceridwen us> wrote:
> I'm trying to make Pango introspect on OSX, and The following defines are giving me trouble:
> #define PANGO_GLYPH_EMPTY           ((PangoGlyph)0x0FFFFFFF)
> #define PANGO_GLYPH_INVALID_INPUT   ((PangoGlyph)0xFFFFFFFF)
> #define PANGO_GLYPH_UNKNOWN_FLAG    ((PangoGlyph)0x10000000)
>
> Produce the following in Pango-1.0.gir:
>    <constant name="GLYPH_EMPTY" value="268435455" c:type="PANGO_GLYPH_EMPTY">
>      <type c:type="PangoGlyph"/>
>    </constant>
> Which dependent introspections (including PangoCairo) reject with the following:
> Pango-1.0.gir:40:34: error: Line 40, character 34: The attribute 'name' on the element 'type' must be specified
> error parsing file Pango-1.0.gir: Line 40, character 34: The attribute 'name' on the element 'type' must be specified
> make[4]: *** [Pango-1.0.typelib] Error 1
>
> No doubt there's some magic annotation to fix that, but I can't see it from the annotations page on GnomeLive [1]. What is it?
>
> Regards,
> John Ralls
>
> [1] https://live.gnome.org/GObjectIntrospection/Annotations
>
> _______________________________________________
> gtk-devel-list mailing list
> gtk-devel-list gnome org
> https://mail.gnome.org/mailman/listinfo/gtk-devel-list
>
>
>
> --
> James Michael DuPont
> Member of Free Libre Open Source Software Kosova http://flossk.org
> Saving wikipedia(tm) articles from deletion http://SpeedyDeletion.wikia.com
> Contributor FOSM, the CC-BY-SA map of the world http://fosm.org
> Mozilla Rep https://reps.mozilla.org/u/h4ck3rm1k3
>




--
James Michael DuPont
Member of Free Libre Open Source Software Kosova http://flossk.org
Saving wikipedia(tm) articles from deletion http://SpeedyDeletion.wikia.com
Contributor FOSM, the CC-BY-SA map of the world http://fosm.org
Mozilla Rep https://reps.mozilla.org/u/h4ck3rm1k3



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