Back to index

lightning-sunbird  0.9+nobinonly
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends
nsLookAndFeel Class Reference

#include <nsLookAndFeel.h>

Inheritance diagram for nsLookAndFeel:
Inheritance graph
[legend]
Collaboration diagram for nsLookAndFeel:
Collaboration graph
[legend]

List of all members.

Public Types

enum  nsColorID {
  eColor_WindowBackground, eColor_WindowForeground, eColor_WidgetBackground, eColor_WidgetForeground,
  eColor_WidgetSelectBackground, eColor_WidgetSelectForeground, eColor_Widget3DHighlight, eColor_Widget3DShadow,
  eColor_TextBackground, eColor_TextForeground, eColor_TextSelectBackground, eColor_TextSelectForeground,
  eColor_TextSelectBackgroundDisabled, eColor_TextSelectBackgroundAttention, eColor_activeborder, eColor_activecaption,
  eColor_appworkspace, eColor_background, eColor_buttonface, eColor_buttonhighlight,
  eColor_buttonshadow, eColor_buttontext, eColor_captiontext, eColor_graytext,
  eColor_highlight, eColor_highlighttext, eColor_inactiveborder, eColor_inactivecaption,
  eColor_inactivecaptiontext, eColor_infobackground, eColor_infotext, eColor_menu,
  eColor_menutext, eColor_scrollbar, eColor_threeddarkshadow, eColor_threedface,
  eColor_threedhighlight, eColor_threedlightshadow, eColor_threedshadow, eColor_window,
  eColor_windowframe, eColor_windowtext, eColor__moz_buttondefault, eColor__moz_field,
  eColor__moz_fieldtext, eColor__moz_dialog, eColor__moz_dialogtext, eColor__moz_dragtargetzone,
  eColor__moz_cellhighlight, eColor__moz_cellhighlighttext, eColor__moz_buttonhoverface, eColor__moz_buttonhovertext,
  eColor__moz_menuhover, eColor__moz_menuhovertext, eColor__moz_mac_focusring, eColor__moz_mac_menuselect,
  eColor__moz_mac_menushadow, eColor__moz_mac_menutextdisable, eColor__moz_mac_menutextselect, eColor__moz_mac_accentlightesthighlight,
  eColor__moz_mac_accentregularhighlight, eColor__moz_mac_accentface, eColor__moz_mac_accentlightshadow, eColor__moz_mac_accentregularshadow,
  eColor__moz_mac_accentdarkshadow, eColor__moz_mac_accentdarkestshadow, eColor__moz_mac_alternateprimaryhighlight, eColor__moz_mac_secondaryhighlight,
  eColor_LAST_COLOR
}
enum  nsMetricID {
  eMetric_WindowTitleHeight, eMetric_WindowBorderWidth, eMetric_WindowBorderHeight, eMetric_Widget3DBorder,
  eMetric_TextFieldBorder, eMetric_TextFieldHeight, eMetric_TextVerticalInsidePadding, eMetric_TextShouldUseVerticalInsidePadding,
  eMetric_TextHorizontalInsideMinimumPadding, eMetric_TextShouldUseHorizontalInsideMinimumPadding, eMetric_ButtonHorizontalInsidePaddingNavQuirks, eMetric_ButtonHorizontalInsidePaddingOffsetNavQuirks,
  eMetric_CheckboxSize, eMetric_RadioboxSize, eMetric_ListShouldUseHorizontalInsideMinimumPadding, eMetric_ListHorizontalInsideMinimumPadding,
  eMetric_ListShouldUseVerticalInsidePadding, eMetric_ListVerticalInsidePadding, eMetric_CaretBlinkTime, eMetric_CaretWidth,
  eMetric_ShowCaretDuringSelection, eMetric_SelectTextfieldsOnKeyFocus, eMetric_SubmenuDelay, eMetric_MenusCanOverlapOSBar,
  eMetric_SkipNavigatingDisabledMenuItem, eMetric_DragFullWindow, eMetric_DragThresholdX, eMetric_DragThresholdY,
  eMetric_UseAccessibilityTheme, eMetric_IsScreenReaderActive, eMetric_ScrollArrowStyle, eMetric_ScrollSliderStyle,
  eMetric_TreeOpenDelay, eMetric_TreeCloseDelay, eMetric_TreeLazyScrollDelay, eMetric_TreeScrollDelay,
  eMetric_TreeScrollLinesMax, eMetric_TabFocusModel, eMetric_AlertNotificationOrigin
}
enum  { eMetric_ScrollArrowStyleSingle, eMetric_ScrollArrowStyleBothAtBottom, eMetric_ScrollArrowStyleBothAtEachEnd, eMetric_ScrollArrowStyleBothAtTop }
enum  { eMetric_ScrollThumbStyleNormal, eMetric_ScrollThumbStyleProportional }
enum  nsMetricFloatID {
  eMetricFloat_TextFieldVerticalInsidePadding, eMetricFloat_TextFieldHorizontalInsidePadding, eMetricFloat_TextAreaVerticalInsidePadding, eMetricFloat_TextAreaHorizontalInsidePadding,
  eMetricFloat_ListVerticalInsidePadding, eMetricFloat_ListHorizontalInsidePadding, eMetricFloat_ButtonVerticalInsidePadding, eMetricFloat_ButtonHorizontalInsidePadding
}

Public Member Functions

 nsLookAndFeel ()
virtual ~nsLookAndFeel ()
nsresult NativeGetColor (const nsColorID aID, nscolor &aColor)
NS_IMETHOD GetMetric (const nsMetricID aID, PRInt32 &aMetric)
NS_IMETHOD GetMetric (const nsMetricFloatID aID, float &aMetric)
 nsLookAndFeel ()
virtual ~nsLookAndFeel ()
nsresult NativeGetColor (const nsColorID aID, nscolor &aColor)
NS_IMETHOD GetMetric (const nsMetricID aID, PRInt32 &aMetric)
NS_IMETHOD GetMetric (const nsMetricFloatID aID, float &aMetric)
 nsLookAndFeel ()
virtual ~nsLookAndFeel ()
nsresult NativeGetColor (const nsColorID aID, nscolor &aColor)
NS_IMETHOD GetMetric (const nsMetricID aID, PRInt32 &aMetric)
NS_IMETHOD GetMetric (const nsMetricFloatID aID, float &aMetric)
NS_IMETHOD LookAndFeelChanged ()
 nsLookAndFeel ()
virtual ~nsLookAndFeel ()
nsresult NativeGetColor (const nsColorID aID, nscolor &aColor)
NS_IMETHOD GetMetric (const nsMetricID aID, PRInt32 &aMetric)
NS_IMETHOD GetMetric (const nsMetricFloatID aID, float &aMetric)
 nsLookAndFeel ()
virtual ~nsLookAndFeel ()
nsresult NativeGetColor (const nsColorID aID, nscolor &aColor)
NS_IMETHOD GetMetric (const nsMetricID aID, PRInt32 &aMetric)
NS_IMETHOD GetMetric (const nsMetricFloatID aID, float &aMetric)
 nsLookAndFeel ()
virtual ~nsLookAndFeel ()
nsresult NativeGetColor (const nsColorID aID, nscolor &aColor)
NS_IMETHOD GetMetric (const nsMetricID aID, PRInt32 &aMetric)
NS_IMETHOD GetMetric (const nsMetricFloatID aID, float &aMetric)
 nsLookAndFeel ()
virtual ~nsLookAndFeel ()
nsresult NativeGetColor (const nsColorID aID, nscolor &aColor)
NS_IMETHOD GetMetric (const nsMetricID aID, PRInt32 &aMetric)
NS_IMETHOD GetMetric (const nsMetricFloatID aID, float &aMetric)
 nsLookAndFeel ()
