Numerous bug fixes and code cleanup for photon related memory leaks and
bugs.
This commit is contained in:
briane%qnx.com 2001-03-14 19:46:53 +00:00
Родитель 81bc3e2f3d
Коммит a799c2e203
19 изменённых файлов: 1215 добавлений и 3942 удалений

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

@ -37,7 +37,7 @@ static void raw_draw_container_draw( PtWidget_t *widget, PhTile_t *damage )
}
if( rdc->draw_f )
rdc->draw_f( widget, damage );
rdc->draw_f( widget, damage );
}
//

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

@ -121,8 +121,6 @@ NS_IMETHODIMP nsAppShell::SetDispatchListener(nsDispatchListener* aDispatchListe
static int event_processor_callback(int fd, void *data, unsigned mode)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsAppShell::event_processor_callback fd=<%d> data=<%p> mode=<%d>\n", fd, data, mode));
nsIEventQueue *eventQueue = (nsIEventQueue*)data;
if (eventQueue)
eventQueue->ProcessPendingEvents();
@ -147,8 +145,6 @@ NS_IMETHODIMP nsAppShell::Create(int *bac, char **bav)
PhWidLog = PR_NewLogModule("PhWidLog");
}
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsAppShell::Create\n"));
int argc = bac ? *bac : 0;
char **argv = bav;
@ -289,9 +285,6 @@ NS_METHOD nsAppShell::GetNativeEvent(PRBool &aRealEvent, void *&aEvent)
NS_METHOD nsAppShell::DispatchNativeEvent(PRBool aRealEvent, void * aEvent)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsAppShell::DispatchNativeEvent aRealEvent=<%d> aEvent=<%p> mEventQueue=<%p>\n", aRealEvent, aEvent, mEventQueue));
if (!mEventQueue)
return NS_ERROR_NOT_INITIALIZED;

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

@ -61,7 +61,6 @@ nsButton::nsButton() : nsWidget(), nsIButton()
//-------------------------------------------------------------------------
nsButton::~nsButton()
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsButton::~nsButton this=<%p> - Not Implemented!\n", this));
}
//-------------------------------------------------------------------------
@ -71,7 +70,6 @@ nsButton::~nsButton()
//-------------------------------------------------------------------------
NS_METHOD nsButton::SetLabel(const nsString& aText)
{
nsresult res = NS_ERROR_FAILURE;
mLabel = aText;
if( mWidget )
@ -80,16 +78,13 @@ NS_METHOD nsButton::SetLabel(const nsString& aText)
NS_ALLOC_STR_BUF(label, aText, aText.Length());
PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsButton:SetLabel - aText=<%s> mWidget=%p mRefCnt=<%d>\n", label, mWidget, mRefCnt));
PtSetArg( &arg, Pt_ARG_TEXT_STRING, label, 0 );
if( PtSetResources( mWidget, 1, &arg ) == 0 )
res = NS_OK;
PtSetResources( mWidget, 1, &arg );
NS_FREE_STR_BUF(label);
}
return res;
return NS_OK;
}
//-------------------------------------------------------------------------
@ -99,10 +94,6 @@ NS_METHOD nsButton::SetLabel(const nsString& aText)
//-------------------------------------------------------------------------
NS_METHOD nsButton::GetLabel(nsString& aBuffer)
{
NS_ALLOC_STR_BUF(label, mLabel, mLabel.Length());
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsButton::GetLabel label=<%s> mRefCnt=<%d>\n", label, mRefCnt));
NS_FREE_STR_BUF(label);
aBuffer = mLabel;
return NS_OK;
}
@ -112,21 +103,21 @@ NS_METHOD nsButton::GetLabel(nsString& aBuffer)
// move, paint, resizes message - ignore
//
//-------------------------------------------------------------------------
// Not Implemented
PRBool nsButton::OnMove(PRInt32, PRInt32)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsButton::OnMove - Not Implemented\n"));
return PR_FALSE;
}
// Not Implemented
PRBool nsButton::OnPaint()
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsButton::OnPaint - Not Implemented\n"));
return PR_FALSE;
}
// Not Implemented
PRBool nsButton::OnResize(nsRect &aWindowRect)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsButton::OnResize - Not Implemented\n"));
return PR_FALSE;
}
@ -135,10 +126,10 @@ PRBool nsButton::OnResize(nsRect &aWindowRect)
* Renders the Button for Printing
*
**/
// Not Implemented
NS_METHOD nsButton::Paint(nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsButton::Paint - Not Implemented\n"));
return NS_OK;
}
@ -151,8 +142,6 @@ NS_METHOD nsButton::CreateNative( PtWidget_t* aParent )
PhDim_t dim;
const unsigned short BorderWidth = 2;
PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsButton::CreateNative at (%d,%d) for (%d,%d) with mRefCnt=<%d>\n",mBounds.x,mBounds.y, mBounds.width, mBounds.height, mRefCnt));
NS_PRECONDITION(aParent, "nsButton::CreateNative aParent is NULL");
pos.x = mBounds.x;

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

