1a3b25e4fSDarkWyrm/*
2f0650dc9Slooncraz * Copyright 2001-2015, Haiku.
3a3b25e4fSDarkWyrm * Distributed under the terms of the MIT License.
4a3b25e4fSDarkWyrm *
5a3b25e4fSDarkWyrm * Authors:
6a3b25e4fSDarkWyrm *		DarkWyrm <bpmagic@columbus.rr.com>
7a3b25e4fSDarkWyrm *		Stephan A��mus <superstippi@gmx.de>
8f6d52cb7SRene Gollent *		Rene Gollent <rene@gollent.com>
9f0650dc9Slooncraz *		Joseph Groover <looncraz@looncraz.net>
10a3b25e4fSDarkWyrm */
11a3b25e4fSDarkWyrm
123e30da29SJohn Scipione
13a3b25e4fSDarkWyrm#include <stdio.h>
14d36235a2SAdrien Destugues#include <Catalog.h>
15e11b156dSPhilippe Saint-Pierre#include <DefaultColors.h>
16d36235a2SAdrien Destugues#include <Directory.h>
17d36235a2SAdrien Destugues#include <Entry.h>
18d36235a2SAdrien Destugues#include <File.h>
19a3b25e4fSDarkWyrm#include <InterfaceDefs.h>
20d36235a2SAdrien Destugues#include <Locale.h>
21a3b25e4fSDarkWyrm#include <Message.h>
22e11b156dSPhilippe Saint-Pierre#include <ServerReadOnlyMemory.h>
23a3b25e4fSDarkWyrm#include <String.h>
24f0650dc9Slooncraz#include "Colors.h"
25a3b25e4fSDarkWyrm
263e30da29SJohn Scipione
27546208a5SOliver Tappe#undef B_TRANSLATION_CONTEXT
28546208a5SOliver Tappe#define B_TRANSLATION_CONTEXT "Colors tab"
29a3b25e4fSDarkWyrm
303e30da29SJohn Scipione
31429ae1b1SJohn Scipionestatic ColorDescription sColorDescriptionTable[] = {
32c31c1fefSMatt Madia	{ B_PANEL_BACKGROUND_COLOR, B_TRANSLATE_MARK("Panel background") },
33c31c1fefSMatt Madia	{ B_PANEL_TEXT_COLOR, B_TRANSLATE_MARK("Panel text") },
34c31c1fefSMatt Madia	{ B_DOCUMENT_BACKGROUND_COLOR, B_TRANSLATE_MARK("Document background") },
35c31c1fefSMatt Madia	{ B_DOCUMENT_TEXT_COLOR, B_TRANSLATE_MARK("Document text") },
36c31c1fefSMatt Madia	{ B_CONTROL_BACKGROUND_COLOR, B_TRANSLATE_MARK("Control background") },
37c31c1fefSMatt Madia	{ B_CONTROL_TEXT_COLOR, B_TRANSLATE_MARK("Control text") },
38c31c1fefSMatt Madia	{ B_CONTROL_BORDER_COLOR, B_TRANSLATE_MARK("Control border") },
39c31c1fefSMatt Madia	{ B_CONTROL_HIGHLIGHT_COLOR, B_TRANSLATE_MARK("Control highlight") },
404bb5af76SJohn Scipione	{ B_CONTROL_MARK_COLOR, B_TRANSLATE_MARK("Control mark") },
41c31c1fefSMatt Madia	{ B_NAVIGATION_BASE_COLOR, B_TRANSLATE_MARK("Navigation base") },
42c31c1fefSMatt Madia	{ B_NAVIGATION_PULSE_COLOR, B_TRANSLATE_MARK("Navigation pulse") },
43c31c1fefSMatt Madia	{ B_SHINE_COLOR, B_TRANSLATE_MARK("Shine") },
44c31c1fefSMatt Madia	{ B_SHADOW_COLOR, B_TRANSLATE_MARK("Shadow") },
45f0650dc9Slooncraz	{ B_LINK_TEXT_COLOR, B_TRANSLATE_MARK("Link text") },
46f0650dc9Slooncraz	{ B_LINK_HOVER_COLOR, B_TRANSLATE_MARK("Link hover") },
47f0650dc9Slooncraz	{ B_LINK_VISITED_COLOR, B_TRANSLATE_MARK("Link visited") },
48f0650dc9Slooncraz	{ B_LINK_ACTIVE_COLOR, B_TRANSLATE_MARK("Link active") },
49c31c1fefSMatt Madia	{ B_MENU_BACKGROUND_COLOR, B_TRANSLATE_MARK("Menu background") },
50c31c1fefSMatt Madia	{ B_MENU_SELECTED_BACKGROUND_COLOR,
51c31c1fefSMatt Madia		B_TRANSLATE_MARK("Selected menu item background") },
52c31c1fefSMatt Madia	{ B_MENU_ITEM_TEXT_COLOR, B_TRANSLATE_MARK("Menu item text") },
53c31c1fefSMatt Madia	{ B_MENU_SELECTED_ITEM_TEXT_COLOR,
54c31c1fefSMatt Madia		B_TRANSLATE_MARK("Selected menu item text") },
55c31c1fefSMatt Madia	{ B_MENU_SELECTED_BORDER_COLOR,
56c31c1fefSMatt Madia		B_TRANSLATE_MARK("Selected menu item border") },
5791c78f09SJohn Scipione	{ B_LIST_BACKGROUND_COLOR, B_TRANSLATE_MARK("List background") },
5891c78f09SJohn Scipione	{ B_LIST_SELECTED_BACKGROUND_COLOR,
5991c78f09SJohn Scipione		B_TRANSLATE_MARK("Selected list item background") },
6091c78f09SJohn Scipione	{ B_LIST_ITEM_TEXT_COLOR, B_TRANSLATE_MARK("List item text") },
6191c78f09SJohn Scipione	{ B_LIST_SELECTED_ITEM_TEXT_COLOR,
6291c78f09SJohn Scipione		B_TRANSLATE_MARK("Selected list item text") },
639f24981aSJohn Scipione	{ B_SCROLL_BAR_THUMB_COLOR,
649f24981aSJohn Scipione		B_TRANSLATE_MARK("Scroll bar thumb") },
65c31c1fefSMatt Madia	{ B_TOOL_TIP_BACKGROUND_COLOR, B_TRANSLATE_MARK("Tooltip background") },
66c31c1fefSMatt Madia	{ B_TOOL_TIP_TEXT_COLOR, B_TRANSLATE_MARK("Tooltip text") },
6780bc632aSAugustin Cavalier	{ B_STATUS_BAR_COLOR, B_TRANSLATE_MARK("Status bar") },
68c31c1fefSMatt Madia	{ B_SUCCESS_COLOR, B_TRANSLATE_MARK("Success") },
69c31c1fefSMatt Madia	{ B_FAILURE_COLOR, B_TRANSLATE_MARK("Failure") },
70c31c1fefSMatt Madia	{ B_WINDOW_TAB_COLOR, B_TRANSLATE_MARK("Window tab") },
71c31c1fefSMatt Madia	{ B_WINDOW_TEXT_COLOR, B_TRANSLATE_MARK("Window tab text") },
72c31c1fefSMatt Madia	{ B_WINDOW_INACTIVE_TAB_COLOR, B_TRANSLATE_MARK("Inactive window tab") },
73c31c1fefSMatt Madia	{ B_WINDOW_INACTIVE_TEXT_COLOR,
7430d17caaSJohn Scipione		B_TRANSLATE_MARK("Inactive window tab text") },
7530d17caaSJohn Scipione	{ B_WINDOW_BORDER_COLOR, B_TRANSLATE_MARK("Window border") },
7630d17caaSJohn Scipione	{ B_WINDOW_INACTIVE_BORDER_COLOR,
7730d17caaSJohn Scipione		B_TRANSLATE_MARK("Inactive window border") }
78b3c05fb6SMichael Pfeiffer};
79b3c05fb6SMichael Pfeiffer
80d36235a2SAdrien Destuguesconst int32 sColorDescriptionCount = sizeof(sColorDescriptionTable)
81d36235a2SAdrien Destugues	/ sizeof(ColorDescription);
82b3c05fb6SMichael Pfeiffer
83429ae1b1SJohn Scipione
840bd0875dSAxel Dörflerconst ColorDescription*
85b3c05fb6SMichael Pfeifferget_color_description(int32 index)
86b3c05fb6SMichael Pfeiffer{
87b3c05fb6SMichael Pfeiffer	if (index < 0 || index >= sColorDescriptionCount)
88b3c05fb6SMichael Pfeiffer		return NULL;
89b3c05fb6SMichael Pfeiffer	return &sColorDescriptionTable[index];
90b3c05fb6SMichael Pfeiffer}
91b3c05fb6SMichael Pfeiffer
923e30da29SJohn Scipione
93b3c05fb6SMichael Pfeifferint32
94b3c05fb6SMichael Pfeiffercolor_description_count(void)
95b3c05fb6SMichael Pfeiffer{
96b3c05fb6SMichael Pfeiffer	return sColorDescriptionCount;
976eb01296SRyan Leavengood}
986eb01296SRyan Leavengood
99429ae1b1SJohn Scipione
100f0650dc9Slooncrazvoid
101f0650dc9Slooncrazget_default_colors(BMessage* message)
102a3b25e4fSDarkWyrm{
103f0650dc9Slooncraz	if (message == NULL)
104f0650dc9Slooncraz		return;
1053e30da29SJohn Scipione
106f0650dc9Slooncraz	for (int32 index = 0; index < kColorWhichCount; ++index) {
107f0650dc9Slooncraz		color_which which = index_to_color_which(index);
108f0650dc9Slooncraz		message->AddColor(ui_color_name(which),
109f0650dc9Slooncraz			BPrivate::kDefaultColors[index]);
110e11b156dSPhilippe Saint-Pierre	}
111a3b25e4fSDarkWyrm}
112a3b25e4fSDarkWyrm
1130bd0875dSAxel Dörfler
114b3c05fb6SMichael Pfeiffervoid
115f0650dc9Slooncrazget_current_colors(BMessage* message)
116a3b25e4fSDarkWyrm{
117f0650dc9Slooncraz	if (message == NULL)
118f0650dc9Slooncraz		return;
119a3b25e4fSDarkWyrm
120f0650dc9Slooncraz	for (int32 index = 0; index < kColorWhichCount; ++index) {
121f0650dc9Slooncraz		color_which which = index_to_color_which(index);
122f0650dc9Slooncraz		message->AddColor(ui_color_name(which), ui_color(which));
123f0650dc9Slooncraz	}
124a3b25e4fSDarkWyrm}
125f0650dc9Slooncraz
126