[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fwd: DBusKit HelloWorldService Example
From: |
Niels Grewe |
Subject: |
Fwd: DBusKit HelloWorldService Example |
Date: |
Sat, 5 Apr 2014 17:33:04 +0000 |
Sorry, forgot to CC the list...
Anfang der weitergeleiteten Nachricht:
> Von: Niels Grewe <address@hidden>
> Betreff: Aw: DBusKit HelloWorldService Example
> Datum: 5. April 2014 18:42:08 MESZ
> An: <address@hidden>
>
> Hi Sven,
>
> Am 01.04.2014 um 08:04 schrieb address@hidden:
>
>> Hi List,
>>
>> I am new to DBusKit and would like to fully understand it.
>> The HelloWorldService sample main.m includes these lines:
>>
>> // WARNING: This is not a public API. Don't use it.
>> [p _setObject: obj atPath: @"/eu/numberfour/installer/p"];
>> id pProxy = [p _objectPathNodeAtPath: @"/eu/numberfour/installer/p"];
>> [pProxy _loadIntrospectionFromFile: @"N4InstallerService.xml"];
>>
>> How should they be correctly written without private API usage?
>> I would like to understand the DBusKit but the provided documentation is too
>> sketchy for me
>
> Yes, the documentation on exporting objects is virtually nonexistent. It’s a
> new feature for 0.2 and there will be documentation when that release is
> ready. But as a short answer: The public API is not quite ready yet. The one
> that you are supposed to be using in the future is -[NSConnection
> setObject:atPath:]. You can already call that method right now, but the
> automatic introspection loading mechanism is not completed yet, so you will
> end up with a proxy that does not respond to any method invocations. The
> introspection loader is supposed to do the following until it succeeds
>
> 1. If implemented, call -introspectionDataForDBus on the object being proxied
> and use that to construct the D-Bus interfaces.
> 2. From the bundle implementing the class, try to load a ${Class}.xml file
> and use that to construct the interfaces if available. Also do the same for
> any protocols implemented by the class.
> 3. Dynamically generate introspection data for all methods mentioned in the
> GSPermittedMessages user default (this is also used by GSServicesManager)
>
> Basically, the 2. is what you would usually do: You implement a FooService
> class to be exported via D-Bus, and just stick a FooService.xml resource into
> the app bundle and whenever you export such an object, it will just work.
> Option 1. would be for when you need to customize the exported methods on the
> fly and 3. is meant for quick prototyping of bus interfaces. I’ll keep you
> updates as to when this is ready...
>
> Cheers,
>
> Niels