3 jun 2007 kl. 06.01 skrev limcore limcore.pl:
Hi,
Forgot to reply here after I replied on Jabber but it might
be
interesting to others as well.
> Hello,
>
> I would like to write a small Jabber client using LM
library.
>
> The problem is - I have existing application with own
main-message-
> loop
> (own gui) and so on.
>
> Best thing for me would be to run LM jabber reciving
client in
> background (thread?) and then use it from time to time
in my
> application
> polling-style:
>
> void PollJabber() {
> if (lm_messages_pending()) {
> std::string msg = lm_get_message_text();
> MyFunctionToDisplayMessage( msg );
> }
> }
>
> and of course to send messages in simmilar matter:
>
> void OnButtonSend() {
> ...
> lm_send_message();
> }
>
>
> How can I do the first part?
>
> Main example, lm-test, creates own main loop (also,
using GTK main
> loop/context things which I dont see applayable to my
application).
You can do this in two ways.
1) Use a separate thread/mainloop for Loudmouth and for
example use
GAsyncQueue to send the
LmMessages to your main thread.
2) Don't setup a mainloop to handle the GMainContext but
instead
iterate it on your own with
g_main_context_iteration.
> Any examples using methode as above?
I haven't got any but there might be some other client that
you might
look at.
> Btw, about the dependency on GTK, which libraries
(dll?) I must ship
> with my application to windows users after
crosscompilation of lm-
> using
> program? Also, can my application be closed source
(non-GPL)?
Loudmouth doesn't depend on GTK+ at all but on GLib. You
application
can be non-GPL as Loudmouth (and GLib) are LGPL.
Cheers,
Mikael Hallendal
--
Imendio AB, http://www.imendio.com
_______________________________________________
Loudmouth mailing list
Loudmouth lists.imendio.com
h
ttp://lists.imendio.com/mailman/listinfo/loudmouth
|