* Fixes some build problems when trying to build non-static. (removing link

libraries that don't exist on Windows CE)

* Taking xxx advice and making GetNAME always return a GDI forcing us to use
GetTextMetrics instead of GetFontData (which doesn't exist on Windows CE)

* Windows CE on ARM doesn't support C++ exceptions.  In the windows plugin code
uses catches to ensure that the plugins don't crash mozilla.  On windows ce on
arm, we have no choice but to disable CALL_SAFETY_ON.

* On Windows CE, VerQueryValue internal structure can not be modified so
callers must do a bit of string conversion.

* Disabling more code in nsOSHelperAppService for Windows CE.

* Enabling the Windows Registry code in XPCOM since the Window CE shunt now
supports the limited set needed (all but notification).

Bug=297683, r=Ere Maijala, sr=Dan Veditz, a=Asa


git-svn-id: svn://10.0.0.236/trunk@174725 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dougt%meer.net
2005-06-16 21:20:45 +00:00
parent ccadd61505
commit 5ad50e9b43
8 changed files with 45 additions and 5 deletions

View File

@@ -101,7 +101,9 @@ LOCAL_INCLUDES = \
-I$(srcdir)/../shared \
$(NULL)
ifndef WINCE
_OS_LIBS = winspool comdlg32
endif
ifdef GNU_CC
_OS_LIBS += gdi32
endif

View File

@@ -626,6 +626,10 @@ enum eGetNameError
static eGetNameError
GetNAME(HDC aDC, nsString* aName, PRBool* aIsSymbolEncoding = nsnull)
{
#ifdef WINCE
return eGetName_GDIError;
#else
DWORD len = GetFontData(aDC, NAME, 0, nsnull, 0);
if (len == GDI_ERROR) {
TEXTMETRIC metrics;
@@ -692,6 +696,7 @@ GetNAME(HDC aDC, nsString* aName, PRBool* aIsSymbolEncoding = nsnull)
}
return eGetName_OK;
#endif
}
static PLHashNumber
@@ -2733,6 +2738,16 @@ nsFontMetricsWin::FindSubstituteFont(HDC aDC, PRUint32 c)
}
else if (res == eGetName_GDIError) { // Bitmap font
// alright, was treated as unicode font in GetCCMAP()
#ifdef WINCE
name.AssignWithConversion(font->mName);
font = LoadSubstituteFont(aDC, name);
if (font) {
((nsFontWinSubstitute*)font)->SetRepresentable(c);
mSubstituteFont = font;
return font;
}
#endif
}
else {
continue;

View File

@@ -43,7 +43,7 @@
#include "nsIPrefBranch.h"
#include "nsIPrefService.h"
#ifdef XP_WIN
#if defined(XP_WIN) && !defined(WINCE)
#define CALL_SAFETY_ON
#endif

View File

@@ -68,9 +68,18 @@ static char* GetKeyValue(char* verbuf, char* key)
(void **)&buf, &blen);
if(buf != NULL)
return PL_strdup(buf);
else
return nsnull;
{
#ifdef WINCE
// On windows CE, the verbuf is wide and the shunt
// layer can't do much about it. So, here we
// convert the wide string.
return PL_strdup(NS_ConvertUCS2toUTF8((PRUnichar*)buf).get());
#else
return PL_strdup(buf);
#endif
}
return nsnull;
}
static PRUint32 CalculateVariantCount(char* mimeTypes)

View File

@@ -76,11 +76,16 @@ FORCE_USE_PIC = 1
NO_DIST_INSTALL = 1
NO_INSTALL = 1
ifndef WINCE
ENABLE_CXX_EXCEPTIONS = 1
endif
include $(topsrcdir)/config/rules.mk
ifndef WINCE
_OS_LIBS = version
endif
ifdef GNU_CC
_OS_LIBS += gdi32
endif

View File

@@ -375,6 +375,9 @@ nsresult
nsOSHelperAppService::GetDefaultAppInfo(nsAString& aTypeName, nsAString& aDefaultDescription,
nsIFile** aDefaultApplication)
{
#ifdef WINCE
return NS_ERROR_NOT_IMPLEMENTED;
#else
// If all else fails, use the file type key name, which will be
// something like "pngfile" for .pngs, "WMVFile" for .wmvs, etc.
aDefaultDescription = aTypeName;
@@ -486,6 +489,7 @@ nsOSHelperAppService::GetDefaultAppInfo(nsAString& aTypeName, nsAString& aDefaul
}
return NS_OK;
#endif
}
already_AddRefed<nsMIMEInfoWin> nsOSHelperAppService::GetByExtension(const nsAFlatString& aFileExt, const char *aTypeHint)

View File

@@ -164,7 +164,7 @@ SDK_XPIDLSRCS = \
nsISupportsPrimitives.idl \
$(NULL)
ifeq ($(OS_ARCH),WINNT)
ifneq (,$(filter WINNT WINCE,$(OS_ARCH)))
CPPSRCS += nsWindowsRegKey.cpp
XPIDLSRCS += nsIWindowsRegKey.idl
EXPORTS += nsWindowsRegKey.h

View File

@@ -646,6 +646,10 @@ nsWindowsRegKey::WriteBinaryValue(const nsAString &name, const nsACString &value
NS_IMETHODIMP
nsWindowsRegKey::StartWatching(PRBool recurse)
{
#ifdef WINCE
return NS_ERROR_NOT_IMPLEMENTED;
#else
NS_ENSURE_TRUE(mKey, NS_ERROR_NOT_INITIALIZED);
if (mWatchEvent)
@@ -670,6 +674,7 @@ nsWindowsRegKey::StartWatching(PRBool recurse)
mWatchRecursive = recurse;
return NS_OK;
#endif
}
NS_IMETHODIMP