[haiku-commits] Re: BRANCH looncraz-github.setviewuicolor [143d6d016198] src/kits/interface src/servers/app headers/os/interface headers/private

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 14 Oct 2015 12:11:23 +0200

On 10/13/2015 11:47 PM, looncraz-github.setviewuicolor wrote:

143d6d016198: Implement BColorSet

Allows a uniform method by which to handle the multi-color update
mechanism more simply as well as accessing system default colors
and current colors very simply.

Made generic enough to be useful for any application and safe for use
in the app_server.

Implements BArchivable, follows general form of BStringList.

This commit includes usage in the app_server.

It took me a bit to understand what this class does/is. In fact it is not a "Set" at all, but an inefficient (O(n^2)) color_which -> rgb_color map which exposes that it is implemented via a list.

Admittedly it sucks that we don't have a public map class in our API, which makes implementing something like this more overhead than necessary. At any rate, I'd recommend to use an actual map (std::map or HashMap) internally and (only if needed!) implement an iteration interface.

CU, Ingo


Other related posts: