draglist: unicodification
Dimitrie O. Paun
dpaun at rogers.com
Wed Mar 2 14:59:30 CST 2005
ChangeLog
Unicodification. Small cleanups.
Index: include/commctrl.h
===================================================================
RCS file: /var/cvs/wine/include/commctrl.h,v
retrieving revision 1.142
diff -u -r1.142 commctrl.h
--- include/commctrl.h 21 Feb 2005 18:28:30 -0000 1.142
+++ include/commctrl.h 2 Mar 2005 20:51:23 -0000
@@ -367,7 +367,17 @@
#define DL_COPYCURSOR 2
#define DL_MOVECURSOR 3
-#define DRAGLISTMSGSTRING TEXT("commctrl_DragListMsg")
+#define DRAGLISTMSGSTRINGA "commctrl_DragListMsg"
+#if defined(__GNUC__)
+# define DRAGLISTMSGSTRINGW (const WCHAR []){ 'c','o','m','m','c','t','r','l', \
+ '_','D','r','a','g','L','i','s','t','M','s','g',0 }
+#elif defined(_MSC_VER)
+# define DRAGLISTMSGSTRINGW L"commctrl_DragListMsg"
+#else
+static const WCHAR DRAGLISTMSGSTRINGW[] = { 'c','o','m','m','c','t','r','l', \
+ '_','D','r','a','g','L','i','s','t','M','s','g',0 };
+#endif
+#define DRAGLISTMSGSTRING WINELIB_NAME_AW(DRAGLISTMSGSTRING)
BOOL WINAPI MakeDragList (HWND);
VOID WINAPI DrawInsert (HWND, HWND, INT);
Index: dlls/comctl32/draglist.c
===================================================================
RCS file: /var/cvs/wine/dlls/comctl32/draglist.c,v
retrieving revision 1.20
diff -u -r1.20 draglist.c
--- dlls/comctl32/draglist.c 14 Sep 2004 01:06:11 -0000 1.20
+++ dlls/comctl32/draglist.c 2 Mar 2005 20:54:30 -0000
@@ -42,10 +42,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(commctrl);
-/* for compiler compatibility we only accept literal ASCII strings */
-#undef TEXT
-#define TEXT(string) string
-
#define DRAGLIST_SUBCLASSID 0
#define DRAGLIST_SCROLLPERIOD 200
#define DRAGLIST_TIMERID 666
@@ -95,7 +91,7 @@
}
/* cleans up after dragging */
-static inline void DragList_EndDrag(HWND hwnd, DRAGLISTDATA * data)
+static void DragList_EndDrag(HWND hwnd, DRAGLISTDATA * data)
{
KillTimer(hwnd, DRAGLIST_TIMERID);
ReleaseCapture();
@@ -207,12 +203,12 @@
*/
BOOL WINAPI MakeDragList (HWND hwndLB)
{
- DRAGLISTDATA * data = Alloc(sizeof(DRAGLISTDATA));
+ DRAGLISTDATA *data = Alloc(sizeof(DRAGLISTDATA));
TRACE("(%p)\n", hwndLB);
if (!uDragListMessage)
- uDragListMessage = RegisterWindowMessageA(DRAGLISTMSGSTRING);
+ uDragListMessage = RegisterWindowMessageW(DRAGLISTMSGSTRINGW);
return SetWindowSubclass(hwndLB, DragList_SubclassWindowProc, DRAGLIST_SUBCLASSID, (DWORD_PTR)data);
}
@@ -301,14 +297,14 @@
ScreenToClient (hwndLB, &pt);
GetClientRect (hwndLB, &rcClient);
- nIndex = (INT)SendMessageA (hwndLB, LB_GETTOPINDEX, 0, 0);
+ nIndex = (INT)SendMessageW (hwndLB, LB_GETTOPINDEX, 0, 0);
if (PtInRect (&rcClient, pt))
{
/* point is inside -- get the item index */
while (TRUE)
{
- if (SendMessageA (hwndLB, LB_GETITEMRECT, nIndex, (LPARAM)&rcClient) == LB_ERR)
+ if (SendMessageW (hwndLB, LB_GETITEMRECT, nIndex, (LPARAM)&rcClient) == LB_ERR)
return -1;
if (PtInRect (&rcClient, pt))
@@ -338,7 +334,7 @@
dwLastScrollTime = dwScrollTime;
- SendMessageA (hwndLB, LB_SETTOPINDEX, (WPARAM)nIndex, 0);
+ SendMessageW (hwndLB, LB_SETTOPINDEX, (WPARAM)nIndex, 0);
}
return -1;
--
Dimi.
More information about the wine-patches
mailing list