virtual ~nsLookAndFeel ()
nsresult NativeGetColor (const nsColorID aID, nscolor &aColor)
NS_IMETHOD GetMetric (const nsMetricID aID, PRInt32 &aMetric)
NS_IMETHOD GetMetric (const nsMetricFloatID aID, float &aMetric)
 nsLookAndFeel ()
virtual ~nsLookAndFeel ()
nsresult NativeGetColor (const nsColorID aID, nscolor &aColor)
NS_IMETHOD GetMetric (const nsMetricID aID, PRInt32 &aMetric)
NS_IMETHOD GetMetric (const nsMetricFloatID aID, float &aMetric)
NS_DECL_ISUPPORTS void Init ()
NS_IMETHOD GetColor (const nsColorID aID, nscolor &aColor)

Protected Types

enum  nsMacAccentColorOffset {
  eColorOffset_mac_accentlightesthighlight, eColorOffset_mac_accentregularhighlight, eColorOffset_mac_accentface, eColorOffset_mac_accentlightshadow,
  eColorOffset_mac_accentregularshadow, eColorOffset_mac_accentdarkshadow, eColorOffset_mac_accentdarkestshadow
}

Protected Member Functions

void InitWidget ()
NS_IMETHOD GetMacBrushColor (const PRInt32 aBrushType, nscolor &aColor, const nscolor &aDefaultColor)
NS_IMETHOD GetMacTextColor (const PRInt32 aTextType, nscolor &aColor, const nscolor &aDefaultColor)
NS_IMETHOD GetMacAccentColor (const nsMacAccentColorOffset aAccent, nscolor &aColor, const nscolor &aDefaultColor)
nsresult InitFromPref (nsLookAndFeelIntPref *aPref, nsIPref *aPrefService)
nsresult InitFromPref (nsLookAndFeelFloatPref *aPref, nsIPref *aPrefService)
nsresult InitColorFromPref (PRInt32 aIndex, nsIPref *aPrefService)

Static Protected Member Functions

static void InitColors ()
static void InitColors ()

Protected Attributes

GtkStyle * mStyle
GtkWidget * mWidget

Static Protected Attributes

static PRBool sColorsInitialized = PR_FALSE
static nscolor sInfoBackground = 0
static nscolor sInfoText = 0
static nscolor sMenuBackground = 0
static nscolor sMenuText = 0
static nscolor sButtonBackground = 0
static nscolor sButtonText = 0
static nscolor sButtonOuterLightBorder = 0
static nscolor sButtonInnerDarkBorder = 0
static nscolor sMenuHover = 0
static nscolor sMenuHoverText = 0
static PRBool sInitialized = PR_FALSE
static nsLookAndFeelIntPref sIntPrefs []
static nsLookAndFeelFloatPref sFloatPrefs []
static const char sColorPrefs [][36]
static PRInt32 sCachedColors [nsILookAndFeel::eColor_LAST_COLOR] = {0}
static PRInt32 sCachedColorBits [COLOR_CACHE_SIZE] = {0}

Friends

int colorPrefChanged (const char *aPref, void *aData)

Detailed Description

Definition at line 42 of file nsLookAndFeel.h.


Member Enumeration Documentation

anonymous enum [inherited]
Enumerator:
eMetric_ScrollArrowStyleSingle 
eMetric_ScrollArrowStyleBothAtBottom 
eMetric_ScrollArrowStyleBothAtEachEnd 
eMetric_ScrollArrowStyleBothAtTop 

Definition at line 212 of file nsILookAndFeel.h.

       {
    eMetric_ScrollArrowStyleSingle,                       // single arrow at each end
    eMetric_ScrollArrowStyleBothAtBottom,                 // both arrows at bottom/right, none at top/left
    eMetric_ScrollArrowStyleBothAtEachEnd,                // both arrows at both ends
    eMetric_ScrollArrowStyleBothAtTop                     // both arrows at top/left, none at bottom/right
  };
anonymous enum [inherited]
Enumerator:
eMetric_ScrollThumbStyleNormal 
eMetric_ScrollThumbStyleProportional 

Definition at line 218 of file nsILookAndFeel.h.

enum nsILookAndFeel::nsColorID [inherited]
Enumerator:
eColor_WindowBackground 
eColor_WindowForeground 
eColor_WidgetBackground 
eColor_WidgetForeground 
eColor_WidgetSelectBackground 
eColor_WidgetSelectForeground 
eColor_Widget3DHighlight 
eColor_Widget3DShadow 
eColor_TextBackground 
eColor_TextForeground 
eColor_TextSelectBackground 
eColor_TextSelectForeground 
eColor_TextSelectBackgroundDisabled 
eColor_TextSelectBackgroundAttention 
eColor_activeborder 
eColor_activecaption 
eColor_appworkspace 
eColor_background 
eColor_buttonface 
eColor_buttonhighlight 
eColor_buttonshadow 
eColor_buttontext 
eColor_captiontext 
eColor_graytext 
eColor_highlight 
eColor_highlighttext 
eColor_inactiveborder 
eColor_inactivecaption 
eColor_inactivecaptiontext 
eColor_infobackground 
eColor_infotext 
eColor_menu 
eColor_menutext 
eColor_scrollbar 
eColor_threeddarkshadow 
eColor_threedface 
eColor_threedhighlight 
eColor_threedlightshadow 
eColor_threedshadow 
eColor_window 
eColor_windowframe 
eColor_windowtext 
eColor__moz_buttondefault 
eColor__moz_field 
eColor__moz_fieldtext 
eColor__moz_dialog 
eColor__moz_dialogtext 
eColor__moz_dragtargetzone 
eColor__moz_cellhighlight 
eColor__moz_cellhighlighttext 
eColor__moz_buttonhoverface 
eColor__moz_buttonhovertext 
eColor__moz_menuhover 
eColor__moz_menuhovertext 
eColor__moz_mac_focusring 
eColor__moz_mac_menuselect 
eColor__moz_mac_menushadow 
eColor__moz_mac_menutextdisable 
eColor__moz_mac_menutextselect 
eColor__moz_mac_accentlightesthighlight 
eColor__moz_mac_accentregularhighlight 
eColor__moz_mac_accentface 
eColor__moz_mac_accentlightshadow 
eColor__moz_mac_accentregularshadow 
eColor__moz_mac_accentdarkshadow 
eColor__moz_mac_accentdarkestshadow 
eColor__moz_mac_alternateprimaryhighlight 
eColor__moz_mac_secondaryhighlight 
eColor_LAST_COLOR 

