2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
* John Fairhurst <john_fairhurst@iname.com>
|
|
|
|
* Michael Lowe <michael.lowe@bigfoot.com>
|
|
|
|
* Pierre Phaneuf <pp@ludusdesign.com>
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
|
|
|
|
|
|
|
#define INCL_WIN
|
|
|
|
#include <os2.h>
|
|
|
|
#include "nsLookAndFeel.h"
|
|
|
|
#include "nsFont.h"
|
|
|
|
#include "nsSize.h"
|
2011-03-31 05:26:49 -07:00
|
|
|
#include "nsStyleConsts.h"
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
nsLookAndFeel::nsLookAndFeel() : nsXPLookAndFeel()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
nsLookAndFeel::~nsLookAndFeel()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2011-09-08 19:27:13 -07:00
|
|
|
nsresult
|
|
|
|
nsLookAndFeel::NativeGetColor(ColorID aID, nscolor &aColor)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
nsresult res = NS_OK;
|
|
|
|
|
|
|
|
int idx;
|
|
|
|
switch (aID) {
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_WindowBackground:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_WINDOW;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_WindowForeground:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_WINDOWTEXT;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_WidgetBackground:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_BUTTONMIDDLE;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_WidgetForeground:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_WINDOWTEXT;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_WidgetSelectBackground:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_HILITEBACKGROUND;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_WidgetSelectForeground:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_HILITEFOREGROUND;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_Widget3DHighlight:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_BUTTONLIGHT;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_Widget3DShadow:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_BUTTONDARK;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_TextBackground:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_WINDOW;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_TextForeground:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_WINDOWTEXT;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_TextSelectBackground:
|
|
|
|
case eColorID_IMESelectedRawTextBackground:
|
|
|
|
case eColorID_IMESelectedConvertedTextBackground:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_HILITEBACKGROUND;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_TextSelectForeground:
|
|
|
|
case eColorID_IMESelectedRawTextForeground:
|
|
|
|
case eColorID_IMESelectedConvertedTextForeground:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_HILITEFOREGROUND;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_IMERawInputBackground:
|
|
|
|
case eColorID_IMEConvertedTextBackground:
|
2007-03-22 10:30:00 -07:00
|
|
|
aColor = NS_TRANSPARENT;
|
|
|
|
return NS_OK;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_IMERawInputForeground:
|
|
|
|
case eColorID_IMEConvertedTextForeground:
|
2007-03-22 10:30:00 -07:00
|
|
|
aColor = NS_SAME_AS_FOREGROUND_COLOR;
|
|
|
|
return NS_OK;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_IMERawInputUnderline:
|
|
|
|
case eColorID_IMEConvertedTextUnderline:
|
2007-03-22 10:30:00 -07:00
|
|
|
aColor = NS_SAME_AS_FOREGROUND_COLOR;
|
|
|
|
return NS_OK;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_IMESelectedRawTextUnderline:
|
|
|
|
case eColorID_IMESelectedConvertedTextUnderline:
|
2007-03-22 10:30:00 -07:00
|
|
|
aColor = NS_TRANSPARENT;
|
|
|
|
return NS_OK;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_SpellCheckerUnderline:
|
2009-04-03 00:26:28 -07:00
|
|
|
aColor = NS_RGB(0xff, 0, 0);
|
|
|
|
return NS_OK;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// New CSS 2 Color definitions
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_activeborder:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_ACTIVEBORDER;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_activecaption:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_ACTIVETITLETEXT;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_appworkspace:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_APPWORKSPACE;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_background:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_BACKGROUND;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_buttonface:
|
|
|
|
case eColorID__moz_buttonhoverface:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_BUTTONMIDDLE;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_buttonhighlight:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_BUTTONLIGHT;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_buttonshadow:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_BUTTONDARK;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_buttontext:
|
|
|
|
case eColorID__moz_buttonhovertext:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_MENUTEXT;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_captiontext:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_WINDOWTEXT;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_graytext:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_MENUDISABLEDTEXT;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_highlight:
|
|
|
|
case eColorID__moz_html_cellhighlight:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_HILITEBACKGROUND;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_highlighttext:
|
|
|
|
case eColorID__moz_html_cellhighlighttext:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_HILITEFOREGROUND;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_inactiveborder:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_INACTIVEBORDER;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_inactivecaption:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_INACTIVETITLE;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_inactivecaptiontext:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_INACTIVETITLETEXT;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_infobackground:
|
2007-03-22 10:30:00 -07:00
|
|
|
aColor = NS_RGB( 255, 255, 228);
|
|
|
|
return res;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_infotext:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_WINDOWTEXT;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_menu:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_MENU;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_menutext:
|
|
|
|
case eColorID__moz_menubartext:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_MENUTEXT;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_scrollbar:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_SCROLLBAR;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_threeddarkshadow:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_BUTTONDARK;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_threedface:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_BUTTONMIDDLE;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_threedhighlight:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_BUTTONLIGHT;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_threedlightshadow:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_BUTTONMIDDLE;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_threedshadow:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_BUTTONDARK;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_window:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_WINDOW;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_windowframe:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_WINDOWFRAME;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID_windowtext:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_WINDOWTEXT;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID__moz_eventreerow:
|
|
|
|
case eColorID__moz_oddtreerow:
|
|
|
|
case eColorID__moz_field:
|
|
|
|
case eColorID__moz_combobox:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_ENTRYFIELD;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID__moz_fieldtext:
|
|
|
|
case eColorID__moz_comboboxtext:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_WINDOWTEXT;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID__moz_dialog:
|
|
|
|
case eColorID__moz_cellhighlight:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_DIALOGBACKGROUND;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID__moz_dialogtext:
|
|
|
|
case eColorID__moz_cellhighlighttext:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_WINDOWTEXT;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID__moz_buttondefault:
|
2007-03-22 10:30:00 -07:00
|
|
|
idx = SYSCLR_BUTTONDEFAULT;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID__moz_menuhover:
|
2007-12-28 15:34:22 -08:00
|
|
|
if (WinQuerySysColor(HWND_DESKTOP, SYSCLR_MENUHILITEBGND, 0) ==
|
|
|
|
WinQuerySysColor(HWND_DESKTOP, SYSCLR_MENU, 0)) {
|
2007-12-14 12:30:02 -08:00
|
|
|
// if this happens, we would paint menu selections unreadable
|
|
|
|
// (we are most likely on Warp3), so let's fake a dark grey
|
|
|
|
// background for the selected menu item
|
|
|
|
aColor = NS_RGB( 132, 130, 132);
|
|
|
|
return res;
|
|
|
|
} else {
|
|
|
|
idx = SYSCLR_MENUHILITEBGND;
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID__moz_menuhovertext:
|
|
|
|
case eColorID__moz_menubarhovertext:
|
2007-12-28 15:34:22 -08:00
|
|
|
if (WinQuerySysColor(HWND_DESKTOP, SYSCLR_MENUHILITEBGND, 0) ==
|
|
|
|
WinQuerySysColor(HWND_DESKTOP, SYSCLR_MENU, 0)) {
|
2007-12-14 12:30:02 -08:00
|
|
|
// white text to be readable on dark grey
|
|
|
|
aColor = NS_RGB( 255, 255, 255);
|
|
|
|
return res;
|
|
|
|
} else {
|
|
|
|
idx = SYSCLR_MENUHILITE;
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eColorID__moz_nativehyperlinktext:
|
2008-08-21 15:09:28 -07:00
|
|
|
aColor = NS_RGB( 0, 0, 255);
|
|
|
|
return res;
|
2007-03-22 10:30:00 -07:00
|
|
|
default:
|
|
|
|
idx = SYSCLR_WINDOW;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
long lColor = WinQuerySysColor( HWND_DESKTOP, idx, 0);
|
|
|
|
|
|
|
|
int iRed = (lColor & RGB_RED) >> 16;
|
|
|
|
int iGreen = (lColor & RGB_GREEN) >> 8;
|
|
|
|
int iBlue = (lColor & RGB_BLUE);
|
|
|
|
|
|
|
|
aColor = NS_RGB( iRed, iGreen, iBlue);
|
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2011-09-08 19:27:13 -07:00
|
|
|
nsresult
|
|
|
|
nsLookAndFeel::GetIntImpl(IntID aID, PRInt32 &aResult)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2011-09-08 19:27:13 -07:00
|
|
|
nsresult res = nsXPLookAndFeel::GetIntImpl(aID, aResult);
|
2007-03-22 10:30:00 -07:00
|
|
|
if (NS_SUCCEEDED(res))
|
|
|
|
return res;
|
|
|
|
res = NS_OK;
|
|
|
|
|
|
|
|
switch (aID) {
|
2011-09-08 19:27:13 -07:00
|
|
|
case eIntID_CaretBlinkTime:
|
|
|
|
aResult = WinQuerySysValue( HWND_DESKTOP, SV_CURSORRATE);
|
2007-03-22 10:30:00 -07:00
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eIntID_CaretWidth:
|
|
|
|
aResult = 1;
|
2007-03-22 10:30:00 -07:00
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eIntID_ShowCaretDuringSelection:
|
|
|
|
aResult = 0;
|
2007-03-22 10:30:00 -07:00
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eIntID_SelectTextfieldsOnKeyFocus:
|
2007-03-22 10:30:00 -07:00
|
|
|
// Do not select textfield content when focused by kbd
|
|
|
|
// used by nsEventStateManager::sTextfieldSelectModel
|
2011-09-08 19:27:13 -07:00
|
|
|
aResult = 0;
|
2007-03-22 10:30:00 -07:00
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eIntID_SubmenuDelay:
|
|
|
|
aResult = 300;
|
2007-03-22 10:30:00 -07:00
|
|
|
break;
|
2011-12-16 01:18:48 -08:00
|
|
|
case eIntID_TooltipDelay:
|
|
|
|
aResult = 500;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eIntID_MenusCanOverlapOSBar:
|
2007-03-22 10:30:00 -07:00
|
|
|
// we want XUL popups to be able to overlap the task bar.
|
2011-09-08 19:27:13 -07:00
|
|
|
aResult = 1;
|
2007-03-22 10:30:00 -07:00
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eIntID_ScrollArrowStyle:
|
|
|
|
aResult = eScrollArrowStyle_Single;
|
2007-03-22 10:30:00 -07:00
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eIntID_ScrollSliderStyle:
|
|
|
|
aResult = eScrollThumbStyle_Proportional;
|
2007-03-22 10:30:00 -07:00
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eIntID_TreeOpenDelay:
|
|
|
|
aResult = 1000;
|
2007-03-22 10:30:00 -07:00
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eIntID_TreeCloseDelay:
|
|
|
|
aResult = 0;
|
2007-03-22 10:30:00 -07:00
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eIntID_TreeLazyScrollDelay:
|
|
|
|
aResult = 150;
|
2007-03-22 10:30:00 -07:00
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eIntID_TreeScrollDelay:
|
|
|
|
aResult = 100;
|
2007-03-22 10:30:00 -07:00
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eIntID_TreeScrollLinesMax:
|
|
|
|
aResult = 3;
|
2007-03-22 10:30:00 -07:00
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eIntID_DWMCompositor:
|
|
|
|
case eIntID_WindowsClassic:
|
|
|
|
case eIntID_WindowsDefaultTheme:
|
|
|
|
case eIntID_TouchEnabled:
|
|
|
|
case eIntID_WindowsThemeIdentifier:
|
|
|
|
aResult = 0;
|
2008-04-08 11:36:53 -07:00
|
|
|
res = NS_ERROR_NOT_IMPLEMENTED;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eIntID_MacGraphiteTheme:
|
|
|
|
case eIntID_MacLionTheme:
|
|
|
|
case eIntID_MaemoClassic:
|
|
|
|
aResult = 0;
|
2008-09-17 09:23:58 -07:00
|
|
|
res = NS_ERROR_NOT_IMPLEMENTED;
|
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eIntID_IMERawInputUnderlineStyle:
|
|
|
|
case eIntID_IMEConvertedTextUnderlineStyle:
|
|
|
|
aResult = NS_STYLE_TEXT_DECORATION_STYLE_SOLID;
|
2007-08-16 13:35:18 -07:00
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eIntID_IMESelectedRawTextUnderlineStyle:
|
|
|
|
case eIntID_IMESelectedConvertedTextUnderline:
|
|
|
|
aResult = NS_STYLE_TEXT_DECORATION_STYLE_NONE;
|
2007-08-16 13:35:18 -07:00
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eIntID_SpellCheckerUnderlineStyle:
|
|
|
|
aResult = NS_STYLE_TEXT_DECORATION_STYLE_WAVY;
|
2009-04-03 00:26:28 -07:00
|
|
|
break;
|
2011-11-17 15:41:35 -08:00
|
|
|
case eIntID_ScrollbarButtonAutoRepeatBehavior:
|
|
|
|
aResult = 0;
|
|
|
|
break;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
default:
|
2011-09-08 19:27:13 -07:00
|
|
|
aResult = 0;
|
2007-03-22 10:30:00 -07:00
|
|
|
res = NS_ERROR_FAILURE;
|
|
|
|
}
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2011-09-08 19:27:13 -07:00
|
|
|
nsresult
|
|
|
|
nsLookAndFeel::GetFloatImpl(FloatID aID, float &aResult)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2011-09-08 19:27:13 -07:00
|
|
|
nsresult res = nsXPLookAndFeel::GetFloatImpl(aID, aResult);
|
2007-03-22 10:30:00 -07:00
|
|
|
if (NS_SUCCEEDED(res))
|
|
|
|
return res;
|
|
|
|
res = NS_OK;
|
|
|
|
|
|
|
|
switch (aID) {
|
2011-09-08 19:27:13 -07:00
|
|
|
case eFloatID_IMEUnderlineRelativeSize:
|
|
|
|
aResult = 1.0f;
|
2007-03-22 10:30:00 -07:00
|
|
|
break;
|
2011-09-08 19:27:13 -07:00
|
|
|
case eFloatID_SpellCheckerUnderlineRelativeSize:
|
|
|
|
aResult = 1.0f;
|
2009-04-03 00:26:28 -07:00
|
|
|
break;
|
2007-03-22 10:30:00 -07:00
|
|
|
default:
|
2011-09-08 19:27:13 -07:00
|
|
|
aResult = -1.0;
|
2007-03-22 10:30:00 -07:00
|
|
|
res = NS_ERROR_FAILURE;
|
|
|
|
}
|
|
|
|
return res;
|
|
|
|
}
|