How do you bind dispatch_queue_t?

The MuPdf library defines some constants and methods like this;

extern fz_context *ctx;
extern dispatch_queue_t queue;
extern float screenScale;

CGSize fitPageToScreen(CGSize page, CGSize screen);

int search_page(fz_document *doc, int number, char *needle, fz_cookie *cookie);

fz_rect search_result_bbox(fz_document *doc, int i);

CGDataProviderRef CreateWrappedPixmap(fz_pixmap *pix);

CGImageRef CreateCGImageWithPixmap(fz_pixmap *pix, CGDataProviderRef cgdata);

They are used like global variables and methods, but Objective Sharpie convert this file like this:


partial interface Constants
    // extern int * ctx;
    [Field("ctx", "__Internal")]
    unsafe int ctx { get; }

    // extern dispatch_queue_t queue;
    [Field("queue", "__Internal")]
    DispatchQueue queue { get; }

    // extern float screenScale;
    [Field("screenScale", "__Internal")]
    float screenScale { get; }


static class CFunctions
        // extern CGSize fitPageToScreen (CGSize page, CGSize screen);
        [DllImport ("__Internal")]
        //[Verify (PlatformInvoke)]
        static extern CGSize fitPageToScreen (CGSize page, CGSize screen);

        // extern int search_page (int *doc, int number, char *needle, int *cookie);
        [DllImport ("__Internal")]
        //[Verify (PlatformInvoke)]
        static extern unsafe int search_page (int doc, int number, sbyte needle, int cookie);

        // extern int search_result_bbox (int *doc, int i);
        [DllImport ("__Internal")]
        //[Verify (PlatformInvoke)]
        static extern unsafe int search_result_bbox (int doc, int i);

        // extern CGDataProviderRef CreateWrappedPixmap (int *pix);
        [DllImport ("__Internal")]
        //[Verify (PlatformInvoke)]
        static extern unsafe CGDataProvider CreateWrappedPixmap (int pix);

        // extern CGImageRef CreateCGImageWithPixmap (int *pix, CGDataProviderRef cgdata);
        [DllImport ("__Internal")]
        //[Verify (PlatformInvoke)]
        static extern unsafe CGImage CreateCGImageWithPixmap (int pix, CGDataProvider cgdata);

DispatchQueue is not working as expected.
"BTOUCH: Error BI1014: btouch: Unsupported type for Fields: global::CoreFoundation.DispatchQueue (BI1014)"

And All the mentioned methods showing iside the struct.cs file.

I am not able to create binding library. Help will be appriciate.


Sign In or Register to comment.