Definition at line 58 of file nsILookAndFeel.h.

               {

    // WARNING : NO NEGATIVE VALUE IN THIS ENUMERATION
    // see patch in bug 57757 for more information

    eColor_WindowBackground,
    eColor_WindowForeground,
    eColor_WidgetBackground,
    eColor_WidgetForeground,
    eColor_WidgetSelectBackground,
    eColor_WidgetSelectForeground,
    eColor_Widget3DHighlight,
    eColor_Widget3DShadow,
    eColor_TextBackground,
    eColor_TextForeground,
    eColor_TextSelectBackground,
    eColor_TextSelectForeground,
    eColor_TextSelectBackgroundDisabled,
    eColor_TextSelectBackgroundAttention,

    // New CSS 2 color definitions
    eColor_activeborder,
    eColor_activecaption,
    eColor_appworkspace,
    eColor_background,
    eColor_buttonface,
    eColor_buttonhighlight,
    eColor_buttonshadow,
    eColor_buttontext,
    eColor_captiontext,
    eColor_graytext,
    eColor_highlight,
    eColor_highlighttext,
    eColor_inactiveborder,
    eColor_inactivecaption,
    eColor_inactivecaptiontext,
    eColor_infobackground,
    eColor_infotext,
    eColor_menu,
    eColor_menutext,
    eColor_scrollbar,
    eColor_threeddarkshadow,
    eColor_threedface,
    eColor_threedhighlight,
    eColor_threedlightshadow,
    eColor_threedshadow,
    eColor_window,
    eColor_windowframe,
    eColor_windowtext,

    eColor__moz_buttondefault,
    // Colors which will hopefully become CSS3
    eColor__moz_field,
    eColor__moz_fieldtext,
    eColor__moz_dialog,
    eColor__moz_dialogtext,
    eColor__moz_dragtargetzone,                         //used to highlight valid regions to drop something onto

    eColor__moz_cellhighlight,                               //used to cell text background, selected but not focus
    eColor__moz_cellhighlighttext,                           //used to cell text, selected but not focus
    eColor__moz_buttonhoverface,                             //used to button text background, when mouse is over
    eColor__moz_buttonhovertext,                             //used to button text, when mouse is over
    eColor__moz_menuhover,                                   //used to menu item background, when mouse is over
    eColor__moz_menuhovertext,                               //used to menu item text, when mouse is over

    //colours needed by Mac Classic skin
    eColor__moz_mac_focusring,                          //ring around text fields and lists
    eColor__moz_mac_menuselect,                         //colour used when mouse is over a menu item
    eColor__moz_mac_menushadow,                         //colour used to do shadows on menu items
    eColor__moz_mac_menutextdisable,                    // color used to display text for disabled menu items
    eColor__moz_mac_menutextselect,                     //colour used to display text while mouse is over a menu item

       //all of the accent colours
       eColor__moz_mac_accentlightesthighlight,
    eColor__moz_mac_accentregularhighlight,
    eColor__moz_mac_accentface,
    eColor__moz_mac_accentlightshadow,
    eColor__moz_mac_accentregularshadow,
    eColor__moz_mac_accentdarkshadow,
    eColor__moz_mac_accentdarkestshadow,
    
    //new in 10.2
    eColor__moz_mac_alternateprimaryhighlight, //active list highlight
    eColor__moz_mac_secondaryhighlight,        //inactive light hightlight
  
    // keep this one last, please
    eColor_LAST_COLOR
  } nsColorID;
Enumerator:
eColorOffset_mac_accentlightesthighlight 
eColorOffset_mac_accentregularhighlight 
eColorOffset_mac_accentface 
eColorOffset_mac_accentlightshadow 
eColorOffset_mac_accentregularshadow 
eColorOffset_mac_accentdarkshadow 
eColorOffset_mac_accentdarkestshadow 

Definition at line 53 of file nsLookAndFeel.h.

Enumerator:
eMetricFloat_TextFieldVerticalInsidePadding 
eMetricFloat_TextFieldHorizontalInsidePadding 
eMetricFloat_TextAreaVerticalInsidePadding 
eMetricFloat_TextAreaHorizontalInsidePadding 
eMetricFloat_ListVerticalInsidePadding 
eMetricFloat_ListHorizontalInsidePadding 
eMetricFloat_ButtonVerticalInsidePadding 
eMetricFloat_ButtonHorizontalInsidePadding 

Definition at line 225 of file nsILookAndFeel.h.

enum nsILookAndFeel::nsMetricID [inherited]
Enumerator:
eMetric_WindowTitleHeight 
eMetric_WindowBorderWidth 
eMetric_WindowBorderHeight 
eMetric_Widget3DBorder 
eMetric_TextFieldBorder 
eMetric_TextFieldHeight 
eMetric_TextVerticalInsidePadding 
eMetric_TextShouldUseVerticalInsidePadding 
eMetric_TextHorizontalInsideMinimumPadding 
eMetric_TextShouldUseHorizontalInsideMinimumPadding 
eMetric_ButtonHorizontalInsidePaddingNavQuirks 
eMetric_ButtonHorizontalInsidePaddingOffsetNavQuirks 
eMetric_CheckboxSize 
eMetric_RadioboxSize 
eMetric_ListShouldUseHorizontalInsideMinimumPadding 
eMetric_ListHorizontalInsideMinimumPadding 
eMetric_ListShouldUseVerticalInsidePadding 
eMetric_ListVerticalInsidePadding 
eMetric_CaretBlinkTime 
eMetric_CaretWidth 
eMetric_ShowCaretDuringSelection 
eMetric_SelectTextfieldsOnKeyFocus 
eMetric_SubmenuDelay 
eMetric_MenusCanOverlapOSBar 
eMetric_SkipNavigatingDisabledMenuItem 
eMetric_DragFullWindow 
eMetric_DragThresholdX 
eMetric_DragThresholdY 
eMetric_UseAccessibilityTheme 
eMetric_IsScreenReaderActive 
eMetric_ScrollArrowStyle 
eMetric_ScrollSliderStyle 
eMetric_TreeOpenDelay 
eMetric_TreeCloseDelay 
eMetric_TreeLazyScrollDelay 
eMetric_TreeScrollDelay 
eMetric_TreeScrollLinesMax 
eMetric_TabFocusModel 
eMetric_AlertNotificationOrigin 

Definition at line 149 of file nsILookAndFeel.h.

               {
    eMetric_WindowTitleHeight,
    eMetric_WindowBorderWidth,
    eMetric_WindowBorderHeight,
    eMetric_Widget3DBorder,
    eMetric_TextFieldBorder,                              // Native border size
    eMetric_TextFieldHeight,
    eMetric_TextVerticalInsidePadding,                    // needed only because of GTK
    eMetric_TextShouldUseVerticalInsidePadding,           // needed only because of GTK
    eMetric_TextHorizontalInsideMinimumPadding,  
    eMetric_TextShouldUseHorizontalInsideMinimumPadding,  // needed only because of GTK
    eMetric_ButtonHorizontalInsidePaddingNavQuirks,  
    eMetric_ButtonHorizontalInsidePaddingOffsetNavQuirks, 
    eMetric_CheckboxSize,
    eMetric_RadioboxSize,
    
    eMetric_ListShouldUseHorizontalInsideMinimumPadding,  // needed only because of GTK
    eMetric_ListHorizontalInsideMinimumPadding,         

    eMetric_ListShouldUseVerticalInsidePadding,           // needed only because of GTK
    eMetric_ListVerticalInsidePadding,                    // needed only because of GTK

    eMetric_CaretBlinkTime,                               // default, may be overriden by OS
    eMetric_CaretWidth,                                   // pixel width of caret
    eMetric_ShowCaretDuringSelection,                       // show the caret when text is selected?
    eMetric_SelectTextfieldsOnKeyFocus,                   // select textfields when focused via tab/accesskey?
    eMetric_SubmenuDelay,                                 // delay before submenus open
    eMetric_MenusCanOverlapOSBar,                         // can popups overlap menu/task bar?
    eMetric_SkipNavigatingDisabledMenuItem,               // skip navigating to disabled menu item?
    eMetric_DragFullWindow,                               // show window contents while dragging?
    eMetric_DragThresholdX,                               // begin a drag if the mouse is moved further than the threshold while the button is down
    eMetric_DragThresholdY,
    eMetric_UseAccessibilityTheme,                        // Accessibility theme being used?
    eMetric_IsScreenReaderActive,                         // Screen reader being used?

    eMetric_ScrollArrowStyle,                             // position of scroll arrows in a scrollbar
    eMetric_ScrollSliderStyle,                            // is scroll thumb proportional or fixed?

    eMetric_TreeOpenDelay,                                // delay for opening spring loaded folders
    eMetric_TreeCloseDelay,                               // delay for closing spring loaded folders
    eMetric_TreeLazyScrollDelay,                          // delay for triggering the tree scrolling
    eMetric_TreeScrollDelay,                              // delay for scrolling the tree
    eMetric_TreeScrollLinesMax,                           // the maximum number of lines to be scrolled at ones
    eMetric_TabFocusModel,                                // What type of tab-order to use

    /*
     * eMetric_AlertNotificationOrigin indicates from which corner of the
     * screen alerts slide in, and from which direction (horizontal/vertical).
     * 0, the default, represents bottom right, sliding vertically.
     * Use any bitwise combination of the following constants:
     * NS_ALERT_HORIZONTAL (1), NS_ALERT_LEFT (2), NS_ALERT_TOP (4).
     *
     *       6       4
     *     +-----------+
     *    7|           |5
     *     |           |
     *    3|           |1
     *     +-----------+
     *       2       0
     */
    eMetric_AlertNotificationOrigin
  } nsMetricID;

