Minimo only. 1) This allows software keyboard support to be toggled via preferences. 2) Alerting if we ever fail to load a preload lib. 3) Adding the dummy ce softkey menu resource as required by SP. 4) Removing nsInterfaceInfoToIDL.

This commit is contained in:
dougt%meer.net 2006-01-19 23:44:17 +00:00
Родитель 1ff2c7a9ea
Коммит d9777e3f9d
9 изменённых файлов: 64 добавлений и 38 удалений

Просмотреть файл

@ -545,8 +545,17 @@ _library Libraries[] =
void LoadKnownLibs()
{
for (int i=0; Libraries[i].name; i++)
for (int i=0; Libraries[i].name; i++)
{
Libraries[i].module = LoadLibraryW(Libraries[i].name);
if (!Libraries[i].module)
{
MessageBox(0,
"Preload library failed to load.",
"Lib Load Failed",
MB_APPLMODAL);
}
}
}
void UnloadKnownLibs()

Просмотреть файл

@ -9,4 +9,9 @@ END
IDB_BITMAP1 BITMAP DISCARDABLE "splashscreen.bmp"
// HI_RES_AWARE CEUX {1} // To turn off the emulation layer
HI_RES_AWARE CEUX {1} // To turn off the emulation layer
IDC_DUMMY_CE_MENUBAR RCDATA MOVEABLE PURE
BEGIN
0x0000, 0x0001, 0xfffe, 0x0001, 0x0004, 0x0010, 0x0066, 0x0000, 0xffff
END

Просмотреть файл

@ -37,4 +37,4 @@
#define IDD_SPLASHSCREEN 101
#define IDB_BITMAP1 104
#define IDC_SPLASHBMP 1001
#define IDC_DUMMY_CE_MENUBAR 4111 /* defined in mozilla/widget/src/windows/resource.h */

Просмотреть файл

