Axel Simon <axel.si...@ens.fr> writes:

> Hi Andy,
>
> I suspect that you have not added the Makefile rule to create the Type.chs 
> file. Check the other
> bindings such as Cairo for an example.  Note that these rules have changed 
> recently with the
> multi-threading  fixes.
In Makefile.am file, it have below snippets:

------------------------------> snippets start <------------------------------
...
libHSdbus_a_GENERATEDSOURCES =                          \
        dbus/System/DBus/Types.chs

nodist_libHSdbus_a_SOURCES = $(libHSdbus_a_GENERATEDSOURCES)

libHSdbus_a_SOURCES =                                   \
        dbus/System/DBus/GConnection.chs                \
        dbus/System/DBus/GError.chs             \
        dbus/System/DBus/GMessage.chs           \
        dbus/System/DBus/GMethod.chs            \
        dbus/System/DBus/GProxy.chs             \
        dbus/System/DBus/DBus.hs

htmldoc_HSFILES_HIDDEN += $(libHSdbus_a_GENERATEDSOURCES:.chs=.hs)

libHSdbus_a_LIBADD =    \
        dbus/System/DBus/DBus_stub.o

dbus/System/DBus/Types.chs :                    \
        $(srcdir)/tools/hierarchyGen/hierarchy.list \
        $(srcdir)/tools/hierarchyGen/TypeGenerator$(EXEEXT)  \
        $(srcdir)/tools/hierarchyGen/Hierarchy.chs.template
        $(strip $(srcdir)/tools/hierarchyGen/TypeGenerator$(EXEEXT) \
        $(srcdir)/tools/hierarchyGen/hierarchy.list \
        $(srcdir)/tools/hierarchyGen/Hierarchy.chs.template \
        $@ --tag=dbus --lib=dbus --prefix=dbus \
        --modname=System.DBus.Types --import=*System.Glib.GObject)
...    
------------------------------> snippets end   <------------------------------

And i have wrote

  DBusGProxy                    as GProxy, dbus_g_proxy_get_type if dbus
  
in `gtk2hs/tools/hierarchyGen/hierarchy.list` file.

Then gtk2hs will generate Types.chs file for type `DBusGProxy`, and below is
`dbus/System/DBus/Types.chs` file.

Attachment: Types.chs
Description: Binary data

So code "{#import System.DBus.Types#}" in GProxy.chs.pp should works fine, 
because
Types.chs file generate correctly, right?

Because objects in DBus-Glib just derived from GObject, so i just copy
and replace `gconf` in Makefile.am for binding DBus-Glib.
And i have check Cairo example, haven't saw any difference.

I don't understand "these rules have changed recently with the
multi-threading fixes.", can you explain it more detail?

Thanks!

  -- Andy
 
>
> Cheers,
> Axel.
>
> On Dec 8, 2009, at 14:39, Andy Stewart wrote:
>
>> Hi Axel,
>>
>> After finish cross-process embedded test in gtk2hs, so we can build a
>> multi-process program with gtk2hs.
>>
>> And we need a IPC for multi-process communication, and DBus is efficient
>> IPC implement for this.
>>
>> So i try to binding DBus-Glib 0.80 in gtk2hs
>> (http://dbus.freedesktop.org/releases/dbus-glib/dbus-
>> glib-0.80.tar.gz).
>>
>> Below is test patch, haven't finish.
>>
>> <dbuspatch.txt.zip>
>> When i `make` those patch, i got below error:
>> ------------------------------> error start <------------------------------
>> dbus/System/DBus/GProxy.chs.pp:46:0:
>>     Failed to load interface for `System.DBus.Types':
>>       Use -v to see a list of the files searched for.
>> ------------------------------> error end   <------------------------------
>>
>> Looks can't find correct path of System.DBus.Types for GProxy.chs.pp
>> file.
>>
>> And i have check gtk2hs/dbus/System/DBus/GProxy.dep file
>> ------------------------------> GProxy.dep start 
>> <------------------------------
>> # .chs dependencies for dbus/System/DBus/GProxy.chs
>> dbus/System/DBus/GProxy.hs :  dbus/System/DBus/Types.chi glib/
>> System/Glib/GObject.chi
>> ------------------------------> GProxy.dep end   
>> <------------------------------
>> But it generate right `Types` path for GProxy.hs
>>
>> I don't know why my patch can't compile pass, I missing something?
>>
>> Cheers,
>>
>>   -- Andy
>> ----------------------------------------------------------------------
>> --------
>> Return on Information:
>> Google Enterprise Search pays you back
>> Get the facts.
>> http://p.sf.net/sfu/google-dev2dev
>> _______________________________________________
>> Gtk2hs-devel mailing list
>> Gtk2hs-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gtk2hs-devel
------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Gtk2hs-devel mailing list
Gtk2hs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtk2hs-devel

Reply via email to