Constructor & Destructor Documentation

Definition at line 46 of file nsLookAndFeel.cpp.

                             : nsXPLookAndFeel()
{
}

Definition at line 50 of file nsLookAndFeel.cpp.

{
}
virtual nsLookAndFeel::~nsLookAndFeel ( ) [virtual]
virtual nsLookAndFeel::~nsLookAndFeel ( ) [virtual]
virtual nsLookAndFeel::~nsLookAndFeel ( ) [virtual]
virtual nsLookAndFeel::~nsLookAndFeel ( ) [virtual]
virtual nsLookAndFeel::~nsLookAndFeel ( ) [virtual]
virtual nsLookAndFeel::~nsLookAndFeel ( ) [virtual]
virtual nsLookAndFeel::~nsLookAndFeel ( ) [virtual]
virtual nsLookAndFeel::~nsLookAndFeel ( ) [virtual]

Member Function Documentation

NS_IMETHODIMP nsXPLookAndFeel::GetColor ( const nsColorID  aID,
nscolor aColor 
) [virtual, inherited]

Implements nsILookAndFeel.

Definition at line 387 of file nsXPLookAndFeel.cpp.

{
  if (!sInitialized)
    Init();

  // define DEBUG_SYSTEM_COLOR_USE if you want to debug system color
  // use in a skin that uses them.  When set, it will make all system
  // color pairs that are appropriate for foreground/background
  // pairing the same.  This means if the skin is using system colors
  // correctly you will not be able to see *any* text.
#undef DEBUG_SYSTEM_COLOR_USE

#ifdef DEBUG_SYSTEM_COLOR_USE
  {
    nsresult rv = NS_OK;
    switch (aID) {
        // css2  http://www.w3.org/TR/REC-CSS2/ui.html#system-colors
      case eColor_activecaption:
          // active window caption background
      case eColor_captiontext:
          // text in active window caption
        aColor = NS_RGB(0xff, 0x00, 0x00);
        break;

      case eColor_highlight:
          // background of selected item
      case eColor_highlighttext:
          // text of selected item
        aColor = NS_RGB(0xff, 0xff, 0x00);
        break;

      case eColor_inactivecaption:
          // inactive window caption
      case eColor_inactivecaptiontext:
          // text in inactive window caption
        aColor = NS_RGB(0x66, 0x66, 0x00);
        break;

      case eColor_infobackground:
          // tooltip background color
      case eColor_infotext:
          // tooltip text color
        aColor = NS_RGB(0x00, 0xff, 0x00);
        break;

      case eColor_menu:
          // menu background
      case eColor_menutext:
          // menu text
        aColor = NS_RGB(0x00, 0xff, 0xff);
        break;

      case eColor_threedface:
      case eColor_buttonface:
          // 3-D face color
      case eColor_buttontext:
          // text on push buttons
        aColor = NS_RGB(0x00, 0x66, 0x66);
        break;

      case eColor_window:
      case eColor_windowtext:
        aColor = NS_RGB(0x00, 0x00, 0xff);
        break;

      // from the CSS3 working draft (not yet finalized)
      // http://www.w3.org/tr/2000/wd-css3-userint-20000216.html#color

      case eColor__moz_field:
      case eColor__moz_fieldtext:
        aColor = NS_RGB(0xff, 0x00, 0xff);
        break;

      case eColor__moz_dialog:
      case eColor__moz_dialogtext:
        aColor = NS_RGB(0x66, 0x00, 0x66);
        break;

      default:
        rv = NS_ERROR_NOT_AVAILABLE;
    }
    if (NS_SUCCEEDED(rv))
      return rv;
  }
#endif // DEBUG_SYSTEM_COLOR_USE

  if (IS_COLOR_CACHED(aID)) {
    aColor = sCachedColors[aID];
    return NS_OK;
  }

  // There are no system color settings for these, so set them manually
  if (aID == eColor_TextSelectBackgroundDisabled) {
    // This is used to gray out the selection when it's not focused
    // Used with nsISelectionController::SELECTION_DISABLED
    aColor = NS_RGB(0xb0, 0xb0, 0xb0);
    return NS_OK;
  }

  if (aID == eColor_TextSelectBackgroundAttention) {
    // This makes the selection stand out when typeaheadfind is on
    // Used with nsISelectionController::SELECTION_ATTENTION
    aColor = NS_RGB(0x38, 0xd8, 0x78);
    return NS_OK;
  }

  if (NS_SUCCEEDED(NativeGetColor(aID, aColor))) {
    CACHE_COLOR(aID, aColor);
    return NS_OK;
  }

  return NS_ERROR_NOT_AVAILABLE;
}

Here is the call graph for this function:

NS_IMETHODIMP nsLookAndFeel::GetMacAccentColor ( const nsMacAccentColorOffset  aAccent,
nscolor aColor,
const nscolor aDefaultColor 
) [protected]

Definition at line 395 of file nsLookAndFeel.cpp.

{
       nsresult res = NS_OK;
       OSStatus err = noErr;
       ColorTable colourTable;
       CTabPtr ctPointer = &colourTable;
       CTabHandle ctHandle = &ctPointer;
       CTabHandle *colors = &ctHandle;
       RGBColor *macColor;         

       err = ::GetThemeAccentColors(colors);
       if (err == themeHasNoAccentsErr) {
              //fine, theme doesn't support accents, use default
              res = NS_OK;
              aColor = aDefaultColor;
       } else if (err != noErr || ! colors) {
              res = NS_ERROR_FAILURE;
              aColor = aDefaultColor;
       } else {
              if ((**colors)->ctSize == 
                            (eColorOffset_mac_accentdarkestshadow - eColorOffset_mac_accentlightesthighlight +1)) {
                     //if the size is 7 then its likely to be a standard Platinum variation, so lets use it
                     macColor = &((**colors)->ctTable[aAccent].rgb);
                     aColor = NS_RGB(macColor->red>>8, macColor->green>>8, macColor->blue>>8);
                     res = NS_OK;         
              } else if ((**colors)->ctSize == -1) {
                     //this is probably the high contrast Black & White Platinum variation
                     //so lets be high contrast
                     res = NS_OK;
                     if (aAccent <= eColorOffset_mac_accentface) {
                            aColor = NS_RGB(0xFF,0xFF,0xFF);
                     } else {
                            aColor = NS_RGB(0x00,0x00,0x00);
                     }
              //else if ( ?? )  // add aqua support here?
              } else {
                     //some other size we've never heard of, no idea what to do with it
                     res = NS_ERROR_FAILURE;
                     aColor = aDefaultColor;
              }
       }
       return res;
}

Here is the call graph for this function:

NS_IMETHODIMP nsLookAndFeel::GetMacBrushColor ( const PRInt32  aBrushType,
nscolor aColor,
const nscolor aDefaultColor 
) [protected]

Definition at line 365 of file nsLookAndFeel.cpp.

