Re: [Vala] Windows Low level with Vala



Hi fsw:

First of all, the only automated way to create vapi files form headers files is with glib based headers. For non-glib based headers you have to write your own. Creating a vapi file is simple, it has the same sintax as a vala file.

I suggest to you that create a vapi file with the windows specific functions that you need. For the visual components use the gtk library for windows.

a simple windows.vapi file could be this one:

[CCode (lower_case_cprefix="", cheader_filename="windows.h")]
namespace Windows
{
     public bool SetupComm (void* handle, uint in_buffer, uint out_buffer);
}

And you can setup the comm port from windows...
To use this vapi file you can use it like this (if windows.vapi is in the same directory than windows_app.vala):

valac windows_app.vala windows.vapi

If windows.vapi is in the vala's vapi directory you can use it like this:

valac windows_app.vala --pkg windows

Matias



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