Updated style to come pretty close to matching OT style guidelines

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19158 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
DarkWyrm
2006-10-30 23:58:30 +00:00
parent a3b25e4ff0
commit 3d5da9f46c
12 changed files with 281 additions and 527 deletions
+11 -30
View File
@@ -1,43 +1,24 @@
//------------------------------------------------------------------------------ /*
// Copyright (c) 2001-2002, OpenBeOS * Copyright 2002-2006, Haiku. All rights reserved.
// * Distributed under the terms of the MIT License.
// Permission is hereby granted, free of charge, to any person obtaining a *
// copy of this software and associated documentation files (the "Software"), * Authors:
// to deal in the Software without restriction, including without limitation * DarkWyrm ([email protected])
// the rights to use, copy, modify, merge, publish, distribute, sublicense, */
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// File Name: APRMain.cpp
// Author: DarkWyrm <[email protected]>
// Description: Main file for Appearance
//
//
//------------------------------------------------------------------------------
#include "APRMain.h" #include "APRMain.h"
#include "APRWindow.h" #include "APRWindow.h"
#include <stdio.h> #include <stdio.h>
#include "defs.h" #include "defs.h"
APRApplication::APRApplication(void) APRApplication::APRApplication(void)
: BApplication(APPEARANCE_APP_SIGNATURE) : BApplication(APPEARANCE_APP_SIGNATURE)
{ {
fWindow=new APRWindow( BRect(100,100,540,390) ); fWindow = new APRWindow(BRect(100,100,540,390));
fWindow->Show(); fWindow->Show();
} }
int main(int, char**) int
main(int, char**)
{ {
APRApplication myApplication; APRApplication myApplication;
myApplication.Run(); myApplication.Run();
+9 -29
View File
@@ -1,32 +1,12 @@
//------------------------------------------------------------------------------ /*
// Copyright (c) 2001-2002, OpenBeOS * Copyright 2002-2006, Haiku. All rights reserved.
// * Distributed under the terms of the MIT License.
// Permission is hereby granted, free of charge, to any person obtaining a *
// copy of this software and associated documentation files (the "Software"), * Authors:
// to deal in the Software without restriction, including without limitation * DarkWyrm ([email protected])
// the rights to use, copy, modify, merge, publish, distribute, sublicense, */
// and/or sell copies of the Software, and to permit persons to whom the #ifndef APR_MAIN_H
// Software is furnished to do so, subject to the following conditions: #define APR_MAIN_H
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// File Name: APRMain.h
// Author: DarkWyrm <[email protected]>
// Description: Main header for Appearance
//
//
//------------------------------------------------------------------------------
#ifndef APR_WORLD_H
#define APR_WORLD_H
#include <Application.h> #include <Application.h>
+100 -127
View File
@@ -1,33 +1,10 @@
//------------------------------------------------------------------------------ /*
// Copyright (c) 2001-2002, OpenBeOS * Copyright 2002-2006, Haiku. All rights reserved.
// * Distributed under the terms of the MIT License.
// Permission is hereby granted, free of charge, to any person obtaining a *
// copy of this software and associated documentation files (the "Software"), * Authors:
// to deal in the Software without restriction, including without limitation * DarkWyrm ([email protected])
// the rights to use, copy, modify, merge, publish, distribute, sublicense, */
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// File Name: APRView.cpp
// Author: DarkWyrm <[email protected]>
// Description: color handler for the app
//
// Handles all the grunt work. Color settings are stored in a BMessage to
// allow for easy transition to and from disk. The messy details are in the
// hard-coded strings to translate the enumerated color_which defines to
// strings and such, but even those should be easy to maintain.
//------------------------------------------------------------------------------
#include <OS.h> #include <OS.h>
#include <Directory.h> #include <Directory.h>
#include <Alert.h> #include <Alert.h>
@@ -59,160 +36,157 @@ APRView::APRView(const BRect &frame, const char *name, int32 resize, int32 flags
{ {
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
// Set up list of color attributes // Set up list of color fAttributes
BRect rect(10,10,200,85); BRect rect(10,10,200,85);
attrlist = new BListView(rect,"AttributeList"); fAttrList = new BListView(rect,"AttributeList");
scrollview = new BScrollView("ScrollView",attrlist, B_FOLLOW_LEFT | B_FOLLOW_TOP, fScrollView = new BScrollView("ScrollView",fAttrList, B_FOLLOW_LEFT | B_FOLLOW_TOP,
0, false, true); 0, false, true);
AddChild(scrollview); AddChild(fScrollView);
scrollview->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); fScrollView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
attrlist->SetSelectionMessage(new BMessage(ATTRIBUTE_CHOSEN)); fAttrList->SetSelectionMessage(new BMessage(ATTRIBUTE_CHOSEN));
attrlist->AddItem(new ColorWhichItem(B_PANEL_BACKGROUND_COLOR)); fAttrList->AddItem(new ColorWhichItem(B_PANEL_BACKGROUND_COLOR));
attrlist->AddItem(new ColorWhichItem((color_which)B_PANEL_TEXT_COLOR)); fAttrList->AddItem(new ColorWhichItem((color_which)B_PANEL_TEXT_COLOR));
attrlist->AddItem(new ColorWhichItem((color_which)B_DOCUMENT_BACKGROUND_COLOR)); fAttrList->AddItem(new ColorWhichItem((color_which)B_DOCUMENT_BACKGROUND_COLOR));
attrlist->AddItem(new ColorWhichItem((color_which)B_DOCUMENT_TEXT_COLOR)); fAttrList->AddItem(new ColorWhichItem((color_which)B_DOCUMENT_TEXT_COLOR));
attrlist->AddItem(new ColorWhichItem((color_which)B_CONTROL_BACKGROUND_COLOR)); fAttrList->AddItem(new ColorWhichItem((color_which)B_CONTROL_BACKGROUND_COLOR));
attrlist->AddItem(new ColorWhichItem((color_which)B_CONTROL_TEXT_COLOR)); fAttrList->AddItem(new ColorWhichItem((color_which)B_CONTROL_TEXT_COLOR));
attrlist->AddItem(new ColorWhichItem((color_which)B_CONTROL_BORDER_COLOR)); fAttrList->AddItem(new ColorWhichItem((color_which)B_CONTROL_BORDER_COLOR));
attrlist->AddItem(new ColorWhichItem((color_which)B_CONTROL_HIGHLIGHT_COLOR)); fAttrList->AddItem(new ColorWhichItem((color_which)B_CONTROL_HIGHLIGHT_COLOR));
attrlist->AddItem(new ColorWhichItem((color_which)B_NAVIGATION_BASE_COLOR)); fAttrList->AddItem(new ColorWhichItem((color_which)B_NAVIGATION_BASE_COLOR));
attrlist->AddItem(new ColorWhichItem((color_which)B_NAVIGATION_PULSE_COLOR)); fAttrList->AddItem(new ColorWhichItem((color_which)B_NAVIGATION_PULSE_COLOR));
attrlist->AddItem(new ColorWhichItem((color_which)B_SHINE_COLOR)); fAttrList->AddItem(new ColorWhichItem((color_which)B_SHINE_COLOR));
attrlist->AddItem(new ColorWhichItem((color_which)B_SHADOW_COLOR)); fAttrList->AddItem(new ColorWhichItem((color_which)B_SHADOW_COLOR));
attrlist->AddItem(new ColorWhichItem(B_MENU_BACKGROUND_COLOR)); fAttrList->AddItem(new ColorWhichItem(B_MENU_BACKGROUND_COLOR));
attrlist->AddItem(new ColorWhichItem((color_which)B_MENU_SELECTED_BACKGROUND_COLOR)); fAttrList->AddItem(new ColorWhichItem((color_which)B_MENU_SELECTED_BACKGROUND_COLOR));
attrlist->AddItem(new ColorWhichItem(B_MENU_ITEM_TEXT_COLOR)); fAttrList->AddItem(new ColorWhichItem(B_MENU_ITEM_TEXT_COLOR));
attrlist->AddItem(new ColorWhichItem(B_MENU_SELECTED_ITEM_TEXT_COLOR)); fAttrList->AddItem(new ColorWhichItem(B_MENU_SELECTED_ITEM_TEXT_COLOR));
attrlist->AddItem(new ColorWhichItem((color_which)B_MENU_SELECTED_BORDER_COLOR)); fAttrList->AddItem(new ColorWhichItem((color_which)B_MENU_SELECTED_BORDER_COLOR));
attrlist->AddItem(new ColorWhichItem((color_which)B_TOOLTIP_BACKGROUND_COLOR)); fAttrList->AddItem(new ColorWhichItem((color_which)B_TOOLTIP_BACKGROUND_COLOR));
attrlist->AddItem(new ColorWhichItem((color_which)B_SUCCESS_COLOR)); fAttrList->AddItem(new ColorWhichItem((color_which)B_SUCCESS_COLOR));
attrlist->AddItem(new ColorWhichItem((color_which)B_FAILURE_COLOR)); fAttrList->AddItem(new ColorWhichItem((color_which)B_FAILURE_COLOR));
attrlist->AddItem(new ColorWhichItem(B_WINDOW_TAB_COLOR)); fAttrList->AddItem(new ColorWhichItem(B_WINDOW_TAB_COLOR));
attrlist->AddItem(new ColorWhichItem((color_which)B_WINDOW_TAB_TEXT_COLOR)); fAttrList->AddItem(new ColorWhichItem((color_which)B_WINDOW_TAB_TEXT_COLOR));
attrlist->AddItem(new ColorWhichItem((color_which)B_INACTIVE_WINDOW_TAB_COLOR)); fAttrList->AddItem(new ColorWhichItem((color_which)B_INACTIVE_WINDOW_TAB_COLOR));
attrlist->AddItem(new ColorWhichItem((color_which)B_INACTIVE_WINDOW_TAB_TEXT_COLOR)); fAttrList->AddItem(new ColorWhichItem((color_which)B_INACTIVE_WINDOW_TAB_TEXT_COLOR));
BRect wellrect(0,0,50,50); BRect wellrect(0,0,50,50);
wellrect.OffsetTo(rect.right + 30, rect.top + wellrect.OffsetTo(rect.right + 30, rect.top +
(scrollview->Bounds().Height() - wellrect.Height())/2 ); (fScrollView->Bounds().Height() - wellrect.Height())/2 );
colorwell = new ColorWell(wellrect,new BMessage(COLOR_DROPPED),true); fColorWell = new ColorWell(wellrect,new BMessage(COLOR_DROPPED),true);
AddChild(colorwell); AddChild(fColorWell);
// Center the list and color well // Center the list and color well
rect = scrollview->Frame(); rect = fScrollView->Frame();
rect.right = wellrect.right; rect.right = wellrect.right;
rect.OffsetTo((Bounds().Width()-rect.Width())/2,rect.top); rect.OffsetTo((Bounds().Width()-rect.Width())/2,rect.top);
picker = new BColorControl(BPoint(10,scrollview->Frame().bottom+20),B_CELLS_32x8,5.0,"Picker", fPicker = new BColorControl(BPoint(10,fScrollView->Frame().bottom+20),B_CELLS_32x8,5.0,"fPicker",
new BMessage(UPDATE_COLOR)); new BMessage(UPDATE_COLOR));
AddChild(picker); AddChild(fPicker);
defaults = new BButton(BRect(0,0,1,1),"DefaultsButton","Defaults", fDefaults = new BButton(BRect(0,0,1,1),"DefaultsButton","Defaults",
new BMessage(DEFAULT_SETTINGS), new BMessage(DEFAULT_SETTINGS),
B_FOLLOW_LEFT |B_FOLLOW_TOP, B_WILL_DRAW | B_NAVIGABLE); B_FOLLOW_LEFT |B_FOLLOW_TOP, B_WILL_DRAW | B_NAVIGABLE);
defaults->ResizeToPreferred(); fDefaults->ResizeToPreferred();
defaults->MoveTo((picker->Frame().right-(defaults->Frame().Width()*2)-20)/2,picker->Frame().bottom+20); fDefaults->MoveTo((fPicker->Frame().right-(fDefaults->Frame().Width()*2)-20)/2,fPicker->Frame().bottom+20);
AddChild(defaults); AddChild(fDefaults);
BRect cvrect(defaults->Frame()); BRect cvrect(fDefaults->Frame());
cvrect.OffsetBy(cvrect.Width() + 20,0); cvrect.OffsetBy(cvrect.Width() + 20,0);
revert = new BButton(cvrect,"RevertButton","Revert", fRevert = new BButton(cvrect,"RevertButton","Revert",
new BMessage(REVERT_SETTINGS), new BMessage(REVERT_SETTINGS),
B_FOLLOW_LEFT |B_FOLLOW_TOP, B_WILL_DRAW | B_NAVIGABLE); B_FOLLOW_LEFT |B_FOLLOW_TOP, B_WILL_DRAW | B_NAVIGABLE);
AddChild(revert); AddChild(fRevert);
revert->SetEnabled(false); fRevert->SetEnabled(false);
} }
APRView::~APRView(void) APRView::~APRView(void)
{ {
ColorSet::SaveColorSet("/boot/home/config/settings/app_server/system_colors",currentset); ColorSet::SaveColorSet("/boot/home/config/settings/app_server/system_colors",fCurrentSet);
} }
void APRView::AttachedToWindow(void) void
APRView::AttachedToWindow(void)
{ {
picker->SetTarget(this); fPicker->SetTarget(this);
attrlist->SetTarget(this); fAttrList->SetTarget(this);
defaults->SetTarget(this); fDefaults->SetTarget(this);
revert->SetTarget(this); fRevert->SetTarget(this);
colorwell->SetTarget(this); fColorWell->SetTarget(this);
picker->SetValue(currentset.StringToColor(attrstring.String())); fPicker->SetValue(fCurrentSet.StringToColor(fAttrString.String()));
Window()->ResizeTo(MAX(picker->Frame().right,picker->Frame().right) + 10, Window()->ResizeTo(MAX(fPicker->Frame().right,fPicker->Frame().right) + 10,
defaults->Frame().bottom + 10); fDefaults->Frame().bottom + 10);
LoadSettings(); LoadSettings();
attrlist->Select(0); fAttrList->Select(0);
} }
void APRView::MessageReceived(BMessage *msg) void
APRView::MessageReceived(BMessage *msg)
{ {
if(msg->WasDropped()) if(msg->WasDropped()) {
{
rgb_color *col; rgb_color *col;
ssize_t size; ssize_t size;
if(msg->FindData("RGBColor",(type_code)'RGBC',(const void**)&col,&size)==B_OK)
{ if(msg->FindData("RGBColor",(type_code)'RGBC',(const void**)&col,&size)==B_OK) {
picker->SetValue(*col); fPicker->SetValue(*col);
colorwell->SetColor(*col); fColorWell->SetColor(*col);
colorwell->Invalidate(); fColorWell->Invalidate();
} }
} }
switch(msg->what) switch(msg->what) {
{ case UPDATE_COLOR: {
case UPDATE_COLOR: // Received from the color fPicker when its color changes
{
// Received from the color picker when its color changes
rgb_color col=picker->ValueAsColor(); rgb_color col=fPicker->ValueAsColor();
colorwell->SetColor(col); fColorWell->SetColor(col);
colorwell->Invalidate(); fColorWell->Invalidate();
// Update current attribute in the settings // Update current fAttribute in the settings
currentset.SetColor(attrstring.String(),col); fCurrentSet.SetColor(fAttrString.String(),col);
revert->SetEnabled(true); fRevert->SetEnabled(true);
break; break;
} }
case ATTRIBUTE_CHOSEN: case ATTRIBUTE_CHOSEN: {
{ // Received when the user chooses a GUI fAttribute from the list
// Received when the user chooses a GUI attribute from the list
ColorWhichItem *whichitem = (ColorWhichItem*)attrlist->ItemAt( attrlist->CurrentSelection() ); ColorWhichItem *whichitem = (ColorWhichItem*)
fAttrList->ItemAt(fAttrList->CurrentSelection());
if(!whichitem) if(!whichitem)
break; break;
attrstring=whichitem->Text(); fAttrString=whichitem->Text();
UpdateControlsFromAttr(whichitem->Text()); UpdateControlsFromAttr(whichitem->Text());
break; break;
} }
case REVERT_SETTINGS: case REVERT_SETTINGS: {
{ fCurrentSet=fPrevSet;
currentset=prevset; UpdateControlsFromAttr(fAttrString.String());
UpdateControlsFromAttr(attrstring.String());
revert->SetEnabled(false); fRevert->SetEnabled(false);
break; break;
} }
case DEFAULT_SETTINGS: case DEFAULT_SETTINGS: {
{ fCurrentSet.SetToDefaults();
currentset.SetToDefaults();
UpdateControlsFromAttr(attrstring.String()); UpdateControlsFromAttr(fAttrString.String());
break; break;
} }
default: default:
@@ -227,16 +201,15 @@ void APRView::LoadSettings(void)
// getting them from the server at this point for testing purposes. // getting them from the server at this point for testing purposes.
// Query the server for the current settings // Query the server for the current settings
//BPrivate::get_system_colors(&currentset); //BPrivate::get_system_colors(&fCurrentSet);
// TODO: remove this and enable the get_system_colors() call // TODO: remove this and enable the get_system_colors() call
if(ColorSet::LoadColorSet("/boot/home/config/settings/app_server/system_colors",&currentset)!=B_OK) if(ColorSet::LoadColorSet("/boot/home/config/settings/app_server/system_colors",&fCurrentSet)!=B_OK) {
{ fCurrentSet.SetToDefaults();
currentset.SetToDefaults(); ColorSet::SaveColorSet("/boot/home/config/settings/app_server/system_colors",fCurrentSet);
ColorSet::SaveColorSet("/boot/home/config/settings/app_server/system_colors",currentset);
} }
prevset = currentset; fPrevSet = fCurrentSet;
} }
void APRView::UpdateControlsFromAttr(const char *string) void APRView::UpdateControlsFromAttr(const char *string)
@@ -245,7 +218,7 @@ void APRView::UpdateControlsFromAttr(const char *string)
return; return;
STRACE(("Update color for %s\n",string)); STRACE(("Update color for %s\n",string));
picker->SetValue(currentset.StringToColor(string)); fPicker->SetValue(fCurrentSet.StringToColor(string));
colorwell->SetColor(picker->ValueAsColor()); fColorWell->SetColor(fPicker->ValueAsColor());
colorwell->Invalidate(); fColorWell->Invalidate();
} }
+17 -36
View File
@@ -1,29 +1,10 @@
//------------------------------------------------------------------------------ /*
// Copyright (c) 2001-2002, OpenBeOS * Copyright 2002-2006, Haiku. All rights reserved.
// * Distributed under the terms of the MIT License.
// Permission is hereby granted, free of charge, to any person obtaining a *
// copy of this software and associated documentation files (the "Software"), * Authors:
// to deal in the Software without restriction, including without limitation * DarkWyrm ([email protected])
// the rights to use, copy, modify, merge, publish, distribute, sublicense, */
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// File Name: APRView.cpp
// Author: DarkWyrm <[email protected]>
// Description: color handler for the app
//
//------------------------------------------------------------------------------
#ifndef APR_VIEW_H_ #ifndef APR_VIEW_H_
#define APR_VIEW_H_ #define APR_VIEW_H_
@@ -62,23 +43,23 @@ protected:
void UpdateControlsFromAttr(const char *string); void UpdateControlsFromAttr(const char *string);
BColorControl *picker; BColorControl *fPicker;
BButton *revert; BButton *fRevert;
BButton *defaults; BButton *fDefaults;
BListView *attrlist; BListView *fAttrList;
color_which attribute; color_which fAttribute;
BString attrstring; BString fAttrString;
BScrollView *scrollview; BScrollView *fScrollView;
ColorWell *colorwell; ColorWell *fColorWell;
ColorSet currentset; ColorSet fCurrentSet;
ColorSet prevset; ColorSet fPrevSet;
}; };
#endif #endif
+13 -32
View File
@@ -1,45 +1,26 @@
//------------------------------------------------------------------------------ /*
// Copyright (c) 2001-2002, OpenBeOS * Copyright 2002-2006, Haiku. All rights reserved.
// * Distributed under the terms of the MIT License.
// Permission is hereby granted, free of charge, to any person obtaining a *
// copy of this software and associated documentation files (the "Software"), * Authors:
// to deal in the Software without restriction, including without limitation * DarkWyrm ([email protected])
// the rights to use, copy, modify, merge, publish, distribute, sublicense, */
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// File Name: APRWindow.cpp
// Author: DarkWyrm <[email protected]>
// Description: basic Window class for Appearance
//
//
//------------------------------------------------------------------------------
#include <Messenger.h> #include <Messenger.h>
#include "APRWindow.h" #include "APRWindow.h"
#include "APRView.h" #include "APRView.h"
#include "defs.h" #include "defs.h"
#include <TabView.h>
APRWindow::APRWindow(BRect frame) APRWindow::APRWindow(BRect frame)
: BWindow(frame, "Appearance", B_TITLED_WINDOW, : BWindow(frame, "Appearance", B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE,
B_NOT_RESIZABLE | B_NOT_ZOOMABLE, B_ALL_WORKSPACES ) B_ALL_WORKSPACES )
{ {
APRView *colorview=new APRView(Bounds(),"Colors",B_FOLLOW_ALL, B_WILL_DRAW); APRView *colorview = new APRView(Bounds(),"Colors",B_FOLLOW_ALL, B_WILL_DRAW);
AddChild(colorview); AddChild(colorview);
} }
bool APRWindow::QuitRequested() bool
APRWindow::QuitRequested(void)
{ {
be_app->PostMessage(B_QUIT_REQUESTED); be_app->PostMessage(B_QUIT_REQUESTED);
return(true); return(true);
+7 -27
View File
@@ -1,30 +1,10 @@
//------------------------------------------------------------------------------ /*
// Copyright (c) 2001-2002, OpenBeOS * Copyright 2002-2006, Haiku. All rights reserved.
// * Distributed under the terms of the MIT License.
// Permission is hereby granted, free of charge, to any person obtaining a *
// copy of this software and associated documentation files (the "Software"), * Authors:
// to deal in the Software without restriction, including without limitation * DarkWyrm ([email protected])
// the rights to use, copy, modify, merge, publish, distribute, sublicense, */
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// File Name: APRWindow.h
// Author: DarkWyrm <[email protected]>
// Description: basic Window class for Appearance
//
//
//------------------------------------------------------------------------------
#ifndef APR_WINDOW_H #ifndef APR_WINDOW_H
#define APR_WINDOW_H #define APR_WINDOW_H
+31 -60
View File
@@ -7,8 +7,6 @@
* Stephan Aßmus <[email protected]> * Stephan Aßmus <[email protected]>
*/ */
/** Class for encapsulating GUI system colors */
#include <stdio.h> #include <stdio.h>
#include <InterfaceDefs.h> #include <InterfaceDefs.h>
#include <Message.h> #include <Message.h>
@@ -18,7 +16,6 @@
#include <String.h> #include <String.h>
#include "ColorSet.h" #include "ColorSet.h"
static void static void
set_rgb_color(rgb_color& color, uint8 red, uint8 green, uint8 blue) set_rgb_color(rgb_color& color, uint8 red, uint8 green, uint8 blue)
{ {
@@ -325,8 +322,7 @@ rgb_color
ColorSet::StringToColor(const char *string) ColorSet::StringToColor(const char *string)
{ {
rgb_color *col=StringToMember(string); rgb_color *col=StringToMember(string);
if(!col) if(!col) {
{
rgb_color c; rgb_color c;
return c; return c;
} }
@@ -403,117 +399,95 @@ ColorSet::StringToMember(const char *string)
rgb_color rgb_color
ColorSet::AttributeToColor(int32 which) ColorSet::AttributeToColor(int32 which)
{ {
switch(which) switch(which) {
{ case B_PANEL_BACKGROUND_COLOR: {
case B_PANEL_BACKGROUND_COLOR:
{
return panel_background; return panel_background;
break; break;
} }
#ifndef HAIKU_TARGET_PLATFORM_BEOS #ifndef HAIKU_TARGET_PLATFORM_BEOS
case B_PANEL_TEXT_COLOR: case B_PANEL_TEXT_COLOR: {
{
return panel_text; return panel_text;
break; break;
} }
case B_DOCUMENT_BACKGROUND_COLOR: case B_DOCUMENT_BACKGROUND_COLOR: {
{
return document_background; return document_background;
break; break;
} }
case B_DOCUMENT_TEXT_COLOR: case B_DOCUMENT_TEXT_COLOR: {
{
return document_text; return document_text;
break; break;
} }
case B_CONTROL_BACKGROUND_COLOR: case B_CONTROL_BACKGROUND_COLOR: {
{
return control_background; return control_background;
break; break;
} }
case B_CONTROL_TEXT_COLOR: case B_CONTROL_TEXT_COLOR: {
{
return control_text; return control_text;
break; break;
} }
case B_CONTROL_BORDER_COLOR: case B_CONTROL_BORDER_COLOR: {
{
return control_border; return control_border;
break; break;
} }
case B_CONTROL_HIGHLIGHT_COLOR: case B_CONTROL_HIGHLIGHT_COLOR: {
{
return control_highlight; return control_highlight;
break; break;
} }
case B_NAVIGATION_BASE_COLOR: case B_NAVIGATION_BASE_COLOR: {
{
return keyboard_navigation_base; return keyboard_navigation_base;
break; break;
} }
case B_NAVIGATION_PULSE_COLOR: case B_NAVIGATION_PULSE_COLOR: {
{
return keyboard_navigation_pulse; return keyboard_navigation_pulse;
break; break;
} }
case B_SHINE_COLOR: case B_SHINE_COLOR: {
{
return shine; return shine;
break; break;
} }
case B_SHADOW_COLOR: case B_SHADOW_COLOR: {
{
return shadow; return shadow;
break; break;
} }
case B_MENU_SELECTED_BACKGROUND_COLOR: case B_MENU_SELECTED_BACKGROUND_COLOR: {
{
return menu_selected_background; return menu_selected_background;
break; break;
} }
case B_MENU_SELECTED_BORDER_COLOR: case B_MENU_SELECTED_BORDER_COLOR: {
{
return menu_selected_border; return menu_selected_border;
break; break;
} }
case B_TOOLTIP_BACKGROUND_COLOR: case B_TOOLTIP_BACKGROUND_COLOR: {
{
return tooltip_background; return tooltip_background;
break; break;
} }
case B_TOOLTIP_TEXT_COLOR: case B_TOOLTIP_TEXT_COLOR: {
{
return tooltip_text; return tooltip_text;
break; break;
} }
case B_SUCCESS_COLOR: case B_SUCCESS_COLOR: {
{
return success; return success;
break; break;
} }
case B_FAILURE_COLOR: case B_FAILURE_COLOR: {
{
return failure; return failure;
break; break;
} }
#endif #endif
case B_MENU_BACKGROUND_COLOR: case B_MENU_BACKGROUND_COLOR: {
{
return menu_background; return menu_background;
break; break;
} }
case B_MENU_ITEM_TEXT_COLOR: case B_MENU_ITEM_TEXT_COLOR: {
{
return menu_text; return menu_text;
break; break;
} }
case B_MENU_SELECTED_ITEM_TEXT_COLOR: case B_MENU_SELECTED_ITEM_TEXT_COLOR: {
{
return menu_selected_text; return menu_selected_text;
break; break;
} }
case B_WINDOW_TAB_COLOR: case B_WINDOW_TAB_COLOR: {
{
return window_tab; return window_tab;
break; break;
} }
@@ -521,24 +495,20 @@ ColorSet::AttributeToColor(int32 which)
// DANGER! DANGER, WILL ROBINSON!! // DANGER! DANGER, WILL ROBINSON!!
// These are magic numbers to work around compatibility difficulties while still keeping // These are magic numbers to work around compatibility difficulties while still keeping
// functionality. This __will__ break following R1 // functionality. This __will__ break following R1
case 22: case 22: {
{
return window_tab_text; return window_tab_text;
break; break;
} }
case 23: case 23: {
{
return inactive_window_tab; return inactive_window_tab;
break; break;
} }
case 24: case 24: {
{
return inactive_window_tab_text; return inactive_window_tab_text;
break; break;
} }
default: default: {
{
rgb_color c; rgb_color c;
return c; return c;
break; break;
@@ -549,7 +519,8 @@ ColorSet::AttributeToColor(int32 which)
void void
ColorSet::PrintMember(const rgb_color &color) const ColorSet::PrintMember(const rgb_color &color) const
{ {
printf("rgb_color(%d, %d, %d, %d)", color.red,color.green,color.blue,color.alpha); printf("rgb_color(%d, %d, %d, %d)",color.red,color.green,color.blue,
color.alpha);
} }
+32 -50
View File
@@ -1,33 +1,14 @@
//------------------------------------------------------------------------------ /*
// Copyright (c) 2001-2002, OpenBeOS * Copyright 2002-2006, Haiku. All rights reserved.
// * Distributed under the terms of the MIT License.
// Permission is hereby granted, free of charge, to any person obtaining a *
// copy of this software and associated documentation files (the "Software"), * Authors:
// to deal in the Software without restriction, including without limitation * DarkWyrm ([email protected])
// the rights to use, copy, modify, merge, publish, distribute, sublicense, */
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// File Name: ColorWell.cpp
// Author: DarkWyrm <[email protected]>
// Description: Color display class which accepts drops
//
//------------------------------------------------------------------------------
#include "ColorWell.h" #include "ColorWell.h"
ColorWell::ColorWell(BRect frame, BMessage *msg, bool is_rectangle=false) ColorWell::ColorWell(BRect frame, BMessage *msg, bool is_rectangle)
: BView(frame,"ColorWell", B_FOLLOW_LEFT|B_FOLLOW_TOP, B_WILL_DRAW) : BView(frame,"ColorWell", B_FOLLOW_LEFT|B_FOLLOW_TOP, B_WILL_DRAW)
{ {
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
SetLowColor(0,0,0); SetLowColor(0,0,0);
@@ -45,42 +26,43 @@ ColorWell::~ColorWell(void)
delete invoker; delete invoker;
} }
void ColorWell::SetTarget(BHandler *tgt) void
ColorWell::SetTarget(BHandler *tgt)
{ {
invoker->SetTarget(tgt); invoker->SetTarget(tgt);
} }
void ColorWell::SetColor(rgb_color col) void
ColorWell::SetColor(rgb_color col)
{ {
SetHighColor(col); SetHighColor(col);
currentcol=col; currentcol=col;
Draw(Bounds()); Draw(Bounds());
// Invalidate();
invoker->Invoke(); invoker->Invoke();
} }
void ColorWell::SetColor(uint8 r,uint8 g, uint8 b) void
ColorWell::SetColor(uint8 r,uint8 g, uint8 b)
{ {
SetHighColor(r,g,b); SetHighColor(r,g,b);
currentcol.red=r; currentcol.red=r;
currentcol.green=g; currentcol.green=g;
currentcol.blue=b; currentcol.blue=b;
Draw(Bounds()); Draw(Bounds());
//Invalidate();
invoker->Invoke(); invoker->Invoke();
} }
void ColorWell::MessageReceived(BMessage *msg) void
ColorWell::MessageReceived(BMessage *msg)
{ {
// If we received a dropped message, try to see if it has color data // If we received a dropped message, try to see if it has color data
// in it // in it
if(msg->WasDropped()) if(msg->WasDropped()) {
{
rgb_color *col; rgb_color *col;
uint8 *ptr; uint8 *ptr;
ssize_t size; ssize_t size;
if(msg->FindData("RGBColor",(type_code)'RGBC',(const void**)&ptr,&size)==B_OK) if(msg->FindData("RGBColor",(type_code)'RGBC',
{ (const void**)&ptr,&size)==B_OK) {
col=(rgb_color*)ptr; col=(rgb_color*)ptr;
SetHighColor(*col); SetHighColor(*col);
} }
@@ -90,27 +72,26 @@ void ColorWell::MessageReceived(BMessage *msg)
BView::MessageReceived(msg); BView::MessageReceived(msg);
} }
void ColorWell::SetEnabled(bool value) void
ColorWell::SetEnabled(bool value)
{ {
if(is_enabled!=value) if(is_enabled!=value) {
{
is_enabled=value; is_enabled=value;
Invalidate(); Invalidate();
} }
} }
void ColorWell::Draw(BRect update) void
ColorWell::Draw(BRect update)
{ {
if(is_enabled) if(is_enabled)
SetHighColor(currentcol); SetHighColor(currentcol);
else else
SetHighColor(disabledcol); SetHighColor(disabledcol);
if(is_rect) if(is_rect) {
{
FillRect(Bounds()); FillRect(Bounds());
if(is_enabled) if(is_enabled) {
{
BRect r(Bounds()); BRect r(Bounds());
SetHighColor(184,184,184); SetHighColor(184,184,184);
StrokeRect(r); StrokeRect(r);
@@ -129,20 +110,21 @@ void ColorWell::Draw(BRect update)
} }
} }
else else {
{
FillEllipse(Bounds()); FillEllipse(Bounds());
if(is_enabled) if(is_enabled)
StrokeEllipse(Bounds(),B_SOLID_LOW); StrokeEllipse(Bounds(),B_SOLID_LOW);
} }
} }
rgb_color ColorWell::Color(void) const rgb_color
ColorWell::Color(void) const
{ {
return currentcol; return currentcol;
} }
void ColorWell::SetMode(bool is_rectangle) void
ColorWell::SetMode(bool is_rectangle)
{ {
is_rect=is_rectangle; is_rect=is_rectangle;
} }
+7 -26
View File
@@ -1,29 +1,10 @@
//------------------------------------------------------------------------------ /*
// Copyright (c) 2001-2002, OpenBeOS * Copyright 2002-2006, Haiku. All rights reserved.
// * Distributed under the terms of the MIT License.
// Permission is hereby granted, free of charge, to any person obtaining a *
// copy of this software and associated documentation files (the "Software"), * Authors:
// to deal in the Software without restriction, including without limitation * DarkWyrm ([email protected])
// the rights to use, copy, modify, merge, publish, distribute, sublicense, */
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// File Name: ColorWell.h
// Author: DarkWyrm <[email protected]>
// Description: Color display class which accepts drops
//
//------------------------------------------------------------------------------
#ifndef COLORWELL_H_ #ifndef COLORWELL_H_
#define COLORWELL_H_ #define COLORWELL_H_
+39 -83
View File
@@ -1,34 +1,15 @@
//------------------------------------------------------------------------------ /*
// Copyright (c) 2001-2002, OpenBeOS * Copyright 2002-2006, Haiku. All rights reserved.
// * Distributed under the terms of the MIT License.
// Permission is hereby granted, free of charge, to any person obtaining a *
// copy of this software and associated documentation files (the "Software"), * Authors:
// to deal in the Software without restriction, including without limitation * DarkWyrm ([email protected])
// the rights to use, copy, modify, merge, publish, distribute, sublicense, */
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// File Name: ColorWhichItem.cpp
// Author: DarkWyrm <[email protected]>
// Description: ListItem class for managing color_which specifiers
//
//------------------------------------------------------------------------------
#include "ColorWhichItem.h" #include "ColorWhichItem.h"
#include <stdio.h> #include <stdio.h>
ColorWhichItem::ColorWhichItem(color_which which) ColorWhichItem::ColorWhichItem(color_which which)
: BStringItem(NULL,0,false) : BStringItem(NULL,0,false)
{ {
SetAttribute(which); SetAttribute(which);
} }
@@ -38,163 +19,137 @@ ColorWhichItem::~ColorWhichItem(void)
// Empty, but exists for just-in-case // Empty, but exists for just-in-case
} }
void ColorWhichItem::SetAttribute(color_which which) void
ColorWhichItem::SetAttribute(color_which which)
{ {
switch(which) switch(which) {
{
// cases not existing in R5 which exist in OpenBeOS // cases not existing in R5 which exist in OpenBeOS
case B_PANEL_BACKGROUND_COLOR: case B_PANEL_BACKGROUND_COLOR: {
{
attribute=which; attribute=which;
SetText("Panel Background"); SetText("Panel Background");
break; break;
} }
case B_PANEL_TEXT_COLOR: case B_PANEL_TEXT_COLOR: {
{
attribute=which; attribute=which;
SetText("Panel Text"); SetText("Panel Text");
break; break;
} }
case B_DOCUMENT_BACKGROUND_COLOR: case B_DOCUMENT_BACKGROUND_COLOR: {
{
attribute=which; attribute=which;
SetText("Document Background"); SetText("Document Background");
break; break;
} }
case B_DOCUMENT_TEXT_COLOR: case B_DOCUMENT_TEXT_COLOR: {
{
attribute=which; attribute=which;
SetText("Document Text"); SetText("Document Text");
break; break;
} }
case B_CONTROL_BACKGROUND_COLOR: case B_CONTROL_BACKGROUND_COLOR: {
{
attribute=which; attribute=which;
SetText("Control Background"); SetText("Control Background");
break; break;
} }
case B_CONTROL_TEXT_COLOR: case B_CONTROL_TEXT_COLOR: {
{
attribute=which; attribute=which;
SetText("Control Text"); SetText("Control Text");
break; break;
} }
case B_CONTROL_BORDER_COLOR: case B_CONTROL_BORDER_COLOR: {
{
attribute=which; attribute=which;
SetText("Control Border"); SetText("Control Border");
break; break;
} }
case B_CONTROL_HIGHLIGHT_COLOR: case B_CONTROL_HIGHLIGHT_COLOR: {
{
attribute=which; attribute=which;
SetText("Control Highlight"); SetText("Control Highlight");
break; break;
} }
case B_TOOLTIP_BACKGROUND_COLOR: case B_TOOLTIP_BACKGROUND_COLOR: {
{
attribute=which; attribute=which;
SetText("Tooltip Background"); SetText("Tooltip Background");
break; break;
} }
case B_TOOLTIP_TEXT_COLOR: case B_TOOLTIP_TEXT_COLOR: {
{
attribute=which; attribute=which;
SetText("Tooltip Text"); SetText("Tooltip Text");
break; break;
} }
case B_MENU_BACKGROUND_COLOR: case B_MENU_BACKGROUND_COLOR: {
{
attribute=which; attribute=which;
SetText("Menu Background"); SetText("Menu Background");
break; break;
} }
case B_MENU_SELECTION_BACKGROUND_COLOR: case B_MENU_SELECTION_BACKGROUND_COLOR: {
{
attribute=which; attribute=which;
SetText("Selected Menu Item Background"); SetText("Selected Menu Item Background");
break; break;
} }
case B_MENU_ITEM_TEXT_COLOR: case B_MENU_ITEM_TEXT_COLOR: {
{
attribute=which; attribute=which;
SetText("Menu Item Text"); SetText("Menu Item Text");
break; break;
} }
case B_MENU_SELECTED_ITEM_TEXT_COLOR: case B_MENU_SELECTED_ITEM_TEXT_COLOR: {
{
attribute=which; attribute=which;
SetText("Selected Menu Item Text"); SetText("Selected Menu Item Text");
break; break;
} }
case B_MENU_SELECTED_BORDER_COLOR: case B_MENU_SELECTED_BORDER_COLOR: {
{
attribute=which; attribute=which;
SetText("Selected Menu Item Border"); SetText("Selected Menu Item Border");
break; break;
} }
case B_NAVIGATION_BASE_COLOR: case B_NAVIGATION_BASE_COLOR: {
{
attribute=which; attribute=which;
SetText("Navigation Base"); SetText("Navigation Base");
break; break;
} }
case B_NAVIGATION_PULSE_COLOR: case B_NAVIGATION_PULSE_COLOR: {
{
attribute=which; attribute=which;
SetText("Navigation Pulse"); SetText("Navigation Pulse");
break; break;
} }
case B_SUCCESS_COLOR: case B_SUCCESS_COLOR: {
{
attribute=which; attribute=which;
SetText("Success"); SetText("Success");
break; break;
} }
case B_FAILURE_COLOR: case B_FAILURE_COLOR: {
{
attribute=which; attribute=which;
SetText("Failure"); SetText("Failure");
break; break;
} }
case B_SHINE_COLOR: case B_SHINE_COLOR: {
{
attribute=which; attribute=which;
SetText("Shine"); SetText("Shine");
break; break;
} }
case B_SHADOW_COLOR: case B_SHADOW_COLOR: {
{
attribute=which; attribute=which;
SetText("Shadow"); SetText("Shadow");
break; break;
} }
case B_WINDOW_TAB_COLOR: case B_WINDOW_TAB_COLOR: {
{
attribute=which; attribute=which;
SetText("Window Tab"); SetText("Window Tab");
break; break;
} }
case B_WINDOW_TAB_TEXT_COLOR: case B_WINDOW_TAB_TEXT_COLOR: {
{
attribute=which; attribute=which;
SetText("Window Tab Text"); SetText("Window Tab Text");
break; break;
} }
case B_INACTIVE_WINDOW_TAB_COLOR: case B_INACTIVE_WINDOW_TAB_COLOR: {
{
attribute=which; attribute=which;
SetText("Inactive Window Tab"); SetText("Inactive Window Tab");
break; break;
} }
case B_INACTIVE_WINDOW_TAB_TEXT_COLOR: case B_INACTIVE_WINDOW_TAB_TEXT_COLOR: {
{
attribute=which; attribute=which;
SetText("Inactive Window Tab Text"); SetText("Inactive Window Tab Text");
break; break;
} }
default: default: {
{
printf("unknown code '%c%c%c%c'\n",(char)((which & 0xFF000000) >> 24), printf("unknown code '%c%c%c%c'\n",(char)((which & 0xFF000000) >> 24),
(char)((which & 0x00FF0000) >> 16), (char)((which & 0x00FF0000) >> 16),
(char)((which & 0x0000FF00) >> 8), (char)((which & 0x0000FF00) >> 8),
@@ -204,7 +159,8 @@ void ColorWhichItem::SetAttribute(color_which which)
} }
} }
color_which ColorWhichItem::GetAttribute(void) color_which
ColorWhichItem::GetAttribute(void)
{ {
return attribute; return attribute;
} }
+7 -26
View File
@@ -1,29 +1,10 @@
//------------------------------------------------------------------------------ /*
// Copyright (c) 2001-2002, OpenBeOS * Copyright 2001-2006, Haiku.
// * Distributed under the terms of the MIT License.
// Permission is hereby granted, free of charge, to any person obtaining a *
// copy of this software and associated documentation files (the "Software"), * Authors:
// to deal in the Software without restriction, including without limitation * DarkWyrm <[email protected]>
// the rights to use, copy, modify, merge, publish, distribute, sublicense, */
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// File Name: ColorWhichItem.h
// Author: DarkWyrm <[email protected]>
// Description: ListItem class for managing color_which specifiers
//
//------------------------------------------------------------------------------
#ifndef COLORWHICH_ITEM_H #ifndef COLORWHICH_ITEM_H
#define COLORWHICH_ITEM_H #define COLORWHICH_ITEM_H
+8 -1
View File
@@ -1,3 +1,10 @@
/*
* Copyright 2002-2006, Haiku. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* DarkWyrm ([email protected])
*/
#ifndef DEFS_H_ #ifndef DEFS_H_
#define DEFS_H_ #define DEFS_H_
@@ -10,7 +17,7 @@
#define COLOR_SETTINGS_NAME "system_colors" #define COLOR_SETTINGS_NAME "system_colors"
*/ */
#define APPEARANCE_APP_SIGNATURE "application/x-vnd.obos-Appearance" #define APPEARANCE_APP_SIGNATURE "application/x-vnd.haiku-Appearance"
#define APPLY_SETTINGS 'aply' #define APPLY_SETTINGS 'aply'
#define REVERT_SETTINGS 'rvrt' #define REVERT_SETTINGS 'rvrt'