@ -41,10 +41,6 @@
// Initialize the class statics:
#if defined(DEBUG)
#define DEBUG_CLIPBOARD
#endif
//-------------------------------------------------------------------------
//
// nsClipboard constructor
@ -52,7 +48,6 @@
//-------------------------------------------------------------------------
nsClipboard::nsClipboard() : nsBaseClipboard()
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsClipboard::nsClipboard this=<%p>\n", this));
}
//-------------------------------------------------------------------------
@ -60,19 +55,12 @@ nsClipboard::nsClipboard() : nsBaseClipboard()
//-------------------------------------------------------------------------
nsClipboard::~nsClipboard()
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsClipboard::~nsClipboard this=<%p>\n", this));
}
//-------------------------------------------------------------------------
NS_IMETHODIMP nsClipboard::ForceDataToClipboard(PRInt32 aWhichClipboard)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsClipboard::ForceDataToClipboard this=<%p>\n", this));
#ifdef DEBUG_CLIPBOARD
printf("nsClipboard::ForceDataToClipboard this=<%p>\n", this);
#endif
// make sure we have a good transferable
if (nsnull == mTransferable) {
return NS_ERROR_FAILURE;
@ -85,167 +73,93 @@ NS_IMETHODIMP nsClipboard::ForceDataToClipboard(PRInt32 aWhichClipboard)
//-------------------------------------------------------------------------
NS_IMETHODIMP nsClipboard::SetNativeClipboardData(PRInt32 aWhichClipboard)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsClipboard::SetNativeClipboardData this=<%p>\n", this));
#ifdef DEBUG_CLIPBOARD
printf("nsClipboard::SetNativeClipboardData this=<%p>\n", this);
#endif
nsresult res = NS_ERROR_FAILURE;
// make sure we have a good transferable
if (nsnull == mTransferable)
{
printf("nsClipboard::SetNativeClipboardData(): no transferable!\n");
return NS_ERROR_FAILURE;
}
if( nsnull == mTransferable ) return NS_ERROR_FAILURE;
// get flavor list that includes all flavors that can be written (including ones
// obtained through conversion)
nsCOMPtr<nsISupportsArray> flavorList;
nsresult errCode = mTransferable->FlavorsTransferableCanExport ( getter_AddRefs(flavorList) );
if ( NS_FAILED(errCode) )
return NS_ERROR_FAILURE;
if ( NS_FAILED(errCode) ) return NS_ERROR_FAILURE;
PRUint32 cnt;
flavorList->Count(&cnt);
if (cnt)
{
PhClipHeader *cliphdr = (PhClipHeader *) malloc( cnt * sizeof( PhClipHeader ));
if (cnt) {
PhClipHeader *cliphdr = (PhClipHeader *) calloc( cnt, sizeof( PhClipHeader ));
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsClipboard::SetNativeClipboardData cnt=<%d> cliphdr=<%p>\n", cnt, cliphdr));
if( cliphdr )
{
if( cliphdr ) {
PRUint32 i=0, index=0;
nsString *df;
void *data = nsnull;
PRUint32 dataLen;
mIgnoreEmptyNotification = PR_TRUE;
mIgnoreEmptyNotification = PR_TRUE;
for ( PRUint32 i=0; i<cnt; ++i )
{
for ( PRUint32 i=0; i<cnt; ++i ) {
nsCOMPtr<nsISupports> genericFlavor;
flavorList->GetElementAt ( i, getter_AddRefs(genericFlavor) );
nsCOMPtr<nsISupportsString> currentFlavor ( do_QueryInterface(genericFlavor) );
if ( currentFlavor )
{
nsXPIDLCString flavorStr;
currentFlavor->ToString(getter_Copies(flavorStr));
nsresult err = GetFormat( flavorStr, &cliphdr[index] );
if (err != NS_OK)
continue;
{
nsXPIDLCString flavorStr;
currentFlavor->ToString(getter_Copies(flavorStr));
nsresult err = GetFormat( flavorStr, &cliphdr[index] );
if( err != NS_OK ) continue;
// Get data out of transferable.
nsCOMPtr<nsISupports> genericDataWrapper;
mTransferable->GetTransferData(flavorStr,
getter_AddRefs(genericDataWrapper),
&dataLen);
// Get data out of transferable.
nsCOMPtr<nsISupports> genericDataWrapper;
mTransferable->GetTransferData( flavorStr, getter_AddRefs(genericDataWrapper), &dataLen );
nsPrimitiveHelpers::CreateDataFromPrimitive ( flavorStr, genericDataWrapper, &data, dataLen );
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsClipboard::SetNativeClipboardData adding %d index=<%d> type=<%s> length=%d data=<%s>\n", i, index, cliphdr[index].type, dataLen, data));
nsPrimitiveHelpers::CreateDataFromPrimitive ( flavorStr, genericDataWrapper, &data, dataLen );
int len = 0;
char *plain;
nsPrimitiveHelpers::ConvertUnicodeToPlatformPlainText( (PRUnichar*)data, dataLen/2, &plain, &len );
printf("nsClipboard::setNativeClipboardData 1 data=<%s> dataLen=<%d> \n", data, dataLen );
cliphdr[index].length = len+1;
cliphdr[index].data = plain;
#if defined(DEBUG) && 0
{
unsigned char *ptr = data;
int i=0;
printf("nsClipboard::setNativeClipboardData before: ");
for(i=0; i < dataLen; ptr++,i++)
{
printf("%x ",*ptr);
}
printf("\n");
}
#endif
int len;
char *mbsbuffer = (char *) calloc(dataLen,1); /* MEMORY LEAK */
len = wcstombs (mbsbuffer, (const wchar_t*) data, dataLen);
printf("nsClipboard::setNativeClipboardData 2 mbsbuffer=<%s> dataLen=<%d> len=<%d> \n", mbsbuffer, dataLen, len );
#if defined(DEBUG) && 0
{
unsigned char *ptr = mbsbuffer;
int i=0;
printf("nsClipboard::setNativeClipboardData after: ");
for(i=0; i < len; ptr++,i++)
{
printf("%x ",*ptr);
}
printf("\n");
}
#endif
#if 0
cliphdr[index].length = dataLen;
cliphdr[index].data = data;
#endif
#if 0
cliphdr[index].length = len;
cliphdr[index].data = mbsbuffer;
#endif
#if 1
cliphdr[index].length = strlen(mbsbuffer) + 1; /* Add the NULL */
cliphdr[index].data = mbsbuffer;
#endif
index++;
}
}
PhClipboardCopy( 1, index, cliphdr );
for(i=0; i<index; i++)
index++;
}
}
PhClipboardCopy( 1, index, cliphdr );
for(i=0; i<index; i++)
nsCRT::free ( NS_REINTERPRET_CAST(char*, cliphdr[i].data) );
res = NS_OK;
mIgnoreEmptyNotification = PR_FALSE;
}
}
res = NS_OK;
mIgnoreEmptyNotification = PR_FALSE;
free( cliphdr );
}
}
return res;
}
}
//-------------------------------------------------------------------------
NS_IMETHODIMP
nsClipboard::GetNativeClipboardData(nsITransferable * aTransferable,
PRInt32 aWhichClipboard)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsClipboard::GetNativeClipboardData this=<%p>\n", this));
#ifdef DEBUG_CLIPBOARD
printf("nsClipboard::GetNativeClipboardData this=<%p>\n", this);
#endif
nsClipboard::GetNativeClipboardData( nsITransferable * aTransferable, PRInt32 aWhichClipboard ) {
nsresult res = NS_ERROR_FAILURE;
// make sure we have a good transferable
if (nsnull == aTransferable) {
printf(" GetNativeClipboardData: Transferable is null!\n");
return NS_ERROR_FAILURE;
}
if( nsnull == aTransferable ) return NS_ERROR_FAILURE;
// get flavor list that includes all acceptable flavors (including ones obtained through
// conversion)
nsCOMPtr<nsISupportsArray> flavorList;
nsresult errCode = aTransferable->FlavorsTransferableCanImport ( getter_AddRefs(flavorList) );
if ( NS_FAILED(errCode) )
return NS_ERROR_FAILURE;
if ( NS_FAILED(errCode) ) return NS_ERROR_FAILURE;
// Walk through flavors and see which flavor matches the one being pasted:
PRUint32 cnt;
flavorList->Count(&cnt);
nsCAutoString foundFlavor;
if (cnt > 0)
{
if (cnt > 0) {
void *clipPtr;
PhClipHeader cliptype;
PhClipHeader *cliphdr;
@ -254,66 +168,28 @@ nsClipboard::GetNativeClipboardData(nsITransferable * aTransferable,
clipPtr = PhClipboardPasteStart( 1 );
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsClipboard::GetNativeClipboardData cnt=<%d>\n", cnt));
for ( PRUint32 i = 0; i < cnt; ++i )
{
for ( PRUint32 i = 0; i < cnt; ++i ) {
nsCOMPtr<nsISupports> genericFlavor;
flavorList->GetElementAt ( i, getter_AddRefs(genericFlavor) );
nsCOMPtr<nsISupportsString> currentFlavor ( do_QueryInterface(genericFlavor) );
if ( currentFlavor )
{
if ( currentFlavor ) {
nsXPIDLCString flavorStr;
currentFlavor->ToString ( getter_Copies(flavorStr) );
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsClipboard::GetNativeClipboardData looking for=<%s>\n", (const char *) flavorStr));
nsresult err = GetFormat( flavorStr, &cliptype);
if (err != NS_OK)
continue;
if (err != NS_OK) continue;
cliphdr = PhClipboardPasteType( clipPtr, cliptype.type );
if (cliphdr)
{
data = cliphdr->data;
dataLen = cliphdr->length;
if (cliphdr) {
data = cliphdr->data;
dataLen = cliphdr->length;
printf("nsClipboard::GetNativeClipboardData 1 data=<%s> dataLen=<%d> \n", data, dataLen );
#if defined(DEBUG) && 0
{
unsigned char *ptr = data;
int i=0;
printf("nsClipboard::GetNativeClipboardData before: ");
for(i=0; i < dataLen; ptr++,i++)
{
printf("%x ",*ptr);
}
printf("\n");
}
#endif
int len;
wchar_t *wbuffer = (wchar_t *) calloc(dataLen*3, 1); /* MEMORY LEAK */
len = mbstowcs(wbuffer, (const char *) data, dataLen*3);
printf("nsClipboard::GetNativeClipboardData %s(%d)\n", data, len );
data = wbuffer;
dataLen = len*2;
printf("nsClipboard::GetNativeClipboardData 2 data=<%s> dataLen=<%d>\n", data, dataLen );
#if defined(DEBUG) && 0
{
unsigned char *ptr = data;
int i=0;
printf("nsClipboard::GetNativeClipboardData after: ");
for(i=0; i < dataLen; ptr++,i++)
{
printf("%x ",*ptr);
}
printf("\n");
}
#endif
int len_unicode;
PRUnichar *unicode;
nsPrimitiveHelpers::ConvertPlatformPlainTextToUnicode( (char*) data, dataLen, &unicode, &len_unicode );
len_unicode *= 2;
#if 0
/* Kirk - 2/25/99 Disable this for unicode text */
@ -327,80 +203,44 @@ printf("nsClipboard::GetNativeClipboardData 2 data=<%s> dataLen=<%d>\n", data, d
#endif
nsCOMPtr<nsISupports> genericDataWrapper;
nsPrimitiveHelpers::CreatePrimitiveForData ( flavorStr, data, dataLen, getter_AddRefs(genericDataWrapper) );
aTransferable->SetTransferData(flavorStr,
genericDataWrapper,
dataLen);
printf("nsClipboard::GetNativeClipboardData flavorStr=<%s> length=<%d> data=<%s>\n", cliptype.type, dataLen, data );
res = NS_OK;
break;
}
}
}
nsCOMPtr<nsISupports> genericDataWrapper;
nsPrimitiveHelpers::CreatePrimitiveForData ( flavorStr, unicode, len_unicode, getter_AddRefs(genericDataWrapper) );
aTransferable->SetTransferData(flavorStr, genericDataWrapper, len_unicode );
PhClipboardPasteFinish( clipPtr );
}
res = NS_OK;
break;
}
}
}
PhClipboardPasteFinish( clipPtr );
}
return res;
}
}
NS_IMETHODIMP
nsClipboard::HasDataMatchingFlavors(nsISupportsArray* aFlavorList,
PRInt32 aWhichClipboard,
PRBool * outResult)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsClipboard::HasDataMatchingFlavors this=<%p>\n", this));
#ifdef DEBUG_CLIPBOARD
PRUint32 cnt;
aFlavorList->Count(&cnt);
if (cnt)
{
PRUint32 i;
for ( PRUint32 i=0; i<cnt; ++i )
{
nsCOMPtr<nsISupports> genericFlavor;
aFlavorList->GetElementAt ( i, getter_AddRefs(genericFlavor) );
nsCOMPtr<nsISupportsString> currentFlavor ( do_QueryInterface(genericFlavor) );
if ( currentFlavor )
{
nsXPIDLCString flavorStr;
currentFlavor->ToString(getter_Copies(flavorStr));
printf("nsClipboard::HasDataMatchingFlavors : <%s>\n", (const char *) flavorStr);
}
}
}
#endif
PRBool * outResult) {
*outResult = PR_TRUE; // say we always do.
return NS_OK;
}
}
//=========================================================================
//-------------------------------------------------------------------------
nsresult nsClipboard::GetFormat(const char* aMimeStr, PhClipHeader *cliphdr )
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsClipboard::GetFormat this=<%p> aMimeStr=<%s>\n", this, aMimeStr));
#ifdef DEBUG_CLIPBOARD
printf("nsClipboard::GetFormat this=<%p> aMimeStr=<%s>\n", this, aMimeStr);
#endif
nsresult nsClipboard::GetFormat(const char* aMimeStr, PhClipHeader *cliphdr ) {
nsCAutoString mimeStr ( CBufDescriptor(NS_CONST_CAST(char*,aMimeStr), PR_TRUE, PL_strlen(aMimeStr)+1) );
cliphdr->type[0]=0;
if (mimeStr.Equals(kUnicodeMime))
{
strcpy( cliphdr->type, Ph_CLIPBOARD_TYPE_TEXT );
}
if (cliphdr->type[0] == 0)
return NS_ERROR_FAILURE;
else
return NS_OK;
}
if (cliphdr->type[0] == 0)
return NS_ERROR_FAILURE;
else
return NS_OK;
}

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

