project); new files for querying and setting bidi properties of the
keyboard
This commit is contained in:
erik%netscape.com 2001-02-14 23:13:07 +00:00
Родитель 0363d9beec
Коммит 14c49ae9c5
32 изменённых файлов: 929 добавлений и 0 удалений

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

@ -37,6 +37,10 @@
#include "nsFontRetrieverService.h"
#include "nsSound.h"
#ifdef IBMBIDI
#include "nsBidiKeyboard.h"
#endif
#include "nsWindowsTimer.h"
#include "nsTimerManager.h"
@ -75,6 +79,9 @@ static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
static NS_DEFINE_CID(kCSound, NS_SOUND_CID);
static NS_DEFINE_CID(kCFileSpecWithUI, NS_FILESPECWITHUI_CID);
#ifdef IBMBIDI
static NS_DEFINE_IID(kCBidiKeyboard, NS_BIDIKEYBOARD_CID);
#endif
class nsWidgetFactory : public nsIFactory
{
@ -207,6 +214,11 @@ nsresult nsWidgetFactory::CreateInstance( nsISupports* aOuter,
else if (mClassID.Equals(kCTimerManager)) {
inst = (nsISupports*)(nsITimerQueue*) new nsTimerManager();
}
#ifdef IBMBIDI
else if (mClassID.Equals(kCBidiKeyboard)) {
inst = (nsISupports*)(nsIBidiKeyboard*) new nsBidiKeyboard();
}
#endif // IBMBIDI
if (inst == NULL) {
return NS_ERROR_OUT_OF_MEMORY;
}

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

@ -32,6 +32,7 @@ CSRCS = \
CPPSRCS = \
nsAppShell.cpp \
nsBidiKeyboard.cpp \
nsButton.cpp \
nsCheckButton.cpp \
nsClipboard.cpp \

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

@ -0,0 +1,52 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 IBM code.
*
* The Initial Developer of the Original Code is IBM.
* Portions created by IBM are
* Copyright (C) International Business Machines
* Corporation, 2000. All Rights Reserved.
*
* Contributor(s): Simon Montagu
*/
#include "nsBidiKeyboard.h"
static NS_DEFINE_IID(kIBidiKeyboardIID, NS_IBIDIKEYBOARD_IID);
NS_IMPL_ISUPPORTS1(nsBidiKeyboard, nsBidiKeyboard)
nsBidiKeyboard::nsBidiKeyboard() : nsIBidiKeyboard()
{
NS_INIT_REFCNT();
}
nsBidiKeyboard::~nsBidiKeyboard()
{
}
NS_IMETHODIMP nsBidiKeyboard::IsLangRTL(PRBool *aIsRTL)
{
*aIsRTL = PR_FALSE;
#ifdef IBMBIDI
// XXX Insert platform specific code to determine keyboard direction
#endif
return NS_OK;
}
NS_IMETHODIMP nsBidiKeyboard::SetLangFromBidiLevel(PRUint8 aLevel)
{
#ifdef IBMBIDI
// XXX Insert platform specific code to set keyboard language
#endif
return NS_OK;
}

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

@ -0,0 +1,39 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 IBM code.
*
* The Initial Developer of the Original Code is IBM.
* Portions created by IBM are
* Copyright (C) International Business Machines
* Corporation, 2000. All Rights Reserved.
*
* Contributor(s): Simon Montagu
*/
#ifndef __nsBidiKeyboard
#define __nsBidiKeyboard
#include "nsIBidiKeyboard.h"
class nsBidiKeyboard : public nsIBidiKeyboard
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIBIDIKEYBOARD
nsBidiKeyboard();
virtual ~nsBidiKeyboard();
/* additional members */
};
#endif // __nsBidiKeyboard

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

@ -43,6 +43,9 @@
#include "nsFileSpecWithUIImpl.h"
#include "nsScrollbar.h"
#include "nsSound.h"
#ifdef IBMBIDI
#include "nsBidiKeyboard.h"
#endif
#include "nsGtkIMEHelper.h"
@ -63,6 +66,9 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsFontRetrieverService)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDragService)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFileSpecWithUIImpl)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSound)
#ifdef IBMBIDI
NS_GENERIC_FACTORY_CONSTRUCTOR(nsBidiKeyboard)
#endif
static nsresult nsHorizScrollbarConstructor (nsISupports *aOuter, REFNSIID aIID, void **aResult)
{
@ -200,6 +206,12 @@ static nsModuleComponentInfo components[] =
// "@mozilla.org/widget/dragservice/gtk;1",
"@mozilla.org/widget/dragservice;1",
nsDragServiceConstructor },
#ifdef IBMBIDI
{ "Gtk Bidi Keyboard",
NS_BIDIKEYBOARD_CID,
"@mozilla.org/widget/bidikeyboard;1",
nsBidiKeyboardConstructor },
#endif // IBMBIDI
{ "File Spec with UI",
NS_FILESPECWITHUI_CID,
// "@mozilla.org/widget/filespecwithui/gtk;1",

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

@ -28,6 +28,7 @@ IS_COMPONENT = 1
CPPSRCS = nsAppShell.cpp \
nsBidiKeyboard.cpp \
nsButton.cpp \
nsChildWindow.cpp \
nsClipboard.cpp \

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

@ -0,0 +1,52 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 IBM code.
*
* The Initial Developer of the Original Code is IBM.
* Portions created by IBM are
* Copyright (C) International Business Machines
* Corporation, 2000. All Rights Reserved.
*
* Contributor(s): Simon Montagu
*/
#include "nsBidiKeyboard.h"
static NS_DEFINE_IID(kIBidiKeyboardIID, NS_IBIDIKEYBOARD_IID);
NS_IMPL_ISUPPORTS(nsBidiKeyboard, NS_IBIDIKEYBOARD_IID)
nsBidiKeyboard::nsBidiKeyboard() : nsIBidiKeyboard()
{
NS_INIT_REFCNT();
}
nsBidiKeyboard::~nsBidiKeyboard()
{
}
NS_IMETHODIMP nsBidiKeyboard::IsLangRTL(PRBool *aIsRTL)
{
*aIsRTL = PR_FALSE;
#ifdef IBMBIDI
// XXX Insert platform specific code to determine keyboard direction
#endif
return NS_OK;
}
NS_IMETHODIMP nsBidiKeyboard::SetLangFromBidiLevel(PRUint8 aLevel)
{
#ifdef IBMBIDI
// XXX Insert platform specific code to set keyboard language
#endif
return NS_OK;
}

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

@ -0,0 +1,39 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 IBM code.
*
* The Initial Developer of the Original Code is IBM.
* Portions created by IBM are
* Copyright (C) International Business Machines
* Corporation, 2000. All Rights Reserved.
*
* Contributor(s): Simon Montagu
*/
#ifndef __nsBidiKeyboard
#define __nsBidiKeyboard
#include "nsIBidiKeyboard.h"
class nsBidiKeyboard : public nsIBidiKeyboard
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIBIDIKEYBOARD
nsBidiKeyboard();
virtual ~nsBidiKeyboard();
/* additional members */
};
#endif // __nsBidiKeyboard

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

