[Y-devel] libYc-0.2
Casey Winans casey at cwinans.com
Fri Feb 27 17:33:52 GMT 2004
On Thu, 2004-02-26 at 20:33 +0000, Richard Hills wrote:
> To whom it may concern,
> This is pretty much the same as libYc-0.1, but with saner function
> names for the API. Some stuff is still a little broken, such as message
> sending/receiving, but works fine. Installation is basically the same as
> before, and will be difficult until we have a pkg-config thing for Y.
> This version number matches with the version number of Y, which is
> nice. I will try and keep the version of libYc in sync with Y-core in
> future. Anyway, good luck,
>
> Richard Hills
In object.c, the Y_CreateObjectFromClassName function doesn't take into
account the class not being found (Y_FindClassID returning 0), or am I
missing something?
--------------------
Also are you open to creating some alternative functions for wrapper
libraries. I'm writing a C# binding for Y (I haven't added myself to the
Wiki yet) and I'm trying to keep as many C-isms out of my code as
possible such as the object structs.
At the moment I'm using libY and four of its functions: yInitialise,
yFinalise, ySend, yReceive. I currently handle
Here is the listing of functions I'd like to have available to me:
- int Y_ObjectCreate(int classId)
// returns the objectId or 0 if unsuccessful
- char * Y_GetProperty(int objectId, const char *propertyName)
// returns null if unsuccessful
- int Y_SetProperty(int objectId, const char *propertyName, int
propertyValue)
// returns 1 if successful or 0 if not
- int Y_SetProperty(int objectId, const char *propertyName, const char
*propertyValue)
// returns 1 if successful or 0 if not
- int YSignal_Subscribe(int objectID, const char *signalName)
// returns 1 if successful or 0 if not
- int YObject_InvokeMethod(int objectId, const char *methodName, const
char *methodArgs)
// returns 1 if successful or 0 if not and methodArgs may be null
- char * YObject_InvokeMethod(int objectId, const char *methodName,
const char *methodArgs, int expectReturn)
// returns the response's data or null if unsuccessful and methodArgs
may be null
The last one I'm up in the air about. I'm not sure of the best way to go
about do listing for events. Here are two ideas:
(1) char * YSignal_Receive(int objectId)
// returns the response's data (signalName and signalArgs) and updates
the objectId -- this method is synchronous and I'll poll it in its own
thread.
(2) int YSignal_Receive( <a callback with 3 args> )
// execute it when the a signal is fired such as:
"void SignalReceived(int objectId, const char *signalName, const char
*signalArgs)"
I'm not sure how to accomplish this... I've never had to pass a C#
delegate to native code or would I attempt to pass the address as:
YSignal_Receive(ref mySignalReceivingMethod)
Anyone that thinks this is a stupid idea please chime in. I'm very open
to suggestion and I would like all the feedback I can get. Maybe the
perl and python binding guys can offer some insight.
I'll also be releasing my first version once MonoDevelop has been
release so I can just tar up the project files so it's easy to just
untar and open the project in MonoDevelop.
--
Casey Winans
More information about the Y-devel mailing list
2026 © www.Y-Windows.Org - All Rights Reserved