{
       OSStatus err = noErr;
       RGBColor macColor;
       
       err = ::GetThemeBrushAsColor(aBrushType, 32, true, &macColor);
       if (err == noErr) 
              aColor =  NS_RGB(macColor.red>>8, macColor.green>>8, macColor.blue>>8);
       else
              aColor = aDefaultColor;
       return NS_OK;
       
}

Here is the call graph for this function:

NS_IMETHODIMP nsLookAndFeel::GetMacTextColor ( const PRInt32  aTextType,
nscolor aColor,
const nscolor aDefaultColor 
) [protected]

Definition at line 380 of file nsLookAndFeel.cpp.

{
       OSStatus err = noErr;
       RGBColor macColor;
       
       err = ::GetThemeTextColor(aTextType, 32, true, &macColor);
       if (err == noErr) 
              aColor =  NS_RGB(macColor.red>>8, macColor.green>>8, macColor.blue>>8);
       else
              aColor = aDefaultColor;
       return NS_OK;
       
}

Here is the call graph for this function:

NS_IMETHODIMP nsLookAndFeel::GetMetric ( const nsMetricID  aID,
PRInt32 aMetric 
) [virtual]

Reimplemented from nsXPLookAndFeel.

Definition at line 266 of file nsLookAndFeel.cpp.

{
  nsresult res = nsXPLookAndFeel::GetMetric(aID, aMetric);
  if (NS_SUCCEEDED(res))
    return res;
  res = NS_OK;

  /*
   * There used to be an entirely separate list of these metrics in
   * nsDeviceContextBeOS::GetSystemAttribute.  The metrics given there
   * were a bit different from these.  If these are inaccurate, it might
   * be worth looking at cvs history for the ones there to see if they
   * were better.
   */

  switch (aID) 
  {
    case eMetric_WindowTitleHeight:
      // 2*horizontal scrollbar height
      aMetric = 28;
      break;
    case eMetric_WindowBorderWidth:
      aMetric = 2;
      break;
    case eMetric_WindowBorderHeight:
      aMetric = 2;
      break;
    case eMetric_Widget3DBorder:
      aMetric = 5;
      break;
    case eMetric_TextFieldBorder:
      aMetric = 3;
      break;
    case eMetric_TextFieldHeight:
      aMetric = 24;
      break;
    case eMetric_TextVerticalInsidePadding:
      aMetric = 0;
      break;    
    case eMetric_TextShouldUseVerticalInsidePadding:
      aMetric = 0;
      break;
    case eMetric_TextHorizontalInsideMinimumPadding:
      aMetric = 3;
      break;
    case eMetric_TextShouldUseHorizontalInsideMinimumPadding:
      aMetric = 1;
      break;    
    case eMetric_ButtonHorizontalInsidePaddingNavQuirks:
      aMetric = 10;
      break;
    case eMetric_ButtonHorizontalInsidePaddingOffsetNavQuirks:
      aMetric = 8;
      break;
    case eMetric_CheckboxSize:
      aMetric = 12;
      break;
    case eMetric_RadioboxSize:
      aMetric = 12;
      break;

    case eMetric_ListShouldUseHorizontalInsideMinimumPadding:
      aMetric = 0;
      break;
    case eMetric_ListHorizontalInsideMinimumPadding:
      aMetric = 3;
      break;
      
    case eMetric_ListShouldUseVerticalInsidePadding:
      aMetric = 0;
      break;
    case eMetric_ListVerticalInsidePadding:
      aMetric = 0;
      break;
      
    case eMetric_CaretBlinkTime:
      aMetric = 500;
      break;
    case eMetric_CaretWidth:
      aMetric = 1;
      break;
    case eMetric_ShowCaretDuringSelection:
      aMetric = 1;
      break;
    case eMetric_SelectTextfieldsOnKeyFocus:
      // Do not select textfield content when focused by kbd
      // used by nsEventStateManager::sTextfieldSelectModel
      aMetric = 0;
      break;
    case eMetric_SubmenuDelay:
      aMetric = 500;
      break;
    case eMetric_MenusCanOverlapOSBar: // can popups overlap menu/task bar?
      aMetric = 0;
      break;
    case eMetric_DragFullWindow:
      aMetric = 0;
      break;
    case eMetric_ScrollArrowStyle:
      {
        aMetric = eMetric_ScrollArrowStyleBothAtEachEnd; // BeOS default

        scroll_bar_info info;
        if(B_OK == get_scroll_bar_info(&info) && !info.double_arrows)
        {
          aMetric = eMetric_ScrollArrowStyleSingle;
        }
      }
      break;
    case eMetric_ScrollSliderStyle:
      {
        aMetric = eMetric_ScrollThumbStyleProportional; // BeOS default

        scroll_bar_info info;
        if(B_OK == get_scroll_bar_info(&info) && !info.proportional)
        {
          aMetric = eMetric_ScrollThumbStyleNormal;
        }
      }
      break;
    case eMetric_TreeOpenDelay:
      aMetric = 1000;
      break;
    case eMetric_TreeCloseDelay:
      aMetric = 1000;
      break;
    case eMetric_TreeLazyScrollDelay:
      aMetric = 150;
      break;
    case eMetric_TreeScrollDelay:
      aMetric = 100;
      break;
    case eMetric_TreeScrollLinesMax:
      aMetric = 3;
      break;
    default:
        aMetric = 0;
        res = NS_ERROR_FAILURE;
    }
  return res;
}

Here is the caller graph for this function:

NS_IMETHOD nsLookAndFeel::GetMetric ( const nsMetricID  aID,
PRInt32 aMetric 
) [virtual]

Reimplemented from nsXPLookAndFeel.

NS_IMETHOD nsLookAndFeel::GetMetric ( const nsMetricID  aID,
PRInt32 aMetric 
) [virtual]

Reimplemented from nsXPLookAndFeel.

NS_IMETHOD nsLookAndFeel::GetMetric ( const nsMetricID  aID,
PRInt32 aMetric 
) [virtual]

Reimplemented from nsXPLookAndFeel.

NS_IMETHOD nsLookAndFeel::GetMetric ( const nsMetricID  aID,
PRInt32 aMetric 
) [virtual]

Reimplemented from nsXPLookAndFeel.

NS_IMETHOD nsLookAndFeel::GetMetric ( const nsMetricFloatID  aID,
float &  aMetric 
) [virtual]

Reimplemented from nsXPLookAndFeel.

NS_IMETHOD nsLookAndFeel::GetMetric ( const nsMetricFloatID  aID,
float &  aMetric 
) [virtual]

Reimplemented from nsXPLookAndFeel.

NS_IMETHOD nsLookAndFeel::GetMetric ( const nsMetricFloatID  aID,
float &  aMetric 
) [virtual]

Reimplemented from nsXPLookAndFeel.

NS_IMETHODIMP nsLookAndFeel::GetMetric ( const nsMetricFloatID  aID,
float &  aMetric 
) [virtual]

Reimplemented from nsXPLookAndFeel.

Definition at line 408 of file nsLookAndFeel.cpp.

{
  nsresult res = nsXPLookAndFeel::GetMetric(aID, aMetric);
  if (NS_SUCCEEDED(res))
    return res;
  res = NS_OK;

  switch (aID) {
    case eMetricFloat_TextFieldVerticalInsidePadding:
        aMetric = 0.25f;
        break;
    case eMetricFloat_TextFieldHorizontalInsidePadding:
        aMetric = 0.95f;
        break;
    case eMetricFloat_TextAreaVerticalInsidePadding:
        aMetric = 0.40f;
        break;
    case eMetricFloat_TextAreaHorizontalInsidePadding:
        aMetric = 0.40f;
        break;
    case eMetricFloat_ListVerticalInsidePadding:
        aMetric = 0.10f;
        break;
    case eMetricFloat_ListHorizontalInsidePadding:
        aMetric = 0.40f;
        break;
    case eMetricFloat_ButtonVerticalInsidePadding:
        aMetric = 0.25f;
        break;
    case eMetricFloat_ButtonHorizontalInsidePadding:
        aMetric = 0.25f;
        break;
    default:
        aMetric = -1.0;
        res = NS_ERROR_FAILURE;
    }
  return res;
}