@ -74,6 +74,10 @@
#include "nsSound.h"
#include "nsTimerMac.h"
#ifdef IBMBIDI
#include "nsBidiKeyboard.h"
#endif
// NOTE the following does not match MAC_STATIC actually used below in this file!
#define MACSTATIC
@ -112,6 +116,9 @@ static NS_DEFINE_CID(kCDragService, NS_DRAGSERVICE_CID);
static NS_DEFINE_CID(kCSound, NS_SOUND_CID);
static NS_DEFINE_CID(kCFileSpecWithUI, NS_FILESPECWITHUI_CID);
#ifdef IBMBIDI
static NS_DEFINE_CID(kCBidiKeyboard, NS_BIDIKEYBOARD_CID);
#endif
//-------------------------------------------------------------------------
//
//-------------------------------------------------------------------------
@ -264,6 +271,10 @@ nsresult nsWidgetFactory::CreateInstance(nsISupports *aOuter,
inst = (nsISupports*)new nsClipboard();
else if (mClassID.Equals(kCDragService))
inst = (nsISupports*)NS_STATIC_CAST(nsIDragService*, new nsDragService());
#ifdef IBMBIDI
else if (mClassID.Equals(kCBidiKeyboard))
inst = (nsISupports*)(nsIBidiKeyboard*) new nsBidiKeyboard();
#endif // IBMBIDI
if (inst == NULL) {
return NS_ERROR_OUT_OF_MEMORY;

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

@ -33,6 +33,7 @@ DIRS = app_context
CPPSRCS = \
nsAppShell.cpp \
nsBidiKeyboard.cpp \
nsButton.cpp \
nsCheckButton.cpp \
nsComboBox.cpp \

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

@ -0,0 +1,52 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 IBM code.
*
* The Initial Developer of the Original Code is IBM.
* Portions created by IBM are
* Copyright (C) International Business Machines
* Corporation, 2000. All Rights Reserved.
*
* Contributor(s): Simon Montagu
*/
#include "nsBidiKeyboard.h"
static NS_DEFINE_IID(kIBidiKeyboardIID, NS_IBIDIKEYBOARD_IID);
NS_IMPL_ISUPPORTS(nsBidiKeyboard, NS_IBIDIKEYBOARD_IID)
nsBidiKeyboard::nsBidiKeyboard() : nsIBidiKeyboard()
{
NS_INIT_REFCNT();
}
nsBidiKeyboard::~nsBidiKeyboard()
{
}
NS_IMETHODIMP nsBidiKeyboard::IsLangRTL(PRBool *aIsRTL)
{
*aIsRTL = PR_FALSE;
#ifdef IBMBIDI
// XXX Insert platform specific code to determine keyboard direction
#endif
return NS_OK;
}
NS_IMETHODIMP nsBidiKeyboard::SetLangFromBidiLevel(PRUint8 aLevel)
{
#ifdef IBMBIDI
// XXX Insert platform specific code to set keyboard language
#endif
return NS_OK;
}

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

@ -0,0 +1,39 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 IBM code.
*
* The Initial Developer of the Original Code is IBM.
* Portions created by IBM are
* Copyright (C) International Business Machines
* Corporation, 2000. All Rights Reserved.
*
* Contributor(s): Simon Montagu
*/
#ifndef __nsBidiKeyboard
#define __nsBidiKeyboard
#include "nsIBidiKeyboard.h"
class nsBidiKeyboard : public nsIBidiKeyboard
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIBIDIKEYBOARD
nsBidiKeyboard();
virtual ~nsBidiKeyboard();
/* additional members */
};
#endif // __nsBidiKeyboard

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

@ -52,6 +52,10 @@
// #include "nsDragTarget.h"
// #include "nsDraggedObject.h"
#ifdef IBMBIDI
#include "nsBidiKeyboard.h"
#endif
static NS_DEFINE_IID(kCWindow, NS_WINDOW_CID);
static NS_DEFINE_IID(kCChild, NS_CHILD_CID);
static NS_DEFINE_IID(kCButton, NS_BUTTON_CID);
@ -81,6 +85,10 @@ static NS_DEFINE_IID(kCHTMLFormatConverter, NS_HTMLFORMATCONVERTER_CID);
// static NS_DEFINE_IID(kCDragTarget, NS_DRAGTARGET_CID);
// static NS_DEFINE_IID(kCDraggedObject, NS_DRAGGEDOBJECT_CID);
#ifdef IBMBIDI
static NS_DEFINE_IID(kCBidiKeyboard, NS_BIDIKEYBOARD_CID);
#endif
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
@ -214,6 +222,11 @@ nsresult nsWidgetFactory::CreateInstance(nsISupports *aOuter,
else if (mClassID.Equals(kCHTMLFormatConverter)) {
inst = (nsISupports*)new nsHTMLFormatConverter();
}
#ifdef IBMBIDI
else if (mClassID.Equals(kCBidiKeyboard)) {
inst = (nsISupports*)(nsIBidiKeyboard*) new nsBidiKeyboard();
}
#endif // IBMBIDI
// else if (mClassID.Equals(kCFontRetrieverService)) {
// inst = (nsISupports*)(nsIFontRetrieverService *) new nsFontRetrieverService();
// }

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

@ -37,6 +37,7 @@ endif
CPPSRCS = \
nsAppShell.cpp \
nsBidiKeyboard.cpp \
nsCanvas.cpp \
nsClipboard.cpp \
nsDirPicker.cpp \

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

@ -0,0 +1,53 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 IBM code.
*
* The Initial Developer of the Original Code is IBM.
* Portions created by IBM are
* Copyright (C) International Business Machines
* Corporation, 2000. All Rights Reserved.
*
* Contributor(s): Simon Montagu
*/
#include "nsBidiKeyboard.h"
static NS_DEFINE_IID(kIBidiKeyboardIID, NS_IBIDIKEYBOARD_IID);
//NS_IMPL_ISUPPORTS(nsBidiKeyboard, NS_IBIDIKEYBOARD_IID)
NS_IMPL_ISUPPORTS(nsBidiKeyboard, NS_GET_IID(nsBidiKeyboard))
nsBidiKeyboard::nsBidiKeyboard() : nsIBidiKeyboard()
{
NS_INIT_REFCNT();
}
nsBidiKeyboard::~nsBidiKeyboard()
{
}
NS_IMETHODIMP nsBidiKeyboard::IsLangRTL(PRBool *aIsRTL)
{
*aIsRTL = PR_FALSE;
#ifdef IBMBIDI
// XXX Insert platform specific code to determine keyboard direction
#endif
return NS_OK;
}
NS_IMETHODIMP nsBidiKeyboard::SetLangFromBidiLevel(PRUint8 aLevel)
{
#ifdef IBMBIDI
// XXX Insert platform specific code to set keyboard language
#endif
return NS_OK;
}

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

@ -0,0 +1,39 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 IBM code.
*
* The Initial Developer of the Original Code is IBM.
* Portions created by IBM are
* Copyright (C) International Business Machines
* Corporation, 2000. All Rights Reserved.
*
* Contributor(s): Simon Montagu
*/
#ifndef __nsBidiKeyboard
#define __nsBidiKeyboard
#include "nsIBidiKeyboard.h"
class nsBidiKeyboard : public nsIBidiKeyboard
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIBIDIKEYBOARD
nsBidiKeyboard();
virtual ~nsBidiKeyboard();
/* additional members */
};
#endif // __nsBidiKeyboard

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

@ -63,6 +63,10 @@
#include "nsFrameWindow.h" // OS/2 only
#ifdef IBMBIDI
#include "nsBidiKeyboard.h"
#endif
static NS_DEFINE_IID(kCWindow, NS_WINDOW_CID);
static NS_DEFINE_IID(kCChild, NS_CHILD_CID);
static NS_DEFINE_IID(kCFileOpen, NS_FILEWIDGET_CID);
@ -92,6 +96,9 @@ static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
static NS_DEFINE_CID(kCSound, NS_SOUND_CID);
static NS_DEFINE_CID(kCFileSpecWithUI, NS_FILESPECWITHUI_CID);
#ifdef IBMBIDI
static NS_DEFINE_IID(kCBidiKeyboard, NS_BIDIKEYBOARD_CID);
#endif
class nsWidgetFactory : public nsIFactory
{
@ -233,6 +240,11 @@ nsresult nsWidgetFactory::CreateInstance( nsISupports* aOuter,
else if (mClassID.Equals(kCFontRetrieverService)) {
inst = (nsISupports*)(nsIFontRetrieverService *)new nsFontRetrieverService();
}
#ifdef IBMBIDI
else if (mClassID.Equals(kCBidiKeyboard)) {
inst = (nsISupports*)(nsIBidiKeyboard*) new nsBidiKeyboard();
}
#endif // IBMBIDI
else if (mClassID.Equals(kCClipboard)) {
inst = (nsISupports*)(nsBaseClipboard *)new nsClipboard();

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

@ -44,6 +44,7 @@ OLD_WIDGETS = \
CPPSRCS = \
nsBidiKeyboard.cpp \
nsButton.cpp \
nsTextAreaWidget.cpp \
nsTextHelper.cpp \

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

@ -0,0 +1,52 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 IBM code.
*
* The Initial Developer of the Original Code is IBM.
* Portions created by IBM are
* Copyright (C) International Business Machines
* Corporation, 2000. All Rights Reserved.
*
* Contributor(s): Simon Montagu
*/
#include "nsBidiKeyboard.h"
static NS_DEFINE_IID(kIBidiKeyboardIID, NS_IBIDIKEYBOARD_IID);
NS_IMPL_ISUPPORTS(nsBidiKeyboard, NS_IBIDIKEYBOARD_IID)
nsBidiKeyboard::nsBidiKeyboard() : nsIBidiKeyboard()
{
NS_INIT_REFCNT();
}
nsBidiKeyboard::~nsBidiKeyboard()
{
}
NS_IMETHODIMP nsBidiKeyboard::IsLangRTL(PRBool *aIsRTL)
{
*aIsRTL = PR_FALSE;
#ifdef IBMBIDI
// XXX Insert platform specific code to determine keyboard direction
#endif
return NS_OK;
}
NS_IMETHODIMP nsBidiKeyboard::SetLangFromBidiLevel(PRUint8 aLevel)
{
#ifdef IBMBIDI
// XXX Insert platform specific code to set keyboard language
#endif
return NS_OK;
}

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

@ -0,0 +1,39 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 IBM code.
*
* The Initial Developer of the Original Code is IBM.
* Portions created by IBM are
* Copyright (C) International Business Machines
* Corporation, 2000. All Rights Reserved.
*
* Contributor(s): Simon Montagu
*/
#ifndef __nsBidiKeyboard
#define __nsBidiKeyboard
#include "nsIBidiKeyboard.h"
class nsBidiKeyboard : public nsIBidiKeyboard
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIBIDIKEYBOARD
nsBidiKeyboard();
virtual ~nsBidiKeyboard();
/* additional members */
};
#endif // __nsBidiKeyboard

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

@ -44,6 +44,10 @@
#include "nsScrollbar.h"
#include "nsSound.h"
#ifdef IBMBIDI
#include "nsBidiKeyboard.h"
#endif
#include <prlog.h>
struct PRLogModuleInfo *PhWidLog = nsnull;
#include "nsPhWidgetLog.h"
@ -65,6 +69,9 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsFontRetrieverService)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDragService)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFileSpecWithUIImpl)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSound)
#ifdef IBMBIDI
NS_GENERIC_FACTORY_CONSTRUCTOR(nsBidiKeyboard)
#endif
static nsresult nsHorizScrollbarConstructor (nsISupports *aOuter, REFNSIID aIID, void **aResult)
{
@ -209,6 +216,12 @@ static nsModuleComponentInfo components[] =
// "@mozilla.org/widget/dragservice/ph;1",
"@mozilla.org/widget/dragservice;1",
nsDragServiceConstructor },
#ifdef IBMBIDI
{ "Ph Bidi Keyboard",
NS_BIDIKEYBOARD_CID,
"@mozilla.org/widget/bidikeyboard;1",
nsBidiKeyboardConstructor },
#endif // IBMBIDI
{ "File Spec with UI",
NS_FILESPECWITHUI_CID,
// "@mozilla.org/widget/filespecwithui/ph;1",

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

@ -34,6 +34,7 @@ CPPSRCS = \
$(MOCSRCS) \
nsQApplication.cpp \
nsAppShell.cpp \
nsBidiKeyboard.cpp \
nsComboBox.cpp \
nsLabel.cpp \
nsScrollbar.cpp \

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

@ -0,0 +1,52 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 IBM code.
*
* The Initial Developer of the Original Code is IBM.
* Portions created by IBM are
* Copyright (C) International Business Machines
* Corporation, 2000. All Rights Reserved.
*
* Contributor(s): Simon Montagu
*/
#include "nsBidiKeyboard.h"
static NS_DEFINE_IID(kIBidiKeyboardIID, NS_IBIDIKEYBOARD_IID);
NS_IMPL_ISUPPORTS(nsBidiKeyboard, NS_IBIDIKEYBOARD_IID)
nsBidiKeyboard::nsBidiKeyboard() : nsIBidiKeyboard()
{
NS_INIT_REFCNT();
}
nsBidiKeyboard::~nsBidiKeyboard()
{
}
NS_IMETHODIMP nsBidiKeyboard::IsLangRTL(PRBool *aIsRTL)
{
*aIsRTL = PR_FALSE;
#ifdef IBMBIDI
// XXX Insert platform specific code to determine keyboard direction
#endif
return NS_OK;
}
NS_IMETHODIMP nsBidiKeyboard::SetLangFromBidiLevel(PRUint8 aLevel)
{
#ifdef IBMBIDI
// XXX Insert platform specific code to set keyboard language
#endif
return NS_OK;
}

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

@ -0,0 +1,39 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 IBM code.
*
* The Initial Developer of the Original Code is IBM.
* Portions created by IBM are
* Copyright (C) International Business Machines
* Corporation, 2000. All Rights Reserved.
*
* Contributor(s): Simon Montagu
*/
#ifndef __nsBidiKeyboard
#define __nsBidiKeyboard
#include "nsIBidiKeyboard.h"
class nsBidiKeyboard : public nsIBidiKeyboard
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIBIDIKEYBOARD
nsBidiKeyboard();
virtual ~nsBidiKeyboard();
/* additional members */
};
#endif // __nsBidiKeyboard

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