@ -48,8 +48,6 @@ NS_IMPL_QUERY_INTERFACE2(nsDragService, nsIDragService, nsIDragSession)
//-------------------------------------------------------------------------
nsDragService::nsDragService()
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsDragService::nsDragService this=<%p>\n", this));
NS_INIT_REFCNT();
mWidget = nsnull;
mNumFlavors = 0;
@ -62,8 +60,6 @@ nsDragService::nsDragService()
//-------------------------------------------------------------------------
nsDragService::~nsDragService()
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsDragService::~nsDragService this=<%p>\n", this));
if (mWidget)
{
PtDestroyWidget(mWidget);
@ -75,8 +71,6 @@ nsDragService::~nsDragService()
NS_IMETHODIMP nsDragService::StartDragSession()
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsDragService::StartDragSession this=<%p>\n", this));
NS_WARNING("nsDragService::StartDragSession() - Not Supported Yet");
nsBaseDragService::StartDragSession();
@ -85,8 +79,6 @@ NS_IMETHODIMP nsDragService::StartDragSession()
NS_IMETHODIMP nsDragService::EndDragSession()
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsDragService::EndDragSession this=<%p>\n", this));
NS_WARNING("nsDragService::EndDragSession()\n");
nsBaseDragService::EndDragSession();
@ -104,7 +96,6 @@ NS_IMETHODIMP nsDragService::InvokeDragSession (nsIDOMNode *aDOMNode,
{
nsBaseDragService::InvokeDragSession ( aDOMNode, aTransferableArray, aRegion, aActionType );
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsDragService::InvokeDragSession this=<%p> aActionType=<%d>\n", this, aActionType));
//mWidget = gtk_invisible_new();
//gtk_widget_show(mWidget);
@ -228,8 +219,6 @@ PRBool nsDragService::DoConvert(GdkAtom type)
//-------------------------------------------------------------------------
NS_IMETHODIMP nsDragService::GetNumDropItems (PRUint32 * aNumItems)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsDragService::GetNumDropItems this=<%p>\n", this));
*aNumItems = 0;
return NS_OK;
}
@ -237,13 +226,6 @@ NS_IMETHODIMP nsDragService::GetNumDropItems (PRUint32 * aNumItems)
//-------------------------------------------------------------------------
NS_IMETHODIMP nsDragService::GetData (nsITransferable * aTransferable, PRUint32 anItem)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsDragService::GetData this=<%p>\n", this));
#ifdef DEBUG_DRAG
printf("nsClipboard::GetNativeClipboardData()\n");
#endif /* DEBUG_CLIPBOARD */
#if 0
// make sure we have a good transferable
@ -277,11 +259,6 @@ NS_IMETHODIMP nsDragService::GetData (nsITransferable * aTransferable, PRUint32
}
}
#ifdef DEBUG_CLIPBOARD
printf(" Got the callback: '%s', %d\n",
mSelectionData.data, mSelectionData.length);
#endif /* DEBUG_CLIPBOARD */
// We're back from the callback, no longer blocking:
mBlocking = PR_FALSE;
@ -320,9 +297,6 @@ NS_IMETHODIMP nsDragService::GetData (nsITransferable * aTransferable, PRUint32
//-------------------------------------------------------------------------
NS_IMETHODIMP nsDragService::IsDataFlavorSupported(const char *aDataFlavor, PRBool *_retval)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsDragService::IsDataFlavorSupported this=<%p>\n", this));
printf("nsDragService::IsDataFlavorSupported\n");
if (!aDataFlavor || !_retval)
return NS_ERROR_FAILURE;
@ -334,9 +308,6 @@ NS_IMETHODIMP nsDragService::IsDataFlavorSupported(const char *aDataFlavor, PRBo
//-------------------------------------------------------------------------
NS_IMETHODIMP nsDragService::GetCurrentSession (nsIDragSession **aSession)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsDragService::GetCurrentSession this=<%p>\n", this));
printf("nsDragService::GetCurrentSession\n");
if (!aSession)
return NS_ERROR_FAILURE;

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

@ -36,8 +36,6 @@ NS_IMPL_ISUPPORTS(nsFileWidget, kIFileWidgetIID);
//-------------------------------------------------------------------------
nsFileWidget::nsFileWidget() : nsIFileWidget()
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsFileWidget::nsFileWidget - Constructor Called this=<%p>\n", this));
NS_INIT_REFCNT();
mWidget = nsnull;
mParent = nsnull;
@ -51,8 +49,6 @@ nsFileWidget::nsFileWidget() : nsIFileWidget()
//-------------------------------------------------------------------------
nsFileWidget::~nsFileWidget()
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsFileWidget::~nsFileWidget - Destructor Called this=<%p>\n", this));
if (mWidget)
PtDestroyWidget(mWidget);
}
@ -64,8 +60,6 @@ nsFileWidget::~nsFileWidget()
//-------------------------------------------------------------------------
PRBool nsFileWidget::Show()
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsFileWidget::Show this=<%p> mMode=<%d>\n", this, mMode));
int err;
PRBool res = PR_FALSE;
char *title = mTitle.ToNewCString();
@ -74,7 +68,6 @@ PRBool nsFileWidget::Show()
if (mParent)
{
myParent = (PtWidget_t *) mParent->GetNativeData(NS_NATIVE_WIDGET);
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsFileWidget::Show myParent=<%p>\n", myParent));
}
PhPoint_t thePos= {100,100};
@ -115,21 +108,14 @@ PRBool nsFileWidget::Show()
PtSetParentWidget( NULL );
err = PtFileSelection(myParent, &thePos, title, root_dir, file_spec, btn1, btn2, format, &info, flags);
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsFileWidget::Show 2 err=<%d>\n", err));
if (err == 0)
{
/* Successfully selected a file or directory */
if (info.ret == Pt_FSDIALOG_BTN1)
{
mSelectedFile.SetLength(0);
mSelectedFile.AppendWithConversion(info.path);
char *str = mSelectedFile.ToNewCString();
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsFileWidget::Create Success from PtFileSelection str=<%s>\n", str));
delete [] str;
res = PR_TRUE;
mSelectedFile.AppendWithConversion(info.path);
res = PR_TRUE;
}
else
{
@ -152,7 +138,6 @@ PRBool nsFileWidget::Show()
//-------------------------------------------------------------------------
PRBool nsFileWidget::AskReplace()
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsFileWidget::AskReplace this=<%p> - Not Implemented\n", this));
PRBool res = PR_FALSE;
/* Almost the same as ::Show Just different button labels */
@ -169,25 +154,6 @@ NS_METHOD nsFileWidget::SetFilterList(PRUint32 aNumberOfFilters,
const nsString aTitles[],
const nsString aFilters[])
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsFileWidget::SetFilterList numFilters=<%d>\n", aNumberOfFilters));
#if defined(DEBUG)
{
int i;
for(i=0; i<aNumberOfFilters; i++)
{
char *str1 = aTitles[i].ToNewCString();
char *str2 = aFilters[i].ToNewCString();
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsFileWidget::SetFilterList %d Title=<%s> Filter=<%s>\n", i, str1, str2));
delete [] str1;
delete [] str2;
}
}
#endif
mNumberOfFilters = aNumberOfFilters;
mTitles = aTitles;
mFilters = aFilters;
@ -203,10 +169,6 @@ NS_METHOD nsFileWidget::SetFilterList(PRUint32 aNumberOfFilters,
//-------------------------------------------------------------------------
NS_METHOD nsFileWidget::SetDefaultString(const nsString& aString)
{
char *str = aString.ToNewCString();
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsFileWidget::SetDefaultString new string=<%s> - Not Implemented\n", str));
delete [] str;
mDefault = aString;
return NS_OK;
}
@ -219,8 +181,6 @@ NS_METHOD nsFileWidget::SetDefaultString(const nsString& aString)
//-------------------------------------------------------------------------
NS_METHOD nsFileWidget::SetDisplayDirectory(const nsFileSpec & aDirectory)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsFileWidget::SetDisplayDirectory to <%s> - Not Implemented\n", aDirectory.GetCString()));
mDisplayDirectory = (const PRUnichar *) aDirectory.GetCString(); /* LEAK? */
return NS_OK;
}
@ -232,8 +192,6 @@ NS_METHOD nsFileWidget::SetDisplayDirectory(const nsFileSpec & aDirectory)
//-------------------------------------------------------------------------
NS_METHOD nsFileWidget::GetDisplayDirectory(nsFileSpec& aDirectory)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsFileWidget::GetDisplayDirectory - Not Implemented\n"));
aDirectory = mDisplayDirectory;
return NS_OK;
}
@ -248,8 +206,6 @@ NS_METHOD nsFileWidget::Create(nsIWidget *aParent,
nsIToolkit *aToolkit,
void *aInitData)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsFileWidget::Create aParent=<%p>\n", aParent));
mMode = aMode;
mTitle.SetLength(0);
mTitle.Append(aTitle);
@ -262,10 +218,7 @@ NS_METHOD nsFileWidget::Create(nsIWidget *aParent,
NS_METHOD nsFileWidget::GetFile(nsFileSpec& aFile)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsFileWidget::GetFile with nsFileSpec this=<%p>\n", this));
char *str = mSelectedFile.ToNewCString();
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsFileWidget::GetFile with nsFileSpec filename=<%s>\n", str));
aFile = strdup(str);
delete [] str;
@ -274,10 +227,9 @@ NS_METHOD nsFileWidget::GetFile(nsFileSpec& aFile)
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
// Not Implemented
NS_METHOD nsFileWidget::GetSelectedType(PRInt16& theType)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsFileWidget::GetSelectedType - Not Implemented\n"));
theType = mSelectedType;
return NS_OK;
}
@ -288,8 +240,6 @@ nsFileDlgResults nsFileWidget::GetFile(
const nsString & promptString, // Window title for the dialog
nsFileSpec & theFileSpec) // Populate with initial path for file dialog
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsFileWidget::GetFile with nsIWidget this=<%p> aParent=<%p>\n", this, aParent));
Create(aParent, promptString, eMode_load, nsnull, nsnull);
if (Show() == PR_TRUE)
{
@ -305,8 +255,6 @@ nsFileDlgResults nsFileWidget::GetFolder(
const nsString & promptString, // Window title for the dialog
nsFileSpec & theFileSpec) // Populate with initial path for file dialog
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsFileWidget::GetFolder with nsIWidget\n"));
Create(aParent, promptString, eMode_getfolder, nsnull, nsnull);
if (Show() == PR_TRUE)
{
@ -322,8 +270,6 @@ nsFileDlgResults nsFileWidget::PutFile(
const nsString & promptString, // Window title for the dialog
nsFileSpec & theFileSpec) // Populate with initial path for file dialog
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsFileWidget::PutFile with nsIWidget\n"));
nsFileDlgResults theResult = nsFileDlgResults_Cancel;
Create(aParent, promptString, eMode_save, nsnull, nsnull);

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

@ -39,8 +39,6 @@ NS_IMPL_ISUPPORTS2(nsFontRetrieverService, nsIFontRetrieverService, nsIFontNameI
//----------------------------------------------------------
nsFontRetrieverService::nsFontRetrieverService()
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsFontRetrieverService::nsFontRetrieverService this=<%p>\n", this));
NS_INIT_REFCNT();
mFontList = nsnull;
mSizeIter = nsnull;
@ -51,8 +49,6 @@ nsFontRetrieverService::nsFontRetrieverService()
//----------------------------------------------------------
nsFontRetrieverService::~nsFontRetrieverService()
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsFontRetrieverService::~nsFontRetrieverService this=<%p>\n",this));
if (nsnull != mFontList) {
for (PRInt32 i=0;i<mFontList->Count();i++) {
FontInfo * font = (FontInfo *)mFontList->ElementAt(i);
@ -73,8 +69,6 @@ nsFontRetrieverService::~nsFontRetrieverService()
//----------------------------------------------------------
NS_IMETHODIMP nsFontRetrieverService::CreateFontNameIterator( nsIFontNameIterator** aIterator )
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsFontRetrieverService::CreateFontNameIterator this=<%p>\n",this));
if (nsnull == aIterator) {
return NS_ERROR_FAILURE;
}
@ -91,8 +85,6 @@ NS_IMETHODIMP nsFontRetrieverService::CreateFontNameIterator( nsIFontNameIterato
NS_IMETHODIMP nsFontRetrieverService::CreateFontSizeIterator( const nsString & aFontName,
nsIFontSizeIterator** aIterator )
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsFontRetrieverService::CreateFontNameIterator 2 this=<%p>\n",this));
// save value in case someone externally is using it
PRInt32 saveIterInx = mNameIterInx;
@ -130,8 +122,6 @@ NS_IMETHODIMP nsFontRetrieverService::CreateFontSizeIterator( const nsString & a
//----------------------------------------------------------
NS_IMETHODIMP nsFontRetrieverService::Reset()
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsFontRetrieverService::Reset this=<%p>\n",this));
mNameIterInx = 0;
return NS_OK;
}
@ -139,8 +129,6 @@ NS_IMETHODIMP nsFontRetrieverService::Reset()
//----------------------------------------------------------
NS_IMETHODIMP nsFontRetrieverService::Get( nsString* aFontName )
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsFontRetrieverService::Get this=<%p>\n",this));
if (mNameIterInx < mFontList->Count()) {
FontInfo * fontInfo = (FontInfo *)mFontList->ElementAt(mNameIterInx);
*aFontName = fontInfo->mName;
@ -152,8 +140,6 @@ NS_IMETHODIMP nsFontRetrieverService::Get( nsString* aFontName )
//----------------------------------------------------------
NS_IMETHODIMP nsFontRetrieverService::Advance()
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsFontRetrieverService::Advance this=<%p>\n",this));
if (mNameIterInx < mFontList->Count()-1) {
mNameIterInx++;
return NS_OK;
@ -164,8 +150,6 @@ NS_IMETHODIMP nsFontRetrieverService::Advance()
//------------------------------
static FontInfo * GetFontInfo(nsVoidArray * aFontList, char * aName)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsFontRetrieverService::GetFontInfo\n"));
nsAutoString name((const PRUnichar *) aName, strlen(aName) );
PRInt32 i;
PRInt32 cnt = aFontList->Count();
@ -188,8 +172,6 @@ static FontInfo * GetFontInfo(nsVoidArray * aFontList, char * aName)
//------------------------------
static void AddSizeToFontInfo(FontInfo * aFontInfo, PRInt32 aSize)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsFontRetrieverService::AddSizeToFontInfo\n"));
nsVoidArray * sizes;
if (nsnull == aFontInfo->mSizes) {
sizes = new nsVoidArray();
@ -228,8 +210,6 @@ static void AddSizeToFontInfo(FontInfo * aFontInfo, PRInt32 aSize)
//--------------------------------------------------
NS_IMETHODIMP nsFontRetrieverService::LoadFontList()
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsFontRetrieverService::LoadFontList this=<%p>\n",this));
#if 0
char * pattern = "*";
int nnames = 1024;
@ -392,8 +372,6 @@ NS_IMETHODIMP nsFontRetrieverService::LoadFontList()
NS_IMETHODIMP nsFontRetrieverService::IsFontScalable(const nsString & aFontName,
PRBool* aResult )
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsFontRetrieverService::IsFontScalable this=<%p>\n",this));
// save value in case someone externally is using it
PRInt32 saveIterInx = mNameIterInx;

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

@ -108,8 +108,6 @@ nsMenuBar::nsMenuBar() : nsIMenuBar(), nsIMenuListener()
//-------------------------------------------------------------------------
nsMenuBar::~nsMenuBar()
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsMenuBar::~nsMenuBar Destructor Called - Not Implmenented\n"));
// Remove all references to menus on this menubar
mItems->Clear();
@ -136,12 +134,10 @@ NS_METHOD nsMenuBar::Create(nsIWidget *aParent)
mMenuBar = PtCreateWidget( PtMenuBar, parent, 1, arg);
if (!mMenuBar)
{
PR_LOG(PhWidLog, PR_LOG_ERROR, ("nsMenuBar::Create Failed to create the PtMenuBar\n"));
return NS_ERROR_FAILURE;
}
else
{
PR_LOG(PhWidLog, PR_LOG_ERROR, ("nsMenuBar::Create with nsIWidget parent=%p, this=%p Photon menuBar=<%p>\n", aParent, this, mMenuBar));
SetParent(aParent);
// PtRealizeWidget(mMenuBar);
@ -152,8 +148,6 @@ NS_METHOD nsMenuBar::Create(nsIWidget *aParent)
//-------------------------------------------------------------------------
NS_METHOD nsMenuBar::GetParent(nsIWidget *&aParent)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsMenuBar::GetParent mParent=<%p>\n", mParent));
aParent = mParent;
return NS_OK;
}
@ -161,8 +155,6 @@ NS_METHOD nsMenuBar::GetParent(nsIWidget *&aParent)
//-------------------------------------------------------------------------
NS_METHOD nsMenuBar::SetParent(nsIWidget *aParent)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsMenuBar::SetParent aParent=<%p>\n", aParent));
mParent = aParent;
return NS_OK;
}
@ -172,20 +164,9 @@ NS_METHOD nsMenuBar::AddMenu(nsIMenu * aMenu)
{
NS_ASSERTION(aMenu, "NULL Pointer in nsMenuBar::AddMenu");
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsMenuBar::AddMenu aMenu=<%p>\n", aMenu));
/* Add the nsMenu to our list */
mItems->AppendElement(aMenu);
NS_ADDREF(aMenu);
#ifdef DEBUG
nsString Label;
aMenu->GetLabel(Label);
char *labelStr = Label.ToNewCString();
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsMenuBar::AddMenu Label is <%s>\n", labelStr));
delete[] labelStr;
#endif
return NS_OK;
}
@ -193,14 +174,12 @@ NS_METHOD nsMenuBar::AddMenu(nsIMenu * aMenu)
NS_METHOD nsMenuBar::GetMenuCount(PRUint32 &aCount)
{
aCount = mItems->Count();;
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsMenuBar::GetMenuCount aCount=<%d>\n", aCount));
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuBar::GetMenuAt(const PRUint32 aPos, nsIMenu *& aMenu)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsMenuBar::GetMenuAt %d\n", aPos));
aMenu = (nsIMenu *) mItems->ElementAt(aPos);
NS_ADDREF(aMenu);
return NS_OK;
@ -209,8 +188,6 @@ NS_METHOD nsMenuBar::GetMenuAt(const PRUint32 aPos, nsIMenu *& aMenu)
//-------------------------------------------------------------------------
NS_METHOD nsMenuBar::InsertMenuAt(const PRUint32 aPos, nsIMenu *& aMenu)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsMenuBar::InsertMenuAt aPos=<%d> - Not Implemented\n", aPos));
mItems->InsertElementAt(aMenu, aPos);
NS_ADDREF(aMenu);
@ -229,8 +206,6 @@ NS_METHOD nsMenuBar::InsertMenuAt(const PRUint32 aPos, nsIMenu *& aMenu)
//-------------------------------------------------------------------------
NS_METHOD nsMenuBar::RemoveMenu(const PRUint32 aPos)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsMenuBar::RemoveMenu aPos=<%d>\n", aPos));
nsIMenu * menu = (nsIMenu *) mItems->ElementAt(aPos);
NS_RELEASE(menu);
mItems->RemoveElementAt(aPos);
@ -240,8 +215,6 @@ NS_METHOD nsMenuBar::RemoveMenu(const PRUint32 aPos)
//-------------------------------------------------------------------------
NS_METHOD nsMenuBar::RemoveAll()
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsMenuBar::RemoveAll\n"));
while (mItems->Count()) {
nsISupports * supports = (nsISupports *)mItems->ElementAt(0);
NS_RELEASE(supports);
@ -254,34 +227,33 @@ NS_METHOD nsMenuBar::RemoveAll()
//-------------------------------------------------------------------------
NS_METHOD nsMenuBar::GetNativeData(void *& aData)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsMenuBar::GetNativeData this=<%p> mMenuBar=<%p>\n", this, mMenuBar));
aData = (void *)mMenuBar;
return NS_OK;
}
//-------------------------------------------------------------------------
// Not Implemented
NS_METHOD nsMenuBar::SetNativeData(void * aData)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsMenuBar::SetNativeData to <%p> - Not Implemented\n", aData));
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuBar::Paint()
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsMenuBar::Paint\n"));
mParent->Invalidate(PR_TRUE);
return NS_OK;
}
//-------------------------------------------------------------------------
// Not Implemented
nsEventStatus nsMenuBar::MenuItemSelected(const nsMenuEvent & aMenuEvent)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsMenuBar::MenuItemSelected - Not Implemented\n"));
return nsEventStatus_eIgnore;
}
//-------------------------------------------------------------------------
// Not Implemented
nsEventStatus nsMenuBar::MenuSelected(const nsMenuEvent & aMenuEvent)
{
// I should determine which menu was selected and call MenuConstruct
@ -289,8 +261,6 @@ nsEventStatus nsMenuBar::MenuSelected(const nsMenuEvent & aMenuEvent)
// Not really sure what to do here, will have to wait until someone
// calls it!
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsMenuBar::MenuSelected aMenuEvent->nativeMsg=<%p> - Not Implemented\n", aMenuEvent.nativeMsg));
/* I have no idea what this really is... */
// PtWidget_t *PhMenu = (PtWidget_t *) aMenuEvent.nativeMsg;
@ -298,9 +268,9 @@ nsEventStatus nsMenuBar::MenuSelected(const nsMenuEvent & aMenuEvent)
}
//-------------------------------------------------------------------------
// Not Implemented
nsEventStatus nsMenuBar::MenuDeselected(const nsMenuEvent & aMenuEvent)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsMenuBar::MenuDeSelected - Not Implemented\n"));
return nsEventStatus_eIgnore;
}
@ -311,7 +281,6 @@ nsEventStatus nsMenuBar::MenuConstruct(
void * menubarNode,
void * aWebShell)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsMenuBar::MenuConstruct\n"));
mWebShell = (nsIWebShell*) aWebShell;
mDOMNode = (nsIDOMNode*)menubarNode;
@ -382,8 +351,8 @@ nsEventStatus nsMenuBar::MenuConstruct(
return nsEventStatus_eIgnore;
}
// Not Implemented
nsEventStatus nsMenuBar::MenuDestruct(const nsMenuEvent & aMenuEvent)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsMenuBar::MenuDeconstruct - Not Implemented\n"));
return nsEventStatus_eIgnore;
}

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

@ -40,8 +40,6 @@ NS_IMPL_QUERY_INTERFACE2(nsScrollbar, nsIScrollbar, nsIWidget)
//-------------------------------------------------------------------------
nsScrollbar::nsScrollbar (PRBool aIsVertical):nsWidget (), nsIScrollbar ()
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsScrollbar::nsScrollbar this=<%p> IsVertical=<%d>\n", this, aIsVertical));
NS_INIT_REFCNT ();
mOrientation = (aIsVertical) ? Pt_VERTICAL : Pt_HORIZONTAL;
@ -54,7 +52,6 @@ nsScrollbar::nsScrollbar (PRBool aIsVertical):nsWidget (), nsIScrollbar ()
//-------------------------------------------------------------------------
nsScrollbar::~nsScrollbar ()
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsScrollbar::~nsScrollbar this=<%p>\n", this));
}
//-------------------------------------------------------------------------
@ -64,8 +61,6 @@ nsScrollbar::~nsScrollbar ()
//-------------------------------------------------------------------------
NS_METHOD nsScrollbar::CreateNative (PtWidget_t * parentWindow)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsScrollbar::CreateNative this=<%p>\n", this));
nsresult res = NS_ERROR_FAILURE;
PhPoint_t pos;
PhDim_t dim;
@ -76,9 +71,6 @@ NS_METHOD nsScrollbar::CreateNative (PtWidget_t * parentWindow)
dim.w = mBounds.width;
dim.h = mBounds.height;
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsScrollbar::CreateNative at (%d,%d) w,h=(%d,%d)\n",
mBounds.x, mBounds.y, mBounds.width, mBounds.height));
PtSetArg( &arg[0], Pt_ARG_ORIENTATION, mOrientation, 0 );
PtSetArg( &arg[1], Pt_ARG_POS, &pos, 0 );
PtSetArg( &arg[2], Pt_ARG_DIM, &dim, 0 );
@ -104,8 +96,6 @@ NS_METHOD nsScrollbar::SetMaxRange (PRUint32 aEndRange)
{
nsresult res = NS_ERROR_FAILURE;
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsScrollbar::SetMaxRange to %d\n", aEndRange));
if( mWidget )
{
PtArg_t arg;
@ -127,8 +117,6 @@ NS_METHOD nsScrollbar::GetMaxRange (PRUint32 & aMaxRange)
{
nsresult res = NS_ERROR_FAILURE;
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsScrollbar::GetMaxRange\n"));
if( mWidget )
{
PtArg_t arg;
@ -153,8 +141,6 @@ NS_METHOD nsScrollbar::GetMaxRange (PRUint32 & aMaxRange)
//-------------------------------------------------------------------------
NS_METHOD nsScrollbar::SetPosition (PRUint32 aPos)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsScrollbar::SetPosition to <%d>\n", aPos));
nsresult res = NS_ERROR_FAILURE;
if( mWidget )
@ -198,8 +184,6 @@ NS_METHOD nsScrollbar::GetPosition (PRUint32 & aPos)
#endif
}
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsScrollbar::GetPosition position=<%d>\n", aPos));
return res;
}
@ -211,7 +195,6 @@ NS_METHOD nsScrollbar::GetPosition (PRUint32 & aPos)
//-------------------------------------------------------------------------
NS_METHOD nsScrollbar::SetThumbSize (PRUint32 aSize)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsScrollbar::SetThumbSize aSize=<%d>\n", aSize));
nsresult res = NS_ERROR_FAILURE;
if( mWidget )
@ -238,8 +221,6 @@ NS_METHOD nsScrollbar::GetThumbSize (PRUint32 & aThumbSize)
{
nsresult res = NS_ERROR_FAILURE;
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsScrollbar::GetThumbSize\n"));
if( mWidget )
{
PtArg_t arg;
@ -264,8 +245,6 @@ NS_METHOD nsScrollbar::GetThumbSize (PRUint32 & aThumbSize)
//-------------------------------------------------------------------------
NS_METHOD nsScrollbar::SetLineIncrement (PRUint32 aLineIncrement)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsScrollbar::SetLineIncrement to %d \n", aLineIncrement));
nsresult res = NS_ERROR_FAILURE;
if( mWidget )
@ -290,8 +269,6 @@ NS_METHOD nsScrollbar::SetLineIncrement (PRUint32 aLineIncrement)
//-------------------------------------------------------------------------
NS_METHOD nsScrollbar::GetLineIncrement (PRUint32 & aLineInc)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsScrollbar::GetLineIncrement\n"));
nsresult res = NS_ERROR_FAILURE;
if( mWidget )
@ -319,9 +296,6 @@ NS_METHOD nsScrollbar::GetLineIncrement (PRUint32 & aLineInc)
NS_METHOD nsScrollbar::SetParameters (PRUint32 aMaxRange, PRUint32 aThumbSize,
PRUint32 aPosition, PRUint32 aLineIncrement)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsScrollbar::SetParameters this=<%p> MaxRange=<%d> ThumbSize=<%d> Position=<%d> LineIncrement=<%d>\n",
this, aMaxRange, aThumbSize, aPosition, aLineIncrement));
nsresult res = NS_ERROR_FAILURE;
if( mWidget )
@ -352,20 +326,12 @@ NS_METHOD nsScrollbar::SetParameters (PRUint32 aMaxRange, PRUint32 aThumbSize,
PRBool nsScrollbar::OnScroll (nsScrollbarEvent & aEvent, PRUint32 cPos)
{
PRBool result = PR_TRUE;
// float newPosition;
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsScrollbar::OnScroll cPos=<%d> aEvent.message=<%d>\n", cPos, aEvent.message));
if (mEventCallback)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsScrollbar::OnScroll Inside mEventCallback portion\n", cPos));
aEvent.position = cPos;
result = ConvertStatus((*mEventCallback)(&aEvent));
// newPosition = aEvent.position;
}
else
PR_LOG(PhWidLog, PR_LOG_ERROR, ("nsScrollbar::OnScroll Error no mEventCallback defined\n"));
return result;
}
@ -382,8 +348,6 @@ int nsScrollbar::handle_scroll_move_event (PtWidget_t *aWidget, void *aData, PtC
PRUint32 thePos = 0;
PtScrollbarCallback_t *theScrollbarCallback = (PtScrollbarCallback_t *) aCbinfo->cbdata;
PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsScrollbar::handle_activate_event me=<%p> new position=<%d>\n",me, theScrollbarCallback->position));
scroll_event.message = NS_SCROLLBAR_POS;
scroll_event.widget = (nsWidget *) me;
scroll_event.eventStructType = NS_SCROLLBAR_EVENT;
@ -407,7 +371,6 @@ int nsScrollbar::handle_scroll_move_event (PtWidget_t *aWidget, void *aData, PtC
scroll_event.message = NS_SCROLLBAR_POS;
break;
default:
PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsScrollbar::handle_activate_event Invalid Scroll Type!\n"));
break;
}

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

@ -40,22 +40,16 @@ NS_IMPL_ISUPPORTS2(nsSound, nsISound, nsIStreamLoaderObserver);
////////////////////////////////////////////////////////////////////////
nsSound::nsSound()
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsSound::nsSound this=<%p>\n", this));
NS_INIT_REFCNT();
mInited = PR_FALSE;
}
nsSound::~nsSound()
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsSound::~nsSound this=<%p>\n", this));
}
nsresult nsSound::Init()
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsSound::Init this=<%p> mInited=<%d>\n", this, mInited));
if (mInited) return NS_OK;
mInited = PR_TRUE;
@ -82,13 +76,11 @@ nsresult NS_NewSound(nsISound** aSound)
NS_METHOD nsSound::Beep()
{
::PtBeep();
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsSound::Beep this=<%p>\n", this));
return NS_OK;
}
NS_METHOD nsSound::Play(nsIURL *aURL)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsSound::Play - Not Implemented\n"));
NS_NOTYETIMPLEMENTED("nsSound::Play");
return NS_OK;
}

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

@ -61,7 +61,6 @@ nsTextAreaWidget::nsTextAreaWidget() : nsTextHelper()
//-------------------------------------------------------------------------
nsTextAreaWidget::~nsTextAreaWidget()
{
PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsTextAreaWidget::~nsTextAreaWidget Destructor called.\n"));
}
//-------------------------------------------------------------------------
@ -89,13 +88,12 @@ nsresult nsTextAreaWidget::QueryInterface(const nsIID& aIID, void** aInstancePtr
//-------------------------------------------------------------------------
PRBool nsTextAreaWidget::OnPaint()
{
PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsTextAreaWidget::OnPaint - Not Implemented\n"));
return PR_FALSE;
}
// Not Implemented
PRBool nsTextAreaWidget::OnResize(nsRect &aWindowRect)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsTextAreaWidget::OnResize - Not Implemented\n"));
return PR_FALSE;
}
@ -106,8 +104,6 @@ NS_METHOD nsTextAreaWidget::CreateNative( PtWidget_t* aParent )
PhPoint_t pos;
PhDim_t dim;
PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsTextAreaWidget::CreateNative"));
pos.x = mBounds.x;
pos.y = mBounds.y;
dim.w = mBounds.width - 4; // Correct for border width
@ -133,8 +129,6 @@ int nsTextAreaWidget::RawEventHandler(PtWidget_t *aWidget, void *aData, PtCallba
{
nsTextAreaWidget *me = (nsTextAreaWidget *) aData; /* Mozilla object that created the event */
//PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsTextAreaWidget::RawEventHandler\n"));
if( aCbInfo->reason == Pt_CB_RAW )
{
PhEvent_t* event = aCbInfo->event;
@ -148,21 +142,9 @@ int nsTextAreaWidget::RawEventHandler(PtWidget_t *aWidget, void *aData, PtCallba
break;
}
default:
PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsTextAreaWidget::RawEventHandler Unknown event\n"));
break;
}
}
return (Pt_CONTINUE);
}
#if 0
int nsTextAreaWidget::handle_activate_event (PtWidget_t *aWidget, void *aData, PtCallbackInfo_t *aCbinfo )
{
nsTextAreaWidget *me = (nsTextAreaWidget *) aData;
PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsTextAreaWidget::handle_activate_event me=<%p> - Not Implemented\n",me));
return (Pt_CONTINUE);
}
#endif

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

@ -32,8 +32,6 @@
NS_METHOD nsTextHelper::PreCreateWidget(nsWidgetInitData *aInitData)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsTextHelper::PreCreateWidget\n"));
if (nsnull != aInitData)
{
nsTextWidgetInitData* data = (nsTextWidgetInitData *) aInitData;
@ -48,8 +46,6 @@ NS_METHOD nsTextHelper::SetMaxTextLength(PRUint32 aChars)
{
PtArg_t arg[2];
PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsTextHelper::SetMaxLength to %d\n", aChars));
if (mWidget)
{
PtSetArg(&arg[0], Pt_ARG_MAX_LENGTH, aChars, 0);
@ -61,8 +57,6 @@ NS_METHOD nsTextHelper::SetMaxTextLength(PRUint32 aChars)
NS_METHOD nsTextHelper::GetText(nsString& aTextBuffer, PRUint32 aBufferSize, PRUint32& aActualSize)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsTextHelper::GetText\n"));
PtArg_t arg[2];
int length;
char *string;
@ -91,8 +85,6 @@ NS_METHOD nsTextHelper::SetText(const nsString &aText, PRUint32& aActualSize)
{
NS_ALLOC_STR_BUF(buf, aText, aText.Length());
PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsTextHelper::SetText to <%s> for <%p>\n", buf, mWidget));
PtSetArg(&arg[0], Pt_ARG_TEXT_STRING, buf, 0);
PtSetResources(mWidget, 1, arg);
@ -105,21 +97,13 @@ NS_METHOD nsTextHelper::SetText(const nsString &aText, PRUint32& aActualSize)
NS_METHOD nsTextHelper::InsertText(const nsString &aText, PRUint32 aStartPos, PRUint32 aEndPos, PRUint32& aActualSize)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsTextHelper::InsertText from %d to %d\n", aStartPos, aEndPos));
PtArg_t arg[2];
int ret;
nsString currentText;
PRUint32 currentTextLength;
if (mWidget)
{
NS_ALLOC_STR_BUF(buf, aText, aText.Length());
ret=PtTextModifyText(mWidget,0,0,aStartPos,buf,aText.Length());
if (!ret)
{
PR_LOG(PhWidLog, PR_LOG_ERROR,("nsTextHelper::InsertText failed in call to PtTextModifyText\n"));
}
PtTextModifyText(mWidget,0,0,aStartPos,buf,aText.Length());
NS_FREE_STR_BUF(buf);
}
aActualSize = aText.Length();
@ -133,7 +117,6 @@ NS_METHOD nsTextHelper::InsertText(const nsString &aText, PRUint32 aStartPos, P
NS_METHOD nsTextHelper::RemoveText()
{
PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsTextHelper::RemoveText\n"));
PtArg_t arg[2];
mText.SetLength(0);
@ -155,8 +138,6 @@ NS_METHOD nsTextHelper::SetPassword(PRBool aIsPassword)
NS_METHOD nsTextHelper::SetReadOnly(PRBool aReadOnlyFlag, PRBool& aOldFlag)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsTextHelper::SetReadOnnly %d %d\n", aReadOnlyFlag, mIsReadOnly));
PtArg_t arg[2];
int temp;
@ -180,8 +161,6 @@ NS_METHOD nsTextHelper::SetReadOnly(PRBool aReadOnlyFlag, PRBool& aOldFlag)
NS_METHOD nsTextHelper::SelectAll()
{
PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsTextHelper::SelectAll\n"));
int start, end;
if (mWidget)
@ -196,18 +175,15 @@ NS_METHOD nsTextHelper::SelectAll()
NS_METHOD nsTextHelper::SetSelection(PRUint32 aStartSel, PRUint32 aEndSel)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsTextHelper::SetSelection %d to %d\n", aStartSel, aEndSel));
/* The text widget is 0 based! */
if (mWidget)
{
int start, end, err=0;
int start, end;
start = aStartSel;
end = aEndSel;
err=PtTextSetSelection(mWidget, &start, &end);
PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsTextHelper::SetSelection after err=%d start=%d end=%d\n", err, start, end));
PtTextSetSelection(mWidget, &start, &end);
}
return NS_OK;
@ -229,15 +205,11 @@ NS_METHOD nsTextHelper::GetSelection(PRUint32 *aStartSel, PRUint32 *aEndSel)
}
PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsTextHelper::GetSelection aStartSel=<%d> aEndSel=<%d>\n", *aStartSel, *aEndSel));
return NS_OK;
}
NS_METHOD nsTextHelper::SetCaretPosition(PRUint32 aPosition)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsTextHelper::SetCaretPosition at %d", aPosition));
PtArg_t arg[2];
if (mWidget)
@ -253,8 +225,6 @@ NS_METHOD nsTextHelper::SetCaretPosition(PRUint32 aPosition)
NS_METHOD nsTextHelper::GetCaretPosition(PRUint32& aPos)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsTextHelper::GetCaretPosition\n"));
PtArg_t arg[2];
short *CaretPosition;
@ -266,8 +236,6 @@ NS_METHOD nsTextHelper::GetCaretPosition(PRUint32& aPos)
aPos = PRUint32(*CaretPosition);
PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsTextHelper::GetCaretPosition aPos=<%d>\n", aPos));
return NS_OK;
}
@ -290,5 +258,4 @@ nsTextHelper::nsTextHelper() : nsWidget(), nsITextAreaWidget(), nsITextWidget()
//-------------------------------------------------------------------------
nsTextHelper::~nsTextHelper()
{
PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsTextHelper::~nsTextHelper Destructor called for <%p>\n", mWidget));
}

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

@ -61,7 +61,6 @@ nsTextWidget::nsTextWidget() : nsTextHelper()
//-------------------------------------------------------------------------
nsTextWidget::~nsTextWidget()
{
PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsTextWidget::~nsTextWidget Destructor called.\n"));
}
//-------------------------------------------------------------------------
@ -89,13 +88,11 @@ nsresult nsTextWidget::QueryInterface(const nsIID& aIID, void** aInstancePtr)
//-------------------------------------------------------------------------
PRBool nsTextWidget::OnPaint()
{
PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsTextWidget::OnPaint - Not Implemented\n"));
return PR_FALSE;
}
PRBool nsTextWidget::OnResize(nsRect &aWindowRect)
{
PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsTextWidget::OnResize - Not Implemented\n"));
return PR_FALSE;
}
@ -106,8 +103,6 @@ NS_METHOD nsTextWidget::CreateNative( PtWidget_t* aParent )
PhPoint_t pos;
PhDim_t dim;
PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsTextWidget::CreateNative"));
pos.x = mBounds.x;
pos.y = mBounds.y;
dim.w = mBounds.width - 4; // Correct for border width
@ -133,8 +128,6 @@ int nsTextWidget::RawEventHandler(PtWidget_t *aWidget, void *aData, PtCallbackIn
{
nsTextWidget *me = (nsTextWidget *) aData; /* Mozilla object that created the event */
//PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsTextWidget::RawEventHandler\n"));
if( aCbInfo->reason == Pt_CB_RAW )
{
PhEvent_t* event = aCbInfo->event;
@ -148,7 +141,6 @@ int nsTextWidget::RawEventHandler(PtWidget_t *aWidget, void *aData, PtCallbackIn
break;
}
default:
PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsTextWidget::RawEventHandler Unknown event\n"));
break;
}
}
@ -158,9 +150,5 @@ int nsTextWidget::RawEventHandler(PtWidget_t *aWidget, void *aData, PtCallbackIn
int nsTextWidget::handle_activate_event (PtWidget_t *aWidget, void *aData, PtCallbackInfo_t *aCbinfo )
{
nsTextWidget *me = (nsTextWidget *) aData;
PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsTextWidget::handle_activate_event me=<%p> - Not Implemented\n",me));
return (Pt_CONTINUE);
}

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

@ -43,8 +43,6 @@ NS_IMPL_ISUPPORTS1(nsToolkit,nsIToolkit);
//-------------------------------------------------------------------------
nsToolkit::nsToolkit()
{
// PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsToolkit::nsToolkit this=<%p>\n", this));
NS_INIT_REFCNT();
}
@ -58,7 +56,6 @@ nsToolkit::~nsToolkit()
{
// Remove the TLS reference to the toolkit...
PR_SetThreadPrivate(gToolkitTLSIndex, nsnull);
// PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsToolkit::~nsToolkit this=<%p>\n", this));
}
@ -81,7 +78,6 @@ NS_METHOD nsToolkit::Init(PRThread *aThread)
mDefaultPhotonDrawContext = PhDCGetCurrent();
}
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsToolkit::Init this=<%p> aThread=<%p>\n", this, aThread));
return NS_OK;
}
@ -96,22 +92,12 @@ PhDrawContext_t *nsToolkit::GetDefaultPhotonDrawContext()
return nsToolkit::mDefaultPhotonDrawContext;
}
PhPoint_t nsToolkit::GetConsoleOffset()
{
PhPoint_t nsToolkit::GetConsoleOffset( ) {
PhRect_t console;
char *p = NULL;
int inp_grp = 0;
p = getenv("PHIG");
if (p)
{
inp_grp = atoi(p);
if (PhWindowQueryVisible( Ph_QUERY_GRAPHICS, 0, inp_grp, &console ) == 0)
return(PhPoint_t) {console.ul.x, console.ul.y};
}
if( PhWindowQueryVisible( Ph_QUERY_GRAPHICS, 0, 1, &console ) == 0 )
return(PhPoint_t) {console.ul.x, console.ul.y};
return(PhPoint_t) {0,0};
}
}
//-------------------------------------------------------------------------
//

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -146,6 +146,7 @@ public:
// nsIKBStateControl
NS_IMETHOD ResetInputState();
NS_IMETHOD PasswordFieldInit();
void InitEvent(nsGUIEvent& event, PRUint32 aEventType, nsPoint* aPoint = nsnull);
@ -164,9 +165,6 @@ public:
static PRBool SetInstance( PtWidget_t *pWidget, nsWidget * inst );
static nsWidget* GetInstance( PtWidget_t *pWidget );
// Raw Paint Method
NS_IMETHOD doPaint();
protected:
virtual void InitCallbacks(char * aName = nsnull);

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

@ -27,26 +27,15 @@
#include "nsWidgetsCID.h"
#include "nsWindow.h"
#include "nsButton.h"
//#include "nsCheckButton.h"
#include "nsFileWidget.h"
#include "nsTextWidget.h"
#include "nsAppShell.h"
#include "nsToolkit.h"
#include "nsLookAndFeel.h"
//#include "nsLabel.h"
#include "nsTransferable.h"
#include "nsClipboard.h"
#include "nsHTMLFormatConverter.h"
#include "nsFontRetrieverService.h"
#include "nsDragService.h"
#include "nsFileSpecWithUIImpl.h"
#include "nsScrollbar.h"
#include "nsSound.h"
#ifdef IBMBIDI
#include "nsBidiKeyboard.h"
#endif
#include <prlog.h>
struct PRLogModuleInfo *PhWidLog = nsnull;
@ -54,32 +43,20 @@ struct PRLogModuleInfo *PhWidLog = nsnull;
NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindow)
NS_GENERIC_FACTORY_CONSTRUCTOR(ChildWindow)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsButton)
//NS_GENERIC_FACTORY_CONSTRUCTOR(nsCheckButton)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFileWidget)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsTextWidget)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAppShell)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsToolkit)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsLookAndFeel)
//NS_GENERIC_FACTORY_CONSTRUCTOR(nsLabel)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsTransferable)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboard)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLFormatConverter)
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)
{
nsresult rv;
nsISupports *inst = nsnull;
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsWidgetFactory::nsHorizScrollbarConstructor\n"));
if ( NULL == aResult )
{
rv = NS_ERROR_NULL_POINTER;
@ -109,7 +86,6 @@ static nsresult nsVertScrollbarConstructor (nsISupports *aOuter, REFNSIID aIID,
nsresult rv;
nsISupports *inst = nsnull;
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsWidgetFactory::nsVertScrollbarConstructor\n"));
if ( NULL == aResult )
{
rv = NS_ERROR_NULL_POINTER;
@ -144,20 +120,6 @@ static nsModuleComponentInfo components[] =
NS_CHILD_CID,
"@mozilla.org/widgets/child_window/ph;1",
ChildWindowConstructor },
{ "Ph Button",
NS_BUTTON_CID,
"@mozilla.org/widgets/button/ph;1",
nsButtonConstructor },
/*
{ "Ph Check Button",
NS_CHECKBUTTON_CID,
"@mozilla.org/widgets/checkbutton/ph;1",
nsCheckButtonConstructor },
*/
{ "Ph File Widget",
NS_FILEWIDGET_CID,
"@mozilla.org/widgets/filewidget/ph;1",
nsFileWidgetConstructor },
{ "Ph Horiz Scrollbar",
NS_HORZSCROLLBAR_CID,
"@mozilla.org/widgets/horizscroll/ph;1",
@ -166,10 +128,6 @@ static nsModuleComponentInfo components[] =
NS_VERTSCROLLBAR_CID,
"@mozilla.org/widgets/vertscroll/ph;1",
nsVertScrollbarConstructor },
{ "Ph Text Widget",
NS_TEXTFIELD_CID,
"@mozilla.org/widgets/textwidget/ph;1",
nsTextWidgetConstructor },
{ "Ph AppShell",
NS_APPSHELL_CID,
"@mozilla.org/widget/appshell/ph;1",
@ -182,17 +140,6 @@ static nsModuleComponentInfo components[] =
NS_LOOKANDFEEL_CID,
"@mozilla.org/widget/lookandfeel/ph;1",
nsLookAndFeelConstructor },
/*
{ "Ph Label",
NS_LABEL_CID,
"@mozilla.org/widget/label/ph;1",
nsLabelConstructor },
*/
{ "Ph Sound",
NS_SOUND_CID,
// "@mozilla.org/widget/sound/ph;1"
"@mozilla.org/sound;1",
nsSoundConstructor },
{ "Transferrable",
NS_TRANSFERABLE_CID,
// "@mozilla.org/widget/transferrable/ph;1",
@ -207,21 +154,12 @@ static nsModuleComponentInfo components[] =
NS_HTMLFORMATCONVERTER_CID,
"@mozilla.org/widget/htmlformatconverter/ph;1",
nsHTMLFormatConverterConstructor },
{ "Ph Font Retriever Service",
NS_FONTRETRIEVERSERVICE_CID,
"@mozilla.org/widget/fontretrieverservice/ph;1",
nsFontRetrieverServiceConstructor },
{ "Ph Drag Service",
NS_DRAGSERVICE_CID,
// "@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",

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -97,7 +97,6 @@ public:
PRBool OnKey(nsKeyEvent &aEvent);
PRBool DispatchFocus(nsGUIEvent &aEvent);
virtual PRBool OnScroll(nsScrollbarEvent & aEvent, PRUint32 cPos);
NS_IMETHOD GetFrameSize(int *FrameLeft, int *FrameRight, int *FrameTop, int *FrameBottom) const;
NS_IMETHOD SetColorMap(nsColorMap *aColorMap);
NS_IMETHOD GetClientBounds( nsRect &aRect );
NS_IMETHOD SetModal(PRBool aModal);
@ -125,9 +124,7 @@ protected:
static int ResizeHandler( PtWidget_t *widget, void *data, PtCallbackInfo_t *cbinfo );
static int WindowCloseHandler( PtWidget_t *widget, void *data, PtCallbackInfo_t *cbinfo );
PRBool HandleEvent( PtCallbackInfo_t* aCbInfo );
NS_METHOD GetSiblingClippedRegion( PhTile_t **btiles, PhTile_t **ctiles );
NS_METHOD SetWindowClipping( PhTile_t *damage, PhPoint_t &offset );
PhTile_t *GetWindowClipping(PhPoint_t &offset);
PhTile_t *GetWindowClipping( );
void ResizeHoldOff();
void RemoveResizeWidget();
@ -152,10 +149,6 @@ protected:
nsFont *mFont;
nsIMenuBar *mMenuBar;
PRBool mMenuBarVis;
int mFrameLeft;
int mFrameRight;
int mFrameTop;
int mFrameBottom;
PRBool mIsUpdating;
// when this is PR_TRUE we will block focus