Reviewed by Adam Roben.
[WIN] Use WCHAR instead of TCHAR
https://bugs.webkit.org/show_bug.cgi?id=53863
We always use the UNICODE versions of windows functions, so
the usage of TCHAR makes no sense and mixing them is bad style.
* platform/graphics/win/IconWin.cpp:
(WebCore::Icon::createIconForFiles):
* platform/graphics/win/QTMovie.cpp:
* platform/graphics/win/QTMovieGWorld.cpp:
(QTMovieGWorld::fullscreenWndProc):
(QTMovieGWorld::enterFullscreen):
* platform/graphics/win/SimpleFontDataCGWin.cpp:
(WebCore::SimpleFontData::platformInit):
* platform/graphics/win/SimpleFontDataCairoWin.cpp:
* platform/graphics/win/SimpleFontDataWin.cpp:
* platform/graphics/wince/SimpleFontDataWinCE.cpp:
* platform/win/BString.cpp:
* platform/win/ClipboardWin.cpp:
(WebCore::filesystemPathFromUrlOrTitle):
(WebCore::createGlobalHDropContent):
(WebCore::createGlobalImageFileDescriptor):
* platform/win/ContextMenuWin.cpp:
* platform/win/CursorWin.cpp:
(WebCore::loadSharedCursor):
* platform/win/FileChooserWin.cpp:
(WebCore::FileChooser::basenameForWidth):
* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenuWin::popupClassName):
(WebCore::PopupMenuWin::show):
* platform/win/PopupMenuWin.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77775
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-02-06 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ [WIN] Use WCHAR instead of TCHAR
+ https://bugs.webkit.org/show_bug.cgi?id=53863
+
+ We always use the UNICODE versions of windows functions, so
+ the usage of TCHAR makes no sense and mixing them is bad style.
+
+ * platform/graphics/win/IconWin.cpp:
+ (WebCore::Icon::createIconForFiles):
+ * platform/graphics/win/QTMovie.cpp:
+ * platform/graphics/win/QTMovieGWorld.cpp:
+ (QTMovieGWorld::fullscreenWndProc):
+ (QTMovieGWorld::enterFullscreen):
+ * platform/graphics/win/SimpleFontDataCGWin.cpp:
+ (WebCore::SimpleFontData::platformInit):
+ * platform/graphics/win/SimpleFontDataCairoWin.cpp:
+ * platform/graphics/win/SimpleFontDataWin.cpp:
+ * platform/graphics/wince/SimpleFontDataWinCE.cpp:
+ * platform/win/BString.cpp:
+ * platform/win/ClipboardWin.cpp:
+ (WebCore::filesystemPathFromUrlOrTitle):
+ (WebCore::createGlobalHDropContent):
+ (WebCore::createGlobalImageFileDescriptor):
+ * platform/win/ContextMenuWin.cpp:
+ * platform/win/CursorWin.cpp:
+ (WebCore::loadSharedCursor):
+ * platform/win/FileChooserWin.cpp:
+ (WebCore::FileChooser::basenameForWidth):
+ * platform/win/PopupMenuWin.cpp:
+ (WebCore::PopupMenuWin::popupClassName):
+ (WebCore::PopupMenuWin::show):
+ * platform/win/PopupMenuWin.h:
+
2011-02-06 Patrick Gansterer <paroga@webkit.org>
Reviewed by Andreas Kling.
#include "GraphicsContext.h"
#include "LocalWindowsContext.h"
#include "PlatformString.h"
-#include <tchar.h>
#include <windows.h>
#if OS(WINCE)
#if OS(WINCE)
return 0;
#else
- TCHAR buffer[MAX_PATH];
- UINT length = ::GetSystemDirectory(buffer, WTF_ARRAY_LENGTH(buffer));
+ WCHAR buffer[MAX_PATH];
+ UINT length = ::GetSystemDirectoryW(buffer, WTF_ARRAY_LENGTH(buffer));
if (!length)
return 0;
-
- if (_tcscat_s(buffer, TEXT("\\shell32.dll")))
+
+ if (wcscat_s(buffer, L"\\shell32.dll"))
return 0;
HICON hIcon;
- if (!::ExtractIconEx(buffer, shell32MultipleFileIconIndex, 0, &hIcon, 1))
+ if (!::ExtractIconExW(buffer, shell32MultipleFileIconIndex, 0, &hIcon, 1))
return 0;
return adoptRef(new Icon(hIcon));
#endif
static const long mpeg4ObjectDescriptionTrackType = 'odsm';
static const long mpeg4SceneDescriptionTrackType = 'sdsm';
static const long closedCaptionDisplayPropertyID = 'disp';
-static LPCTSTR fullscreenQTMoviePointerProp = TEXT("fullscreenQTMoviePointer");
// Resizing GWorlds is slow, give them a minimum size so size of small
// videos can be animated smoothly
static const long minimumQuickTimeVersion = 0x07300000; // 7.3
-static LPCTSTR fullscreenQTMovieGWorldPointerProp = TEXT("fullscreenQTMovieGWorldPointer");
+static LPCWSTR fullscreenQTMovieGWorldPointerProp = L"fullscreenQTMovieGWorldPointer";
// Resizing GWorlds is slow, give them a minimum size so size of small
// videos can be animated smoothly
LRESULT QTMovieGWorld::fullscreenWndProc(HWND wnd, UINT message, WPARAM wParam, LPARAM lParam)
{
- QTMovieGWorld* movie = static_cast<QTMovieGWorld*>(GetProp(wnd, fullscreenQTMovieGWorldPointerProp));
+ QTMovieGWorld* movie = static_cast<QTMovieGWorld*>(GetPropW(wnd, fullscreenQTMovieGWorldPointerProp));
if (message == WM_DESTROY)
- RemoveProp(wnd, fullscreenQTMovieGWorldPointerProp);
+ RemovePropW(wnd, fullscreenQTMovieGWorldPointerProp);
if (!movie)
return DefWindowProc(wnd, message, wParam, lParam);
// Set the 'this' pointer on the HWND
HWND wnd = static_cast<HWND>(GetPortNativeWindow(m_private->m_fullscreenWindow));
- SetProp(wnd, fullscreenQTMovieGWorldPointerProp, static_cast<HANDLE>(this));
+ SetPropW(wnd, fullscreenQTMovieGWorldPointerProp, static_cast<HANDLE>(this));
return wnd;
}
#include "config.h"
#include "SimpleFontData.h"
-#include <winsock2.h>
#include "Font.h"
#include "FontCache.h"
#include "FloatRect.h"
#include "FontDescription.h"
#include "PlatformString.h"
-#include <wtf/MathExtras.h>
-#include <wtf/RetainPtr.h>
-#include <unicode/uchar.h>
-#include <unicode/unorm.h>
#include <ApplicationServices/ApplicationServices.h>
#include <WebKitSystemInterface/WebKitSystemInterface.h>
#include <mlang.h>
-#include <tchar.h>
+#include <unicode/uchar.h>
+#include <unicode/unorm.h>
+#include <winsock2.h>
+#include <wtf/MathExtras.h>
+#include <wtf/RetainPtr.h>
namespace WebCore {
HDC dc = GetDC(0);
HGDIOBJ oldFont = SelectObject(dc, m_platformData.hfont());
int faceLength = GetTextFace(dc, 0, 0);
- Vector<TCHAR> faceName(faceLength);
+ Vector<WCHAR> faceName(faceLength);
GetTextFace(dc, faceLength, faceName.data());
- m_isSystemFont = !_tcscmp(faceName.data(), _T("Lucida Grande"));
+ m_isSystemFont = !wcscmp(faceName.data(), L"Lucida Grande");
SelectObject(dc, oldFont);
ReleaseDC(0, dc);
// web standard. The AppKit adjustment of 20% is too big and is
// incorrectly added to line spacing, so we use a 15% adjustment instead
// and add it to the ascent.
- if (!_tcscmp(faceName.data(), _T("Times")) || !_tcscmp(faceName.data(), _T("Helvetica")) || !_tcscmp(faceName.data(), _T("Courier")))
+ if (!wcscmp(faceName.data(), L"Times") || !wcscmp(faceName.data(), L"Helvetica") || !wcscmp(faceName.data(), L"Courier"))
fAscent += floorf(((fAscent + fDescent) * 0.15f) + 0.5f);
}
}
#include <cairo.h>
#include <cairo-win32.h>
#include <mlang.h>
-#include <tchar.h>
#include <wtf/MathExtras.h>
namespace WebCore {
#include "config.h"
#include "SimpleFontData.h"
-#include <winsock2.h>
#include "Font.h"
#include "FontCache.h"
#include "FloatRect.h"
#include "FontDescription.h"
-#include <wtf/MathExtras.h>
+#include <mlang.h>
#include <unicode/uchar.h>
#include <unicode/unorm.h>
-#include <mlang.h>
-#include <tchar.h>
+#include <winsock2.h>
+#include <wtf/MathExtras.h>
#if PLATFORM(CG)
#include <ApplicationServices/ApplicationServices.h>
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
#include "config.h"
#include "SimpleFontData.h"
#include "Font.h"
#include "FontCache.h"
#include "FontDescription.h"
-#include <wtf/MathExtras.h>
#include <mlang.h>
-#include <tchar.h>
+#include <wtf/MathExtras.h>
namespace WebCore {
#include "KURL.h"
#include "PlatformString.h"
-#include <wtf/text/AtomicString.h>
-#include <tchar.h>
#include <windows.h>
+#include <wtf/text/AtomicString.h>
#if PLATFORM(CF)
#include <CoreFoundation/CoreFoundation.h>
const UniChar* uniChars = CFStringGetCharactersPtr(cfstr);
if (uniChars) {
- m_bstr = SysAllocStringLen((LPCTSTR)uniChars, CFStringGetLength(cfstr));
+ m_bstr = SysAllocStringLen((LPCWSTR)uniChars, CFStringGetLength(cfstr));
return;
}
return true;
if (!(BSTR)a || !(BSTR)b)
return false;
- return !_tcscmp((BSTR)a, (BSTR)b);
+ return !wcscmp((BSTR)a, (BSTR)b);
}
bool operator !=(const BString& a, const BString& b)
return true;
if (!(BSTR)a || !b)
return false;
- return !_tcscmp((BSTR)a, b);
+ return !wcscmp((BSTR)a, b);
}
bool operator !=(const BString& a, BSTR b)
return true;
if (!a || !(BSTR)b)
return false;
- return !_tcscmp(a, (BSTR)b);
+ return !wcscmp(a, (BSTR)b);
}
bool operator !=(BSTR a, const BString& b)
}
#endif
-static String filesystemPathFromUrlOrTitle(const String& url, const String& title, TCHAR* extension, bool isLink)
+static String filesystemPathFromUrlOrTitle(const String& url, const String& title, const UChar* extension, bool isLink)
{
#if OS(WINCE)
notImplemented();
}
String result(static_cast<UChar*>(fsPathBuffer));
- result += String(static_cast<UChar*>(extension));
+ result += String(extension);
return result;
#endif
}
// windows does not enjoy a leading slash on paths
if (localPath[0] == '/')
localPath = localPath.substring(1);
- LPCTSTR localPathStr = localPath.charactersWithNullTermination();
+ LPCWSTR localPathStr = localPath.charactersWithNullTermination();
if (wcslen(localPathStr) + 1 < MAX_PATH)
wcscpy_s(filePath, MAX_PATH, localPathStr);
else
return 0;
}
extension.insert(".", 0);
- fsPath = filesystemPathFromUrlOrTitle(url, preferredTitle, (TCHAR*)extension.charactersWithNullTermination(), false);
+ fsPath = filesystemPathFromUrlOrTitle(url, preferredTitle, extension.charactersWithNullTermination(), false);
if (fsPath.length() <= 0) {
GlobalUnlock(memObj);
#include "FrameView.h"
#include "Node.h"
#include "NotImplemented.h"
-#include <tchar.h>
#include <windows.h>
#include <wtf/Vector.h>
#include <wtf/text/CString.h>
return impl.release();
}
-static PassRefPtr<SharedCursor> loadSharedCursor(HINSTANCE hInstance, LPCTSTR lpCursorName)
+static PassRefPtr<SharedCursor> loadSharedCursor(HINSTANCE hInstance, LPCWSTR lpCursorName)
{
- return SharedCursor::create(::LoadCursor(hInstance, lpCursorName));
+ return SharedCursor::create(::LoadCursorW(hInstance, lpCursorName));
}
static PassRefPtr<SharedCursor> loadCursorByName(char* name, int x, int y)
#include "LocalizedStrings.h"
#include "StringTruncator.h"
#include <shlwapi.h>
-#include <tchar.h>
#include <windows.h>
namespace WebCore {
string = fileButtonNoFileSelectedLabel();
else if (m_filenames.size() == 1) {
String tmpFilename = m_filenames[0];
- LPTSTR basename = PathFindFileName(tmpFilename.charactersWithNullTermination());
+ LPWSTR basename = PathFindFileNameW(tmpFilename.charactersWithNullTermination());
string = String(basename);
} else
return StringTruncator::rightTruncate(String::number(m_filenames.size()) + " files", width, font, false);
#include "SimpleFontData.h"
#include "TextRun.h"
#include "WebCoreInstanceHandle.h"
-#include <tchar.h>
#include <windows.h>
#include <windowsx.h>
#if OS(WINCE)
const int optionSpacingMiddle = 1;
const int popupWindowBorderWidth = 1;
-static LPCTSTR kPopupWindowClassName = _T("PopupWindowClass");
+static LPCWSTR kPopupWindowClassName = L"PopupWindowClass";
// This is used from within our custom message pump when we want to send a
// message to the web view and not have our message stolen and sent to
m_popupClient = 0;
}
-LPCTSTR PopupMenuWin::popupClassName()
+LPCWSTR PopupMenuWin::popupClassName()
{
return kPopupWindowClassName;
}
DWORD exStyle = WS_EX_LTRREADING;
- m_popup = ::CreateWindowEx(exStyle, kPopupWindowClassName, _T("PopupMenu"),
+ m_popup = ::CreateWindowExW(exStyle, kPopupWindowClassName, L"PopupMenu",
WS_POPUP | WS_BORDER,
m_windowRect.x(), m_windowRect.y(), m_windowRect.width(), m_windowRect.height(),
hostWindow, 0, WebCore::instanceHandle(), this);
virtual void updateFromElement();
virtual void disconnectClient();
- static LPCTSTR popupClassName();
+ static LPCWSTR popupClassName();
private:
PopupMenuClient* client() const { return m_popupClient; }