зеркало из https://github.com/mozilla/pjs.git
# 37239
r= mkaply@us.ibm.com OS/2 bring up continues - checking in files for the OS/2 team
This commit is contained in:
Родитель
b1f4f54b0d
Коммит
aab38ad60d
|
@ -60,7 +60,7 @@ nsFontMetricsOS2::~nsFontMetricsOS2()
|
||||||
|
|
||||||
NS_IMPL_ISUPPORTS( nsFontMetricsOS2, nsIFontMetrics::GetIID())
|
NS_IMPL_ISUPPORTS( nsFontMetricsOS2, nsIFontMetrics::GetIID())
|
||||||
|
|
||||||
nsresult nsFontMetricsOS2::Init( const nsFont &aFont, nsIDeviceContext *aContext)
|
nsresult nsFontMetricsOS2::Init( const nsFont &aFont, nsIAtom* aLangGroup, nsIDeviceContext *aContext)
|
||||||
{
|
{
|
||||||
mFont = new nsFont( aFont);
|
mFont = new nsFont( aFont);
|
||||||
mContext = (nsDeviceContextOS2 *) aContext;
|
mContext = (nsDeviceContextOS2 *) aContext;
|
||||||
|
@ -432,3 +432,14 @@ NS_IMETHODIMP nsFontMetricsOS2::GetFontHandle( nsFontHandle &aHandle)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP nsFontMetricsOS2::GetLangGroup(nsIAtom** aLangGroup)
|
||||||
|
{
|
||||||
|
if (!aLangGroup) {
|
||||||
|
return NS_ERROR_NULL_POINTER;
|
||||||
|
}
|
||||||
|
|
||||||
|
*aLangGroup = mLangGroup;
|
||||||
|
NS_IF_ADDREF(*aLangGroup);
|
||||||
|
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
|
@ -32,6 +32,8 @@
|
||||||
|
|
||||||
#include "nsIFontMetrics.h"
|
#include "nsIFontMetrics.h"
|
||||||
#include "nsCRT.h"
|
#include "nsCRT.h"
|
||||||
|
#include "nsIAtom.h"
|
||||||
|
#include "nsCOMPtr.h" //HCT-M15
|
||||||
|
|
||||||
class nsIRenderingContext;
|
class nsIRenderingContext;
|
||||||
class nsDeviceContextOS2;
|
class nsDeviceContextOS2;
|
||||||
|
@ -59,7 +61,7 @@ class nsFontMetricsOS2 : public nsIFontMetrics
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_ISUPPORTS
|
||||||
|
|
||||||
NS_IMETHOD Init( const nsFont& aFont, nsIDeviceContext *aContext);
|
NS_IMETHOD Init( const nsFont& aFont, nsIAtom* aLangGroup, nsIDeviceContext *aContext);
|
||||||
NS_IMETHOD Destroy();
|
NS_IMETHOD Destroy();
|
||||||
|
|
||||||
// Metrics
|
// Metrics
|
||||||
|
@ -75,9 +77,8 @@ class nsFontMetricsOS2 : public nsIFontMetrics
|
||||||
NS_IMETHOD GetMaxDescent( nscoord &aDescent);
|
NS_IMETHOD GetMaxDescent( nscoord &aDescent);
|
||||||
NS_IMETHOD GetMaxAdvance( nscoord &aAdvance);
|
NS_IMETHOD GetMaxAdvance( nscoord &aAdvance);
|
||||||
NS_IMETHOD GetFont( const nsFont *&aFont);
|
NS_IMETHOD GetFont( const nsFont *&aFont);
|
||||||
// NS_IMETHOD GetLangGroup(nsIAtom** aLangGroup);
|
NS_IMETHOD GetLangGroup(nsIAtom** aLangGroup);
|
||||||
NS_IMETHOD GetFontHandle( nsFontHandle &aHandle);
|
NS_IMETHOD GetFontHandle( nsFontHandle &aHandle);
|
||||||
// NS_IMETHOD GetLangGroup(nsIAtom** aLangGroup);
|
|
||||||
|
|
||||||
// for drawing text
|
// for drawing text
|
||||||
PRUint32 GetDevMaxAscender() const { return mDevMaxAscent; }
|
PRUint32 GetDevMaxAscender() const { return mDevMaxAscent; }
|
||||||
|
@ -105,6 +106,9 @@ class nsFontMetricsOS2 : public nsIFontMetrics
|
||||||
|
|
||||||
nsFontHandleOS2 *mFontHandle;
|
nsFontHandleOS2 *mFontHandle;
|
||||||
nsDeviceContextOS2 *mContext; // sigh.. broken broken broken XP interfaces...
|
nsDeviceContextOS2 *mContext; // sigh.. broken broken broken XP interfaces...
|
||||||
|
|
||||||
|
nsCOMPtr<nsIAtom> mLangGroup;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -72,6 +72,10 @@ nsresult nsCollationOS2::GetSortKeyLen( const nsCollationStrength aStrength,
|
||||||
if( !aOutLen)
|
if( !aOutLen)
|
||||||
return NS_ERROR_NULL_POINTER;
|
return NS_ERROR_NULL_POINTER;
|
||||||
|
|
||||||
|
// XXXX M15 LAUNCH HACK: TODO: track down why we get here before Initialize has been called...OS2TODO
|
||||||
|
if (!mLocaleObject)
|
||||||
|
UniCreateLocaleObject(UNI_UCS_STRING_POINTER, (UniChar*)L"", &mLocaleObject);
|
||||||
|
|
||||||
size_t num_elems = UniStrxfrm( mLocaleObject, nsnull,
|
size_t num_elems = UniStrxfrm( mLocaleObject, nsnull,
|
||||||
aStringIn.GetUnicode(), 0);
|
aStringIn.GetUnicode(), 0);
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,6 @@
|
||||||
#include "nsDateTimeFormatCID.h"
|
#include "nsDateTimeFormatCID.h"
|
||||||
#include "nsCollationCID.h"
|
#include "nsCollationCID.h"
|
||||||
#include "nsIServiceManager.h"
|
#include "nsIServiceManager.h"
|
||||||
#include "nsCOMPtr.h"
|
|
||||||
|
|
||||||
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
|
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
|
||||||
|
|
||||||
|
@ -228,7 +227,7 @@ static Components gComponents[] = {
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsLocaleModule::RegisterSelf(nsIComponentManager *aCompMgr,
|
nsLocaleModule::RegisterSelf(nsIComponentManager *aCompMgr,
|
||||||
nsIFileSpec* aPath,
|
nsIFile* aPath,
|
||||||
const char* registryLocation,
|
const char* registryLocation,
|
||||||
const char* componentType)
|
const char* componentType)
|
||||||
{
|
{
|
||||||
|
@ -259,7 +258,7 @@ nsLocaleModule::RegisterSelf(nsIComponentManager *aCompMgr,
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsLocaleModule::UnregisterSelf(nsIComponentManager* aCompMgr,
|
nsLocaleModule::UnregisterSelf(nsIComponentManager* aCompMgr,
|
||||||
nsIFileSpec* aPath,
|
nsIFile* aPath,
|
||||||
const char* registryLocation)
|
const char* registryLocation)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
@ -296,7 +295,7 @@ nsLocaleModule::CanUnload(nsIComponentManager *aCompMgr, PRBool *okToUnload)
|
||||||
static nsLocaleModule *gModule = NULL;
|
static nsLocaleModule *gModule = NULL;
|
||||||
|
|
||||||
extern "C" NS_EXPORT nsresult NSGetModule(nsIComponentManager *servMgr,
|
extern "C" NS_EXPORT nsresult NSGetModule(nsIComponentManager *servMgr,
|
||||||
nsIFileSpec* location,
|
nsIFile* location,
|
||||||
nsIModule** return_cobj)
|
nsIModule** return_cobj)
|
||||||
{
|
{
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
@ -304,7 +303,7 @@ extern "C" NS_EXPORT nsresult NSGetModule(nsIComponentManager *servMgr,
|
||||||
NS_ASSERTION(return_cobj, "Null argument");
|
NS_ASSERTION(return_cobj, "Null argument");
|
||||||
NS_ASSERTION(gModule == NULL, "nsLocaleModule: Module already created.");
|
NS_ASSERTION(gModule == NULL, "nsLocaleModule: Module already created.");
|
||||||
|
|
||||||
// Create an initialize the layout module instance
|
// Create and initialize the layout module instance
|
||||||
nsLocaleModule *m = new nsLocaleModule();
|
nsLocaleModule *m = new nsLocaleModule();
|
||||||
if (!m) {
|
if (!m) {
|
||||||
return NS_ERROR_OUT_OF_MEMORY;
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
|
|
|
@ -290,10 +290,11 @@ nsresult nsMenuItem::DoCommand()
|
||||||
// code copied from windows
|
// code copied from windows
|
||||||
nsresult rv = NS_ERROR_FAILURE;
|
nsresult rv = NS_ERROR_FAILURE;
|
||||||
|
|
||||||
|
#if 0 // XXXXX FIXME no longer works due to WebShell changes
|
||||||
nsCOMPtr<nsIContentViewer> contentViewer;
|
nsCOMPtr<nsIContentViewer> contentViewer;
|
||||||
NS_ENSURE_SUCCESS(mWebShell->GetContentViewer(getter_AddRefs(contentViewer)),
|
NS_ENSURE_SUCCESS(mWebShell->GetContentViewer(getter_AddRefs(contentViewer)),
|
||||||
NS_ERROR_FAILURE);
|
NS_ERROR_FAILURE);
|
||||||
|
|
||||||
nsCOMPtr<nsIDocumentViewer> docViewer;
|
nsCOMPtr<nsIDocumentViewer> docViewer;
|
||||||
docViewer = do_QueryInterface(contentViewer);
|
docViewer = do_QueryInterface(contentViewer);
|
||||||
if (!docViewer) {
|
if (!docViewer) {
|
||||||
|
@ -306,7 +307,7 @@ nsresult nsMenuItem::DoCommand()
|
||||||
NS_ERROR("Unable to retrieve the doc viewer's presentation context.");
|
NS_ERROR("Unable to retrieve the doc viewer's presentation context.");
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsEventStatus status = nsEventStatus_eIgnore;
|
nsEventStatus status = nsEventStatus_eIgnore;
|
||||||
nsMouseEvent event;
|
nsMouseEvent event;
|
||||||
event.eventStructType = NS_MOUSE_EVENT;
|
event.eventStructType = NS_MOUSE_EVENT;
|
||||||
|
@ -320,7 +321,8 @@ nsresult nsMenuItem::DoCommand()
|
||||||
}
|
}
|
||||||
|
|
||||||
rv = contentNode->HandleDOMEvent(presContext, &event, nsnull, NS_EVENT_FLAG_INIT, &status);
|
rv = contentNode->HandleDOMEvent(presContext, &event, nsnull, NS_EVENT_FLAG_INIT, &status);
|
||||||
|
#endif
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -420,3 +422,15 @@ nsresult nsMenuItem::GetCheckboxType(PRBool *aIsCheckbox)
|
||||||
{
|
{
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nsresult nsMenuItem::SetMenuItemType(EMenuItemType aType)
|
||||||
|
{
|
||||||
|
mMenuType = aType;
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
nsresult nsMenuItem::GetMenuItemType(EMenuItemType *aType)
|
||||||
|
{
|
||||||
|
*aType = mMenuType;
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
|
@ -71,6 +71,8 @@ class nsMenuItem : public nsIMenuItem, public nsIMenuListener
|
||||||
NS_IMETHOD GetShortcutChar(nsString &aText);
|
NS_IMETHOD GetShortcutChar(nsString &aText);
|
||||||
NS_IMETHOD SetModifiers(PRUint8 aModifiers);
|
NS_IMETHOD SetModifiers(PRUint8 aModifiers);
|
||||||
NS_IMETHOD GetModifiers(PRUint8 * aModifiers);
|
NS_IMETHOD GetModifiers(PRUint8 * aModifiers);
|
||||||
|
NS_IMETHOD SetMenuItemType(EMenuItemType aIsCheckbox);
|
||||||
|
NS_IMETHOD GetMenuItemType(EMenuItemType *aIsCheckbox);
|
||||||
|
|
||||||
// nsIMenuListener interface
|
// nsIMenuListener interface
|
||||||
nsEventStatus MenuSelected( const nsMenuEvent &aMenuEvent);
|
nsEventStatus MenuSelected( const nsMenuEvent &aMenuEvent);
|
||||||
|
@ -97,6 +99,7 @@ class nsMenuItem : public nsIMenuItem, public nsIMenuListener
|
||||||
nsString mCmdString; // JS command
|
nsString mCmdString; // JS command
|
||||||
nsIDOMElement *mDOMElement; // dom element for item
|
nsIDOMElement *mDOMElement; // dom element for item
|
||||||
nsIWebShell *mWebShell;
|
nsIWebShell *mWebShell;
|
||||||
|
EMenuItemType mMenuType;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -26,6 +26,8 @@
|
||||||
#include "nsWidgetsCID.h"
|
#include "nsWidgetsCID.h"
|
||||||
#include "nsIComponentManager.h"
|
#include "nsIComponentManager.h"
|
||||||
|
|
||||||
|
static PRUintn gToolkitTLSIndex = 0;
|
||||||
|
|
||||||
// Bits to deal with the case where a new toolkit is initted with a null ----
|
// Bits to deal with the case where a new toolkit is initted with a null ----
|
||||||
// thread. In this case it has to create a new thread to be the PM thread.
|
// thread. In this case it has to create a new thread to be the PM thread.
|
||||||
// Hopefully this will never happen!
|
// Hopefully this will never happen!
|
||||||
|
@ -130,6 +132,10 @@ void nsToolkit::CreateInternalWindow( PRThread *aThread)
|
||||||
0, 0, 0);
|
0, 0, 0);
|
||||||
|
|
||||||
NS_ASSERTION( mDispatchWnd, "Couldn't create toolkit internal window");
|
NS_ASSERTION( mDispatchWnd, "Couldn't create toolkit internal window");
|
||||||
|
|
||||||
|
#if DEBUG_sobotka
|
||||||
|
printf("\n+++++++++++nsToolkit created dispatch window 0x%lx\n", mDispatchWnd);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set up the toolkit - create window, check for thread.
|
// Set up the toolkit - create window, check for thread.
|
||||||
|
@ -245,3 +251,52 @@ MRESULT EXPENTRY fnwpDispatch( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
||||||
|
|
||||||
return mRC;
|
return mRC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Return the nsIToolkit for the current thread. If a toolkit does not
|
||||||
|
// yet exist, then one will be created...
|
||||||
|
//
|
||||||
|
//-------------------------------------------------------------------------
|
||||||
|
NS_METHOD NS_GetCurrentToolkit(nsIToolkit* *aResult)
|
||||||
|
{
|
||||||
|
nsIToolkit* toolkit = nsnull;
|
||||||
|
nsresult rv = NS_OK;
|
||||||
|
PRStatus status;
|
||||||
|
|
||||||
|
// Create the TLS index the first time through...
|
||||||
|
if (0 == gToolkitTLSIndex) {
|
||||||
|
status = PR_NewThreadPrivateIndex(&gToolkitTLSIndex, NULL);
|
||||||
|
if (PR_FAILURE == status) {
|
||||||
|
rv = NS_ERROR_FAILURE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (NS_SUCCEEDED(rv)) {
|
||||||
|
toolkit = (nsIToolkit*)PR_GetThreadPrivate(gToolkitTLSIndex);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Create a new toolkit for this thread...
|
||||||
|
//
|
||||||
|
if (!toolkit) {
|
||||||
|
toolkit = new nsToolkit();
|
||||||
|
|
||||||
|
if (!toolkit) {
|
||||||
|
rv = NS_ERROR_OUT_OF_MEMORY;
|
||||||
|
} else {
|
||||||
|
NS_ADDREF(toolkit);
|
||||||
|
toolkit->Init(PR_GetCurrentThread());
|
||||||
|
//
|
||||||
|
// The reference stored in the TLS is weak. It is removed in the
|
||||||
|
// nsToolkit destructor...
|
||||||
|
//
|
||||||
|
PR_SetThreadPrivate(gToolkitTLSIndex, (void*)toolkit);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
NS_ADDREF(toolkit);
|
||||||
|
}
|
||||||
|
*aResult = toolkit;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,127 @@
|
||||||
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||||
|
/*
|
||||||
|
* The contents of this file are subject to the Netscape 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/NPL/
|
||||||
|
*
|
||||||
|
* 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 Communicator client code,
|
||||||
|
* released March 31, 1998.
|
||||||
|
*
|
||||||
|
* The Initial Developer of the Original Code is Netscape Communications
|
||||||
|
* Corporation. Portions created by Netscape are
|
||||||
|
* Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
||||||
|
* Rights Reserved.
|
||||||
|
*
|
||||||
|
* Contributor(s):
|
||||||
|
* Henry Sobotka <sobotka@axess.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _nsLocalFileOS2_H_
|
||||||
|
#define _nsLocalFileOS2_H_
|
||||||
|
|
||||||
|
#include "nscore.h"
|
||||||
|
#include "nsError.h"
|
||||||
|
#include "nsString.h"
|
||||||
|
#include "nsCRT.h"
|
||||||
|
#include "nsIFile.h"
|
||||||
|
#include "nsILocalFile.h"
|
||||||
|
#include "nsIFactory.h"
|
||||||
|
#include "nsLocalFile.h"
|
||||||
|
|
||||||
|
#define INCL_DOSFILEMGR
|
||||||
|
#define INCL_DOSERRORS
|
||||||
|
#define INCL_DOSPROCESS
|
||||||
|
#define INCL_DOSMODULEMGR
|
||||||
|
#include <os2.h>
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <io.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
|
#define NSRESULT_FOR_RETURN(ret) (!(ret) ? NS_OK : NSRESULT_FOR_ERRNO())
|
||||||
|
|
||||||
|
inline nsresult
|
||||||
|
nsresultForErrno(int err)
|
||||||
|
{
|
||||||
|
#ifdef DEBUG
|
||||||
|
if (err)
|
||||||
|
fprintf(stderr, "errno %d\n", err);
|
||||||
|
#endif
|
||||||
|
switch(err) {
|
||||||
|
case 0:
|
||||||
|
return NS_OK;
|
||||||
|
case ENOENT:
|
||||||
|
return NS_ERROR_FILE_TARGET_DOES_NOT_EXIST;
|
||||||
|
case ENOTDIR:
|
||||||
|
return NS_ERROR_FILE_DESTINATION_NOT_DIR;
|
||||||
|
case EEXIST:
|
||||||
|
return NS_ERROR_FILE_ALREADY_EXISTS;
|
||||||
|
case EACCES:
|
||||||
|
default:
|
||||||
|
return NS_ERROR_FAILURE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#define NSRESULT_FOR_ERRNO() nsresultForErrno(errno)
|
||||||
|
|
||||||
|
class NS_COM nsLocalFile : public nsILocalFile
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
NS_DEFINE_STATIC_CID_ACCESSOR(NS_LOCAL_FILE_CID)
|
||||||
|
|
||||||
|
nsLocalFile();
|
||||||
|
virtual ~nsLocalFile();
|
||||||
|
|
||||||
|
static NS_METHOD nsLocalFileConstructor(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr);
|
||||||
|
|
||||||
|
// nsISupports interface
|
||||||
|
NS_DECL_ISUPPORTS
|
||||||
|
|
||||||
|
// nsIFile interface
|
||||||
|
NS_DECL_NSIFILE
|
||||||
|
|
||||||
|
// nsILocalFile interface
|
||||||
|
NS_DECL_NSILOCALFILE
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// String guaranteed to be native path
|
||||||
|
nsCString mPath;
|
||||||
|
nsresult CheckDrive(const char* inPath);
|
||||||
|
|
||||||
|
// Filehandling method
|
||||||
|
nsresult CopyMove(nsIFile *newParentDir, const char *newName, PRBool move);
|
||||||
|
|
||||||
|
// stat caching members and inline methods
|
||||||
|
PRBool mHaveStatCached;
|
||||||
|
struct stat mStatCache;
|
||||||
|
|
||||||
|
void SetNoStatCache() { mHaveStatCached = PR_FALSE; }
|
||||||
|
|
||||||
|
nsresult LoadStatCache() {
|
||||||
|
if (stat((const char*)mPath, &mStatCache) == -1) {
|
||||||
|
#ifdef DEBUG
|
||||||
|
fprintf(stderr, "stat(%s) failed; errno: %d\n", (const char *)mPath, errno);
|
||||||
|
#endif
|
||||||
|
return NS_ERROR_FAILURE;
|
||||||
|
}
|
||||||
|
mHaveStatCached = PR_TRUE;
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check path for system-reserved chars (inPath = whatever follows drive colon, if any)
|
||||||
|
PRBool ValidatePath(const char* inPath) {
|
||||||
|
return ((strpbrk(inPath, "<>:\"|") == NULL) ? PR_TRUE : PR_FALSE);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
#endif // _nsLocalFileOS2_H_
|
|
@ -0,0 +1,43 @@
|
||||||
|
#
|
||||||
|
# The contents of this file are subject to the Netscape 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/NPL/
|
||||||
|
#
|
||||||
|
# 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 Netscape are
|
||||||
|
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||||
|
# Rights Reserved.
|
||||||
|
#
|
||||||
|
# Contributor(s):
|
||||||
|
#
|
||||||
|
|
||||||
|
DEPTH = ../../../../..
|
||||||
|
topsrcdir = @top_srcdir@
|
||||||
|
srcdir = @srcdir@
|
||||||
|
VPATH = @srcdir@
|
||||||
|
|
||||||
|
include $(DEPTH)/config/autoconf.mk
|
||||||
|
|
||||||
|
EXPORT_RESOURCE_CONTENT = \
|
||||||
|
$(srcdir)/platformGlobalOverlay.xul \
|
||||||
|
$(srcdir)/platformDialogOverlay.xul \
|
||||||
|
$(srcdir)/platformInputBindings.xul \
|
||||||
|
$(srcdir)/platformBrowserBindings.xul \
|
||||||
|
$(srcdir)/platformInputBindings.xul \
|
||||||
|
$(srcdir)/platformEditorBindings.xul \
|
||||||
|
$(srcdir)/platformTextAreaBindings.xul \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
|
||||||
|
install::
|
||||||
|
$(INSTALL) $(EXPORT_RESOURCE_CONTENT) $(DIST)/bin/chrome/global/content/default
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<!-- OS/2 version of platformBrowserBindings.xul -->
|
||||||
|
|
||||||
|
<keybinding id="platformBrowserBindings"
|
||||||
|
xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||||
|
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||||
|
|
||||||
|
<!-- change the xul key for Unix -->
|
||||||
|
<keyset id="globalKeySet" xulkey="alt">
|
||||||
|
|
||||||
|
<!-- Add the Windows/Mac cut, copy, paste, undo and redo keys -->
|
||||||
|
<key id="emCutKey" key="x" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_cut');
|
||||||
|
controller.doCommand('cmd_cut');"/>
|
||||||
|
<key id="emCopyKey" key="c" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_copy');
|
||||||
|
controller.doCommand('cmd_copy');"/>
|
||||||
|
<key id="emPasteKey" key="v" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_paste');
|
||||||
|
controller.doCommand('cmd_paste');"/>
|
||||||
|
<key id="emUndoKey" key="z" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_undo');
|
||||||
|
controller.doCommand('cmd_undo');"/>
|
||||||
|
<key id="emRedoKey" key="r" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_redo');
|
||||||
|
controller.doCommand('cmd_redo');"/>
|
||||||
|
|
||||||
|
</keyset>
|
||||||
|
|
||||||
|
</keybinding>
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<!-- OS/2 version of platformDialogOverlay.xul -->
|
||||||
|
|
||||||
|
<!DOCTYPE window SYSTEM "chrome://global/locale/platformDialogOverlay.dtd">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<overlay id="platformDialogOverlay"
|
||||||
|
xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||||
|
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||||
|
|
||||||
|
<box id="okCancelButtons" align="horizontal">
|
||||||
|
<spring flex="1"/>
|
||||||
|
<button class="right dialog" id="ok" value="&okButton.label;" default="true" onclick="doOKButton()"/>
|
||||||
|
<button class="dialog" id="Button2" value="&cancelButton.label;" style="display:none;" onclick="doButton2()"/>
|
||||||
|
<button class="dialog" id="Button3" value="&cancelButton.label;" style="display:none;" onclick="doButton3()"/>
|
||||||
|
<button class="dialog" id="cancel" value="&cancelButton.label;" onclick="doCancelButton()"/>
|
||||||
|
<spring flex="1"/>
|
||||||
|
</box>
|
||||||
|
|
||||||
|
<keyset id="keyset">
|
||||||
|
<key keycode="VK_ENTER" oncommand="doOKButton()"/>
|
||||||
|
<key keycode="VK_RETURN" oncommand="doOKButton()"/>
|
||||||
|
<key keycode="VK_ESCAPE" oncommand="doCancelButton()"/>
|
||||||
|
</keyset>
|
||||||
|
|
||||||
|
</overlay>
|
|
@ -0,0 +1,98 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<!-- OS/2 version of platformEditorBindings.xul -->
|
||||||
|
|
||||||
|
<keybinding id="platformEditorBindings"
|
||||||
|
xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||||
|
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||||
|
|
||||||
|
<!-- change the xul key for Unix -->
|
||||||
|
<keyset id="editorKeySet" xulkey="alt">
|
||||||
|
|
||||||
|
<!-- emacs delete keys -->
|
||||||
|
<key id="emDelCharBWkb" key="h" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_deleteCharBackward');
|
||||||
|
controller.doCommand('cmd_deleteCharBackward');"/>
|
||||||
|
<key id="emDelCharFWkb" key="d" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_deleteCharForward');
|
||||||
|
controller.doCommand('cmd_deleteCharForward');"/>
|
||||||
|
<key id="emDelWordBWkb" key="w" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_deleteWordBackward');
|
||||||
|
controller.doCommand('cmd_deleteWordBackward');"/>
|
||||||
|
<key id="emKillToEndkb" key="k" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_deleteToEndOfLine');
|
||||||
|
controller.doCommand('cmd_deleteToEndOfLine');"/>
|
||||||
|
<key id="emKillToBegkb" key="u" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_deleteToBeginningOfLine');
|
||||||
|
controller.doCommand('cmd_deleteToBeginningOfLine');"/>
|
||||||
|
|
||||||
|
<!-- emacs motion keys: these use the selection controller API -->
|
||||||
|
<key id="emBeginLinekb" key="a" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_beginLine');
|
||||||
|
controller.doCommand('cmd_beginLine');"/>
|
||||||
|
<key id="emEndLinekb" key="e" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_endLine');
|
||||||
|
controller.doCommand('cmd_endLine');"/>
|
||||||
|
<key id="emCharPrevkb" key="b" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_charPrevious');
|
||||||
|
controller.doCommand('cmd_charPrevious');"/>
|
||||||
|
<key id="emCharNextkb" key="f" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_charNext');
|
||||||
|
controller.doCommand('cmd_charNext');"/>
|
||||||
|
<key id="emPrevLinekb" key="p" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_linePrevious');
|
||||||
|
controller.doCommand('cmd_linePrevious');"/>
|
||||||
|
<key id="emNextLinekb" key="n" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_lineNext');
|
||||||
|
controller.doCommand('cmd_lineNext');"/>
|
||||||
|
|
||||||
|
<!-- Add the Windows/Mac cut, copy, paste, undo and redo keys -->
|
||||||
|
<key id="emCutKey" key="x" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_cut');
|
||||||
|
controller.doCommand('cmd_cut');"/>
|
||||||
|
<key id="emCopyKey" key="c" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_copy');
|
||||||
|
controller.doCommand('cmd_copy');"/>
|
||||||
|
<key id="emPasteKey" key="v" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_paste');
|
||||||
|
controller.doCommand('cmd_paste');"/>
|
||||||
|
<key id="emUndoKey" key="z" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_undo');
|
||||||
|
controller.doCommand('cmd_undo');"/>
|
||||||
|
<key id="emRedoKey" key="r" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_redo');
|
||||||
|
controller.doCommand('cmd_redo');"/>
|
||||||
|
|
||||||
|
<key id="winAlternateCutKey" keycode="VK_DELETE" shift="true" control="false" alt="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_cut');
|
||||||
|
controller.doCommand('cmd_cut');"/>
|
||||||
|
<key id="winAlternateCopyKey" keycode="VK_INSERT" control="true" shift="false" alt="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_copy');
|
||||||
|
controller.doCommand('cmd_copy');"/>
|
||||||
|
<key id="winAlternatePasteKey" keycode="VK_INSERT" shift="true" control="false" alt="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_paste');
|
||||||
|
controller.doCommand('cmd_paste');"/>
|
||||||
|
|
||||||
|
</keyset>
|
||||||
|
<!-- End OS/2-specific keybindings -->
|
||||||
|
|
||||||
|
</keybinding>
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<!-- OS/2 version of platformGlobalOverlay.xul -->
|
||||||
|
|
||||||
|
<!DOCTYPE window SYSTEM "chrome://global/locale/platformGlobalOverlay.dtd">
|
||||||
|
|
||||||
|
<overlay id="platformGlobalOverlay"
|
||||||
|
xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||||
|
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||||
|
|
||||||
|
<!-- close -->
|
||||||
|
<menuitem id="menu_close" value="&closeCmd.label;" key="key_close" accesskey="&closeCmd.accesskey;" observes="cmd_close"/>
|
||||||
|
<key id="key_close" xulkey="true" key="&closeCmd.key;" observes="cmd_close"/>
|
||||||
|
|
||||||
|
<!-- quit -->
|
||||||
|
<menupopup id="menu_FilePopup">
|
||||||
|
<menuitem value="&quitApplicationCmd.label;" key="key_quit" accesskey="&quitApplicationCmd.accesskey;" observes="cmd_quit"/>
|
||||||
|
</menupopup>
|
||||||
|
<key id="key_quit" xulkey="true" key="&quitApplicationCmd.key;" observes="cmd_quit"/>
|
||||||
|
<broadcaster id="cmd_quit" oncommand="goQuitApplication()"/>
|
||||||
|
|
||||||
|
<!-- Edit Menu -->
|
||||||
|
<menuitem id="menu_redo" value="&redoCmd.label;" key="key_redo" accesskey="&redoCmd.accesskey;" observes="cmd_redo"/>
|
||||||
|
<key id="key_redo" xulkey="true" shift="true" key="&redoCmd.key;" observes="cmd_redo"/>
|
||||||
|
|
||||||
|
<!-- Delete Key -->
|
||||||
|
<key id="key_delete" keycode="VK_DELETE" observes="cmd_delete"/>
|
||||||
|
|
||||||
|
</overlay>
|
|
@ -0,0 +1,78 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<!-- OS/2 version of platformInputBindings.xul -->
|
||||||
|
|
||||||
|
<keybinding id="platformInputBindings"
|
||||||
|
xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||||
|
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||||
|
|
||||||
|
<!-- change the xul key for Unix -->
|
||||||
|
<keyset id="editorKeySet" xulkey="alt">
|
||||||
|
|
||||||
|
<!-- emacs delete keys -->
|
||||||
|
<key id="emDelCharBWkb" key="h" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_deleteCharBackward');
|
||||||
|
controller.doCommand('cmd_deleteCharBackward');"/>
|
||||||
|
<key id="emDelCharFWkb" key="d" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_deleteCharForward');
|
||||||
|
controller.doCommand('cmd_deleteCharForward');"/>
|
||||||
|
<key id="emDelWordBWkb" key="w" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_deleteWordBackward');
|
||||||
|
controller.doCommand('cmd_deleteWordBackward');"/>
|
||||||
|
<key id="emKillToBegkb" key="u" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_deleteToBeginningOfLine');
|
||||||
|
controller.doCommand('cmd_deleteToBeginningOfLine');"/>
|
||||||
|
<key id="emKillToEndkb" key="k" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_deleteToEndOfLine');
|
||||||
|
controller.doCommand('cmd_deleteToEndOfLine');"/>
|
||||||
|
|
||||||
|
<!-- emacs motion keys: these use the selection controller API -->
|
||||||
|
<key id="emBeginLinekb" key="a" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_beginLine');
|
||||||
|
controller.doCommand('cmd_beginLine');"/>
|
||||||
|
<key id="emEndLinekb" key="e" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_endLine');
|
||||||
|
controller.doCommand('cmd_endLine');"/>
|
||||||
|
<key id="emCharPrevkb" key="b" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_charPrevious');
|
||||||
|
controller.doCommand('cmd_charPrevious');"/>
|
||||||
|
<key id="emCharNextkb" key="f" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_charNext');
|
||||||
|
controller.doCommand('cmd_charNext');"/>
|
||||||
|
|
||||||
|
<!-- Add the Windows/Mac cut, copy, paste, undo and redo keys -->
|
||||||
|
<key id="emCutKey" key="x" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_cut');
|
||||||
|
controller.doCommand('cmd_cut');"/>
|
||||||
|
<key id="emCopyKey" key="c" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_copy');
|
||||||
|
controller.doCommand('cmd_copy');"/>
|
||||||
|
<key id="emPasteKey" key="v" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_paste');
|
||||||
|
controller.doCommand('cmd_paste');"/>
|
||||||
|
<key id="emUndoKey" key="z" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_undo');
|
||||||
|
controller.doCommand('cmd_undo');"/>
|
||||||
|
<key id="emRedoKey" key="r" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_redo');
|
||||||
|
controller.doCommand('cmd_redo');"/>
|
||||||
|
|
||||||
|
</keyset>
|
||||||
|
|
||||||
|
<!-- OS/2 Unix-specific keybindings -->
|
||||||
|
|
||||||
|
</keybinding>
|
||||||
|
|
|
@ -0,0 +1,86 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<!-- OS/2 version of platformTextAreaBindings.xul -->
|
||||||
|
|
||||||
|
<keybinding id="platformTextAreaBindings"
|
||||||
|
xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||||
|
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||||
|
|
||||||
|
<!-- change the xul key for Unix -->
|
||||||
|
<keyset id="editorKeySet" xulkey="alt">
|
||||||
|
|
||||||
|
<!-- emacs delete keys -->
|
||||||
|
<key id="emDelCharBWkb" key="h" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_deleteCharBackward');
|
||||||
|
controller.doCommand('cmd_deleteCharBackward');"/>
|
||||||
|
<key id="emDelCharFWkb" key="d" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_deleteCharForward');
|
||||||
|
controller.doCommand('cmd_deleteCharForward');"/>
|
||||||
|
<key id="emDelWordBWkb" key="w" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_deleteWordBackward');
|
||||||
|
controller.doCommand('cmd_deleteWordBackward');"/>
|
||||||
|
<key id="emKillToBegkb" key="u" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_deleteToBeginningOfLine');
|
||||||
|
controller.doCommand('cmd_deleteToBeginningOfLine');"/>
|
||||||
|
<key id="emKillToEndkb" key="k" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_deleteToEndOfLine');
|
||||||
|
controller.doCommand('cmd_deleteToEndOfLine');"/>
|
||||||
|
|
||||||
|
<!-- emacs motion keys: these use the selection controller API -->
|
||||||
|
<key id="emBeginLinekb" key="a" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_beginLine');
|
||||||
|
controller.doCommand('cmd_beginLine');"/>
|
||||||
|
<key id="emEndLinekb" key="e" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_endLine');
|
||||||
|
controller.doCommand('cmd_endLine');"/>
|
||||||
|
<key id="emCharPrevkb" key="b" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_charPrevious');
|
||||||
|
controller.doCommand('cmd_charPrevious');"/>
|
||||||
|
<key id="emCharNextkb" key="f" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_charNext');
|
||||||
|
controller.doCommand('cmd_charNext');"/>
|
||||||
|
<key id="emPrevLinekb" key="p" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_linePrevious');
|
||||||
|
controller.doCommand('cmd_linePrevious');"/>
|
||||||
|
<key id="emNextLinekb" key="n" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_lineNext');
|
||||||
|
controller.doCommand('cmd_lineNext');"/>
|
||||||
|
|
||||||
|
<!-- Add the Windows/Mac cut, copy, paste, undo and redo keys -->
|
||||||
|
<key id="emCutKey" key="x" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_cut');
|
||||||
|
controller.doCommand('cmd_cut');"/>
|
||||||
|
<key id="emCopyKey" key="c" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_copy');
|
||||||
|
controller.doCommand('cmd_copy');"/>
|
||||||
|
<key id="emPasteKey" key="v" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_paste');
|
||||||
|
controller.doCommand('cmd_paste');"/>
|
||||||
|
<key id="emUndoKey" key="z" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_undo');
|
||||||
|
controller.doCommand('cmd_undo');"/>
|
||||||
|
<key id="emRedoKey" key="r" control="true" shift="false"
|
||||||
|
onkeypress="
|
||||||
|
var controller = document.commandDispatcher.getControllerForCommand('cmd_redo');
|
||||||
|
controller.doCommand('cmd_redo');"/>
|
||||||
|
|
||||||
|
</keyset>
|
||||||
|
|
||||||
|
<!-- End OS/2-specific keybindings -->
|
||||||
|
|
||||||
|
</keybinding>
|
||||||
|
|
|
@ -0,0 +1,135 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
|
||||||
|
<bindings id="htmlBindings"
|
||||||
|
xmlns="http://www.mozilla.org/xbl"
|
||||||
|
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||||
|
|
||||||
|
<binding name="inputFields" extends="resource:/chrome/htmlBindings.xml#inputFieldsBase">
|
||||||
|
<handlers>
|
||||||
|
|
||||||
|
<!-- Emacsish single-line motion and delete keys -->
|
||||||
|
<handler type="keypress" id="key_home" key="a" control="true"
|
||||||
|
command="cmd_beginLine"/>
|
||||||
|
<handler type="keypress" id="key_end" key="e" control="true"
|
||||||
|
command="cmd_endLine"/>
|
||||||
|
<handler type="keypress" id="key_left" key="b" control="true"
|
||||||
|
command="cmd_charPrevious"/>
|
||||||
|
<handler type="keypress" id="key_right" key="f" control="true"
|
||||||
|
command="cmd_charNext"/>
|
||||||
|
<handler type="keypress" id="key_delback" key="h" control="true"
|
||||||
|
command="cmd_deleteCharBackward"/>
|
||||||
|
<handler type="keypress" id="key_delforw" key="d" control="true"
|
||||||
|
command="cmd_deleteCharForward"/>
|
||||||
|
<handler type="keypress" id="key_delwback" key="w" control="true"
|
||||||
|
command="cmd_deleteWordBackward"/>
|
||||||
|
<handler type="keypress" id="key_del_bol" key="u" control="true"
|
||||||
|
command="cmd_deleteToBeginningOfLine"/>
|
||||||
|
<handler type="keypress" id="key_del_eol" key="k" control="true"
|
||||||
|
command="cmd_deleteToEndOfLine"/>
|
||||||
|
|
||||||
|
<!-- Windows copy/paste/undo/redo keys -->
|
||||||
|
<handler type="keypress" id="key_wincopy" key="c" control="true"
|
||||||
|
command="cmd_copy"/>
|
||||||
|
<handler type="keypress" id="key_wincut" key="x" control="true"
|
||||||
|
command="cmd_cut"/>
|
||||||
|
<handler type="keypress" id="key_winundo" key="z" control="true"
|
||||||
|
command="cmd_undo"/>
|
||||||
|
<handler type="keypress" id="key_winredo" key="r" control="true"
|
||||||
|
command="cmd_redo"/>
|
||||||
|
<handler type="keypress" id="key_altwincut" keycode="VK_DELETE" shift="true" control="false" alt="false"
|
||||||
|
command="cmd_cut"/>
|
||||||
|
<handler type="keypress" id="key_altwincopy" keycode="VK_INSERT" control="true" shift="false" alt="false"
|
||||||
|
command="cmd_copy"/>
|
||||||
|
<handler type="keypress" id="key_altwinpaste" keycode="VK_INSERT" shift="true" control="false" alt="false"
|
||||||
|
command="cmd_paste"/>
|
||||||
|
|
||||||
|
<!-- navigating by word keys -->
|
||||||
|
<handler type="keypress" id="key_home" keycode="VK_HOME" alt="false" shift="false" control="false"
|
||||||
|
command="cmd_beginLine"/>
|
||||||
|
<handler type="keypress" id="key_end" keycode="VK_END" alt="false" shift="false" control="false"
|
||||||
|
command="cmd_endLine"/>
|
||||||
|
<handler type="keypress" id="key_homeshift" keycode="VK_HOME" shift="true" alt="false" control="false"
|
||||||
|
command="cmd_selectBeginLine"/>
|
||||||
|
<handler type="keypress" id="key_endshift" keycode="VK_END" shift="true" alt="false" control="false"
|
||||||
|
command="cmd_selectEndLine"/>
|
||||||
|
<handler type="keypress" id="key_leftcontrol" keycode="VK_LEFT" control="true" alt="false" shift="false"
|
||||||
|
command="cmd_wordPrevious"/>
|
||||||
|
<handler type="keypress" id="key_rightcontrol" keycode="VK_RIGHT" control="true" alt="false" shift="false"
|
||||||
|
command="cmd_wordNext"/>
|
||||||
|
<handler type="keypress" id="key_leftshiftcontrol" keycode="VK_LEFT" shift="true" control="true" alt="false"
|
||||||
|
command="cmd_selectWordPrevious"/>
|
||||||
|
<handler type="keypress" id="key_rightshiftcontrol" keycode="VK_RIGHT" shift="true" control="true" alt="false"
|
||||||
|
command="cmd_selectWordNext"/>
|
||||||
|
<handler type="keypress" id="key_redo" key="y" primary="true"
|
||||||
|
command="cmd_redo"/>
|
||||||
|
</handlers>
|
||||||
|
</binding>
|
||||||
|
|
||||||
|
<binding name="textAreas" extends="resource:/chrome/htmlBindings.xml#textAreasBase">
|
||||||
|
<handlers>
|
||||||
|
|
||||||
|
<!-- Emacsish single-line motion and delete keys -->
|
||||||
|
<handler type="keypress" id="key_home" key="a" control="true"
|
||||||
|
command="cmd_beginLine"/>
|
||||||
|
<handler type="keypress" id="key_end" key="e" control="true"
|
||||||
|
command="cmd_endLine"/>
|
||||||
|
<handler type="keypress" id="key_left" key="b" control="true"
|
||||||
|
command="cmd_charPrevious"/>
|
||||||
|
<handler type="keypress" id="key_right" key="f" control="true"
|
||||||
|
command="cmd_charNext"/>
|
||||||
|
<handler type="keypress" id="key_delback" key="h" control="true"
|
||||||
|
command="cmd_deleteCharBackward"/>
|
||||||
|
<handler type="keypress" id="key_delforw" key="d" control="true"
|
||||||
|
command="cmd_deleteCharForward"/>
|
||||||
|
<handler type="keypress" id="key_delwback" key="w" control="true"
|
||||||
|
command="cmd_deleteWordBackward"/>
|
||||||
|
<handler type="keypress" id="key_del_bol" key="u" control="true"
|
||||||
|
command="cmd_deleteToBeginningOfLine"/>
|
||||||
|
<handler type="keypress" id="key_del_eol" key="k" control="true"
|
||||||
|
command="cmd_deleteToEndOfLine"/>
|
||||||
|
|
||||||
|
<!-- Windows copy/paste/undo/redo keys -->
|
||||||
|
<handler type="keypress" id="key_wincopy" key="c" control="true"
|
||||||
|
command="cmd_copy"/>
|
||||||
|
<handler type="keypress" id="key_wincut" key="x" control="true"
|
||||||
|
command="cmd_cut"/>
|
||||||
|
<handler type="keypress" id="key_winundo" key="z" control="true"
|
||||||
|
command="cmd_undo"/>
|
||||||
|
<handler type="keypress" id="key_winredo" key="r" control="true"
|
||||||
|
command="cmd_redo"/>
|
||||||
|
<handler type="keypress" id="key_altwincut" keycode="VK_DELETE" shift="true" control="false" alt="false"
|
||||||
|
command="cmd_cut"/>
|
||||||
|
<handler type="keypress" id="key_altwincopy" keycode="VK_INSERT" control="true" shift="false" alt="false"
|
||||||
|
command="cmd_copy"/>
|
||||||
|
<handler type="keypress" id="key_altwinpaste" keycode="VK_INSERT" shift="true" control="false" alt="false"
|
||||||
|
command="cmd_paste"/>
|
||||||
|
|
||||||
|
<!-- Emacsish multi-line motion and delete keys -->
|
||||||
|
<handler type="keypress" id="key_linedown" key="n" control="true"
|
||||||
|
command="cmd_lineNext"/>
|
||||||
|
<handler type="keypress" id="key_lineup" key="p" control="true"
|
||||||
|
command="cmd_linePrevious"/>
|
||||||
|
|
||||||
|
<!-- handle home/end/arrow keys and redo -->
|
||||||
|
<handler type="keypress" id="key_home" keycode="VK_HOME" alt="false" shift="false" control="false"
|
||||||
|
command="cmd_beginLine"/>
|
||||||
|
<handler type="keypress" id="key_end" keycode="VK_END" alt="false" shift="false" control="false"
|
||||||
|
command="cmd_endLine"/>
|
||||||
|
<handler type="keypress" id="key_homeshift" keycode="VK_HOME" shift="true" alt="false" control="false"
|
||||||
|
command="cmd_selectBeginLine"/>
|
||||||
|
<handler type="keypress" id="key_endshift" keycode="VK_END" shift="true" alt="false" control="false"
|
||||||
|
command="cmd_selectEndLine"/>
|
||||||
|
<handler type="keypress" id="key_leftcontrol" keycode="VK_LEFT" control="true" alt="false" shift="false"
|
||||||
|
command="cmd_wordPrevious"/>
|
||||||
|
<handler type="keypress" id="key_rightcontrol" keycode="VK_RIGHT" control="true" alt="false" shift="false"
|
||||||
|
command="cmd_wordNext"/>
|
||||||
|
<handler type="keypress" id="key_leftshiftcontrol" keycode="VK_LEFT" shift="true" control="true" alt="false"
|
||||||
|
command="cmd_selectWordPrevious"/>
|
||||||
|
<handler type="keypress" id="key_rightshiftcontrol" keycode="VK_RIGHT" shift="true" control="true" alt="false"
|
||||||
|
command="cmd_selectWordNext"/>
|
||||||
|
<handler type="keypress" id="key_redo" key="y" primary="true"
|
||||||
|
command="cmd_redo"/>
|
||||||
|
</handlers>
|
||||||
|
</binding>
|
||||||
|
|
||||||
|
</bindings>
|
Загрузка…
Ссылка в новой задаче