Boost logo

Boost :

Subject: Re: [boost] Thoughts for a GUI (Primitives) Library
From: Yakov Galka (ybungalobill_at_[hidden])
Date: 2010-09-09 12:48:07


On Thu, Sep 9, 2010 at 18:02, Mathias Gaunard
<mathias.gaunard_at_[hidden]>wrote:

> On 08/09/10 16:59, Yakov Galka wrote:
>
> 1) Boost.Asio doesn't support native OS message queue (correct me if I'm
>> wrong).
>> 2) Event handling in GUI is not necessarily asynchronous. It's more on how
>> to design the message passing from one component to the other in an
>> extensible way with some additional requirements.
>>
>
> Boost.Asio has a work queue where you can post arbitrary work.

At least on Windows you must *wait* on the queue in the same thread that
created the window. Also calling the window procedure from a thread
different from the one that window belongs to is looking for trouble.
It *is* possible to extend Boost.Asio to wait simultaneously on the thread
queue and asio's work queue, but it means that you need to introduce
modifications to Asio. Don't get me wrong, I'm not objecting.

On Thu, Sep 9, 2010 at 16:46, Mathias Gaunard
<mathias.gaunard_at_[hidden]>wrote:

> [...]

One slight advantage of UTF-16/UTF-32 is that you could possibly use wide
> string literals to portably input data, if you've got your compiler set up
> correctly, while you cannot do that with regular string literals unless your
> locale is also utf-8 (which isn't possible on windows).
>
> I guess the best choice to make people happy is to allow any range for
> input and deduce the encoding according to the value_type, and return utf-8
> ranges for output.
> Input/output here refers to what you give the API and what the API gives
> back to you.

Sorry, but I can't understand you. If you talk about 'input' done through
the API of the GUI library then it doesn't matter what encoding you choose.
The library will do the conversion to and from the one that's accepted by
the OS (UTF-16 on windows, etc...). If you're talking about some other
'input' then it won't be portable anyway.

On Thu, Sep 9, 2010 at 17:29, Mathias Gaunard
<mathias.gaunard_at_[hidden]>wrote:

> 2. What strings should be used? std::string, std::wstring, custom string
>> like Qt's QString or GTKmm's ustring?
>>
>
> None is the right answer.
> Strings are just ranges of characters, or rather data that encodes such
> characters.
>

Not quite right. Strings are ranges from algorithmic point of view. They are
containers for all other uses.
I prefer to write:
    string caption = window.get_caption();
rather than:
    string caption;
    window.get_caption(back_inserter(caption));

On Thu, Sep 9, 2010 at 16:25, Mathias Gaunard
<mathias.gaunard_at_[hidden]>wrote:

> On 08/09/10 07:55, Yakov Galka wrote:
>
> 3. What about event loop:
>>
>>>
>>> This is the hard part.
>>
>
> What's hard about it?
> We already have a good event loop in Boost.Asio.

The integration into Boost.Asio for example. But it's not really hard. I
just thought about the higher level when I wrote this.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk