From 0d631999027da11bea8b682fb85d8db8981146ee Mon Sep 17 00:00:00 2001 From: "cls%seawood.org" Date: Sun, 2 Apr 2000 07:17:25 +0000 Subject: [PATCH] Adding a script to print out which of a given list of files do not end with a newline. Source files that do not end with a newline break at least the HP-UX compiler. Adding newlines to all of the source files found at this point. --- build/unix/print-non-newline.sh | 47 ++ .../browser/activex/src/plugin/StdAfx.cpp | 2 +- .../browser/activex/tests/cbrowse/Tests.cpp | 2 +- gfx/src/mac/nsUnicodeFontMappingMac.cpp | 2 +- gfx/src/photon/nsDeviceContextSpecPh.cpp | 2 +- gfx/src/photon/nsFontMetricsPh.cpp | 2 +- intl/uconv/tests/plattest.cpp | 2 +- js/src/liveconnect/jsj_nodl.c | 1 + layout/xul/base/src/nsBoxFrame.cpp | 2 +- layout/xul/base/src/nsCheckBoxFrame.cpp | 62 --- layout/xul/base/src/nsColorPickerFrame.cpp | 2 +- layout/xul/base/src/nsLeafBoxFrame.cpp | 2 +- mailnews/import/oexpress/nsOEStringBundle.cpp | 2 +- mailnews/import/outlook/src/MapiMessage.cpp | 2 +- webshell/tests/ComFactory/TestCOMFactory.cpp | 2 +- widget/src/mac/nsDynamicMDEF.cpp | 2 +- widget/src/photon/nsButton.cpp | 2 +- widget/src/photon/nsCheckButton.cpp | 2 +- widget/src/photon/nsFileWidget.cpp | 2 +- widget/src/photon/nsListBox.cpp | 521 ------------------ widget/src/photon/nsMenu.cpp | 2 +- widget/src/photon/nsMenuItem.cpp | 2 +- widget/src/photon/nsScrollbar.cpp | 2 +- widget/src/photon/nsTextWidget.cpp | 2 +- widget/src/photon/nsToolkit.cpp | 2 +- .../appshell/eventloop/photon/nsCAppLoop.cpp | 73 --- xpcom/appshell/eventloop/photon/nsCEvent.cpp | 103 ---- .../eventloop/photon/nsCEventFilter.cpp | 78 --- .../appshell/eventloop/photon/nsCPhEvent.cpp | 89 --- .../eventloop/photon/nsCPlatformBaseLoop.cpp | 188 ------- .../appshell/eventloop/windows/nsCAppLoop.cpp | 62 --- .../eventloop/windows/nsCBreathLoop.cpp | 80 --- xpcom/appshell/eventloop/windows/nsCEvent.cpp | 180 ------ .../eventloop/windows/nsCEventFilter.cpp | 133 ----- .../eventloop/windows/nsCPlatformBaseLoop.cpp | 132 ----- .../eventloop/windows/nsCThreadLoop.cpp | 62 --- xpcom/macbuild/dummy.cpp | 4 - .../ASEncoder/src/nsAppleSingleEncoder.cpp | 2 +- .../mac/ASEncoder/src/nsEventHandler.cpp | 2 +- .../mac/ASEncoder/src/nsFileSelector.cpp | 2 +- xpinstall/src/nsAppleSingleDecoder.cpp | 2 +- xpinstall/wizard/mac/src/AdditionsWin.c | 2 +- xpinstall/wizard/mac/src/CheckboxLDEF.c | 2 +- xpinstall/wizard/mac/src/ComponentsWin.c | 2 +- xpinstall/wizard/mac/src/Deflation.c | 2 +- xpinstall/wizard/mac/src/EvtHandlers.c | 2 +- xpinstall/wizard/mac/src/InstAction.c | 2 +- xpinstall/wizard/mac/src/LicenseWin.c | 2 +- xpinstall/wizard/mac/src/MacInstallWizard.c | 2 +- xpinstall/wizard/mac/src/SetupTypeWin.c | 2 +- xpinstall/wizard/mac/src/TerminalWin.c | 2 +- xpinstall/wizard/mac/src/XPInstallGlue.c | 2 +- 52 files changed, 84 insertions(+), 1803 deletions(-) create mode 100755 build/unix/print-non-newline.sh diff --git a/build/unix/print-non-newline.sh b/build/unix/print-non-newline.sh new file mode 100755 index 00000000000..3c0c04e9dbc --- /dev/null +++ b/build/unix/print-non-newline.sh @@ -0,0 +1,47 @@ +#!/bin/sh +# 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 test-ending-newline.sh +# +# The Initial Developer of the Original Code is Christopher +# Seawood . Portions created by Christopher Seawood +# are Copyright (C) 2000 Christopher Seawood. All Rights Reserved. + +# +# The purpose of this file is to find the files that do not end with a +# newline. Some compilers fail if the source files do not end with a +# newline. +# + +# +test_file=newline_test +test_dummy=newline_testee +inlist="$*" +broken_list= + +if test "$inlist" = ""; then + echo "Usage: $0 *.c *.cpp"; + exit 0; +fi + +echo "" > $test_file + +for f in $inlist; do + if test -f $f; then + tail -c 1 $f > $test_dummy + if ! `cmp -s $test_file $test_dummy`; then + broken_list="$broken_list $f" + fi + fi +done + +rm -f $test_file $test_dummy +echo $broken_list diff --git a/embedding/browser/activex/src/plugin/StdAfx.cpp b/embedding/browser/activex/src/plugin/StdAfx.cpp index 09f15b61cc9..e717491dfaa 100644 --- a/embedding/browser/activex/src/plugin/StdAfx.cpp +++ b/embedding/browser/activex/src/plugin/StdAfx.cpp @@ -1 +1 @@ -#include "StdAfx.h" \ No newline at end of file +#include "StdAfx.h" diff --git a/embedding/browser/activex/tests/cbrowse/Tests.cpp b/embedding/browser/activex/tests/cbrowse/Tests.cpp index 6281322deaa..80155c7a0e5 100644 --- a/embedding/browser/activex/tests/cbrowse/Tests.cpp +++ b/embedding/browser/activex/tests/cbrowse/Tests.cpp @@ -488,4 +488,4 @@ TestSet aTestSets[] = }; -int nTestSets = sizeof(aTestSets) / sizeof(aTestSets[0]); \ No newline at end of file +int nTestSets = sizeof(aTestSets) / sizeof(aTestSets[0]); diff --git a/gfx/src/mac/nsUnicodeFontMappingMac.cpp b/gfx/src/mac/nsUnicodeFontMappingMac.cpp index d54106fbe78..7bb4ab31f0e 100644 --- a/gfx/src/mac/nsUnicodeFontMappingMac.cpp +++ b/gfx/src/mac/nsUnicodeFontMappingMac.cpp @@ -501,4 +501,4 @@ static getUnicodeBlock gAllGetBlock[16] = nsUnicodeBlock nsUnicodeFontMappingMac:: GetBlock(PRUnichar aChar) { return (*(gAllGetBlock[(aChar >> 12)]))(aChar); -} \ No newline at end of file +} diff --git a/gfx/src/photon/nsDeviceContextSpecPh.cpp b/gfx/src/photon/nsDeviceContextSpecPh.cpp index 91ace2a0486..39c8146ae80 100644 --- a/gfx/src/photon/nsDeviceContextSpecPh.cpp +++ b/gfx/src/photon/nsDeviceContextSpecPh.cpp @@ -60,4 +60,4 @@ NS_IMETHODIMP nsDeviceContextSpecPh :: GetPrintContext(PpPrintContext_t *&aPrint { aPrintContext = mPC; return NS_OK; -} \ No newline at end of file +} diff --git a/gfx/src/photon/nsFontMetricsPh.cpp b/gfx/src/photon/nsFontMetricsPh.cpp index 4d7e35dba10..95076ae2932 100644 --- a/gfx/src/photon/nsFontMetricsPh.cpp +++ b/gfx/src/photon/nsFontMetricsPh.cpp @@ -688,4 +688,4 @@ nsFontEnumeratorPh::EnumerateFonts(const char* aLangGroup, // XXX still need to implement aLangGroup and aGeneric return EnumerateAllFonts(aCount, aResult); -} \ No newline at end of file +} diff --git a/intl/uconv/tests/plattest.cpp b/intl/uconv/tests/plattest.cpp index 7b9b200e1fe..441b8354a1b 100644 --- a/intl/uconv/tests/plattest.cpp +++ b/intl/uconv/tests/plattest.cpp @@ -65,4 +65,4 @@ main(int argc, const char** argv) printf("DefaultCharset for %s is %s\n",categoryAsNSString.ToNewCString(),charsetAsNSString.ToNewCString()); return 0; -} \ No newline at end of file +} diff --git a/js/src/liveconnect/jsj_nodl.c b/js/src/liveconnect/jsj_nodl.c index e69de29bb2d..8b137891791 100644 --- a/js/src/liveconnect/jsj_nodl.c +++ b/js/src/liveconnect/jsj_nodl.c @@ -0,0 +1 @@ + diff --git a/layout/xul/base/src/nsBoxFrame.cpp b/layout/xul/base/src/nsBoxFrame.cpp index e6c8be56244..ed964e71b23 100644 --- a/layout/xul/base/src/nsBoxFrame.cpp +++ b/layout/xul/base/src/nsBoxFrame.cpp @@ -2037,4 +2037,4 @@ nsBoxFrameInner::GetFrameSizeWithMargin(nsIBox* aBox, nsSize& aSize) aSize.width = rect.width; aSize.height = rect.height; return NS_OK; -} \ No newline at end of file +} diff --git a/layout/xul/base/src/nsCheckBoxFrame.cpp b/layout/xul/base/src/nsCheckBoxFrame.cpp index 85443144ef1..e69de29bb2d 100644 --- a/layout/xul/base/src/nsCheckBoxFrame.cpp +++ b/layout/xul/base/src/nsCheckBoxFrame.cpp @@ -1,62 +0,0 @@ -/* -*- 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 Communicator client 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): - */ -#include "nsCOMPtr.h" -#include "nsCheckBoxFrame.h" -#include "nsIDOMXULCheckboxElement.h" -#include "nsIContent.h" -#include "nsIDOMXULRadioElement.h" -#include "nsIDocument.h" -#include "nsIDOMXULDocument.h" -#include "nsIDOMNodeList.h" -#include "nsHTMLAtoms.h" -#include "nsINameSpaceManager.h" - - -// -// NS_NewCheckBoxFrame -// -// Creates a new checkbox frame and returns it in |aNewFrame| -// -nsresult -NS_NewCheckBoxFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame ) -{ - NS_PRECONDITION(aNewFrame, "null OUT ptr"); - if (nsnull == aNewFrame) { - return NS_ERROR_NULL_POINTER; - } - nsCheckBoxFrame* it = new (aPresShell) nsCheckBoxFrame (aPresShell); - if (nsnull == it) - return NS_ERROR_OUT_OF_MEMORY; - - *aNewFrame = it; - return NS_OK; - -} // NS_NewCheckBoxFrame - -PRIntn nsCheckBoxFrame::GetDefaultAlignment() -{ - return NS_SIDE_LEFT; -} - -nsCheckBoxFrame::nsCheckBoxFrame(nsIPresShell* aPresShell):nsButtonBoxFrame(aPresShell) -{ -} \ No newline at end of file diff --git a/layout/xul/base/src/nsColorPickerFrame.cpp b/layout/xul/base/src/nsColorPickerFrame.cpp index 2952278aeb5..3e0a9d069df 100644 --- a/layout/xul/base/src/nsColorPickerFrame.cpp +++ b/layout/xul/base/src/nsColorPickerFrame.cpp @@ -223,4 +223,4 @@ nsColorPickerFrame::GetDesiredSize(nsIPresContext* aPresContext, { } // GetDesiredSize -*/ \ No newline at end of file +*/ diff --git a/layout/xul/base/src/nsLeafBoxFrame.cpp b/layout/xul/base/src/nsLeafBoxFrame.cpp index 5c8cf3ddeae..86337328266 100644 --- a/layout/xul/base/src/nsLeafBoxFrame.cpp +++ b/layout/xul/base/src/nsLeafBoxFrame.cpp @@ -243,4 +243,4 @@ NS_INTERFACE_MAP_BEGIN(nsLeafBoxFrame) NS_INTERFACE_MAP_ENTRY(nsIFrameDebug) #endif NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIBox) -NS_INTERFACE_MAP_END_INHERITING(nsLeafFrame) \ No newline at end of file +NS_INTERFACE_MAP_END_INHERITING(nsLeafFrame) diff --git a/mailnews/import/oexpress/nsOEStringBundle.cpp b/mailnews/import/oexpress/nsOEStringBundle.cpp index a537666ebc0..362200f4f9a 100644 --- a/mailnews/import/oexpress/nsOEStringBundle.cpp +++ b/mailnews/import/oexpress/nsOEStringBundle.cpp @@ -108,4 +108,4 @@ void nsOEStringBundle::Cleanup( void) if (m_pBundle) m_pBundle->Release(); m_pBundle = nsnull; -} \ No newline at end of file +} diff --git a/mailnews/import/outlook/src/MapiMessage.cpp b/mailnews/import/outlook/src/MapiMessage.cpp index cbdfb1de728..94a2cb0e5d1 100644 --- a/mailnews/import/outlook/src/MapiMessage.cpp +++ b/mailnews/import/outlook/src/MapiMessage.cpp @@ -766,4 +766,4 @@ void nsSimpleUInt32Array::Allocate( void) delete [] m_pData; m_pData = pData; } -} \ No newline at end of file +} diff --git a/webshell/tests/ComFactory/TestCOMFactory.cpp b/webshell/tests/ComFactory/TestCOMFactory.cpp index 3fc96aa3ed2..e2226e50bc4 100644 --- a/webshell/tests/ComFactory/TestCOMFactory.cpp +++ b/webshell/tests/ComFactory/TestCOMFactory.cpp @@ -59,4 +59,4 @@ int main(int argc, char **argv) OleUninitialize(); return 0; -} \ No newline at end of file +} diff --git a/widget/src/mac/nsDynamicMDEF.cpp b/widget/src/mac/nsDynamicMDEF.cpp index 92f9c8c42c1..b9416cc71c5 100644 --- a/widget/src/mac/nsDynamicMDEF.cpp +++ b/widget/src/mac/nsDynamicMDEF.cpp @@ -563,4 +563,4 @@ void TestBuild(MenuHandle theMenu, PRBool isChild) } */ -#pragma options align=reset \ No newline at end of file +#pragma options align=reset diff --git a/widget/src/photon/nsButton.cpp b/widget/src/photon/nsButton.cpp index b416419811c..dfd6d927fe1 100644 --- a/widget/src/photon/nsButton.cpp +++ b/widget/src/photon/nsButton.cpp @@ -178,4 +178,4 @@ NS_METHOD nsButton::CreateNative( PtWidget_t* aParent ) return res; } - \ No newline at end of file + diff --git a/widget/src/photon/nsCheckButton.cpp b/widget/src/photon/nsCheckButton.cpp index 7710091a56c..6564f2c3efa 100644 --- a/widget/src/photon/nsCheckButton.cpp +++ b/widget/src/photon/nsCheckButton.cpp @@ -283,4 +283,4 @@ NS_METHOD nsCheckButton::CreateNative( PtWidget_t* aParent ) return res; } - \ No newline at end of file + diff --git a/widget/src/photon/nsFileWidget.cpp b/widget/src/photon/nsFileWidget.cpp index 876d7d9813a..5980783bc9c 100644 --- a/widget/src/photon/nsFileWidget.cpp +++ b/widget/src/photon/nsFileWidget.cpp @@ -342,4 +342,4 @@ nsFileDlgResults nsFileWidget::PutFile( } } return theResult; -} \ No newline at end of file +} diff --git a/widget/src/photon/nsListBox.cpp b/widget/src/photon/nsListBox.cpp index d472590599e..e69de29bb2d 100644 --- a/widget/src/photon/nsListBox.cpp +++ b/widget/src/photon/nsListBox.cpp @@ -1,521 +0,0 @@ -/* -*- 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): - */ - -#include "nsListBox.h" -#include "nsColor.h" -#include "nsGUIEvent.h" -#include "nsString.h" -#include "nsStringUtil.h" - -#include -#include "nsPhWidgetLog.h" - - -NS_IMPL_ADDREF(nsListBox) -NS_IMPL_RELEASE(nsListBox) - -//------------------------------------------------------------------------- -// -// nsListBox constructor -// -//------------------------------------------------------------------------- -nsListBox::nsListBox() : nsWidget(), nsIListWidget(), nsIListBox() -{ - NS_INIT_REFCNT(); - mMultiSelect = PR_FALSE; -} - -//------------------------------------------------------------------------- -// -// nsListBox:: destructor -// -//------------------------------------------------------------------------- -nsListBox::~nsListBox() -{ - PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsListBox::~nsListBox - Destructor Called\n")); -} - -//------------------------------------------------------------------------- -// -// Query interface implementation -// -//------------------------------------------------------------------------- -nsresult nsListBox::QueryInterface(const nsIID& aIID, void** aInstancePtr) -{ - nsresult result = nsWidget::QueryInterface(aIID, aInstancePtr); - - static NS_DEFINE_IID(kInsListBoxIID, NS_ILISTBOX_IID); - static NS_DEFINE_IID(kInsListWidgetIID, NS_ILISTWIDGET_IID); - if (result == NS_NOINTERFACE) { - if (aIID.Equals(kInsListBoxIID)) { - *aInstancePtr = (void*) ((nsIListBox*)this); - AddRef(); - result = NS_OK; - } - else if (aIID.Equals(kInsListWidgetIID)) { - *aInstancePtr = (void*) ((nsIListWidget*)this); - AddRef(); - result = NS_OK; - } - } - - return result; -} - - -//------------------------------------------------------------------------- -// -// initializer -// -//------------------------------------------------------------------------- - -NS_METHOD nsListBox::SetMultipleSelection(PRBool aMultipleSelections) -{ - PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsListBox::SetMultipleSelection aMultipleSelections=<%d>\n", aMultipleSelections)); - - PtArg_t arg; - nsresult res = NS_ERROR_FAILURE; - - mMultiSelect = aMultipleSelections; - - if (mWidget) - { - if (mMultiSelect) - PtSetArg( &arg, Pt_ARG_SELECTION_MODE, (Pt_EXTENDED_MODE), 0); - else - PtSetArg( &arg, Pt_ARG_SELECTION_MODE, (Pt_SINGLE_MODE), 0); - - if ( PtSetResources(mWidget, 1, &arg ) == 0) - res = NS_OK; - } - - return NS_OK; -} - - -//------------------------------------------------------------------------- -// -// AddItemAt -// -//------------------------------------------------------------------------- - -NS_METHOD nsListBox::AddItemAt(nsString &aItem, PRInt32 aPosition) -{ - char *str = aItem.ToNewCString(); - PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsListBox::AddItemAt aItem=<%s> aPosition=<%d>\n", str, aPosition)); - - PtArg_t arg; - nsresult res = NS_ERROR_FAILURE; - int err; - - if (mWidget) - { - err = PtListAddItems(mWidget, (const char **) &str, 1, (unsigned int) (aPosition+1)); - if (err == 0) - res = NS_OK; - } - - delete [] str; - return res; -} - -//------------------------------------------------------------------------- -// -// Finds an item at a postion -// -//------------------------------------------------------------------------- -PRInt32 nsListBox::FindItem(nsString &aItem, PRInt32 aStartPos) -{ - char *str = aItem.ToNewCString(); - int index = -1; - - PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsListBox::AddItemAt aItem=<%s> aStartPos=<%d>\n", str, aStartPos)); - - if (mWidget) - { - index = PtListItemPos(mWidget, str); - if (index == 0) - index = -1; /* item wasn't found */ - } - - - delete [] str; - return index; -} - -//------------------------------------------------------------------------- -// -// CountItems - Get Item Count -// -//------------------------------------------------------------------------- -PRInt32 nsListBox::GetItemCount() -{ - PtArg_t arg; - short *theCount; - PRInt32 total = 0; - - if (mWidget) - { - PtSetArg( &arg, Pt_ARG_LIST_ITEM_COUNT, &theCount, 0); - PtGetResources(mWidget, 1, &arg ); - - total = *theCount; - } - - PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsListBox::GetItemCount is <%d>\n", total)); - return total; -} - -//------------------------------------------------------------------------- -// -// Removes an Item at a specified location -// -//------------------------------------------------------------------------- -PRBool nsListBox::RemoveItemAt(PRInt32 aPosition) -{ - PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsListBox::RemoveItemAt %d\n", aPosition)); - - int err; - PRBool res = PR_FALSE; - - if (mWidget) - { - if (PtListDeleteItemPos(mWidget, 1, (aPosition+1)) == 0) - res = PR_TRUE; - } - - return res; -} - -//------------------------------------------------------------------------- -// -// -// -//------------------------------------------------------------------------- -PRBool nsListBox::GetItemAt(nsString& anItem, PRInt32 aPosition) -{ - PRBool result = PR_FALSE; - short *num; - char **items; - PtArg_t arg; - - /* Clear the nsString */ - anItem.SetLength(0); - - if (mWidget) - { - PtSetArg( &arg, Pt_ARG_ITEMS, &items, &num); - PtGetResources(mWidget, 1, &arg ); - - PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsListBox::GetItemAt aPosition=<%d> aItem=<%s>\n", aPosition, items[aPosition])); - - anItem.Append(items[aPosition]); - result = PR_TRUE; - } - - return result; -} - -//------------------------------------------------------------------------- -// -// Gets the text from the first selected Item -// -//------------------------------------------------------------------------- -NS_METHOD nsListBox::GetSelectedItem(nsString& aItem) -{ - int theFirstSelectedItem = GetSelectedIndex(); - nsresult res = NS_ERROR_FAILURE; - - - if (mWidget) - { - PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsListBox::GetSelectedItem theFirstSelectedItem is <%d>\n", theFirstSelectedItem)); - - GetItemAt(aItem, theFirstSelectedItem); - - res = NS_OK; - } - - return res; -} - -//------------------------------------------------------------------------- -// -// Gets the list of selected items -// Gets the Position of the first selected Item or -1 if no items. -//------------------------------------------------------------------------- -PRInt32 nsListBox::GetSelectedIndex() -{ -// PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsListBox::GetSelectedIndex - Not Implemented\n")); - - PRInt32 index=-1; - int theFirstSelectedItem[1]; - nsresult res = NS_ERROR_FAILURE; - - if (mWidget) - { - GetSelectedIndices(theFirstSelectedItem, 1); - - PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsListBox::GetSelectedIndex theFirstSelectedItem is <%d>\n", theFirstSelectedItem[0])); - - index = theFirstSelectedItem[0]; - res = NS_OK; - } - - return index; -} - -//------------------------------------------------------------------------- -// -// SelectItem -// -//------------------------------------------------------------------------- -NS_METHOD nsListBox::SelectItem(PRInt32 aPosition) -{ - PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsListBox::SelectItem %d\n", aPosition)); - nsresult res = NS_ERROR_FAILURE; - - if (mWidget) - { - PtListSelectPos(mWidget, (aPosition+1)); /* Photon is 1 based */ - res = NS_OK; - } - - return res; -} - -//------------------------------------------------------------------------- -// -// GetSelectedCount -// -//------------------------------------------------------------------------- -PRInt32 nsListBox::GetSelectedCount() -{ - PtArg_t arg; - short *theCount; - PRInt32 total = 0; - - if (mWidget) - { - PtSetArg( &arg, Pt_ARG_LIST_SEL_COUNT, &theCount, 0); - PtGetResources(mWidget, 1, &arg ); - - total = *theCount; - } - - PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsListBox::GetSelectedCount theCount=<%d>\n", total)); - return total; -} - -//------------------------------------------------------------------------- -// -// GetSelectedIndices -// -//------------------------------------------------------------------------- -NS_METHOD nsListBox::GetSelectedIndices(PRInt32 aIndices[], PRInt32 aSize) -{ - PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsListBox::GetSelectedIndices aSize=<%d>\n", aSize)); - - PRInt32 i=0, num = 0; - short *theSelectedIndices, *theSelectedCount; - nsresult res = NS_ERROR_FAILURE; - PtArg_t arg; - - if (mWidget) - { - PtSetArg( &arg, Pt_ARG_SELECTION_INDEXES, &theSelectedIndices, &theSelectedCount); - PtGetResources(mWidget, 1, &arg ); - - PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsListBox::GetSelectedIndices Found %d Selected Items\n", *theSelectedCount)); - - for (i=0; i < *theSelectedCount && i < aSize; i++) - { - PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsListBox::GetSelectedIndices %d is Selected.\n", theSelectedIndices[i])); - - aIndices[i] = (theSelectedIndices[i]-1) ; /* photon is 1 based, mozilla appears to be 0 based */ - } - - res = NS_OK; - } - - return res; -} - -//------------------------------------------------------------------------- -// -// SetSelectedIndices -// -//------------------------------------------------------------------------- -NS_METHOD nsListBox::SetSelectedIndices(PRInt32 aIndices[], PRInt32 aSize) -{ - PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsListBox::SetSelectedIndices\n")); - - /* De-Select Everything ... */ - Deselect(); - - int i; - for (i=0;i\n", theList[i])); - PtListUnselectPos(mWidget, theList[i]); - } - - res = NS_OK; - } - - return res; -} - -//------------------------------------------------------------------------- -// -// Set initial parameters -// -//------------------------------------------------------------------------- -NS_METHOD nsListBox::PreCreateWidget(nsWidgetInitData *aInitData) -{ - PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsListBox::PreCreateWidget - Not Implemented\n")); - - if (nsnull != aInitData) { - nsListBoxInitData* data = (nsListBoxInitData *) aInitData; - mMultiSelect = data->mMultiSelect; - } - - return NS_OK; -} - -//------------------------------------------------------------------------- -// -// Create the native widget -// -//------------------------------------------------------------------------- -NS_METHOD nsListBox::CreateNative(PtWidget_t *parentWindow) -{ - PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsListBox::CreateNative\n")); - - nsresult res = NS_ERROR_FAILURE; - PtArg_t arg[5]; - PhPoint_t pos; - PhDim_t dim; - - pos.x = mBounds.x; - pos.y = mBounds.y; - dim.w = mBounds.width - 4; // Correct for border width - dim.h = mBounds.height - 4; - - PtSetArg( &arg[0], Pt_ARG_POS, &pos, 0 ); - PtSetArg( &arg[1], Pt_ARG_DIM, &dim, 0 ); - PtSetArg( &arg[2], Pt_ARG_BORDER_WIDTH, 2, 0 ); - - mWidget = PtCreateWidget( PtList, parentWindow, 3, arg ); - if( mWidget ) - { - res = NS_OK; - - /* Mozilla calls this first before we have a widget so re-call this */ - SetMultipleSelection(mMultiSelect); - - /* Add a Callback so I can keep track of whats selected or not */ -// PtAddCallback(mWidget, Pt_CB_SELECTION, handle_selection_event, this); - } - - return res; -} - -//------------------------------------------------------------------------- -// -// move, paint, resizes message - ignore -// -//------------------------------------------------------------------------- -PRBool nsListBox::OnMove(PRInt32, PRInt32) -{ - PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsListBox::OnMove - Not Implemented\n")); - - return PR_FALSE; -} - -//------------------------------------------------------------------------- -// -// paint message. Don't send the paint out -// -//------------------------------------------------------------------------- -PRBool nsListBox::OnPaint(nsPaintEvent &aEvent) -{ - PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsListBox::OnPaint - Not Implemented\n")); - - return PR_FALSE; -} - -PRBool nsListBox::OnResize(nsSizeEvent &aEvent) -{ - PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsListBox::OnResize - Not Implemented\n")); - - return PR_FALSE; -} - -//------------------------------------------------------------------------- -// -// Callback when user selects or deselects an item -// -//------------------------------------------------------------------------- -int nsListBox::handle_selection_event (PtWidget_t *aWidget, void *aData, PtCallbackInfo_t *aCbinfo ) -{ - nsListBox *me = (nsListBox *) aData; - - PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsListBox::handle_select_event widget=<%p>\n",me)); - - if ((me) && (aCbinfo->reason == Pt_CB_SELECTION) && - (aCbinfo->reason_subtype == Pt_LIST_SELECTION_FINAL)) - { - PtListCallback_t *ListCallback = (PtListCallback_t *) aCbinfo->cbdata; - -// PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsListBox::handle_select_event mode=<%d>\n",ListCal)); - - } - - return (Pt_CONTINUE); -} \ No newline at end of file diff --git a/widget/src/photon/nsMenu.cpp b/widget/src/photon/nsMenu.cpp index 0e049ef04ed..19d118ff73c 100644 --- a/widget/src/photon/nsMenu.cpp +++ b/widget/src/photon/nsMenu.cpp @@ -1005,4 +1005,4 @@ int nsMenu::SubMenuMenuItemMenuCb (PtWidget_t *widget, void *aNSMenu, PtCallback } return( Pt_CONTINUE ); -} \ No newline at end of file +} diff --git a/widget/src/photon/nsMenuItem.cpp b/widget/src/photon/nsMenuItem.cpp index 98d51bdaafe..f9b464779da 100644 --- a/widget/src/photon/nsMenuItem.cpp +++ b/widget/src/photon/nsMenuItem.cpp @@ -675,4 +675,4 @@ int nsMenuItem::MenuItemDisarmCb (PtWidget_t *widget, void *nsClassPtr, PtCallba delete [] str; return Pt_CONTINUE; -} \ No newline at end of file +} diff --git a/widget/src/photon/nsScrollbar.cpp b/widget/src/photon/nsScrollbar.cpp index a21efa818c5..53f114b0252 100644 --- a/widget/src/photon/nsScrollbar.cpp +++ b/widget/src/photon/nsScrollbar.cpp @@ -413,4 +413,4 @@ int nsScrollbar::handle_scroll_move_event (PtWidget_t *aWidget, void *aData, PtC me->OnScroll(scroll_event, thePos); return (Pt_CONTINUE); -} \ No newline at end of file +} diff --git a/widget/src/photon/nsTextWidget.cpp b/widget/src/photon/nsTextWidget.cpp index b5f7c0c0810..97f3a8575f2 100644 --- a/widget/src/photon/nsTextWidget.cpp +++ b/widget/src/photon/nsTextWidget.cpp @@ -163,4 +163,4 @@ int nsTextWidget::handle_activate_event (PtWidget_t *aWidget, void *aData, PtCal PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsTextWidget::handle_activate_event me=<%p> - Not Implemented\n",me)); return (Pt_CONTINUE); -} \ No newline at end of file +} diff --git a/widget/src/photon/nsToolkit.cpp b/widget/src/photon/nsToolkit.cpp index 453d83fda1c..f5b6a4f92a3 100644 --- a/widget/src/photon/nsToolkit.cpp +++ b/widget/src/photon/nsToolkit.cpp @@ -104,4 +104,4 @@ PhPoint_t nsToolkit::GetConsoleOffset() } return(PhPoint_t) {0,0}; -} \ No newline at end of file +} diff --git a/xpcom/appshell/eventloop/photon/nsCAppLoop.cpp b/xpcom/appshell/eventloop/photon/nsCAppLoop.cpp index ad0f73830b5..e69de29bb2d 100644 --- a/xpcom/appshell/eventloop/photon/nsCAppLoop.cpp +++ b/xpcom/appshell/eventloop/photon/nsCAppLoop.cpp @@ -1,73 +0,0 @@ -/* -*- Mode: IDL; tab-width: 4; 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 the Mozilla browser. - * - * The Initial Developer of the Original Code is Netscape - * Communications, Inc. Portions created by Netscape are - * Copyright (C) 1999, Mozilla. All Rights Reserved. - * - * Contributor(s): - * Travis Bogard - */ - -#include "nsCAppLoop.h" -#include "nsCPhFilter.h" -#include "nsPhEventLog.h" - -//***************************************************************************** -//*** nsCAppLoop: Object Management -//***************************************************************************** - -nsCAppLoop::nsCAppLoop() : nsCBaseAppLoop() -{ - PR_LOG(PhEventLog, PR_LOG_DEBUG, ("nsCAppLoop::nsCAppLoop m_PhThreadId=<%d>\n", m_PhThreadId)); -} - -nsCAppLoop::~nsCAppLoop() -{ - PR_LOG(PhEventLog, PR_LOG_DEBUG, ("nsCAppLoop::~nsCAppLoop m_PhThreadId=<%d>\n", m_PhThreadId)); - -} - -NS_METHOD nsCAppLoop::Create(nsISupports* aOuter, const nsIID& aIID, - void** ppv) -{ - PR_LOG(PhEventLog, PR_LOG_DEBUG, ("nsCAppLoop::Create\n")); - - NS_ENSURE_ARG_POINTER(ppv); - NS_ENSURE_NO_AGGREGATION(aOuter); - - nsCAppLoop* app = new nsCAppLoop(); - NS_ENSURE_TRUE(app, NS_ERROR_OUT_OF_MEMORY); - - NS_ADDREF(app); - nsresult rv = app->QueryInterface(aIID, ppv); - NS_RELEASE(app); - - PR_LOG(PhEventLog, PR_LOG_DEBUG, ("nsCAppLoop::Create the end rv=<%d>\n", rv)); - - return rv; -} - -//***************************************************************************** -// nsCAppLoop:: Internal Platform Implementations of nsIEventLoop -// (Error checking is ensured above) -//***************************************************************************** - -nsresult nsCAppLoop::PlatformExit(PRInt32 exitCode) -{ - PR_LOG(PhEventLog, PR_LOG_DEBUG, ("nsCAppLoop::PlatformExit exitCode=<%d>\n", exitCode)); - - PostQuitMessage(exitCode); - return NS_OK; -} \ No newline at end of file diff --git a/xpcom/appshell/eventloop/photon/nsCEvent.cpp b/xpcom/appshell/eventloop/photon/nsCEvent.cpp index c1c139481c9..e69de29bb2d 100644 --- a/xpcom/appshell/eventloop/photon/nsCEvent.cpp +++ b/xpcom/appshell/eventloop/photon/nsCEvent.cpp @@ -1,103 +0,0 @@ -/* -*- Mode: IDL; tab-width: 4; 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 the Mozilla browser. - * - * The Initial Developer of the Original Code is Netscape - * Communications, Inc. Portions created by Netscape are - * Copyright (C) 1999, Mozilla. All Rights Reserved. - * - * Contributor(s): - * Travis Bogard - * Jerry Kirk - */ - -#include "nsCRT.h" -#include "nsCEvent.h" - -#include -PRLogModuleInfo *PhEventLog = PR_NewLogModule("PhEventLog"); - -#include "nsPhEventLog.h" - -//***************************************************************************** -//*** nsCEvent: Object Management -//***************************************************************************** - -nsCEvent::nsCEvent(void* platformEventData) -{ - PR_LOG(PhEventLog, PR_LOG_DEBUG, ("nsCEvent::nsCEvent platformEventData=<%p>\n", platformEventData)); - - NS_INIT_REFCNT(); - m_msg = new nsCPhEvent( (PhEvent_t *) platformEventData); -} - -nsCEvent::~nsCEvent() -{ - PR_LOG(PhEventLog, PR_LOG_DEBUG, ("nsCEvent::~nsCEvent\n")); - - if (m_msg) - { - delete m_msg; - } -} - -//***************************************************************************** -// nsCEvent::nsISupports -//***************************************************************************** - -NS_IMPL_ISUPPORTS1(nsCEvent, nsIEvent) - -//***************************************************************************** -// nsCEvent::nsIEvent -//***************************************************************************** - -NS_IMETHODIMP nsCEvent::GetNativeData(nsNativeEventDataType dataType, - void** data) -{ - PR_LOG(PhEventLog, PR_LOG_DEBUG, ("nsCEvent::GetNativeData dataType=<%d> data=<%p>\n", dataType, data)); - - - NS_ENSURE_ARG(nsNativeEventDataTypes::PhotonMsgStruct == dataType); - NS_ENSURE_ARG_POINTER(data); - - *data = m_msg; - return NS_OK; -} - -NS_IMETHODIMP nsCEvent::SetNativeData(nsNativeEventDataType dataType, - void* data) -{ - PR_LOG(PhEventLog, PR_LOG_DEBUG, ("nsCEvent::SetNativeData dataType=<%d>\n", dataType)); - - NS_ENSURE_ARG(nsNativeEventDataTypes::PhotonMsgStruct == dataType); - - if(!data) - { - /* Get rid of the Event */ - if (m_msg) - delete m_msg; - m_msg = new nsCPhEvent(NULL); - } - else - { - /* Get rid of the Event */ - if (m_msg) - delete m_msg; - - nsCPhEvent *aEvent = (nsCPhEvent *) data; - m_msg = new nsCPhEvent(aEvent->m_msg); - } - - return NS_OK; -} - \ No newline at end of file diff --git a/xpcom/appshell/eventloop/photon/nsCEventFilter.cpp b/xpcom/appshell/eventloop/photon/nsCEventFilter.cpp index 2eed2f731a6..e69de29bb2d 100644 --- a/xpcom/appshell/eventloop/photon/nsCEventFilter.cpp +++ b/xpcom/appshell/eventloop/photon/nsCEventFilter.cpp @@ -1,78 +0,0 @@ -/* -*- Mode: IDL; tab-width: 4; 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 the Mozilla browser. - * - * The Initial Developer of the Original Code is Netscape - * Communications, Inc. Portions created by Netscape are - * Copyright (C) 1999, Mozilla. All Rights Reserved. - * - * Contributor(s): - * Travis Bogard - * Jerry Kirk - */ - -#include "nsCRT.h" - -#include "nsCEventFilter.h" - -//***************************************************************************** -//*** nsCEventFilter: Object Management -//***************************************************************************** - -nsCEventFilter::nsCEventFilter(void* platformFilterData) -{ - NS_INIT_REFCNT(); - - if(platformFilterData) - nsCRT::memcpy(&m_filter, platformFilterData, sizeof(m_filter)); - else - nsCRT::memset(&m_filter, 0, sizeof(m_filter)); -} - -nsCEventFilter::~nsCEventFilter() -{ -} - -//***************************************************************************** -// nsCEventFilter::nsISupports -//***************************************************************************** - -NS_IMPL_ISUPPORTS1(nsCEventFilter, nsIEventFilter) - -//***************************************************************************** -// nsCEventFilter::nsIEventFilter -//***************************************************************************** - -NS_IMETHODIMP nsCEventFilter::GetNativeData(nsNativeFilterDataType dataType, - void** data) -{ - NS_ENSURE_ARG(nsNativeFilterDataTypes::PhotonFilter == dataType); - NS_ENSURE_ARG_POINTER(data); - - *data = &m_filter; - - return NS_OK; -} - -NS_IMETHODIMP nsCEventFilter::SetNativeData(nsNativeFilterDataType dataType, - void* data) -{ - NS_ENSURE_ARG(nsNativeFilterDataTypes::PhotonFilter == dataType); - - if(!data) - nsCRT::memset(&m_filter, 0, sizeof(m_filter)); - else - nsCRT::memcpy(&m_filter, data, sizeof(m_filter)); - - return NS_OK; -} \ No newline at end of file diff --git a/xpcom/appshell/eventloop/photon/nsCPhEvent.cpp b/xpcom/appshell/eventloop/photon/nsCPhEvent.cpp index 199d406f1bc..e69de29bb2d 100644 --- a/xpcom/appshell/eventloop/photon/nsCPhEvent.cpp +++ b/xpcom/appshell/eventloop/photon/nsCPhEvent.cpp @@ -1,89 +0,0 @@ -/* -*- Mode: IDL; tab-width: 4; 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 the Mozilla browser. - * - * The Initial Developer of the Original Code is Netscape - * Communications, Inc. Portions created by Netscape are - * Copyright (C) 1999, Mozilla. All Rights Reserved. - * - * Contributor(s): - * Jerry Kirk - */ - -#include "nsCRT.h" -#include "nsCPhEvent.h" - -#include "nsPhEventLog.h" - -//***************************************************************************** -//*** nsCPhEvent: Object Management -//***************************************************************************** - -nsCPhEvent::nsCPhEvent(PhEvent_t* platformEventData) -{ - PR_LOG(PhEventLog, PR_LOG_DEBUG, ("nsCPhEvent::nsCPhEvent platformEventData=<%p>\n", platformEventData)); - - if (platformEventData) - { - mEventBufferSz = PhGetMsgSize ( platformEventData ); - m_msg = (PhEvent_t *) malloc( mEventBufferSz ); - if (m_msg); - nsCRT::memcpy(m_msg, platformEventData, mEventBufferSz); - } - else - { - mEventBufferSz = sizeof(PhEvent_t); - m_msg = (PhEvent_t *) malloc( mEventBufferSz ); - if (m_msg); - nsCRT::memset(m_msg, 0, mEventBufferSz); - } -} - -nsCPhEvent::~nsCPhEvent() -{ - PR_LOG(PhEventLog, PR_LOG_DEBUG, ("nsCPhEvent::~nsCPhEvent\n")); - - if (m_msg) - { - free(m_msg); - m_msg = nsnull; - mEventBufferSz = 0; - } -} - -unsigned long nsCPhEvent::GetEventBufferSize() -{ - return mEventBufferSz; -} - -unsigned long nsCPhEvent::GetEventSize() -{ - unsigned long theEventSize = 0; - if (m_msg) - theEventSize = PhGetMsgSize ( (PhEvent_t *) m_msg ); - - PR_LOG(PhEventLog, PR_LOG_DEBUG, ("nsCPhEvent::GetEventSize theEventSize=<%d>\n", theEventSize)); - - return theEventSize; -} - -nsresult nsCPhEvent::ResizeEvent(unsigned long aEventSize) -{ - PR_LOG(PhEventLog, PR_LOG_DEBUG, ("nsCPhEvent::ResizeEvent old_size=<%d> new_size=<%d>\n", mEventBufferSz, aEventSize)); - - mEventBufferSz = aEventSize; - m_msg = (PhEvent_t *) realloc( m_msg, mEventBufferSz ); - NS_ENSURE_ARG_POINTER(m_msg); - return NS_OK; -} - \ No newline at end of file diff --git a/xpcom/appshell/eventloop/photon/nsCPlatformBaseLoop.cpp b/xpcom/appshell/eventloop/photon/nsCPlatformBaseLoop.cpp index c39468d4d98..e69de29bb2d 100644 --- a/xpcom/appshell/eventloop/photon/nsCPlatformBaseLoop.cpp +++ b/xpcom/appshell/eventloop/photon/nsCPlatformBaseLoop.cpp @@ -1,188 +0,0 @@ -/* -*- Mode: IDL; tab-width: 4; 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 the Mozilla browser. - * - * The Initial Developer of the Original Code is Netscape - * Communications, Inc. Portions created by Netscape are - * Copyright (C) 1999, Mozilla. All Rights Reserved. - * - * Contributor(s): - * Travis Bogard - * Jerry Kirk - */ - -#include "nsCPlatformBaseLoop.h" -#include "nsCPhEvent.h" -#include "nsCPhFilter.h" - -#include "nsPhEventLog.h" -#include - -//***************************************************************************** -//*** nsCPlatformBaseLoop: Object Management -//***************************************************************************** - -nsCPlatformBaseLoop::nsCPlatformBaseLoop(nsEventLoopType type) : - nsCBaseLoop(type) -{ - m_PhThreadId = pthread_self(); - - PR_LOG(PhEventLog, PR_LOG_DEBUG, ("nsCPlatformBaseLoop::nsCPlatformBaseLoop nsEventLoopType=<%d> m_PhThreadId=<%d>\n", type, m_PhThreadId)); -} - -nsCPlatformBaseLoop::~nsCPlatformBaseLoop() -{ - PR_LOG(PhEventLog, PR_LOG_DEBUG, ("nsCPlatformBaseLoop::~nsCPlatformBaseLoop m_PhThreadId=<%d>\n", m_PhThreadId)); -} - -//***************************************************************************** -// nsCPlatformBaseLoop:: Internal Platform Implementations of nsIEventLoop -// (Error checking is ensured above) -//***************************************************************************** - -nsresult nsCPlatformBaseLoop::PlatformGetNextEvent(void* platformFilterData, - void* platformEventData) -{ - PR_LOG(PhEventLog, PR_LOG_DEBUG, ("nsCPlatformBaseLoop::PlatformGetNextEvent platformFilterData=<%p> platformEventData=<%p>\n", platformFilterData, platformEventData)); - - nsCPhFilter* filter=(nsCPhFilter*)platformFilterData; - nsCPhEvent* pEvent = (nsCPhEvent*) platformEventData; - PRBool done = PR_FALSE; - - if(filter != NULL) - { - PR_LOG(PhEventLog, PR_LOG_DEBUG, ("nsCPlatformBaseLoop::PlatformGetNextEvent Filters not supported\n")); - - return NS_COMFALSE; - } - - while(!done) - { - switch( PhEventNext(pEvent->m_msg, pEvent->GetEventBufferSize())) - { - case Ph_EVENT_MSG: - PR_LOG(PhEventLog, PR_LOG_DEBUG, ("nsCPlatformBaseLoop::PlatformGetNextEvent GetMessage\n")); - done = PR_TRUE; - break; - case Ph_RESIZE_MSG: - PR_LOG(PhEventLog, PR_LOG_DEBUG, ("nsCPlatformBaseLoop::PlatformGetNextEvent Resize Message from <%d> to <%d>\n", pEvent->GetEventBufferSize(), pEvent->GetEventSize())); - pEvent->ResizeEvent(pEvent->GetEventSize()); - break; - } - } - - return NS_OK; -} - -nsresult nsCPlatformBaseLoop::PlatformPeekNextEvent(void* platformFilterData, - void* platformEventData, PRBool fRemoveEvent) -{ - PR_LOG(PhEventLog, PR_LOG_DEBUG, ("nsCPlatformBaseLoop::PlatformPeekNextEvent platformFilterData=<%p> platformEventData=<%p> fRemoveEvent=<%d>\n", platformFilterData, platformEventData, fRemoveEvent)); - - if(fRemoveEvent == PR_FALSE) - { - PR_LOG(PhEventLog, PR_LOG_DEBUG, ("nsCPlatformBaseLoop::PlatformPeekNextEvent Leaving the element on the queue is not supported\n")); - return NS_COMFALSE; - } - -#if 0 - nsCWinFilter* filter=(nsCWinFilter*)platformFilterData; - MSG* pMsg=(MSG*)platformEventData; - - if(fRemoveEvent) - filter->wRemoveFlags|= PM_REMOVE; - else - filter->wRemoveFlags&= ~PM_REMOVE; - if(::PeekMessage(pMsg, filter->hWnd, filter->wMsgFilterMin, - filter->wMsgFilterMax, filter->wRemoveFlags)) - return NS_OK; -#endif - return NS_COMFALSE; -} - -nsresult nsCPlatformBaseLoop::PlatformTranslateEvent(void* platformEventData) -{ - PR_LOG(PhEventLog, PR_LOG_DEBUG, ("nsCPlatformBaseLoop::PlatformTranslateEvent platformEventData=<%p>\n", platformEventData)); - -#if 0 - MSG* pMsg=(MSG*)platformEventData; - ::TranslateMessage(pMsg); -#endif - - return NS_OK; -} - -nsresult nsCPlatformBaseLoop::PlatformDispatchEvent(void* platformEventData) -{ - PR_LOG(PhEventLog, PR_LOG_DEBUG, ("nsCPlatformBaseLoop::PlatformDispatchEvent platformEventData=<%p>\n", platformEventData)); - -#if 0 - MSG* pMsg=(MSG*)platformEventData; - ::DispatchMessage(pMsg); -#endif - - return NS_OK; -} - -nsresult nsCPlatformBaseLoop::PlatformSendLoopEvent(void* platformEventData, PRInt32* result) -{ - PR_LOG(PhEventLog, PR_LOG_DEBUG, ("nsCPlatformBaseLoop::PlatformSendLoopEvent platformEventData=<%p>\n", platformEventData)); - -#if 0 - MSG* pMsg=(MSG*)platformEventData; - *result = ::SendMessage(pMsg->hwnd, pMsg->message, pMsg->wParam,pMsg->lParam); -#endif - - return NS_OK; -} - -nsresult nsCPlatformBaseLoop::PlatformPostLoopEvent(void* platformEventData) -{ - PR_LOG(PhEventLog, PR_LOG_DEBUG, ("nsCPlatformBaseLoop::PlatformPostLoopEvent platformEventData=<%p>\n", platformEventData)); - -#if 0 - MSG* pMsg=(MSG*)platformEventData; - if(!pMsg->hwnd) - { - if(!::PostThreadMessage(m_WinThreadId, pMsg->message, pMsg->wParam, - pMsg->lParam)) - return NS_ERROR_FAILURE; - } - else if(!::PostMessage(pMsg->hwnd, pMsg->message, pMsg->wParam, pMsg->lParam)) - return NS_ERROR_FAILURE; -#endif - - return NS_OK; -} - -nsNativeEventDataType nsCPlatformBaseLoop::PlatformGetEventType() -{ - return nsNativeEventDataTypes::PhotonMsgStruct; -} - -nsNativeEventDataType nsCPlatformBaseLoop::PlatformGetFilterType() -{ - return nsNativeFilterDataTypes::PhotonFilter; -} - -PRInt32 nsCPlatformBaseLoop::PlatformGetReturnCode(void* platformEventData) -{ - PR_LOG(PhEventLog, PR_LOG_DEBUG, ("nsCPlatformBaseLoop::PlatformGetReturnCode platformEventData=<%p>\n", platformEventData)); - -#if 0 - MSG* pMsg=(MSG*)platformEventData; - return pMsg->wParam; -#endif - - return -1; -} \ No newline at end of file diff --git a/xpcom/appshell/eventloop/windows/nsCAppLoop.cpp b/xpcom/appshell/eventloop/windows/nsCAppLoop.cpp index 756e092042e..e69de29bb2d 100644 --- a/xpcom/appshell/eventloop/windows/nsCAppLoop.cpp +++ b/xpcom/appshell/eventloop/windows/nsCAppLoop.cpp @@ -1,62 +0,0 @@ -/* -*- Mode: IDL; tab-width: 4; 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 the Mozilla browser. - * - * The Initial Developer of the Original Code is Netscape - * Communications, Inc. Portions created by Netscape are - * Copyright (C) 1999, Mozilla. All Rights Reserved. - * - * Contributor(s): - * Travis Bogard - */ - -#include "nsCAppLoop.h" -#include "nsCWinFilter.h" - -//***************************************************************************** -//*** nsCAppLoop: Object Management -//***************************************************************************** - -nsCAppLoop::nsCAppLoop() : nsCBaseAppLoop() -{ -} - -nsCAppLoop::~nsCAppLoop() -{ -} - -NS_METHOD nsCAppLoop::Create(nsISupports* aOuter, const nsIID& aIID, - void** ppv) -{ - NS_ENSURE_ARG_POINTER(ppv); - NS_ENSURE_NO_AGGREGATION(aOuter); - - nsCAppLoop* app = new nsCAppLoop(); - NS_ENSURE_TRUE(app, NS_ERROR_OUT_OF_MEMORY); - - NS_ADDREF(app); - nsresult rv = app->QueryInterface(aIID, ppv); - NS_RELEASE(app); - return rv; -} - -//***************************************************************************** -// nsCAppLoop:: Internal Platform Implementations of nsIEventLoop -// (Error checking is ensured above) -//***************************************************************************** - -nsresult nsCAppLoop::PlatformExit(PRInt32 exitCode) -{ - PostQuitMessage(exitCode); - return NS_OK; -} \ No newline at end of file diff --git a/xpcom/appshell/eventloop/windows/nsCBreathLoop.cpp b/xpcom/appshell/eventloop/windows/nsCBreathLoop.cpp index 2deb55b96b3..e69de29bb2d 100644 --- a/xpcom/appshell/eventloop/windows/nsCBreathLoop.cpp +++ b/xpcom/appshell/eventloop/windows/nsCBreathLoop.cpp @@ -1,80 +0,0 @@ -/* -*- Mode: IDL; tab-width: 4; 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 the Mozilla browser. - * - * The Initial Developer of the Original Code is Netscape - * Communications, Inc. Portions created by Netscape are - * Copyright (C) 1999, Mozilla. All Rights Reserved. - * - * Contributor(s): - * Travis Bogard - */ - -#include "nsCBreathLoop.h" -#include "nsCWinFilter.h" - -//***************************************************************************** -//*** nsCBreathLoop: Object Management -//***************************************************************************** - -nsCBreathLoop::nsCBreathLoop() : nsCBaseBreathLoop() -{ -} - -nsCBreathLoop::~nsCBreathLoop() -{ -} - -NS_METHOD nsCBreathLoop::Create(nsISupports* aOuter, const nsIID& aIID, - void** ppv) -{ - NS_ENSURE_ARG_POINTER(ppv); - NS_ENSURE_NO_AGGREGATION(aOuter); - - nsCBreathLoop* app = new nsCBreathLoop(); - NS_ENSURE_TRUE(app, NS_ERROR_OUT_OF_MEMORY); - - NS_ADDREF(app); - nsresult rv = app->QueryInterface(aIID, ppv); - NS_RELEASE(app); - return rv; -} - -//***************************************************************************** -// nsCBreathLoop:: Internal Platform Implementations of nsIEventLoop -// (Error checking is ensured above) -//***************************************************************************** - -nsresult nsCBreathLoop::PlatformExit(PRInt32 exitCode) -{ - // XXX Not sure we can force PeekMessage out.... - return NS_OK; -} - -PRInt32 nsCBreathLoop::PlatformGetReturnCode(void* platformEventData) -{ - return 0; -} - -nsresult nsCBreathLoop::PlatformRetrieveNextEvent(void* platformFilterData, - void* platformEventData) -{ - nsCWinFilter* filter=(nsCWinFilter*)platformFilterData; - MSG* pMsg=(MSG*)platformEventData; - - filter->wRemoveFlags|= PM_REMOVE; - if(::PeekMessage(pMsg, filter->hWnd, filter->wMsgFilterMin, - filter->wMsgFilterMax, filter->wRemoveFlags)) - return NS_OK; - return NS_COMFALSE; -} \ No newline at end of file diff --git a/xpcom/appshell/eventloop/windows/nsCEvent.cpp b/xpcom/appshell/eventloop/windows/nsCEvent.cpp index 7e6662a03b0..e69de29bb2d 100644 --- a/xpcom/appshell/eventloop/windows/nsCEvent.cpp +++ b/xpcom/appshell/eventloop/windows/nsCEvent.cpp @@ -1,180 +0,0 @@ -/* -*- Mode: IDL; tab-width: 4; 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 the Mozilla browser. - * - * The Initial Developer of the Original Code is Netscape - * Communications, Inc. Portions created by Netscape are - * Copyright (C) 1999, Mozilla. All Rights Reserved. - * - * Contributor(s): - * Travis Bogard - */ - -#include "nsCRT.h" - -#include "nsCEvent.h" - -//***************************************************************************** -//*** nsCEvent: Object Management -//***************************************************************************** - -nsCEvent::nsCEvent(void* platformEventData) -{ - NS_INIT_REFCNT(); - - if(platformEventData) - nsCRT::memcpy(&m_msg, platformEventData, sizeof(m_msg)); - else - nsCRT::memset(&m_msg, 0, sizeof(m_msg)); -} - -nsCEvent::~nsCEvent() -{ -} - -//***************************************************************************** -// nsCEvent::nsISupports -//***************************************************************************** - -NS_IMPL_ISUPPORTS2(nsCEvent, nsIEvent, nsIWinEvent) - -//***************************************************************************** -// nsCEvent::nsIEvent -//***************************************************************************** - -NS_IMETHODIMP nsCEvent::GetNativeData(nsNativeEventDataType dataType, - void** data) -{ - NS_ENSURE_ARG(nsNativeEventDataTypes::WinMsgStruct == dataType); - NS_ENSURE_ARG_POINTER(data); - - *data = &m_msg; - - return NS_OK; -} - -NS_IMETHODIMP nsCEvent::SetNativeData(nsNativeEventDataType dataType, - void* data) -{ - NS_ENSURE_ARG(nsNativeEventDataTypes::WinMsgStruct == dataType); - - if(!data) - nsCRT::memset(&m_msg, 0, sizeof(m_msg)); - else - nsCRT::memcpy(&m_msg, data, sizeof(m_msg)); - - return NS_OK; -} - -NS_IMETHODIMP nsCEvent::GetIsExitEvent(PRBool* aIsExitEvent) -{ - NS_ENSURE_ARG_POINTER(aIsExitEvent); - - *aIsExitEvent = m_msg.message == WM_QUIT ? PR_TRUE : PR_FALSE; - - return NS_OK; -} -//***************************************************************************** -// nsCEvent::nsIWinEvent -//***************************************************************************** - -NS_IMETHODIMP nsCEvent::GetHwnd(void** aHwnd) -{ - NS_ENSURE_ARG_POINTER(aHwnd); - *aHwnd = m_msg.hwnd; - return NS_OK; -} - -NS_IMETHODIMP nsCEvent::SetHwnd(void* aHwnd) -{ - m_msg.hwnd = (HWND)aHwnd; - return NS_OK; -} - -NS_IMETHODIMP nsCEvent::GetMessage(PRUint32* aMessage) -{ - NS_ENSURE_ARG_POINTER(aMessage); - *aMessage = m_msg.message; - return NS_OK; -} - -NS_IMETHODIMP nsCEvent::SetMessage(PRUint32 aMessage) -{ - m_msg.message = aMessage; - return NS_OK; -} - -NS_IMETHODIMP nsCEvent::GetWParam(PRUint32* aWParam) -{ - NS_ENSURE_ARG_POINTER(aWParam); - *aWParam = m_msg.wParam; - return NS_OK; -} - -NS_IMETHODIMP nsCEvent::SetWParam(PRUint32 aWParam) -{ - m_msg.wParam = aWParam; - return NS_OK; -} - -NS_IMETHODIMP nsCEvent::GetLParam(PRUint32* aLParam) -{ - NS_ENSURE_ARG_POINTER(aLParam); - *aLParam = m_msg.lParam; - return NS_OK; -} - -NS_IMETHODIMP nsCEvent::SetLParam(PRUint32 aLParam) -{ - m_msg.lParam = aLParam; - return NS_OK; -} - -NS_IMETHODIMP nsCEvent::GetTime(PRUint32* aTime) -{ - NS_ENSURE_ARG_POINTER(aTime); - *aTime = m_msg.time; - return NS_OK; -} - -NS_IMETHODIMP nsCEvent::SetTime(PRUint32 aTime) -{ - m_msg.time = aTime; - return NS_OK; -} - -NS_IMETHODIMP nsCEvent::GetPointX(PRInt32* aPointX) -{ - NS_ENSURE_ARG_POINTER(aPointX); - *aPointX = m_msg.pt.x; - return NS_OK; -} - -NS_IMETHODIMP nsCEvent::SetPointX(PRInt32 aPointX) -{ - m_msg.pt.x = aPointX; - return NS_OK; -} - -NS_IMETHODIMP nsCEvent::GetPointY(PRInt32* aPointY) -{ - NS_ENSURE_ARG_POINTER(aPointY); - *aPointY = m_msg.pt.y; - return NS_OK; -} - -NS_IMETHODIMP nsCEvent::SetPointY(PRInt32 aPointY) -{ - m_msg.pt.y = aPointY; - return NS_OK; -} \ No newline at end of file diff --git a/xpcom/appshell/eventloop/windows/nsCEventFilter.cpp b/xpcom/appshell/eventloop/windows/nsCEventFilter.cpp index fac620b14b7..e69de29bb2d 100644 --- a/xpcom/appshell/eventloop/windows/nsCEventFilter.cpp +++ b/xpcom/appshell/eventloop/windows/nsCEventFilter.cpp @@ -1,133 +0,0 @@ -/* -*- Mode: IDL; tab-width: 4; 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 the Mozilla browser. - * - * The Initial Developer of the Original Code is Netscape - * Communications, Inc. Portions created by Netscape are - * Copyright (C) 1999, Mozilla. All Rights Reserved. - * - * Contributor(s): - * Travis Bogard - */ - -#include "nsCRT.h" - -#include "nsCEventFilter.h" - -//***************************************************************************** -//*** nsCEventFilter: Object Management -//***************************************************************************** - -nsCEventFilter::nsCEventFilter(void* platformFilterData) -{ - NS_INIT_REFCNT(); - - if(platformFilterData) - nsCRT::memcpy(&m_filter, platformFilterData, sizeof(m_filter)); - else - nsCRT::memset(&m_filter, 0, sizeof(m_filter)); -} - -nsCEventFilter::~nsCEventFilter() -{ -} - -//***************************************************************************** -// nsCEventFilter::nsISupports -//***************************************************************************** - -NS_IMPL_ISUPPORTS2(nsCEventFilter, nsIEventFilter, nsIWinEventFilter) - -//***************************************************************************** -// nsCEventFilter::nsIEventFilter -//***************************************************************************** - -NS_IMETHODIMP nsCEventFilter::GetNativeData(nsNativeFilterDataType dataType, - void** data) -{ - NS_ENSURE_ARG(nsNativeFilterDataTypes::WinFilter == dataType); - NS_ENSURE_ARG_POINTER(data); - - *data = &m_filter; - - return NS_OK; -} - -NS_IMETHODIMP nsCEventFilter::SetNativeData(nsNativeFilterDataType dataType, - void* data) -{ - NS_ENSURE_ARG(nsNativeFilterDataTypes::WinFilter == dataType); - - if(!data) - nsCRT::memset(&m_filter, 0, sizeof(m_filter)); - else - nsCRT::memcpy(&m_filter, data, sizeof(m_filter)); - - return NS_OK; -} - -//***************************************************************************** -// nsCEventFilter::nsIEventFilter -//***************************************************************************** - -NS_IMETHODIMP nsCEventFilter::GetHwnd(void** aHwnd) -{ - NS_ENSURE_ARG_POINTER(aHwnd); - *aHwnd = m_filter.hWnd; - return NS_OK; -} - -NS_IMETHODIMP nsCEventFilter::SetHwnd(void* aHwnd) -{ - m_filter.hWnd = (HWND)aHwnd; - return NS_OK; -} - -NS_IMETHODIMP nsCEventFilter::GetMsgFilterMin(PRUint32* aMsgFilterMin) -{ - NS_ENSURE_ARG_POINTER(aMsgFilterMin); - *aMsgFilterMin = m_filter.wMsgFilterMin; - return NS_OK; -} - -NS_IMETHODIMP nsCEventFilter::SetMsgFilterMin(PRUint32 aMsgFilterMin) -{ - m_filter.wMsgFilterMin = aMsgFilterMin; - return NS_OK; -} - -NS_IMETHODIMP nsCEventFilter::GetMsgFilterMax(PRUint32* aMsgFilterMax) -{ - NS_ENSURE_ARG_POINTER(aMsgFilterMax); - *aMsgFilterMax = m_filter.wMsgFilterMax; - return NS_OK; -} - -NS_IMETHODIMP nsCEventFilter::SetMsgFilterMax(PRUint32 aMsgFilterMax) -{ - m_filter.wMsgFilterMax = aMsgFilterMax; - return NS_OK; -} - -NS_IMETHODIMP nsCEventFilter::GetRemoveFlags(PRUint32* aRemoveFlags) -{ - NS_ENSURE_ARG_POINTER(aRemoveFlags); - *aRemoveFlags = m_filter.wRemoveFlags; - return NS_OK; -} - -NS_IMETHODIMP nsCEventFilter::SetRemoveFlags(PRUint32 aRemoveFlags) -{ - m_filter.wRemoveFlags = aRemoveFlags; - return NS_OK; -} \ No newline at end of file diff --git a/xpcom/appshell/eventloop/windows/nsCPlatformBaseLoop.cpp b/xpcom/appshell/eventloop/windows/nsCPlatformBaseLoop.cpp index 9470b64013a..e69de29bb2d 100644 --- a/xpcom/appshell/eventloop/windows/nsCPlatformBaseLoop.cpp +++ b/xpcom/appshell/eventloop/windows/nsCPlatformBaseLoop.cpp @@ -1,132 +0,0 @@ -/* -*- Mode: IDL; tab-width: 4; 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 the Mozilla browser. - * - * The Initial Developer of the Original Code is Netscape - * Communications, Inc. Portions created by Netscape are - * Copyright (C) 1999, Mozilla. All Rights Reserved. - * - * Contributor(s): - * Travis Bogard - */ - -#include "nsCPlatformBaseLoop.h" -#include "nsCWinFilter.h" - -//***************************************************************************** -//*** nsCPlatformBaseLoop: Object Management -//***************************************************************************** - -nsCPlatformBaseLoop::nsCPlatformBaseLoop(nsEventLoopType type) : - nsCBaseLoop(type) -{ - m_WinThreadId = ::GetCurrentThreadId(); -} - -nsCPlatformBaseLoop::~nsCPlatformBaseLoop() -{ -} - -//***************************************************************************** -// nsCPlatformBaseLoop:: Internal Platform Implementations of nsIEventLoop -// (Error checking is ensured above) -//***************************************************************************** - -nsresult nsCPlatformBaseLoop::PlatformGetNextEvent(void* platformFilterData, - void* platformEventData) -{ - nsCWinFilter* filter=(nsCWinFilter*)platformFilterData; - MSG* pMsg=(MSG*)platformEventData; - if(::GetMessage(pMsg, filter->hWnd, filter->wMsgFilterMin, - filter->wMsgFilterMax)) - return NS_OK; - return NS_COMFALSE; -} - -nsresult nsCPlatformBaseLoop::PlatformPeekNextEvent(void* platformFilterData, - void* platformEventData, PRBool fRemoveEvent) -{ - nsCWinFilter* filter=(nsCWinFilter*)platformFilterData; - MSG* pMsg=(MSG*)platformEventData; - - if(fRemoveEvent) - filter->wRemoveFlags|= PM_REMOVE; - else - filter->wRemoveFlags&= ~PM_REMOVE; - if(::PeekMessage(pMsg, filter->hWnd, filter->wMsgFilterMin, - filter->wMsgFilterMax, filter->wRemoveFlags)) - return NS_OK; - return NS_COMFALSE; -} - -nsresult nsCPlatformBaseLoop::PlatformTranslateEvent(void* platformEventData) -{ - MSG* pMsg=(MSG*)platformEventData; - ::TranslateMessage(pMsg); - return NS_OK; -} - -nsresult nsCPlatformBaseLoop::PlatformDispatchEvent(void* platformEventData) -{ - MSG* pMsg=(MSG*)platformEventData; - ::DispatchMessage(pMsg); - return NS_OK; -} - -nsresult nsCPlatformBaseLoop::PlatformSendLoopEvent(void* platformEventData, PRInt32* result) -{ - MSG* pMsg=(MSG*)platformEventData; - *result = ::SendMessage(pMsg->hwnd, pMsg->message, pMsg->wParam,pMsg->lParam); - return NS_OK; -} - -nsresult nsCPlatformBaseLoop::PlatformPostLoopEvent(void* platformEventData) -{ - MSG* pMsg=(MSG*)platformEventData; - if(!pMsg->hwnd) - { - if(!::PostThreadMessage(m_WinThreadId, pMsg->message, pMsg->wParam, - pMsg->lParam)) - return NS_ERROR_FAILURE; - } - else if(!::PostMessage(pMsg->hwnd, pMsg->message, pMsg->wParam, pMsg->lParam)) - return NS_ERROR_FAILURE; - return NS_OK; -} - -nsNativeEventDataType nsCPlatformBaseLoop::PlatformGetEventType() -{ - return nsNativeEventDataTypes::WinMsgStruct; -} - -nsNativeEventDataType nsCPlatformBaseLoop::PlatformGetFilterType() -{ - return nsNativeFilterDataTypes::WinFilter; -} - -PRInt32 nsCPlatformBaseLoop::PlatformGetReturnCode(void* platformEventData) -{ - MSG* pMsg=(MSG*)platformEventData; - return pMsg->wParam; -} - -nsresult nsCPlatformBaseLoop::PlatformRetrieveNextEvent(void* platformFilterData, - void* platformEventData) -{ - nsCWinFilter* filter=(nsCWinFilter*)platformFilterData; - MSG* pMsg=(MSG*)platformEventData; - if(::GetMessage(pMsg, filter->hWnd, filter->wMsgFilterMin, - filter->wMsgFilterMax)) - return NS_OK; - return NS_COMFALSE; -} \ No newline at end of file diff --git a/xpcom/appshell/eventloop/windows/nsCThreadLoop.cpp b/xpcom/appshell/eventloop/windows/nsCThreadLoop.cpp index 78c8f4a0bbc..e69de29bb2d 100644 --- a/xpcom/appshell/eventloop/windows/nsCThreadLoop.cpp +++ b/xpcom/appshell/eventloop/windows/nsCThreadLoop.cpp @@ -1,62 +0,0 @@ -/* -*- Mode: IDL; tab-width: 4; 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 the Mozilla browser. - * - * The Initial Developer of the Original Code is Netscape - * Communications, Inc. Portions created by Netscape are - * Copyright (C) 1999, Mozilla. All Rights Reserved. - * - * Contributor(s): - * Travis Bogard - */ - -#include "nsCThreadLoop.h" -#include "nsCWinFilter.h" - -//***************************************************************************** -//*** nsCThreadLoop: Object Management -//***************************************************************************** - -nsCThreadLoop::nsCThreadLoop() : nsCBaseThreadLoop() -{ -} - -nsCThreadLoop::~nsCThreadLoop() -{ -} - -NS_METHOD nsCThreadLoop::Create(nsISupports* aOuter, const nsIID& aIID, - void** ppv) -{ - NS_ENSURE_ARG_POINTER(ppv); - NS_ENSURE_NO_AGGREGATION(aOuter); - - nsCThreadLoop* app = new nsCThreadLoop(); - NS_ENSURE_TRUE(app, NS_ERROR_OUT_OF_MEMORY); - - NS_ADDREF(app); - nsresult rv = app->QueryInterface(aIID, ppv); - NS_RELEASE(app); - return rv; -} - -//***************************************************************************** -// nsCThreadLoop:: Internal Platform Implementations of nsIEventLoop -// (Error checking is ensured above) -//***************************************************************************** - -nsresult nsCThreadLoop::PlatformExit(PRInt32 exitCode) -{ - ::PostThreadMessage(m_WinThreadId, WM_QUIT, 0, 0); - return NS_OK; -} \ No newline at end of file diff --git a/xpcom/macbuild/dummy.cpp b/xpcom/macbuild/dummy.cpp index 38c747f1a30..e69de29bb2d 100644 --- a/xpcom/macbuild/dummy.cpp +++ b/xpcom/macbuild/dummy.cpp @@ -1,4 +0,0 @@ -static void dummy() -{ - // This is just so that base.shlb has something to compile. -} \ No newline at end of file diff --git a/xpinstall/packager/mac/ASEncoder/src/nsAppleSingleEncoder.cpp b/xpinstall/packager/mac/ASEncoder/src/nsAppleSingleEncoder.cpp index 90e16fe1b8f..3bfb556d0aa 100644 --- a/xpinstall/packager/mac/ASEncoder/src/nsAppleSingleEncoder.cpp +++ b/xpinstall/packager/mac/ASEncoder/src/nsAppleSingleEncoder.cpp @@ -460,4 +460,4 @@ nsAppleSingleEncoder::FSpGetCatInfo(CInfoPBRec *pb, FSSpecPtr aFile) ERR_CHECK( PBGetCatInfoSync(pb) ); return err; -} \ No newline at end of file +} diff --git a/xpinstall/packager/mac/ASEncoder/src/nsEventHandler.cpp b/xpinstall/packager/mac/ASEncoder/src/nsEventHandler.cpp index 76baac46e90..c1971f4a3a4 100644 --- a/xpinstall/packager/mac/ASEncoder/src/nsEventHandler.cpp +++ b/xpinstall/packager/mac/ASEncoder/src/nsEventHandler.cpp @@ -267,4 +267,4 @@ nsEventHandler::HandleMenuChoice(SInt32 aChoice) } return err; -} \ No newline at end of file +} diff --git a/xpinstall/packager/mac/ASEncoder/src/nsFileSelector.cpp b/xpinstall/packager/mac/ASEncoder/src/nsFileSelector.cpp index 251c900c37c..ff69f376f92 100644 --- a/xpinstall/packager/mac/ASEncoder/src/nsFileSelector.cpp +++ b/xpinstall/packager/mac/ASEncoder/src/nsFileSelector.cpp @@ -173,4 +173,4 @@ nsFileSelector::GetCWD(long *aOutDirID, short *aOutVRefNum) } return err; -} \ No newline at end of file +} diff --git a/xpinstall/src/nsAppleSingleDecoder.cpp b/xpinstall/src/nsAppleSingleDecoder.cpp index 03b95197525..6800ee92225 100644 --- a/xpinstall/src/nsAppleSingleDecoder.cpp +++ b/xpinstall/src/nsAppleSingleDecoder.cpp @@ -741,4 +741,4 @@ nsAppleSingleDecoder::PLstrcmp(StringPtr str1, StringPtr str2) bEqual = false; return bEqual; -} \ No newline at end of file +} diff --git a/xpinstall/wizard/mac/src/AdditionsWin.c b/xpinstall/wizard/mac/src/AdditionsWin.c index 922a1ae4c1e..b534deb2f82 100644 --- a/xpinstall/wizard/mac/src/AdditionsWin.c +++ b/xpinstall/wizard/mac/src/AdditionsWin.c @@ -59,4 +59,4 @@ DisableAdditionsWin(void) DisableNavButtons(); // TO DO -} \ No newline at end of file +} diff --git a/xpinstall/wizard/mac/src/CheckboxLDEF.c b/xpinstall/wizard/mac/src/CheckboxLDEF.c index 644fd8ef72e..32b6aa4d9e6 100644 --- a/xpinstall/wizard/mac/src/CheckboxLDEF.c +++ b/xpinstall/wizard/mac/src/CheckboxLDEF.c @@ -105,4 +105,4 @@ DrawCheckedCheckbox(Rect *cellRect) MoveTo(checkbox.right-2, checkbox.top+1); LineTo(checkbox.left+1, checkbox.bottom-2); -} \ No newline at end of file +} diff --git a/xpinstall/wizard/mac/src/ComponentsWin.c b/xpinstall/wizard/mac/src/ComponentsWin.c index f928a507ec8..188104c2e9b 100644 --- a/xpinstall/wizard/mac/src/ComponentsWin.c +++ b/xpinstall/wizard/mac/src/ComponentsWin.c @@ -590,4 +590,4 @@ DisableComponentsWin(void) DisableNavButtons(); // TO DO -} \ No newline at end of file +} diff --git a/xpinstall/wizard/mac/src/Deflation.c b/xpinstall/wizard/mac/src/Deflation.c index 8eb0ac2f2e5..5b0c7d3b73c 100644 --- a/xpinstall/wizard/mac/src/Deflation.c +++ b/xpinstall/wizard/mac/src/Deflation.c @@ -409,4 +409,4 @@ aurevoir: if (pcoreDir) DisposePtr((Ptr) pcoreDir); return err; -} \ No newline at end of file +} diff --git a/xpinstall/wizard/mac/src/EvtHandlers.c b/xpinstall/wizard/mac/src/EvtHandlers.c index 24ab7dd49ed..fb87b2a27dc 100644 --- a/xpinstall/wizard/mac/src/EvtHandlers.c +++ b/xpinstall/wizard/mac/src/EvtHandlers.c @@ -377,4 +377,4 @@ void React2InContent(EventRecord* evt, WindowPtr wCurrPtr) gDone = true; break; } -} \ No newline at end of file +} diff --git a/xpinstall/wizard/mac/src/InstAction.c b/xpinstall/wizard/mac/src/InstAction.c index 487c095a4af..4f39adb4693 100644 --- a/xpinstall/wizard/mac/src/InstAction.c +++ b/xpinstall/wizard/mac/src/InstAction.c @@ -764,4 +764,4 @@ UnloadSDLib(CFragConnectionID *connID) return false; return true; -} \ No newline at end of file +} diff --git a/xpinstall/wizard/mac/src/LicenseWin.c b/xpinstall/wizard/mac/src/LicenseWin.c index e15b2174f02..5c54e21f6ea 100644 --- a/xpinstall/wizard/mac/src/LicenseWin.c +++ b/xpinstall/wizard/mac/src/LicenseWin.c @@ -504,4 +504,4 @@ DisableNavButtons(void) HiliteControl(gControls->nextB, kDisableControl); // TO DO -} \ No newline at end of file +} diff --git a/xpinstall/wizard/mac/src/MacInstallWizard.c b/xpinstall/wizard/mac/src/MacInstallWizard.c index e38f3f600d2..ab0ad61ddfb 100644 --- a/xpinstall/wizard/mac/src/MacInstallWizard.c +++ b/xpinstall/wizard/mac/src/MacInstallWizard.c @@ -346,4 +346,4 @@ void Shutdown(void) HideWindow(gWPtr); DisposeWindow(gWPtr); } -} \ No newline at end of file +} diff --git a/xpinstall/wizard/mac/src/SetupTypeWin.c b/xpinstall/wizard/mac/src/SetupTypeWin.c index 12ba102ed46..fd2a32dac5e 100644 --- a/xpinstall/wizard/mac/src/SetupTypeWin.c +++ b/xpinstall/wizard/mac/src/SetupTypeWin.c @@ -1017,4 +1017,4 @@ DisableSetupTypeWin(void) HiliteControl(gControls->stw->instType, kDisableControl); if (gControls->stw->destLoc) HiliteControl(gControls->stw->destLoc, kDisableControl); -} \ No newline at end of file +} diff --git a/xpinstall/wizard/mac/src/TerminalWin.c b/xpinstall/wizard/mac/src/TerminalWin.c index 790462ce4dc..df6f91a5cfd 100644 --- a/xpinstall/wizard/mac/src/TerminalWin.c +++ b/xpinstall/wizard/mac/src/TerminalWin.c @@ -202,4 +202,4 @@ DisableTerminalWin(void) DisableNavButtons(); // TO DO -} \ No newline at end of file +} diff --git a/xpinstall/wizard/mac/src/XPInstallGlue.c b/xpinstall/wizard/mac/src/XPInstallGlue.c index 7f55dc4b32d..fb1eb1e9a51 100644 --- a/xpinstall/wizard/mac/src/XPInstallGlue.c +++ b/xpinstall/wizard/mac/src/XPInstallGlue.c @@ -424,4 +424,4 @@ IsArchiveXPI(StringPtr archive) return true; return false; -} \ No newline at end of file +}