1 /* 2 * Copyright 2006, Haiku. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Stephan Aßmus <superstippi@gmx.de> 7 */ 8 9 #include "CurrentColor.h" 10 11 #include <stdio.h> 12 13 #include <OS.h> 14 15 #include "ui_defines.h" 16 17 // init global CurrentColor instance 18 CurrentColor 19 CurrentColor::fDefaultInstance; 20 21 22 // constructor 23 CurrentColor::CurrentColor() 24 : Observable(), 25 fColor(kBlack) 26 { 27 } 28 29 // destructor 30 CurrentColor::~CurrentColor() 31 { 32 } 33 34 // Default 35 CurrentColor* 36 CurrentColor::Default() 37 { 38 return &fDefaultInstance; 39 } 40 41 // SetColor 42 void 43 CurrentColor::SetColor(rgb_color color) 44 { 45 if ((uint32&)fColor == (uint32&)color) 46 return; 47 48 fColor = color; 49 Notify(); 50 } 51 52