[Vala] Purple.CoreUiOps



My brain is melting trying to figure out how to get Purple.CoreUiOps
to initialize.

Here is the vapi:
        [CCode (cheader_filename = "purple.h")]
        [Compact]
        public class CoreUiOps {
                [CCode (has_construct_function = false)]
                public weak GLib.Callback debug_ui_init;
                public weak GLib.Callback get_ui_info;
                public weak GLib.Callback quit;
                public weak GLib.Callback ui_init;
                public weak GLib.Callback ui_prefs_init;
        }

I just tried creating an object:
var ui_ops = new Purple.CoreUiOps();
*error: `Purple.CoreUiOps' does not have a default constructor
    var ui_ops = new Purple.CoreUiOps();*

So I tried another way, which I can't do because its not initialized.
    Purple.CoreUiOps ui_opts;
    ui_opts.debug_ui_init = null;
    ui_opts.get_ui_info = null;
    ui_opts.quit = null;
    ui_opts.ui_init = () => {

    };
    ui_opts.ui_prefs_init = null;

*error: use of possibly unassigned local variable `ui_opts'
    ui_opts.debug_ui_init = null;*

So after some Google'ing i tried:
[Compact]
public class UiOps :  Purple.CoreUiOps {
    public UiOps() {

    }
    public new GLib.Callback debug_ui_init () {

    }
    public new GLib.Callback get_ui_info () {

    }
    public new GLib.Callback quit () {

    }
    public new GLib.Callback ui_init () {

    }
    public new GLib.Callback ui_prefs_init () {

    }
}

The I get the error of:

*error: unable to chain up to private base constructor
    public UiOps() {*


I really have no idea what is wrong. In C it should look like this:
static PurpleCoreUiOps core_uiops =
{
        NULL,
        NULL,
        ui_init,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL
};

I just can't seem to get it to work in Vala. I am sure its something
stupid on my end. I am using vala 0.15.1
-- 
Joseph Montanez
Web Developer
Gorilla3D
Design, Develop, Deploy



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