Here is the call graph for this function:

NS_IMETHOD nsLookAndFeel::GetMetric ( const nsMetricID  aID,
PRInt32 aMetric 
) [virtual]

Reimplemented from nsXPLookAndFeel.

NS_IMETHOD nsLookAndFeel::GetMetric ( const nsMetricFloatID  aID,
float &  aMetric 
) [virtual]

Reimplemented from nsXPLookAndFeel.

NS_IMETHOD nsLookAndFeel::GetMetric ( const nsMetricID  aID,
PRInt32 aMetric 
) [virtual]

Reimplemented from nsXPLookAndFeel.

NS_IMETHOD nsLookAndFeel::GetMetric ( const nsMetricFloatID  aID,
float &  aMetric 
) [virtual]

Reimplemented from nsXPLookAndFeel.

NS_IMETHOD nsLookAndFeel::GetMetric ( const nsMetricFloatID  aID,
float &  aMetric 
) [virtual]

Reimplemented from nsXPLookAndFeel.

NS_IMETHOD nsLookAndFeel::GetMetric ( const nsMetricID  aID,
PRInt32 aMetric 
) [virtual]

Reimplemented from nsXPLookAndFeel.

NS_IMETHOD nsLookAndFeel::GetMetric ( const nsMetricID  aID,
PRInt32 aMetric 
) [virtual]

Reimplemented from nsXPLookAndFeel.

NS_IMETHOD nsLookAndFeel::GetMetric ( const nsMetricFloatID  aID,
float &  aMetric 
) [virtual]

Reimplemented from nsXPLookAndFeel.

NS_IMETHOD nsLookAndFeel::GetMetric ( const nsMetricFloatID  aID,
float &  aMetric 
) [virtual]

Reimplemented from nsXPLookAndFeel.

void nsXPLookAndFeel::Init ( void  ) [inherited]

Definition at line 355 of file nsXPLookAndFeel.cpp.

