Board.KolibriOS.org

Official KolibriOS board
It is currently Tue Jan 26, 2021 5:45 am

All times are UTC+03:00




Post new topic  Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Mon May 25, 2015 9:47 pm 
Offline

Joined: Tue Sep 29, 2009 10:48 pm
Posts: 11
Заранее извиняюсь за глупые вопросы. Пишу небольшой xmpp-клиент, слегка просел на получении сообщений. Собственно, окно для сообщений делаю отдельным потоком. Как я понял, эвент network получает именно родительский поток, а не дочерний. Есть ли какой-нибудь вариант чтоб его проверяли сразу оба потока (ну или хоть IPC, хотя имхо костыль будет)? Или проще сделать одно окно ростер+сообщения и не парить себе мозг? Просто не слишком хочется переносить куски логики для сообщений в логику ростера, да и скайпообразный интерфейс не слишком нравится.

И второй вопрос по box_lib. Ввиду отсутствия половины манов тыкаю наугад, есть ли способ чтоб text_edit выглядел не слишком вырвиглазо? Вид TinyPad намного лучше, но там рисование идет вручную.

upd.: и еще про отладку - умеет ли mtdbg с потоками работать?


Top
   
PostPosted: Mon May 25, 2015 10:26 pm 
Offline
Mentor/Kernel Developer
User avatar

Joined: Fri Jun 30, 2006 9:01 am
Posts: 1279
Welcome to the forums,

Unfortunately, I could not understand all your questions (google translate's Russian is bad, and my own is even worse.)
Threads and processes in KolibriOS are the same thing, so it's not possible to have one process with multiple threads as in linux/windows.
Socket functions only work properly in the thread where the socket was opened.

If you don't need multiple windows, it might be best to use non-blocking sockets, and run everything in one thread.
Perhaps you can borrow some code of the IRC client for your XMPP experiments.

Good luck!

_________________
"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein


Top
   
PostPosted: Mon May 25, 2015 10:34 pm 
Offline

Joined: Tue Sep 29, 2009 10:48 pm
Posts: 11
thx, so it's better to use 1 thread/window. That's a bit sad but ok, i was trying to make it with multiple windows like pidgin or old skype.

the second question was about t_edit from box_lib. Because of lack of docs i'm just poking it randomly, and the question was is there any way to make it look a bit better. TinyPad looks good, but it uses pure canvas drawing (and i'm afraid that'd be too much for me to handle).

the third question was about mtdbg and threads, but since i'll try to convert everything into 1 thread, it doesn't matter now.


Top
   
PostPosted: Mon May 25, 2015 10:51 pm 
Offline
Mentor/Kernel Developer
User avatar

Joined: Fri Jun 30, 2006 9:01 am
Posts: 1279
It's certainly possible to run with multiple windows later. But I would use only one thread for the first version(s), for simplicity.

For box lib, there is the text and html documentation in source code tree. (http://websvn.kolibrios.org/listing.php ... box_lib%2F)
There is also this page on the wiki: http://wiki.kolibrios.org/wiki/Box_lib/ru and countless examples on SVN ofcourse.

Please, bare in mind that textbox in box_lib has no multi-line support. (That's why I wrote my own multi-line, multi-color, read-only text box in IRC client.)

I'm not sure about thread support in MTDBG, so will not answer that question at this point.

_________________
"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein


Last edited by hidnplayr on Mon May 25, 2015 11:04 pm, edited 1 time in total.

Top
   
PostPosted: Mon May 25, 2015 11:00 pm 
Offline

Joined: Tue Sep 29, 2009 10:48 pm
Posts: 11
The man i'm using for t_edit is the one from svn. Not the best one, maybe, but still useful, at least it's possible to use source if in doubt. Also, it's t_edit, not editbox, so it can handle multiline, and its input can be easily pruned down to arrows/ctrl+c. The only problem is how it looks :( Actually, right now sending messages works ok (or 90% ok).

About windows - is there any way to make second window in one process? Or it's just 1 process == 1 window?


Top
   
PostPosted: Mon May 25, 2015 11:06 pm 
Offline
Mentor/Kernel Developer
User avatar

Joined: Fri Jun 30, 2006 9:01 am
Posts: 1279
Oh okay. I have not worked with t_edit so cannot help you with that, but it should work with multiline indeed.

There is only one window per process possible. Unfortunately.

_________________
"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein


Top
   
PostPosted: Mon May 25, 2015 11:10 pm 
Offline

Joined: Tue Sep 29, 2009 10:48 pm
Posts: 11
ok, thx for help :) maybe i'll still try ipc, like if one logic chain fails to parse the query, it just calls yet another logic chain over ipc.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 7 posts ] 

All times are UTC+03:00


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited