b=479733; stub out clipboard service on Windows CE, and reenable nsSound; r=dougt

This commit is contained in:
Vladimir Vukicevic 2009-04-14 14:59:58 -07:00
Родитель 6912079945
Коммит 4fbc43f426
6 изменённых файлов: 151 добавлений и 15 удалений

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

@ -56,10 +56,14 @@
#include "nsWindow.h"
// Drag & Drop, Clipboard
#ifndef WINCE
#include "nsBidiKeyboard.h"
#include "nsClipboard.h"
#include "nsClipboardHelper.h"
#ifdef WINCE
#include "nsClipboardCE.h"
#else
#include "nsClipboard.h"
#include "nsBidiKeyboard.h"
#include "nsDragService.h"
#include "nsHTMLFormatConverter.h"
#include "nsTransferable.h"
@ -78,13 +82,13 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsLookAndFeel)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsToolkit)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsScreenManagerWin)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsIdleServiceWin)
#ifndef WINCE
NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboard)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboardHelper)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSound)
#ifndef WINCE
NS_GENERIC_FACTORY_CONSTRUCTOR(nsTransferable)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLFormatConverter)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSound)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDragService)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsBidiKeyboard)
#endif
@ -135,8 +139,6 @@ static const nsModuleComponentInfo components[] =
NS_IDLE_SERVICE_CID,
"@mozilla.org/widget/idleservice;1",
nsIdleServiceWinConstructor },
#ifndef WINCE
{ "Clipboard",
NS_CLIPBOARD_CID,
"@mozilla.org/widget/clipboard;1",
@ -149,6 +151,8 @@ static const nsModuleComponentInfo components[] =
NS_SOUND_CID,
"@mozilla.org/sound;1",
nsSoundConstructor },
#ifndef WINCE
{ "Drag Service",
NS_DRAGSERVICE_CID,
"@mozilla.org/widget/dragservice;1",

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

@ -86,6 +86,7 @@ CPPSRCS = \
nsNativeThemeWin.cpp \
nsWinGesture.cpp \
nsIdleServiceWin.cpp \
nsSound.cpp \
$(NULL)
ifdef NS_PRINTING
@ -96,7 +97,11 @@ CPPSRCS += \
$(NULL)
endif
ifneq ($(OS_ARCH), WINCE)
ifeq ($(OS_ARCH), WINCE)
CPPSRCS += \
nsClipboardCE.cpp \
$(NULL)
else
CPPSRCS += \
nsKeyboardLayout.cpp \
IEnumFE.cpp \
@ -108,7 +113,6 @@ CPPSRCS += \
nsClipboard.cpp \
nsImageClipboard.cpp \
nsBidiKeyboard.cpp \
nsSound.cpp \
nsTextStore.cpp \
$(NULL)
endif

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

@ -0,0 +1,62 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* 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 mozilla.org code.
*
* The Initial Developer of the Original Code is
* Mozilla Corporation
* Portions created by the Initial Developer are Copyright (C) 2009
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Vladimir Vukicevic <vladimir@pobox.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsClipboardCE.h"
#include <winuserm.h>
nsClipboard::nsClipboard()
{
}
nsClipboard::~nsClipboard()
{
}
NS_IMETHODIMP
nsClipboard::SetNativeClipboardData(PRInt32 aWhichClipboard)
{
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP
nsClipboard::GetNativeClipboardData(nsITransferable *aTransferable,
PRInt32 aWhichClipboard)
{
return NS_ERROR_FAILURE;
}

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

@ -0,0 +1,62 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* 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 mozilla.org code.
*
* The Initial Developer of the Original Code is
* Mozilla Corporation
* Portions created by the Initial Developer are Copyright (C) 2009
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Vladimir Vukicevic <vladimir@pobox.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsClipboardCE_h__
#define nsClipboardCE_h__
#include "nsBaseClipboard.h"
#include <windows.h>
/*
* Windows CE clipboard wrapper
*/
class nsClipboard :
public nsBaseClipboard
{
public:
nsClipboard();
virtual ~nsClipboard();
protected:
NS_IMETHOD SetNativeClipboardData (PRInt32 aWhichClipboard);
NS_IMETHOD GetNativeClipboardData (nsITransferable * aTransferable, PRInt32 aWhichClipboard);
};
#endif

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

@ -929,7 +929,6 @@ nsDataObj :: GetFileDescriptor ( FORMATETC& aFE, STGMEDIUM& aSTG, PRBool aIsUnic
NS_WARNING ( "Not yet implemented\n" );
return res;
} // GetFileDescriptor
@ -1074,7 +1073,6 @@ GetLocalizedString(const PRUnichar * aName, nsXPIDLString & aString)
HRESULT
nsDataObj :: GetFileDescriptorInternetShortcutA ( FORMATETC& aFE, STGMEDIUM& aSTG )
{
// get the title of the shortcut
nsAutoString title;
if ( NS_FAILED(ExtractShortcutTitle(title)) )

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

@ -53,6 +53,12 @@
#include "nsNativeCharsetUtils.h"
#ifndef SND_PURGE
// Not available on Windows CE, and according to MSDN
// doesn't do anything on recent windows either.
#define SND_PURGE 0
#endif
NS_IMPL_ISUPPORTS2(nsSound, nsISound, nsIStreamLoaderObserver)
@ -68,8 +74,8 @@ nsSound::~nsSound()
void nsSound::PurgeLastSound() {
if (mLastSound) {
// Purge the current sound buffer.
::PlaySound(nsnull, nsnull, SND_PURGE); // This call halts the sound if it was still playing.
// Halt any currently playing sound.
::PlaySound(nsnull, nsnull, SND_PURGE);
// Now delete the buffer.
free(mLastSound);
@ -154,7 +160,7 @@ NS_IMETHODIMP nsSound::Init()
// it is initialized.
// If we wait until the first sound is played, there will
// be a time lag as the library gets loaded.
::PlaySound(nsnull, nsnull, SND_PURGE);
::PlaySound(nsnull, nsnull, SND_PURGE);
return NS_OK;
}