Re: [fpc-pascal] D-Bus. Non blocking listening for signals

2011-01-16 Thread dibo20
I found another way to register own callback events (this is example which connect to Pidgin instant messenger): var VTable: DBusObjectPathVTable; function MessageHandler(connection: PDBusConnection; message_: PDBusMessage; user_data: Pointer): DBusHandlerResult; cdecl; begin

Re: [fpc-pascal] D-Bus. Non blocking listening for signals

2011-01-14 Thread dibo20
W dniu 13.01.2011 21:12, Henry Vermaak pisze: On 13 January 2011 19:51,dib...@wp.pl wrote: I'm trying with dbus_connection_set_watch_functions but this is not easy like it look. I thought that I must only register my event procedures by calling this functions but there is much more work. I

Re: [fpc-pascal] D-Bus. Non blocking listening for signals

2011-01-13 Thread dibo20
W dniu 10.01.2011 20:41, Michael Van Canneyt pisze: On Mon, 10 Jan 2011, dib...@wp.pl wrote: Sorry for refreshing, but the problem is still present :( . It works perfect on my mashine (ubuntu 10.10 64 bit) but doesn't work on my friends computer. For example, one of my friend have this same

Re: [fpc-pascal] D-Bus. Non blocking listening for signals

2011-01-13 Thread michael . vancanneyt
On Thu, 13 Jan 2011, dib...@wp.pl wrote: W dniu 10.01.2011 20:41, Michael Van Canneyt pisze: On Mon, 10 Jan 2011, dib...@wp.pl wrote: Sorry for refreshing, but the problem is still present :( . It works perfect on my mashine (ubuntu 10.10 64 bit) but doesn't work on my friends computer.

Re: [fpc-pascal] D-Bus. Non blocking listening for signals

2011-01-13 Thread Henry Vermaak
On 13/01/11 12:24, dib...@wp.pl wrote: Did you receive my mail with demo? I think I found temporary solution. Can you send me the source for this, too? Thanks Henry ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] D-Bus. Non blocking listening for signals

2011-01-13 Thread Matthias Klumpp
On Thu, 13 Jan 2011 13:32:29 +0100 (CET), michael.vancann...@wisa.be wrote: On Thu, 13 Jan 2011, dib...@wp.pl wrote: W dniu 10.01.2011 20:41, Michael Van Canneyt pisze: On Mon, 10 Jan 2011, dib...@wp.pl wrote: Sorry for refreshing, but the problem is still present :( . It works

Re: [fpc-pascal] D-Bus. Non blocking listening for signals

2011-01-13 Thread dibo20
This code work too: TMyObj = class private procedure EventProc(AData: PtrInt; AFlags: dword); end; var Sock: cint; p: PEventHandler; const GLIB_SYSDEF_POLLIN = 1; GLIB_SYSDEF_POLLOUT = 4; GLIB_SYSDEF_POLLPRI = 2; GLIB_SYSDEF_POLLERR = 8; GLIB_SYSDEF_POLLHUP = 16; GLIB_SYSDEF_POLLNVAL = 32;

Re: [fpc-pascal] D-Bus. Non blocking listening for signals

2011-01-13 Thread michael . vancanneyt
On Thu, 13 Jan 2011, Matthias Klumpp wrote: g_main_context_set_poll_func is only used for the GTK widget set. You'll have to test separately with Qt. Hi! I developed the Listaller Project, a cross-distro Linux software manager, which uses techniques like D-BUS and PolicyKit and had very

Re: [fpc-pascal] D-Bus. Non blocking listening for signals

2011-01-13 Thread michael . vancanneyt
On Thu, 13 Jan 2011, dib...@wp.pl wrote: This code work too: TMyObj = class private procedure EventProc(AData: PtrInt; AFlags: dword); end; var Sock: cint; p: PEventHandler; const GLIB_SYSDEF_POLLIN = 1; GLIB_SYSDEF_POLLOUT = 4; GLIB_SYSDEF_POLLPRI = 2; GLIB_SYSDEF_POLLERR = 8;

Re: [fpc-pascal] D-Bus. Non blocking listening for signals

2011-01-13 Thread dibo20
W dniu 13.01.2011 14:41, Matthias Klumpp pisze: Hi! I developed the Listaller Project, a cross-distro Linux software manager, which uses techniques like D-BUS and PolicyKit and had very similar problems. You can run Qt4 applications which use GLib (but only GLib!), but you need to call

Re: [fpc-pascal] D-Bus. Non blocking listening for signals

2011-01-13 Thread dibo20
W dniu 13.01.2011 15:17, michael.vancann...@wisa.be pisze: On Thu, 13 Jan 2011, dib...@wp.pl wrote: This code work too: TMyObj = class private procedure EventProc(AData: PtrInt; AFlags: dword); end; var Sock: cint; p: PEventHandler; const GLIB_SYSDEF_POLLIN = 1; GLIB_SYSDEF_POLLOUT = 4;

Re: [fpc-pascal] D-Bus. Non blocking listening for signals

2011-01-13 Thread Henry Vermaak
On 13/01/11 12:24, dib...@wp.pl wrote: integrate the GLib event loop with an external event loop - I think this is what I want. What you want to do is to integrate the dbus connection into your main loop (in this case glib). Let me quote from the documentation: If you're using GLib or Qt

Re: [fpc-pascal] D-Bus. Non blocking listening for signals

2011-01-13 Thread Henry Vermaak
On 13/01/11 15:00, Henry Vermaak wrote: On 13/01/11 12:24, dib...@wp.pl wrote: integrate the GLib event loop with an external event loop - I think this is what I want. What you want to do is to integrate the dbus connection into your main loop (in this case glib). Let me quote from the

Re: [fpc-pascal] D-Bus. Non blocking listening for signals

2011-01-13 Thread Matthias Klumpp
On Thu, 13 Jan 2011 15:20:47 +0100, dib...@wp.pl wrote: W dniu 13.01.2011 14:41, Matthias Klumpp pisze: Hi! I developed the Listaller Project, a cross-distro Linux software manager, which uses techniques like D-BUS and PolicyKit and had very similar problems. You can run Qt4 applications

Re: [fpc-pascal] D-Bus. Non blocking listening for signals

2011-01-13 Thread dibo20
W dniu 13.01.2011 16:02, Henry Vermaak pisze: On 13/01/11 15:00, Henry Vermaak wrote: On 13/01/11 12:24, dib...@wp.pl wrote: integrate the GLib event loop with an external event loop - I think this is what I want. What you want to do is to integrate the dbus connection into your main loop

Re: [fpc-pascal] D-Bus. Non blocking listening for signals

2011-01-13 Thread Henry Vermaak
On 13 January 2011 19:51, dib...@wp.pl wrote: I'm trying with dbus_connection_set_watch_functions but this is not easy like it look. I thought that I must only register my event procedures by calling this functions but there is much more work. I have a headache. Now I understand why dbus

Re: [fpc-pascal] D-Bus. Non blocking listening for signals

2011-01-13 Thread dibo20
W dniu 13.01.2011 21:12, Henry Vermaak pisze: On 13 January 2011 19:51,dib...@wp.pl wrote: I'm trying with dbus_connection_set_watch_functions but this is not easy like it look. I thought that I must only register my event procedures by calling this functions but there is much more work. I

Re: [fpc-pascal] D-Bus. Non blocking listening for signals

2011-01-10 Thread dibo20
W dniu 02.01.2011 23:21, Michael Van Canneyt pisze: On Sun, 2 Jan 2011, dib...@wp.pl wrote: Hi, Month ago I posted a bug (http://bugs.freepascal.org/view.php?id=18117) Admin give me solution and feedback, but this solution doesn't work well and i think he don't read my last comment. So,

Re: [fpc-pascal] D-Bus. Non blocking listening for signals

2011-01-10 Thread Michael Van Canneyt
On Mon, 10 Jan 2011, dib...@wp.pl wrote: Sorry for refreshing, but the problem is still present :( . It works perfect on my mashine (ubuntu 10.10 64 bit) but doesn't work on my friends computer. For example, one of my friend have this same laptop as me and exactly this same version of

Re: [fpc-pascal] D-Bus. Non blocking listening for signals

2011-01-10 Thread dibo20
W dniu 10.01.2011 20:41, Michael Van Canneyt pisze: On Mon, 10 Jan 2011, dib...@wp.pl wrote: Sorry for refreshing, but the problem is still present :( . It works perfect on my mashine (ubuntu 10.10 64 bit) but doesn't work on my friends computer. For example, one of my friend have this same

Re: [fpc-pascal] D-Bus. Non blocking listening for signals

2011-01-02 Thread Henry Vermaak
On 2 January 2011 18:49, dib...@wp.pl wrote: Hi, Month ago I posted a bug (http://bugs.freepascal.org/view.php?id=18117) Admin give me solution and feedback, but this solution doesn't work well and i think he don't read my last comment. So, maybe someone have this same problem. There is

Re: [fpc-pascal] D-Bus. Non blocking listening for signals

2011-01-02 Thread dibo20
W dniu 02.01.2011 20:11, Henry Vermaak pisze: On 2 January 2011 18:49,dib...@wp.pl wrote: Hi, Month ago I posted a bug (http://bugs.freepascal.org/view.php?id=18117) Admin give me solution and feedback, but this solution doesn't work well and i think he don't read my last comment. So, maybe

Re: [fpc-pascal] D-Bus. Non blocking listening for signals

2011-01-02 Thread Henry Vermaak
On 2 January 2011 19:42, dib...@wp.pl wrote: You may already know this, but it may help to point out that the OnIdle event won't fire if there are no other events.  For example, you'll have to move your mouse or hit the keyboard for the OnIdle event to be called.  I don't know if this will

Re: [fpc-pascal] D-Bus. Non blocking listening for signals

2011-01-02 Thread dibo20
W dniu 02.01.2011 21:36, Henry Vermaak pisze: On 2 January 2011 19:42,dib...@wp.pl wrote: You may already know this, but it may help to point out that the OnIdle event won't fire if there are no other events. For example, you'll have to move your mouse or hit the keyboard for the OnIdle event

Re: [fpc-pascal] D-Bus. Non blocking listening for signals

2011-01-02 Thread Henry Vermaak
On 2 January 2011 21:23, dib...@wp.pl wrote: I had a quick look at the dbus functions.  Perhaps you can use dbus_connection_set_wakeup_main_function to set up a function that wakes up your main loop (containing something like: g_main_context_wakeup(g_main_context_default) for gtk+).  This

Re: [fpc-pascal] D-Bus. Non blocking listening for signals

2011-01-02 Thread Michael Van Canneyt
On Sun, 2 Jan 2011, dib...@wp.pl wrote: Hi, Month ago I posted a bug (http://bugs.freepascal.org/view.php?id=18117) Admin give me solution and feedback, but this solution doesn't work well and i think he don't read my last comment. So, maybe someone have this same problem. There is good