xref: /haiku/headers/private/app/ServerReadOnlyMemory.h (revision 3e216965baa8d58a67bf7372e2bfa13d999f5a9d)
1 /*
2  * Copyright 2006, Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Axel Dörfler, axeld@pinc-software.de
7  */
8 #ifndef SERVER_READ_ONLY_MEMORY_H
9 #define SERVER_READ_ONLY_MEMORY_H
10 
11 
12 #include <GraphicsDefs.h>
13 #include <InterfaceDefs.h>
14 
15 
16 static const int32 kNumColors = 32;
17 
18 struct server_read_only_memory {
19 	rgb_color	colors[kNumColors];
20 };
21 
22 
23 static inline int32
24 color_which_to_index(color_which which)
25 {
26 	// NOTE: this must be kept in sync with InterfaceDefs.h color_which!
27 	if (which <= B_WINDOW_INACTIVE_TEXT_COLOR)
28 		return which - 1;
29 	if (which >= B_SUCCESS_COLOR && which <= B_FAILURE_COLOR)
30 		return which - B_SUCCESS_COLOR + B_WINDOW_INACTIVE_TEXT_COLOR;
31 
32 	return -1;
33 }
34 
35 #endif	/* SERVER_READ_ONLY_MEMORY_H */
36