@ -964,6 +964,16 @@ function DoSNavToggle()
}
function DoToggleSoftwareKeyboard()
{
try {
var pref = Components.classes["@mozilla.org/preferences-service;1"].getService(nsCI.nsIPrefBranch);
pref.setBoolPref("skey.enabled", !pref.getBoolPref("skey.enabled"));
}
catch(ex) { alert(ex); }
}
function DoFullScreen()
{
gFullScreen = !gFullScreen;

Просмотреть файл

@ -81,7 +81,8 @@
-->
<key id="minimo-key" keycode="VK_F23" oncommand="BrowserMenuSpin()"/>
<key id="minimo-key2" keycode="VK_F11" oncommand="BrowserMenuSpin()"/>
<key id="minimo-key3" keycode="VK_F24" oncommand="BrowserNavMenuPopup()"/>
<key id="minimo-key3" keycode="VK_F24" oncommand="DoToggleSoftwareKeyboard()"/>
<key id="minimo-key4" keycode="VK_F12" oncommand="BrowserNavMenuPopup()"/>
</keyset>

Просмотреть файл

@ -80,6 +80,8 @@
#include "nsITimer.h"
static PRBool gUseSoftwareKeyboard;
#ifdef WINCE
#include "keybd.h"
@ -340,9 +342,6 @@ private:
~nsSoftKeyBoard();
PRBool ShouldOpenKeyboardFor(nsIDOMEvent* aEvent);
void CloseSIP();
void OpenSIP();
nsCOMPtr<nsIDOMWindow> mTopWindow;
class nsSoftKeyBoardService* mService;
@ -372,7 +371,10 @@ public:
nsCOMArray<nsSoftKeyBoard> mObjects;
PRBool mUseSoftwareKeyboard;
static void CloseSIP();
static void OpenSIP();
void HandlePref(const char* pref, nsIPrefBranch2* prefBranch);
};
NS_INTERFACE_MAP_BEGIN(nsSoftKeyBoard)
@ -393,7 +395,7 @@ nsSoftKeyBoard::nsSoftKeyBoard(nsSoftKeyBoardService* aService)
mCurrentDigitCount = 0;
mUsage = eLowerCase;
CloseSIP();
nsSoftKeyBoardService::CloseSIP();
}
nsSoftKeyBoard::~nsSoftKeyBoard()
@ -460,7 +462,7 @@ nsSoftKeyBoard::HandleEvent(nsIDOMEvent* aEvent)
if (keyCode == nsIDOMKeyEvent::DOM_VK_RETURN && controlType != NS_FORM_TEXTAREA)
{
CloseSIP();
nsSoftKeyBoardService::CloseSIP();
}
#ifdef WINCE
@ -563,7 +565,7 @@ nsSoftKeyBoard::HandleEvent(nsIDOMEvent* aEvent)
if (eventType.EqualsLiteral("click"))
{
OpenSIP();
nsSoftKeyBoardService::OpenSIP();
return NS_OK;
}
@ -586,28 +588,21 @@ nsSoftKeyBoard::HandleEvent(nsIDOMEvent* aEvent)
if (eventType.EqualsLiteral("focus"))
{
// if (popupConditions == PR_FALSE)
OpenSIP();
nsSoftKeyBoardService::OpenSIP();
}
else
CloseSIP();
nsSoftKeyBoardService::CloseSIP();
return NS_OK;
}
void
nsSoftKeyBoard::OpenSIP()
nsSoftKeyBoardService::OpenSIP()
{
// It is okay to CloseSip if there is a hardware keyboard
// present, but it isn't nice to use a software keyboard
// when a hardware one is present.
if (!mService->mUseSoftwareKeyboard)
if (!gUseSoftwareKeyboard)
return;
#ifdef WINCE
if (IsSmartphone())
return;
HWND hWndSIP = ::FindWindow( _T( "SipWndClass" ), NULL );
if (hWndSIP)
::ShowWindow( hWndSIP, SW_SHOW);
@ -629,11 +624,9 @@ nsSoftKeyBoard::OpenSIP()
}
void
nsSoftKeyBoard::CloseSIP()
nsSoftKeyBoardService::CloseSIP()
{
#ifdef WINCE
if (IsSmartphone())
return;
HWND hWndSIP = FindWindow( _T( "SipWndClass" ), NULL );
if (hWndSIP)
@ -739,7 +732,7 @@ nsSoftKeyBoard::GetAttachedWindow(nsIDOMWindow * *aAttachedWindow)
nsSoftKeyBoardService::nsSoftKeyBoardService()
{
mUseSoftwareKeyboard = PR_TRUE;
gUseSoftwareKeyboard = PR_FALSE;
}
nsSoftKeyBoardService::~nsSoftKeyBoardService()
@ -748,6 +741,23 @@ nsSoftKeyBoardService::~nsSoftKeyBoardService()
NS_IMPL_ISUPPORTS1(nsSoftKeyBoardService, nsIObserver)
void
nsSoftKeyBoardService::HandlePref(const char* pref, nsIPrefBranch2* prefBranch)
{
if (!strcmp(pref, "skey.enabled"))
{
PRBool enabled;
prefBranch->GetBoolPref(pref, &enabled);
gUseSoftwareKeyboard = enabled;
if (gUseSoftwareKeyboard)
nsSoftKeyBoardService::OpenSIP();
else
nsSoftKeyBoardService::CloseSIP();
}
}
NS_IMETHODIMP
nsSoftKeyBoardService::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *aData)
{
@ -802,23 +812,18 @@ nsSoftKeyBoardService::Observe(nsISupports *aSubject, const char *aTopic, const
prefBranch->AddObserver("skey.", this, PR_FALSE);
HandlePref("snav.enabled", prefBranch);
return NS_OK;
}
if (!strcmp(aTopic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID))
{
nsCOMPtr<nsIPrefBranch> prefBranch = do_QueryInterface(aSubject);
nsCOMPtr<nsIPrefBranch2> prefBranch = do_QueryInterface(aSubject);
nsXPIDLCString cstr;
const char* pref = NS_ConvertUCS2toUTF8(aData).get();
if (!strcmp(pref, "skey.enabled"))
{
PRBool enabled;
prefBranch->GetBoolPref(pref, &enabled);
mUseSoftwareKeyboard = enabled;
}
HandlePref(pref, prefBranch);
return NS_OK;
}
return NS_OK;

Просмотреть файл

@ -62,7 +62,6 @@ cp -pRL bin/components/nsHelperAppDlg.js minimo/components
cp -pRL bin/components/nsProgressDialog.js minimo/components
cp -pRL bin/components/nsDictionary.js minimo/components
cp -pRL bin/components/nsInterfaceInfoToIDL.js minimo/components
cp -pRL bin/components/nsXmlRpcClient.js minimo/components
cp -pRL bin/extensions/spatial-navigation@extensions.mozilla.org/components/* minimo/components

Просмотреть файл

@ -40,7 +40,6 @@ toolkit.manifest=2
all.xpt=3
snav.xpt=3
nsDictionary.js=3
nsInterfaceInfoToIDL.js=3
nsXmlRpcClient.js=3
HelperAppDlg.js=3
@ -103,7 +102,6 @@ toolkit.manifest,,,0
all.xpt,,,0
snav.xpt,,,0
nsDictionary.js,,,0
nsInterfaceInfoToIDL.js,,,0
nsXmlRpcClient.js,,,0
HelperAppDlg.js,,,0

Просмотреть файл

@ -41,7 +41,6 @@ cp -a bin/chrome/toolkit.manifest minimo/chrome
mkdir -p minimo/components
cp -a bin/components/nsDictionary.js minimo/components
cp -a bin/components/nsInterfaceInfoToIDL.js minimo/components
cp -a bin/components/nsXmlRpcClient.js minimo/components
cp -a bin/extensions/spatial-navigation@extensions.mozilla.org/components/* minimo/components