@ -43,6 +43,10 @@
#include "nsFileSpecWithUIImpl.h"
#include "nsScrollbar.h"
#ifdef IBMBIDI
#include "nsBidiKeyboard.h"
#endif
NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindow)
NS_GENERIC_FACTORY_CONSTRUCTOR(ChildWindow)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsButton)
@ -59,6 +63,9 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLFormatConverter)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFontRetrieverService)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDragService)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFileSpecWithUIImpl)
#ifdef IBMBIDI
NS_GENERIC_FACTORY_CONSTRUCTOR(nsBidiKeyboard)
#endif
static nsresult nsHorizScrollbarConstructor (nsISupports *aOuter, REFNSIID aIID, void **aResult)
{
@ -186,6 +193,12 @@ static nsModuleComponentInfo components[] =
NS_DRAGSERVICE_CID,
"@mozilla.org/widget/dragservice;1",
nsDragServiceConstructor },
#ifdef IBMBIDI
{ "Qt Bidi Keyboard",
NS_BIDIKEYBOARD_CID,
"@mozilla.org/widget/bidikeyboard;1",
nsBidiKeyboardConstructor },
#endif // IBMBIDI
{ "File Spec with UI",
NS_FILESPECWITHUI_CID,
"@mozilla.org/filespecwithui;1",

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

@ -44,6 +44,7 @@ CPPSRCS = \
nsToolkit.cpp \
nsSound.cpp \
nsImageClipboard.cpp \
nsBidiKeyboard.cpp \
$(NULL)
MODULE=raptor
@ -67,6 +68,7 @@ OBJS = \
.\$(OBJDIR)\nsToolkit.obj \
.\$(OBJDIR)\nsSound.obj \
.\$(OBJDIR)\nsImageClipboard.obj \
.\$(OBJDIR)\nsBidiKeyboard.obj \
$(NULL)
LINCS= \

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

@ -0,0 +1,133 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 IBM code.
*
* The Initial Developer of the Original Code is IBM.
* Portions created by IBM are
* Copyright (C) International Business Machines
* Corporation, 2000. All Rights Reserved.
*
* Contributor(s): Simon Montagu
*/
#include "nsBidiKeyboard.h"
#include "prmem.h"
static NS_DEFINE_IID(kIBidiKeyboardIID, NS_IBIDIKEYBOARD_IID);
NS_IMPL_ISUPPORTS(nsBidiKeyboard, NS_IBIDIKEYBOARD_IID)
nsBidiKeyboard::nsBidiKeyboard() : nsIBidiKeyboard()
{
NS_INIT_REFCNT();
#ifdef IBMBIDI
mDefaultsSet = PR_FALSE;
#endif
}
nsBidiKeyboard::~nsBidiKeyboard()
{
}
NS_IMETHODIMP nsBidiKeyboard::SetLangFromBidiLevel(PRUint8 aLevel)
{
#ifdef IBMBIDI
if (!mDefaultsSet) {
nsresult result = EnumerateKeyboards();
if (NS_SUCCEEDED(result))
mDefaultsSet = PR_TRUE;
else
return result;
}
if (!::LoadKeyboardLayout((aLevel & 1) ? mRTLKeyboard : mLTRKeyboard, KLF_ACTIVATE))
return NS_ERROR_FAILURE;
#endif
return NS_OK;
}
NS_IMETHODIMP nsBidiKeyboard::IsLangRTL(PRBool *aIsRTL)
{
*aIsRTL = PR_FALSE;
#ifdef IBMBIDI
HKL currentLocale;
char currentLocaleName[KL_NAMELENGTH];
currentLocale = ::GetKeyboardLayout(0);
*aIsRTL = IsRTLLanguage(currentLocale);
::GetKeyboardLayoutName(currentLocaleName);
// The language set by the user overrides the default language for that direction
if (*aIsRTL)
strcpy(mRTLKeyboard, currentLocaleName);
else
strcpy(mLTRKeyboard, currentLocaleName);
#endif
return NS_OK;
}
#ifdef IBMBIDI
// Get the list of keyboard layouts available in the system
// Set mLTRKeyboard to the first LTR keyboard in the list and mRTLKeyboard to the first RTL keyboard in the list
// These defaults will be used unless the user explicitly sets something else.
nsresult nsBidiKeyboard::EnumerateKeyboards()
{
int keyboards;
HKL far* buf;
HKL locale;
// GetKeyboardLayoutList with 0 as first parameter returns the number of keyboard layouts available
keyboards = ::GetKeyboardLayoutList(0, nsnull);
if (!keyboards)
return NS_ERROR_FAILURE;
// allocate a buffer to hold the list
buf = (HKL far*) PR_Malloc(keyboards * sizeof(HKL));
if (!buf)
return NS_ERROR_OUT_OF_MEMORY;
// Call again to fill the buffer
if (::GetKeyboardLayoutList(keyboards, buf) != keyboards) {
PR_Free(buf);
return NS_ERROR_UNEXPECTED;
}
// Go through the list and pick a default LTR and RTL keyboard layout
while (keyboards--) {
locale = buf[keyboards];
if (IsRTLLanguage(locale))
sprintf(mRTLKeyboard, "%.*x", KL_NAMELENGTH - 1, LANGIDFROMLCID(locale));
else
sprintf(mLTRKeyboard, "%.*x", KL_NAMELENGTH - 1, LANGIDFROMLCID(locale));
}
PR_Free(buf);
return NS_OK;
}
// Test whether the language represented by this locale identifier is a right-to-left language
PRBool nsBidiKeyboard::IsRTLLanguage(HKL aLocale)
{
// This macro extracts the primary language id (low 10 bits) from the locale id
switch (PRIMARYLANGID(aLocale)){
case LANG_ARABIC:
case LANG_FARSI:
case LANG_HEBREW:
return PR_TRUE;
break;
default:
return PR_FALSE;
}
}
#endif // IBMBIDI

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

@ -0,0 +1,50 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 IBM code.
*
* The Initial Developer of the Original Code is IBM.
* Portions created by IBM are
* Copyright (C) International Business Machines
* Corporation, 2000. All Rights Reserved.
*
* Contributor(s): Simon Montagu
*/
#ifndef __nsBidiKeyboard
#define __nsBidiKeyboard
#include "nsIBidiKeyboard.h"
#include <windows.h>
class nsBidiKeyboard : public nsIBidiKeyboard
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIBIDIKEYBOARD
nsBidiKeyboard();
virtual ~nsBidiKeyboard();
#ifdef IBMBIDI
protected:
nsresult EnumerateKeyboards();
PRBool IsRTLLanguage(HKL aLocale);
PRBool mDefaultsSet;
char mLTRKeyboard[KL_NAMELENGTH];
char mRTLKeyboard[KL_NAMELENGTH];
#endif // IBMBIDI
};
#endif // __nsBidiKeyboard

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

@ -35,6 +35,7 @@ DIRS = window_service
CPPSRCS = \
nsAppShell.cpp \
nsBidiKeyboard.cpp \
nsButton.cpp \
nsCheckButton.cpp \
nsClipboard.cpp \

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

@ -0,0 +1,52 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 IBM code.
*
* The Initial Developer of the Original Code is IBM.
* Portions created by IBM are
* Copyright (C) International Business Machines
* Corporation, 2000. All Rights Reserved.
*
* Contributor(s): Simon Montagu
*/
#include "nsBidiKeyboard.h"
static NS_DEFINE_IID(kIBidiKeyboardIID, NS_IBIDIKEYBOARD_IID);
NS_IMPL_ISUPPORTS(nsBidiKeyboard, NS_IBIDIKEYBOARD_IID)
nsBidiKeyboard::nsBidiKeyboard() : nsIBidiKeyboard()
{
NS_INIT_REFCNT();
}
nsBidiKeyboard::~nsBidiKeyboard()
{
}
NS_IMETHODIMP nsBidiKeyboard::IsLangRTL(PRBool *aIsRTL)
{
*aIsRTL = PR_FALSE;
#ifdef IBMBIDI
// XXX Insert platform specific code to determine keyboard direction
#endif
return NS_OK;
}
NS_IMETHODIMP nsBidiKeyboard::SetLangFromBidiLevel(PRUint8 aLevel)
{
#ifdef IBMBIDI
// XXX Insert platform specific code to set keyboard language
#endif
return NS_OK;
}

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

@ -0,0 +1,39 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 IBM code.
*
* The Initial Developer of the Original Code is IBM.
* Portions created by IBM are
* Copyright (C) International Business Machines
* Corporation, 2000. All Rights Reserved.
*
* Contributor(s): Simon Montagu
*/
#ifndef __nsBidiKeyboard
#define __nsBidiKeyboard
#include "nsIBidiKeyboard.h"
class nsBidiKeyboard : public nsIBidiKeyboard
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIBIDIKEYBOARD
nsBidiKeyboard();
virtual ~nsBidiKeyboard();
/* additional members */
};
#endif // __nsBidiKeyboard

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

@ -45,6 +45,10 @@
#include "nsScrollBar.h"
#include "nsSound.h"
#ifdef IBMBIDI
#include "nsBidiKeyboard.h"
#endif
NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindow)
NS_GENERIC_FACTORY_CONSTRUCTOR(ChildWindow)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsButton)
@ -62,6 +66,9 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLFormatConverter)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDragService)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFileSpecWithUIImpl)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSound)
#ifdef IBMBIDI
NS_GENERIC_FACTORY_CONSTRUCTOR(nsBidiKeyboard)
#endif
static nsresult nsHorizScrollbarConstructor (nsISupports *aOuter, REFNSIID aIID, void **aResult)
{
@ -199,6 +206,12 @@ static nsModuleComponentInfo components[] =
// "@mozilla.org/widget/dragservice/xlib;1",
"@mozilla.org/widget/dragservice;1",
nsDragServiceConstructor },
#ifdef IBMBIDI
{ "Xlib Bidi Keyboard",
NS_BIDIKEYBOARD_CID,
"@mozilla.org/widget/bidikeyboard;1",
nsBidiKeyboardConstructor },
#endif // IBMBIDI
{ "File Spec with UI",
NS_FILESPECWITHUI_CID,
// "@mozilla.org/widget/filespecwithui/xlib;1",