* There is now a server_read_only_memory structure that is placed in a (surprise!)

read-only area shared between the Desktop and all applications.
* Right now, this area only contains the desktop colors, ie. B_PANEL_BACKGROUND_COLOR
  etc.; ui_color() no longer needs to ask the server for these colors.
* The ui_colors are now maintained by DesktopSettings, though ColorSet is still there.
* The default colors are now hardcoded once and for everyone in InterfaceDefs.h, ie.
  the app_server uses them as well.
* Desktop::Init() can now also return an error (but that is not yet accounted for).
* Cleaned up InterfaceDefs.h.
* Fixed wrong include in moreUTF8.h.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17232 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2006-04-25 20:12:06 +00:00
parent 7225520c09
commit 6d5488e18a
15 changed files with 284 additions and 229 deletions
+5
View File
@@ -11,6 +11,8 @@
#include <Application.h>
struct server_read_only_memory;
class BApplication::Private {
public:
@@ -19,6 +21,9 @@ class BApplication::Private {
static inline BPrivate::ServerMemoryAllocator* ServerAllocator()
{ return be_app->fServerAllocator; }
static inline server_read_only_memory* ServerReadOnlyMemory()
{ return (server_read_only_memory*)be_app->fServerReadOnlyMemory; }
};
#endif // _APPLICATION_PRIVATE_H
+2 -1
View File
@@ -21,7 +21,8 @@ class ServerMemoryAllocator {
status_t InitCheck();
status_t AddArea(area_id serverArea, area_id& _localArea, uint8*& _base);
status_t AddArea(area_id serverArea, area_id& _localArea, uint8*& _base,
bool readOnly = false);
void RemoveArea(area_id serverArea);
status_t AreaAndBaseFor(area_id serverArea, area_id& area, uint8*& base);
@@ -0,0 +1,34 @@
/*
* Copyright 2006, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Axel Dörfler, [email protected]
*/
#ifndef SERVER_READ_ONLY_MEMORY_H
#define SERVER_READ_ONLY_MEMORY_H
#include <GraphicsDefs.h>
#include <InterfaceDefs.h>
static const int32 kNumColors = 32;
struct server_read_only_memory {
rgb_color colors[kNumColors];
};
static inline int32
color_which_to_index(color_which which)
{
if (which <= B_TOOLTIP_TEXT_COLOR)
return which - 1;
if (which >= B_SUCCESS_COLOR && which <= B_FAILURE_COLOR)
return which - B_SUCCESS_COLOR + B_TOOLTIP_TEXT_COLOR;
return -1;
}
#endif /* SERVER_READ_ONLY_MEMORY_H */