{
  // Say we're already initialized, and take the chance that it might fail;
  // protects against some other process writing to our static variables.
  sInitialized = PR_TRUE;

  nsresult rv;
  nsCOMPtr<nsIPref> prefService(do_GetService(kPrefServiceCID, &rv));
  if (NS_FAILED(rv) || !prefService)
    return;

  unsigned int i;
  for (i = 0; i < ((sizeof (sIntPrefs) / sizeof (*sIntPrefs))); ++i)
    InitFromPref(&sIntPrefs[i], prefService);

  for (i = 0; i < ((sizeof (sFloatPrefs) / sizeof (*sFloatPrefs))); ++i)
    InitFromPref(&sFloatPrefs[i], prefService);

  for (i = 0; i < (sizeof(sColorPrefs) / sizeof (*sColorPrefs)); ++i)
    InitColorFromPref(i, prefService);
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsXPLookAndFeel::InitColorFromPref ( PRInt32  aIndex,
nsIPref aPrefService 
) [protected, inherited]

Definition at line 321 of file nsXPLookAndFeel.cpp.

{
  char *colorStr = 0;
  nsresult rv = aPrefService->CopyCharPref(sColorPrefs[i], &colorStr);
  if (NS_SUCCEEDED(rv) && colorStr[0])
  {
    nsAutoString colorNSStr; colorNSStr.AssignWithConversion(colorStr);
    nscolor thecolor;
    if (colorNSStr[0] == '#') {
      nsAutoString hexString;
      colorNSStr.Right(hexString, colorNSStr.Length() - 1);
      if (NS_SUCCEEDED(NS_HexToRGB(hexString, &thecolor))) {
        CACHE_COLOR(i, thecolor);
        PL_strfree(colorStr);
      }
    }
    else if (NS_SUCCEEDED(NS_ColorNameToRGB(colorNSStr, &thecolor)))
    {
      CACHE_COLOR(i, thecolor);
      PL_strfree(colorStr);
    }
  }

  aPrefService->RegisterCallback(sColorPrefs[i], colorPrefChanged, (void*)i);
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsLookAndFeel::InitColors ( ) [static, protected]

Definition at line 452 of file nsLookAndFeel.cpp.

{
  sColorsInitialized = PR_TRUE;
  GtkStyle *style;
  
  // tooltip foreground and background
  GtkTooltips *tooltips = gtk_tooltips_new();
  gtk_tooltips_force_window(tooltips);
  GtkWidget *tip_window = tooltips->tip_window;
  gtk_widget_set_rc_style(tip_window);

  style = gtk_widget_get_style(tip_window);
  sInfoBackground = GDK_COLOR_TO_NS_RGB(style->bg[GTK_STATE_NORMAL]);
  sInfoText = GDK_COLOR_TO_NS_RGB(style->fg[GTK_STATE_NORMAL]);

  gtk_object_unref(GTK_OBJECT(tooltips));


  // menu foreground & menu background
  GtkWidget *accel_label = gtk_accel_label_new("M");
  GtkWidget *menuitem = gtk_menu_item_new();
  GtkWidget *menu = gtk_menu_new();

  gtk_container_add(GTK_CONTAINER(menuitem), accel_label);
  gtk_menu_append(GTK_MENU(menu), menuitem);

  gtk_widget_set_rc_style(accel_label);
  gtk_widget_set_rc_style(menu);
  gtk_widget_realize(menu);
  gtk_widget_realize(accel_label);

  style = gtk_widget_get_style(accel_label);
  sMenuText = GDK_COLOR_TO_NS_RGB(style->fg[GTK_STATE_NORMAL]);

  style = gtk_widget_get_style(menu);
  sMenuBackground = GDK_COLOR_TO_NS_RGB(style->bg[GTK_STATE_NORMAL]);

  gtk_widget_unref(menu);


  // button styles
  GtkWidget *parent = gtk_fixed_new();
  GtkWidget *button = gtk_button_new();
  GtkWidget *label = gtk_label_new("M");
  GtkWidget *window = gtk_window_new(GTK_WINDOW_POPUP);
  
  gtk_container_add(GTK_CONTAINER(button), label);
  gtk_container_add(GTK_CONTAINER(parent), button);
  gtk_container_add(GTK_CONTAINER(window), parent);

  gtk_widget_set_rc_style(button);
  gtk_widget_set_rc_style(label);

  gtk_widget_realize(button);
  gtk_widget_realize(label);

  style = gtk_widget_get_style(label);
  sButtonText = GDK_COLOR_TO_NS_RGB(style->fg[GTK_STATE_NORMAL]);

  style = gtk_widget_get_style(button);
  sButtonBackground = GDK_COLOR_TO_NS_RGB(style->bg[GTK_STATE_NORMAL]);
  sButtonOuterLightBorder =
    GDK_COLOR_TO_NS_RGB(style->light[GTK_STATE_NORMAL]);
  sButtonInnerDarkBorder =
    GDK_COLOR_TO_NS_RGB(style->dark[GTK_STATE_NORMAL]);

  gtk_widget_destroy(window);

}

Here is the caller graph for this function:

static void nsLookAndFeel::InitColors ( ) [static, protected]
nsresult nsXPLookAndFeel::InitFromPref ( nsLookAndFeelIntPref aPref,
nsIPref aPrefService 
) [protected, inherited]

Definition at line 293 of file nsXPLookAndFeel.cpp.

{
  PRInt32 intpref;
  nsresult rv = aPrefService->GetIntPref(aPref->name, &intpref);
  if (NS_SUCCEEDED(rv))
  {
    aPref->isSet = PR_TRUE;
    aPref->intVar = intpref;
  }
  aPrefService->RegisterCallback(aPref->name, intPrefChanged, aPref);
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsXPLookAndFeel::InitFromPref ( nsLookAndFeelFloatPref aPref,
nsIPref aPrefService 
) [protected, inherited]

Definition at line 307 of file nsXPLookAndFeel.cpp.

{
  PRInt32 intpref;
  nsresult rv = aPrefService->GetIntPref(aPref->name, &intpref);
  if (NS_SUCCEEDED(rv))
  {
    aPref->isSet = PR_TRUE;
    aPref->floatVar = (float)intpref / 100.;
  }
  aPrefService->RegisterCallback(aPref->name, floatPrefChanged, aPref);
  return rv;
}

Here is the call graph for this function:

void nsLookAndFeel::InitWidget ( ) [inline, protected]

Definition at line 75 of file nsLookAndFeel.h.

                      {
        mWidget = gtk_invisible_new();
        gtk_object_ref(GTK_OBJECT(mWidget));
        gtk_object_sink(GTK_OBJECT(mWidget));
        gtk_widget_ensure_style(mWidget);
        mStyle = gtk_widget_get_style(mWidget);
    }

Here is the caller graph for this function:

Reimplemented from nsXPLookAndFeel.

Definition at line 576 of file nsLookAndFeel.cpp.

{
    nsXPLookAndFeel::LookAndFeelChanged();

    if (mWidget)
        gtk_widget_unref(mWidget);
 
    InitWidget();
    InitColors();

    return NS_OK;
}

Here is the call graph for this function:

nsresult nsLookAndFeel::NativeGetColor ( const nsColorID  aID,
nscolor aColor 
) [virtual]

Implements nsXPLookAndFeel.

nsresult nsLookAndFeel::NativeGetColor ( const nsColorID  aID,
nscolor aColor 
) [virtual]

Implements nsXPLookAndFeel.

nsresult nsLookAndFeel::NativeGetColor ( const nsColorID  aID,
nscolor aColor 
) [virtual]

Implements nsXPLookAndFeel.

nsresult nsLookAndFeel::NativeGetColor ( const nsColorID  aID,
nscolor aColor 
) [virtual]

Implements nsXPLookAndFeel.

Definition at line 54 of file nsLookAndFeel.cpp.

{
  nsresult res = NS_OK;
  rgb_color color;
  /*
   * There used to be an entirely separate list of these colors in
   * nsDeviceContextBeOS::GetSystemAttribute.  The colors given there
   * were a bit different from these.  If these are inaccurate, it might
   * be worth looking at cvs history for the ones there to see if they
   * were better.
   */

  switch (aID) {
    case eColor_WindowBackground:
      aColor = NS_RGB(0xff, 0xff, 0xff); 
      break;
    case eColor_WindowForeground:
      aColor = NS_RGB(0x00, 0x00, 0x00);        
      break;
    case eColor_WidgetBackground:
      aColor = NS_RGB(0xdd, 0xdd, 0xdd);
      break;
    case eColor_WidgetForeground:
      aColor = NS_RGB(0x00, 0x00, 0x00);        
      break;
    case eColor_WidgetSelectBackground:
      {
        color = ui_color(B_MENU_SELECTION_BACKGROUND_COLOR);
        aColor = NS_RGB(color.red, color.green, color.blue);
      }
      break;
    case eColor_WidgetSelectForeground:
      aColor = NS_RGB(0x00, 0x00, 0x80);
      break;
    case eColor_Widget3DHighlight:
      aColor = NS_RGB(0xa0, 0xa0, 0xa0);
      break;
    case eColor_Widget3DShadow:
      aColor = NS_RGB(0x40, 0x40, 0x40);
      break;
    case eColor_TextBackground:
      aColor = NS_RGB(0xff, 0xff, 0xff);
      break;
    case eColor_TextForeground: 
      aColor = NS_RGB(0x00, 0x00, 0x00);
      break;
    case eColor_TextSelectBackground:
      {
        // looks good in Mozilla, though, never noticed this color in BeOS menu
        color = ui_color(B_MENU_SELECTION_BACKGROUND_COLOR);
        aColor = NS_RGB(color.red, color.green, color.blue);
      }
      break;
    case eColor_TextSelectForeground:
      {
        color = ui_color(B_MENU_SELECTED_ITEM_TEXT_COLOR);
        aColor = NS_RGB(color.red, color.green, color.blue);
      }
      break;
       // two following colors get initialisation in XPLookAndFeel.
       //eColor_TextSelectBackgroundDisabled,
    //eColor_TextSelectBackgroundAttention,
    
    //  CSS 2 Colors
    case eColor_activeborder:
      aColor = NS_RGB(0x88, 0x88, 0x88);
      break;
    // active titletab
    case eColor_activecaption:
      {
        color = ui_color(B_WINDOW_TAB_COLOR);
        aColor = NS_RGB(color.red, color.green, color.blue);
      }    
      break;
    //MDI color
    case eColor_appworkspace:
      aColor = NS_RGB(0xd8, 0xd8, 0xd8);
      break;
    //incidentally, this is supposed to be the colour of the desktop, though how anyone
    //is supposed to guess that from the name?
    case eColor_background:
      {
        color = ui_color(B_DESKTOP_COLOR);
        aColor = NS_RGB(color.red, color.green, color.blue);
      }
      break;
    case eColor_buttonface:
    case eColor__moz_buttonhoverface:
      aColor = NS_RGB(0xdd, 0xdd, 0xdd);
      break;
    //should be lighter of 2 possible highlight colours available
    case eColor_buttonhighlight:
      aColor = NS_RGB(0xff, 0xff, 0xff);
      break;
    //darker of 2 possible shadow colours available
    case eColor_buttonshadow:
      aColor = NS_RGB(0x77, 0x77, 0x77);
      break;
    case eColor_buttontext:
    case eColor__moz_buttonhovertext:
      aColor = NS_RGB(0x00, 0x00, 0x00);
      break;
    case eColor_captiontext:
      aColor = NS_RGB(0x00, 0x00, 0x00);
      break;
    case eColor_graytext:
      aColor = NS_RGB(0x77, 0x77, 0x77);
      break;
    case eColor_highlight:
    case eColor__moz_menuhover:
      {
        // B_MENU_SELECTION_BACKGROUND_COLOR  is used for text selection
        // this blue colors seems more suitable
        color = ui_color(B_KEYBOARD_NAVIGATION_COLOR);
        aColor = NS_RGB(color.red, color.green, color.blue);
      }
      break;
    case eColor_highlighttext:
    case eColor__moz_menuhovertext:
      {
        color = ui_color(B_MENU_SELECTED_ITEM_TEXT_COLOR);
        aColor = NS_RGB(color.red, color.green, color.blue);
      }
      break;
    case eColor_inactiveborder:
      aColor = NS_RGB(0x55, 0x55, 0x55);
      break;
    case eColor_inactivecaption:
      aColor = NS_RGB(0xdd, 0xdd, 0xdd);
      break;
    case eColor_inactivecaptiontext:
      aColor = NS_RGB(0x77, 0x77, 0x77);
      break;
    case eColor_infobackground:
      // tooltips
      aColor = NS_RGB(0xff, 0xff, 0xd0);
      break;
    case eColor_infotext:
      aColor = NS_RGB(0x00, 0x00, 0x00);
      break;
    case eColor_menu:
      {
        color = ui_color(B_MENU_BACKGROUND_COLOR);
        aColor = NS_RGB(color.red, color.green, color.blue);
      }
      break;
    case eColor_menutext:
      {
        color = ui_color(B_MENU_ITEM_TEXT_COLOR);
        aColor = NS_RGB(color.red, color.green, color.blue);
      }
      break;
    case eColor_scrollbar:
      aColor = NS_RGB(0xaa, 0xaa, 0xaa);
      break;
    case eColor_threeddarkshadow:
      aColor = NS_RGB(0x77, 0x77, 0x77);
      break;
    case eColor_threedface:
      aColor = NS_RGB(0xdd, 0xdd, 0xdd);
      break;
    case eColor_threedhighlight:
      aColor = NS_RGB(0xff, 0xff, 0xff);
      break;
    case eColor_threedlightshadow:
      aColor = NS_RGB(0xdd, 0xdd, 0xdd);
      break;
    case eColor_threedshadow:
      aColor = NS_RGB(0x99, 0x99, 0x99);
      break;
    case eColor_window:
      aColor = NS_RGB(0xff, 0xff, 0xff);
      break;
    case eColor_windowframe:
      aColor = NS_RGB(0xcc, 0xcc, 0xcc);
      break;
    case eColor_windowtext:
      aColor = NS_RGB(0x00, 0x00, 0x00);
      break;
    // CSS3 candidates
    case eColor__moz_field: 
      // normal widget background
      aColor = NS_RGB(0xff, 0xff, 0xff);
      break;  
    case eColor__moz_fieldtext:
      aColor = NS_RGB(0x00, 0x00, 0x00);
      break;  
    case eColor__moz_dialog:
    case eColor__moz_cellhighlight:
      //all bars  including MenuBar
      aColor = NS_RGB(0xdd, 0xdd, 0xdd);
      break;  
    case eColor__moz_dialogtext:
    case eColor__moz_cellhighlighttext:
      aColor = NS_RGB(0x00, 0x00, 0x00);
      break;  
    case eColor__moz_dragtargetzone:
      aColor = NS_RGB(0x63, 0x63, 0xCE);
      break;
    case eColor__moz_buttondefault:
      aColor = NS_RGB(0x77, 0x77, 0x77);
      break;
    case eColor_LAST_COLOR:
    default:
      aColor = NS_RGB(0xff, 0xff, 0xff);
      res    = NS_ERROR_FAILURE;
      break;
  }

  return res;
}

Here is the call graph for this function:

nsresult nsLookAndFeel::NativeGetColor ( const nsColorID  aID,
nscolor aColor 
) [virtual]

Implements nsXPLookAndFeel.

nsresult nsLookAndFeel::NativeGetColor ( const nsColorID  aID,
nscolor aColor 
) [virtual]

Implements nsXPLookAndFeel.

nsresult nsLookAndFeel::NativeGetColor ( const nsColorID  aID,
nscolor aColor 
) [virtual]

Implements nsXPLookAndFeel.

nsresult nsLookAndFeel::NativeGetColor ( const nsColorID  aID,
nscolor aColor 
) [virtual]

Implements nsXPLookAndFeel.

nsresult nsLookAndFeel::NativeGetColor ( const nsColorID  aID,
nscolor aColor 
) [virtual]

Implements nsXPLookAndFeel.


Friends And Related Function Documentation

int colorPrefChanged ( const char *  aPref,
void aData 
) [friend, inherited]

Member Data Documentation

GtkStyle * nsLookAndFeel::mStyle [protected]

Definition at line 54 of file nsLookAndFeel.h.

GtkWidget * nsLookAndFeel::mWidget [protected]

Definition at line 55 of file nsLookAndFeel.h.

static nscolor nsLookAndFeel::sButtonBackground = 0 [static, protected]

Definition at line 64 of file nsLookAndFeel.h.

static nscolor nsLookAndFeel::sButtonInnerDarkBorder = 0 [static, protected]

Definition at line 67 of file nsLookAndFeel.h.

static nscolor nsLookAndFeel::sButtonOuterLightBorder = 0 [static, protected]

Definition at line 66 of file nsLookAndFeel.h.

static nscolor nsLookAndFeel::sButtonText = 0 [static, protected]

Definition at line 65 of file nsLookAndFeel.h.

PRInt32 nsXPLookAndFeel::sCachedColorBits = {0} [static, protected, inherited]

Definition at line 125 of file nsXPLookAndFeel.h.

PRInt32 nsXPLookAndFeel::sCachedColors = {0} [static, protected, inherited]

Definition at line 124 of file nsXPLookAndFeel.h.

const char nsXPLookAndFeel::sColorPrefs [static, protected, inherited]

Definition at line 123 of file nsXPLookAndFeel.h.

static PRBool nsLookAndFeel::sColorsInitialized = PR_FALSE [static, protected]

Definition at line 59 of file nsLookAndFeel.h.

nsLookAndFeelFloatPref nsXPLookAndFeel::sFloatPrefs [static, protected, inherited]
Initial value:
{
  { "ui.textFieldVerticalInsidePadding",
    eMetricFloat_TextFieldVerticalInsidePadding, PR_FALSE, nsLookAndFeelTypeFloat, 0 },
  { "ui.textFieldHorizontalInsidePadding",
    eMetricFloat_TextFieldHorizontalInsidePadding, PR_FALSE, nsLookAndFeelTypeFloat, 0 },
  { "ui.textAreaVerticalInsidePadding", eMetricFloat_TextAreaVerticalInsidePadding,
    PR_FALSE, nsLookAndFeelTypeFloat, 0 },
  { "ui.textAreaHorizontalInsidePadding",
    eMetricFloat_TextAreaHorizontalInsidePadding, PR_FALSE, nsLookAndFeelTypeFloat, 0 },
  { "ui.listVerticalInsidePadding",
    eMetricFloat_ListVerticalInsidePadding, PR_FALSE, nsLookAndFeelTypeFloat, 0 },
  { "ui.listHorizontalInsidePadding",
    eMetricFloat_ListHorizontalInsidePadding, PR_FALSE, nsLookAndFeelTypeFloat, 0 },
  { "ui.buttonVerticalInsidePadding", eMetricFloat_ButtonVerticalInsidePadding,
    PR_FALSE, nsLookAndFeelTypeFloat, 0 },
  { "ui.buttonHorizontalInsidePadding", eMetricFloat_ButtonHorizontalInsidePadding,
    PR_FALSE, nsLookAndFeelTypeFloat, 0 },
}

Definition at line 119 of file nsXPLookAndFeel.h.

static nscolor nsLookAndFeel::sInfoBackground = 0 [static, protected]

Definition at line 60 of file nsLookAndFeel.h.

static nscolor nsLookAndFeel::sInfoText = 0 [static, protected]

Definition at line 61 of file nsLookAndFeel.h.

PRBool nsXPLookAndFeel::sInitialized = PR_FALSE [static, protected, inherited]

Definition at line 117 of file nsXPLookAndFeel.h.

nsLookAndFeelIntPref nsXPLookAndFeel::sIntPrefs [static, protected, inherited]

Definition at line 118 of file nsXPLookAndFeel.h.

static nscolor nsLookAndFeel::sMenuBackground = 0 [static, protected]

Definition at line 62 of file nsLookAndFeel.h.

nscolor nsLookAndFeel::sMenuHover = 0 [static, protected]

Definition at line 67 of file nsLookAndFeel.h.

nscolor nsLookAndFeel::sMenuHoverText = 0 [static, protected]

Definition at line 68 of file nsLookAndFeel.h.

static nscolor nsLookAndFeel::sMenuText = 0 [static, protected]

Definition at line 63 of file nsLookAndFeel.h.


The documentation for this class was generated from the following files: