зеркало из https://github.com/mozilla/pjs.git
fix 19132 19135 ane partial fix 12090. implement nsIKBStateContorl for gtk. call ResetInputState from mouse button press. force ime to commit in ResetInputState and send the uncommitted text by using composition start/end and text event. move unicode conversion for IME into nsGtkIMEHelper class. r=erik
This commit is contained in:
Родитель
479ad973d3
Коммит
fab29310c5
|
@ -57,6 +57,7 @@ CPPSRCS = \
|
|||
nsWidget.cpp \
|
||||
nsWidgetFactory.cpp \
|
||||
nsWindow.cpp \
|
||||
nsGtkIMEHelper.cpp \
|
||||
$(NULL)
|
||||
|
||||
SHARED_LIBRARY_LIBS = $(DIST)/lib/libraptorbasewidget_s.a
|
||||
|
|
|
@ -31,11 +31,8 @@
|
|||
#include "nsIMenuListener.h"
|
||||
|
||||
#include "nsTextWidget.h"
|
||||
#include "nsGtkIMEHelper.h"
|
||||
|
||||
#include "nsICharsetConverterManager.h"
|
||||
#include "nsIPlatformCharset.h"
|
||||
#include "nsIServiceManager.h"
|
||||
static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID);
|
||||
|
||||
#include "stdio.h"
|
||||
#include "ctype.h"
|
||||
|
@ -605,8 +602,8 @@ static gint composition_start(GdkEventKey *aEvent, nsWindow *aWin,
|
|||
}
|
||||
|
||||
static gint composition_draw(GdkEventKey *aEvent, nsWindow *aWin,
|
||||
nsIUnicodeDecoder *aDecoder,
|
||||
nsEventStatus *aStatus) {
|
||||
nsresult res= NS_OK;
|
||||
if (!aWin->mIMECompositionUniString) {
|
||||
aWin->mIMECompositionUniStringSize = 128;
|
||||
aWin->mIMECompositionUniString =
|
||||
|
@ -618,12 +615,17 @@ static gint composition_draw(GdkEventKey *aEvent, nsWindow *aWin,
|
|||
for (;;) {
|
||||
uniChar = aWin->mIMECompositionUniString;
|
||||
uniCharSize = aWin->mIMECompositionUniStringSize - 1;
|
||||
aDecoder->Convert((char*)aEvent->string, &srcLen, uniChar, &uniCharSize);
|
||||
res = nsGtkIMEHelper::GetSingleton()->ConvertToUnicode(
|
||||
(char*)aEvent->string, &srcLen, uniChar, &uniCharSize);
|
||||
if(NS_ERROR_ABORT == res)
|
||||
return FALSE;
|
||||
if (srcLen == aEvent->length &&
|
||||
uniCharSize < aWin->mIMECompositionUniStringSize - 1) {
|
||||
break;
|
||||
}
|
||||
aWin->mIMECompositionUniStringSize += 32;
|
||||
if(aWin->mIMECompositionUniString)
|
||||
delete [] aWin->mIMECompositionUniString;
|
||||
aWin->mIMECompositionUniString =
|
||||
new PRUnichar[aWin->mIMECompositionUniStringSize];
|
||||
}
|
||||
|
@ -666,31 +668,6 @@ static gint composition_end(GdkEventKey *aEvent, nsWindow *aWin,
|
|||
return PR_TRUE;
|
||||
}
|
||||
|
||||
static nsIUnicodeDecoder*
|
||||
open_unicode_decoder(void) {
|
||||
nsresult result = NS_ERROR_FAILURE;
|
||||
nsIUnicodeDecoder *decoder = nsnull;
|
||||
NS_WITH_SERVICE(nsIPlatformCharset, platform, NS_PLATFORMCHARSET_PROGID,
|
||||
&result);
|
||||
if (platform && NS_SUCCEEDED(result)) {
|
||||
nsAutoString charset("");
|
||||
result = platform->GetCharset(kPlatformCharsetSel_Menu, charset);
|
||||
if (NS_FAILED(result) || (charset.Length() == 0)) {
|
||||
charset = "ISO-8859-1"; // default
|
||||
}
|
||||
nsICharsetConverterManager* manager = nsnull;
|
||||
nsresult res = nsServiceManager::
|
||||
GetService(kCharsetConverterManagerCID,
|
||||
nsCOMTypeInfo<nsICharsetConverterManager>::GetIID(),
|
||||
(nsISupports**)&manager);
|
||||
if (manager && NS_SUCCEEDED(res)) {
|
||||
manager->GetUnicodeDecoder(&charset, &decoder);
|
||||
nsServiceManager::ReleaseService(kCharsetConverterManagerCID, manager);
|
||||
}
|
||||
}
|
||||
return decoder;
|
||||
}
|
||||
|
||||
// GTK's text widget already does XIM, so we don't want to do this again
|
||||
gint handle_key_press_event_for_text(GtkObject *w, GdkEventKey* event,
|
||||
gpointer p)
|
||||
|
@ -794,21 +771,21 @@ gint handle_key_press_event(GtkObject *w, GdkEventKey* event, gpointer p)
|
|||
// gtk returns a character value for them
|
||||
//
|
||||
if (event->length) {
|
||||
static nsIUnicodeDecoder *decoder = nsnull;
|
||||
if (!decoder) {
|
||||
decoder = open_unicode_decoder();
|
||||
}
|
||||
if (decoder && (!kevent.keyCode)) {
|
||||
if (nsGtkIMEHelper::GetSingleton() && (!kevent.keyCode)) {
|
||||
nsEventStatus status;
|
||||
composition_start(event, win, &status);
|
||||
composition_draw(event, win, decoder, &status);
|
||||
composition_draw(event, win, &status);
|
||||
composition_end(event, win, &status);
|
||||
} else {
|
||||
InitKeyPressEvent(event,p, kevent);
|
||||
win->OnKey(kevent);
|
||||
|
||||
#if 0 // this will break editor Undo/Redo Text Txn system
|
||||
nsEventStatus status;
|
||||
composition_start(event, win, &status);
|
||||
composition_end(event, win, &status);
|
||||
#endif
|
||||
|
||||
}
|
||||
} else { // for Home/End/Up/Down/Left/Right/PageUp/PageDown key
|
||||
InitKeyPressEvent(event,p, kevent);
|
||||
|
|
|
@ -0,0 +1,83 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* 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):
|
||||
* Frank Tang <ftang@netsape.com>
|
||||
*/
|
||||
#include "nsGtkIMEHelper.h"
|
||||
#include "nsIUnicodeDecoder.h"
|
||||
#include "nsIPlatformCharset.h"
|
||||
#include "nsICharsetConverterManager.h"
|
||||
#include "nsIServiceManager.h"
|
||||
static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID);
|
||||
|
||||
nsGtkIMEHelper *nsGtkIMEHelper::gSingleton = nsnull;
|
||||
nsGtkIMEHelper* nsGtkIMEHelper::GetSingleton()
|
||||
{
|
||||
if(! gSingleton)
|
||||
gSingleton = new nsGtkIMEHelper();
|
||||
NS_ASSERTION(gSingleton, "do not have singleton");
|
||||
return gSingleton;
|
||||
}
|
||||
//-----------------------------------------------------------------------
|
||||
nsGtkIMEHelper::nsGtkIMEHelper()
|
||||
{
|
||||
SetupUnicodeDecoder();
|
||||
}
|
||||
nsGtkIMEHelper::~nsGtkIMEHelper()
|
||||
{
|
||||
NS_IF_RELEASE(mDecoder);
|
||||
}
|
||||
//-----------------------------------------------------------------------
|
||||
nsresult
|
||||
nsGtkIMEHelper::ConvertToUnicode( const char* aSrc, PRInt32* aSrcLen,
|
||||
PRUnichar* aDest, PRInt32* aDestLen)
|
||||
{
|
||||
NS_ASSERTION(mDecoder, "do not have mDecoder");
|
||||
if(! mDecoder)
|
||||
return NS_ERROR_ABORT;
|
||||
return mDecoder->Convert(aSrc, aSrcLen, aDest, aDestLen);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
void nsGtkIMEHelper::SetupUnicodeDecoder()
|
||||
{
|
||||
mDecoder = nsnull;
|
||||
nsresult result = NS_ERROR_FAILURE;
|
||||
NS_WITH_SERVICE(nsIPlatformCharset, platform, NS_PLATFORMCHARSET_PROGID,
|
||||
&result);
|
||||
if (platform && NS_SUCCEEDED(result)) {
|
||||
nsAutoString charset("");
|
||||
result = platform->GetCharset(kPlatformCharsetSel_Menu, charset);
|
||||
if (NS_FAILED(result) || (charset.Length() == 0)) {
|
||||
charset = "ISO-8859-1"; // default
|
||||
}
|
||||
nsICharsetConverterManager* manager = nsnull;
|
||||
nsresult res = nsServiceManager::
|
||||
GetService(kCharsetConverterManagerCID,
|
||||
nsCOMTypeInfo<nsICharsetConverterManager>::GetIID(),
|
||||
(nsISupports**)&manager);
|
||||
if (manager && NS_SUCCEEDED(res)) {
|
||||
manager->GetUnicodeDecoder(&charset, &mDecoder);
|
||||
nsServiceManager::ReleaseService(kCharsetConverterManagerCID, manager);
|
||||
}
|
||||
}
|
||||
NS_ASSERTION(mDecoder, "cannot get decoder");
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* 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):
|
||||
* Frank Tang <ftang@netsape.com>
|
||||
*/
|
||||
#ifndef nsGtkIMEHelper_h__
|
||||
#define nsGtkIMEHelper_h__
|
||||
#include "nsIUnicodeDecoder.h"
|
||||
|
||||
/*
|
||||
* We are gratduate moving IME related function into this class
|
||||
*/
|
||||
class nsGtkIMEHelper {
|
||||
public:
|
||||
nsGtkIMEHelper();
|
||||
~nsGtkIMEHelper();
|
||||
|
||||
nsresult ConvertToUnicode(const char* aSrc, PRInt32* aSrcLen,
|
||||
PRUnichar* aDes, PRInt32* aDesLen);
|
||||
static nsGtkIMEHelper* GetSingleton();
|
||||
|
||||
private:
|
||||
nsIUnicodeDecoder* mDecoder;
|
||||
void SetupUnicodeDecoder();
|
||||
static nsGtkIMEHelper *gSingleton;
|
||||
};
|
||||
|
||||
|
||||
#endif // nsGtkIMEHelper_h__
|
|
@ -34,11 +34,12 @@
|
|||
#include "nsGfxCIID.h"
|
||||
#include <gdk/gdkx.h>
|
||||
#include "nsIRollupListener.h"
|
||||
#include "nsIServiceManager.h"
|
||||
|
||||
#include "nsGtkUtils.h" // for nsGtkUtils::gdk_keyboard_get_modifiers()
|
||||
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIPref.h"
|
||||
#include "nsGtkIMEHelper.h"
|
||||
|
||||
|
||||
static NS_DEFINE_CID(kLookAndFeelCID, NS_LOOKANDFEEL_CID);
|
||||
|
@ -175,6 +176,29 @@ nsWidget::~nsWidget()
|
|||
NS_ASSERTION(!ModalWidgetList::Find(this), "destroying widget without first clearing modality.");
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// nsISupport stuff
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
NS_IMPL_ADDREF(nsWidget)
|
||||
NS_IMPL_RELEASE(nsWidget)
|
||||
NS_IMETHODIMP nsWidget::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
{
|
||||
if (NULL == aInstancePtr) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (aIID.Equals(nsIKBStateControl::GetIID())) {
|
||||
*aInstancePtr = (void*) ((nsIKBStateControl*)this);
|
||||
NS_ADDREF((nsBaseWidget*)this);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return nsBaseWidget::QueryInterface(aIID,aInstancePtr);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsWidget::GetAbsoluteBounds(nsRect &aRect)
|
||||
{
|
||||
gint x;
|
||||
|
@ -1895,6 +1919,7 @@ nsWidget::OnLeaveNotifySignal(GdkEventCrossing * aGdkCrossingEvent)
|
|||
/* virtual */ void
|
||||
nsWidget::OnButtonPressSignal(GdkEventButton * aGdkButtonEvent)
|
||||
{
|
||||
ResetInputState();
|
||||
nsMouseEvent event;
|
||||
nsMouseScrollEvent scrollEvent;
|
||||
PRUint32 eventType = 0;
|
||||
|
@ -2678,15 +2703,116 @@ void nsWidget::SetBackgroundColorNative(GdkColor *aColorNor,
|
|||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
NS_IMETHODIMP nsWidget::ResetInputState()
|
||||
{
|
||||
nsresult res = NS_OK;
|
||||
if(nsnull != mIC)
|
||||
{
|
||||
char* uncommitted_text=nsnull;
|
||||
// force IME to commit
|
||||
uncommitted_text = XmbResetIC(mIC->xic);
|
||||
|
||||
// if we got any text back, we need to send
|
||||
// the IME events
|
||||
if(uncommitted_text && uncommitted_text[0])
|
||||
{
|
||||
PRInt32 uncommitted_len = nsCRT::strlen(uncommitted_text);
|
||||
|
||||
if(nsGtkIMEHelper::GetSingleton())
|
||||
{
|
||||
// prepare Unicode buffer for conversion
|
||||
if (!mIMECompositionUniString)
|
||||
{
|
||||
mIMECompositionUniStringSize = 128;
|
||||
mIMECompositionUniString =
|
||||
new PRUnichar[mIMECompositionUniStringSize];
|
||||
} // if (!mIMECompositionUniString)
|
||||
PRInt32 uniCharSize;
|
||||
PRInt32 srcLen;
|
||||
// Convert in a for loop untill we got all the Unicode
|
||||
for(;;)
|
||||
{
|
||||
PRUnichar* uniChar=mIMECompositionUniString;
|
||||
srcLen= uncommitted_len;
|
||||
uniCharSize= mIMECompositionUniStringSize - 1;
|
||||
res = nsGtkIMEHelper::GetSingleton()->ConvertToUnicode(
|
||||
(char*)uncommitted_text, &srcLen,
|
||||
uniChar,
|
||||
&uniCharSize);
|
||||
if(NS_ERROR_ABORT == res)
|
||||
break;
|
||||
|
||||
// if we convert all text, break
|
||||
if((srcLen == uncommitted_len) &&
|
||||
(uniCharSize < mIMECompositionUniStringSize -1))
|
||||
break;
|
||||
|
||||
// otherwise, re allocate the buffer
|
||||
mIMECompositionUniStringSize += 32;
|
||||
if( mIMECompositionUniString )
|
||||
delete [] mIMECompositionUniString;
|
||||
mIMECompositionUniString =
|
||||
new PRUnichar[mIMECompositionUniStringSize];
|
||||
} // for(;;)
|
||||
if(NS_SUCCEEDED(res))
|
||||
{
|
||||
|
||||
// null terminate the Unicode string
|
||||
mIMECompositionUniString[uniCharSize] = 0;
|
||||
|
||||
//-------------------------------------------------------
|
||||
// send START_COMPOSITION
|
||||
//-------------------------------------------------------
|
||||
nsEventStatus aStatus;
|
||||
nsCompositionEvent compEvent;
|
||||
compEvent.widget= (nsWidget*) this;
|
||||
compEvent.point.x = compEvent.point.y = 0;
|
||||
compEvent.time = 0;
|
||||
compEvent.message = compEvent.eventStructType
|
||||
= compEvent.compositionMessage = NS_COMPOSITION_START;
|
||||
|
||||
DispatchEvent(&compEvent, aStatus);
|
||||
//-------------------------------------------------------
|
||||
// send Text Event
|
||||
//-------------------------------------------------------
|
||||
nsTextEvent textEvent;
|
||||
textEvent.message =textEvent.eventStructType =NS_TEXT_EVENT;
|
||||
textEvent.widget= (nsWidget*) this;
|
||||
textEvent.point.x = textEvent.point.y = 0;
|
||||
textEvent.time = 0;
|
||||
textEvent.theText = mIMECompositionUniString;
|
||||
textEvent.rangeCount = 0;
|
||||
textEvent.rangeArray = nsnull;
|
||||
textEvent.isShift = textEvent.isControl =
|
||||
textEvent.isAlt = textEvent.isMeta = PR_FALSE;
|
||||
DispatchEvent(&textEvent, aStatus);
|
||||
|
||||
//-------------------------------------------------------
|
||||
// send END_COMPOSITION
|
||||
//-------------------------------------------------------
|
||||
compEvent.widget= (nsWidget*) this;
|
||||
compEvent.message = compEvent.eventStructType
|
||||
= compEvent.compositionMessage = NS_COMPOSITION_END;
|
||||
DispatchEvent(&compEvent, aStatus);
|
||||
|
||||
//-------------------------------------------------------
|
||||
// finally, we update the preedit position
|
||||
//-------------------------------------------------------
|
||||
SetXICSpotLocation(compEvent.theReply.mCursorPosition);
|
||||
}
|
||||
}
|
||||
XFree(uncommitted_text);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
NS_IMETHODIMP nsWidget::PasswordFieldInit()
|
||||
{
|
||||
// to be implemented
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#define nsWidget_h__
|
||||
|
||||
#include "nsBaseWidget.h"
|
||||
#include "nsIKBStateControl.h"
|
||||
#include "nsIRegion.h"
|
||||
|
||||
|
||||
|
@ -64,12 +65,19 @@ class nsIToolkit;
|
|||
* Base of all GTK+ native widgets.
|
||||
*/
|
||||
|
||||
class nsWidget : public nsBaseWidget
|
||||
class nsWidget : public nsBaseWidget, nsIKBStateControl
|
||||
{
|
||||
public:
|
||||
nsWidget();
|
||||
virtual ~nsWidget();
|
||||
|
||||
// nsISupports
|
||||
NS_IMETHOD_(nsrefcnt) AddRef(void);
|
||||
NS_IMETHOD_(nsrefcnt) Release(void);
|
||||
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
|
||||
|
||||
// nsIWidget
|
||||
|
||||
NS_IMETHOD Create(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
|
@ -146,6 +154,11 @@ public:
|
|||
NS_IMETHOD Update(void);
|
||||
NS_IMETHOD DispatchEvent(nsGUIEvent* event, nsEventStatus & aStatus);
|
||||
|
||||
|
||||
// nsIKBStateControl
|
||||
NS_IMETHOD ResetInputState();
|
||||
NS_IMETHOD PasswordFieldInit();
|
||||
|
||||
void InitEvent(nsGUIEvent& event, PRUint32 aEventType, nsPoint* aPoint = nsnull);
|
||||
|
||||
// Utility functions
|
||||
|
|
|
@ -143,52 +143,52 @@ nsresult nsWidgetFactory::CreateInstance(nsISupports *aOuter,
|
|||
|
||||
nsISupports *inst = nsnull;
|
||||
if (mClassID.Equals(kCWindow)) {
|
||||
inst = (nsISupports *)new nsWindow();
|
||||
inst = (nsISupports *)(nsBaseWidget*)new nsWindow();
|
||||
}
|
||||
else if (mClassID.Equals(kCChild)) {
|
||||
inst = (nsISupports *)new ChildWindow();
|
||||
inst = (nsISupports *)(nsBaseWidget*)new ChildWindow();
|
||||
}
|
||||
else if (mClassID.Equals(kCButton)) {
|
||||
inst = (nsISupports*)(nsWidget *)new nsButton();
|
||||
inst = (nsISupports*)(nsBaseWidget*)(nsWidget *)new nsButton();
|
||||
}
|
||||
else if (mClassID.Equals(kCCheckButton)) {
|
||||
inst = (nsISupports*)(nsWidget *)new nsCheckButton();
|
||||
inst = (nsISupports*)(nsBaseWidget*)(nsWidget *)new nsCheckButton();
|
||||
}
|
||||
else if (mClassID.Equals(kCCombobox)) {
|
||||
inst = (nsISupports*)(nsWidget *)new nsComboBox();
|
||||
inst = (nsISupports*)(nsBaseWidget*)(nsWidget *)new nsComboBox();
|
||||
}
|
||||
else if (mClassID.Equals(kCRadioButton)) {
|
||||
inst = (nsISupports*)(nsWidget *)new nsRadioButton();
|
||||
inst = (nsISupports*)(nsBaseWidget*)(nsWidget *)new nsRadioButton();
|
||||
}
|
||||
else if (mClassID.Equals(kCFileOpen)) {
|
||||
inst = (nsISupports*)new nsFileWidget();
|
||||
}
|
||||
else if (mClassID.Equals(kCListbox)) {
|
||||
inst = (nsISupports*)(nsWidget *)new nsListBox();
|
||||
inst = (nsISupports*)(nsBaseWidget*)(nsWidget *)new nsListBox();
|
||||
}
|
||||
else if (mClassID.Equals(kCHorzScrollbar)) {
|
||||
inst = (nsISupports*)(nsWidget *)new nsScrollbar(PR_FALSE);
|
||||
inst = (nsISupports*)(nsBaseWidget*)(nsWidget *)new nsScrollbar(PR_FALSE);
|
||||
}
|
||||
else if (mClassID.Equals(kCVertScrollbar)) {
|
||||
inst = (nsISupports*)(nsWidget *)new nsScrollbar(PR_TRUE);
|
||||
inst = (nsISupports*)(nsBaseWidget*)(nsWidget *)new nsScrollbar(PR_TRUE);
|
||||
}
|
||||
else if (mClassID.Equals(kCTextArea)) {
|
||||
inst = (nsISupports*)(nsWidget *)new nsTextAreaWidget();
|
||||
inst = (nsISupports*)(nsBaseWidget*)(nsWidget *)new nsTextAreaWidget();
|
||||
}
|
||||
else if (mClassID.Equals(kCTextField)) {
|
||||
inst = (nsISupports*)(nsWidget *)new nsTextWidget();
|
||||
inst = (nsISupports*)(nsBaseWidget*)(nsWidget *)new nsTextWidget();
|
||||
}
|
||||
else if (mClassID.Equals(kCAppShell)) {
|
||||
inst = (nsISupports*)new nsAppShell();
|
||||
}
|
||||
else if (mClassID.Equals(kCToolkit)) {
|
||||
inst = (nsISupports*)(nsWidget *)new nsToolkit();
|
||||
inst = (nsISupports*)(nsBaseWidget*)(nsWidget *)new nsToolkit();
|
||||
}
|
||||
else if (mClassID.Equals(kCLookAndFeel)) {
|
||||
inst = (nsISupports*)(nsWidget *)new nsLookAndFeel();
|
||||
inst = (nsISupports*)(nsBaseWidget*)(nsWidget *)new nsLookAndFeel();
|
||||
}
|
||||
else if (mClassID.Equals(kCLabel)) {
|
||||
inst = (nsISupports*)(nsWidget *)new nsLabel();
|
||||
inst = (nsISupports*)(nsBaseWidget*)(nsWidget *)new nsLabel();
|
||||
}
|
||||
#if 0
|
||||
else if (mClassID.Equals(kCMenuBar)) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче