Commit 8d2933d3 authored by Eric Kohl's avatar Eric Kohl Committed by Alexandre Julliard

Added Unicode support (at least partially).

parent f9d92882
......@@ -83,21 +83,21 @@ TOOLBAR_DrawString (TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr,
if (!(nState & TBSTATE_ENABLED)) {
clrOld = SetTextColor32 (hdc, GetSysColor32 (COLOR_3DHILIGHT));
OffsetRect32 (&rcText, 1, 1);
DrawText32A (hdc, infoPtr->strings[btnPtr->iString], -1,
DrawText32W (hdc, infoPtr->strings[btnPtr->iString], -1,
&rcText, infoPtr->dwDTFlags);
SetTextColor32 (hdc, GetSysColor32 (COLOR_3DSHADOW));
OffsetRect32 (&rcText, -1, -1);
DrawText32A (hdc, infoPtr->strings[btnPtr->iString], -1,
DrawText32W (hdc, infoPtr->strings[btnPtr->iString], -1,
&rcText, infoPtr->dwDTFlags);
}
else if (nState & TBSTATE_INDETERMINATE) {
clrOld = SetTextColor32 (hdc, GetSysColor32 (COLOR_3DSHADOW));
DrawText32A (hdc, infoPtr->strings[btnPtr->iString], -1,
DrawText32W (hdc, infoPtr->strings[btnPtr->iString], -1,
&rcText, infoPtr->dwDTFlags);
}
else {
clrOld = SetTextColor32 (hdc, GetSysColor32 (COLOR_BTNTEXT));
DrawText32A (hdc, infoPtr->strings[btnPtr->iString], -1,
DrawText32W (hdc, infoPtr->strings[btnPtr->iString], -1,
&rcText, infoPtr->dwDTFlags);
}
......@@ -292,8 +292,8 @@ TOOLBAR_CalcStrings (WND *wndPtr, LPSIZE32 lpSize)
if (!(btnPtr->fsState & TBSTATE_HIDDEN) &&
(btnPtr->iString > -1) &&
(btnPtr->iString < infoPtr->nNumStrings)) {
LPSTR lpText = infoPtr->strings[btnPtr->iString];
GetTextExtentPoint32A (hdc, lpText, lstrlen32A(lpText), &sz);
LPWSTR lpText = infoPtr->strings[btnPtr->iString];
GetTextExtentPoint32W (hdc, lpText, lstrlen32W (lpText), &sz);
if (sz.cx > lpSize->cx)
lpSize->cx = sz.cx;
if (sz.cy > lpSize->cy)
......@@ -753,27 +753,28 @@ TOOLBAR_AddString32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
nIndex = infoPtr->nNumStrings;
if (infoPtr->nNumStrings == 0) {
infoPtr->strings =
COMCTL32_Alloc (sizeof(char *));
COMCTL32_Alloc (sizeof(LPWSTR));
}
else {
char **oldStrings = infoPtr->strings;
LPWSTR *oldStrings = infoPtr->strings;
infoPtr->strings =
COMCTL32_Alloc (sizeof(char *) * (infoPtr->nNumStrings + 1));
COMCTL32_Alloc (sizeof(LPWSTR) * (infoPtr->nNumStrings + 1));
memcpy (&infoPtr->strings[0], &oldStrings[0],
sizeof(char *) * infoPtr->nNumStrings);
sizeof(LPWSTR) * infoPtr->nNumStrings);
COMCTL32_Free (oldStrings);
}
infoPtr->strings[infoPtr->nNumStrings] =
COMCTL32_Alloc (sizeof(char)*(len+1));
lstrcpy32A (infoPtr->strings[infoPtr->nNumStrings], szString);
COMCTL32_Alloc (sizeof(WCHAR)*(len+1));
lstrcpyAtoW (infoPtr->strings[infoPtr->nNumStrings], szString);
infoPtr->nNumStrings++;
}
else {
char *p = (char*)lParam;
LPSTR p = (LPSTR)lParam;
INT32 len;
if (p == NULL) return -1;
if (p == NULL)
return -1;
TRACE (toolbar, "adding string(s) from array!\n");
nIndex = infoPtr->nNumStrings;
while (*p) {
......@@ -782,20 +783,20 @@ TOOLBAR_AddString32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
if (infoPtr->nNumStrings == 0) {
infoPtr->strings =
COMCTL32_Alloc (sizeof(char *));
COMCTL32_Alloc (sizeof(LPWSTR));
}
else {
char **oldStrings = infoPtr->strings;
LPWSTR *oldStrings = infoPtr->strings;
infoPtr->strings =
COMCTL32_Alloc (sizeof(char *) * (infoPtr->nNumStrings + 1));
COMCTL32_Alloc (sizeof(LPWSTR) * (infoPtr->nNumStrings + 1));
memcpy (&infoPtr->strings[0], &oldStrings[0],
sizeof(char *) * infoPtr->nNumStrings);
sizeof(LPWSTR) * infoPtr->nNumStrings);
COMCTL32_Free (oldStrings);
}
infoPtr->strings[infoPtr->nNumStrings] =
COMCTL32_Alloc (sizeof(char)*(len+1));
lstrcpy32A (infoPtr->strings[infoPtr->nNumStrings], p);
COMCTL32_Alloc (sizeof(WCHAR)*(len+1));
lstrcpyAtoW (infoPtr->strings[infoPtr->nNumStrings], p);
infoPtr->nNumStrings++;
p += (len+1);
......@@ -806,7 +807,76 @@ TOOLBAR_AddString32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
}
// << TOOLBAR_AddString32W >>
static LRESULT
TOOLBAR_AddString32W (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
INT32 nIndex;
if ((wParam) && (HIWORD(lParam) == 0)) {
WCHAR szString[256];
INT32 len;
TRACE (toolbar, "adding string from resource!\n");
len = LoadString32W ((HINSTANCE32)wParam, (UINT32)lParam,
szString, 256);
TRACE (toolbar, "len=%d \"%s\"\n", len, debugstr_w(szString));
nIndex = infoPtr->nNumStrings;
if (infoPtr->nNumStrings == 0) {
infoPtr->strings =
COMCTL32_Alloc (sizeof(LPWSTR));
}
else {
LPWSTR *oldStrings = infoPtr->strings;
infoPtr->strings =
COMCTL32_Alloc (sizeof(LPWSTR) * (infoPtr->nNumStrings + 1));
memcpy (&infoPtr->strings[0], &oldStrings[0],
sizeof(LPWSTR) * infoPtr->nNumStrings);
COMCTL32_Free (oldStrings);
}
infoPtr->strings[infoPtr->nNumStrings] =
COMCTL32_Alloc (sizeof(WCHAR)*(len+1));
lstrcpy32W (infoPtr->strings[infoPtr->nNumStrings], szString);
infoPtr->nNumStrings++;
}
else {
LPWSTR p = (LPWSTR)lParam;
INT32 len;
if (p == NULL)
return -1;
TRACE (toolbar, "adding string(s) from array!\n");
nIndex = infoPtr->nNumStrings;
while (*p) {
len = lstrlen32W (p);
TRACE (toolbar, "len=%d \"%s\"\n", len, debugstr_w(p));
if (infoPtr->nNumStrings == 0) {
infoPtr->strings =
COMCTL32_Alloc (sizeof(LPWSTR));
}
else {
LPWSTR *oldStrings = infoPtr->strings;
infoPtr->strings =
COMCTL32_Alloc (sizeof(LPWSTR) * (infoPtr->nNumStrings + 1));
memcpy (&infoPtr->strings[0], &oldStrings[0],
sizeof(LPWSTR) * infoPtr->nNumStrings);
COMCTL32_Free (oldStrings);
}
infoPtr->strings[infoPtr->nNumStrings] =
COMCTL32_Alloc (sizeof(WCHAR)*(len+1));
lstrcpy32W (infoPtr->strings[infoPtr->nNumStrings], p);
infoPtr->nNumStrings++;
p += (len+1);
}
}
return nIndex;
}
static LRESULT
......@@ -2055,7 +2125,7 @@ TOOLBAR_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
infoPtr->cxMax = -1;
infoPtr->bCaptured = FALSE;
infoPtr->bUnicode = FALSE;
infoPtr->bUnicode = IsWindowUnicode (wndPtr->hwndSelf);
infoPtr->nButtonDown = -1;
infoPtr->nOldHit = -1;
......@@ -2555,7 +2625,8 @@ ToolbarWindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
case TB_ADDSTRING32A:
return TOOLBAR_AddString32A (wndPtr, wParam, lParam);
// case TB_ADDSTRING32W:
case TB_ADDSTRING32W:
return TOOLBAR_AddString32W (wndPtr, wParam, lParam);
case TB_AUTOSIZE:
return TOOLBAR_AutoSize (wndPtr, wParam, lParam);
......
......@@ -141,7 +141,6 @@ typedef struct tagNMTOOLTIPSCREATED
#define SB_GETTEXTLENGTH32A (WM_USER+3)
#define SB_GETTEXTLENGTH32W (WM_USER+12)
#define SB_GETTEXTLENGTH WINELIB_NAME_AW(SB_GETTEXTLENGTH)
#define SB_SETPARTS (WM_USER+4)
#define SB_GETPARTS (WM_USER+6)
#define SB_GETBORDERS (WM_USER+7)
......@@ -158,6 +157,8 @@ typedef struct tagNMTOOLTIPSCREATED
#define SB_GETTIPTEXT WINELIB_NAME_AW(SB_GETTIPTEXT)
#define SB_GETICON (WM_USER+20)
#define SB_SETBKCOLOR CCM_SETBKCOLOR /* lParam = bkColor */
#define SB_GETUNICODEFORMAT CCM_GETUNICODEFORMAT
#define SB_SETUNICODEFORMAT CCM_SETUNICODEFORMAT
#define SBN_FIRST (0U-880U)
#define SBN_LAST (0U-899U)
......@@ -1160,11 +1161,11 @@ typedef struct tagNMTTDISPINFOW
#define RB_SETPALETTE (WM_USER+37)
#define RB_GETPALETTE (WM_USER+38)
#define RB_MOVEBAND (WM_USER+39)
#define RB_GETDROPTARGET CCS_GETDROPTARGET
#define RB_SETCOLORSCHEME CCS_SETCOLORSCHEME
#define RB_GETCOLORSCHEME CCS_GETCOLORSCHEME
#define RB_SETUNICODEFORMAT CCS_SETUNICODEFORMAT
#define RB_GETUNICODEFORMAT CCS_GETUNICODEFORMAT
#define RB_GETDROPTARGET CCM_GETDROPTARGET
#define RB_SETCOLORSCHEME CCM_SETCOLORSCHEME
#define RB_GETCOLORSCHEME CCM_GETCOLORSCHEME
#define RB_SETUNICODEFORMAT CCM_SETUNICODEFORMAT
#define RB_GETUNICODEFORMAT CCM_GETUNICODEFORMAT
#define RBN_FIRST (0U-831U)
#define RBN_LAST (0U-859U)
......@@ -1218,7 +1219,7 @@ typedef struct tagREBARBANDINFOW
UINT32 fStyle;
COLORREF clrFore;
COLORREF clrBack;
LPSTR lpText;
LPWSTR lpText;
UINT32 cch;
INT32 iImage;
HWND32 hwndChild;
......@@ -1248,7 +1249,7 @@ typedef REBARBANDINFO32W const *LPCREBARBANDINFO32W;
typedef struct tagNMREBARCHILDSIZE
{
NMHDR hdr;
UINT32 iBand;
UINT32 uBand;
UINT32 wID;
RECT32 rcChild;
RECT32 rcBand;
......@@ -2443,6 +2444,10 @@ LPVOID WINAPI DSA_GetItemPtr (const HDSA, INT32);
INT32 WINAPI DSA_InsertItem (const HDSA, INT32, LPVOID);
BOOL32 WINAPI DSA_SetItem (const HDSA, INT32, LPVOID);
typedef INT32 (CALLBACK *DSAENUMPROC)(LPVOID, DWORD);
VOID WINAPI DSA_EnumCallback (const HDSA, DSAENUMPROC, LPARAM);
BOOL32 WINAPI DSA_DestroyCallback (const HDSA, DSAENUMPROC, LPARAM);
/* Dynamic Pointer Array */
......@@ -2476,6 +2481,15 @@ BOOL32 WINAPI DPA_Sort (const HDPA, PFNDPACOMPARE, LPARAM);
INT32 WINAPI DPA_Search (const HDPA, LPVOID, INT32, PFNDPACOMPARE, LPARAM, UINT32);
#define DPAM_SORT 0x0001
BOOL32 WINAPI DPA_Merge (const HDPA, const HDPA, DWORD, PFNDPACOMPARE, LPVOID, LPARAM);
typedef INT32 (CALLBACK *DPAENUMPROC)(LPVOID, DWORD);
VOID WINAPI DPA_EnumCallback (const HDPA, DPAENUMPROC, LPARAM);
BOOL32 WINAPI DPA_DestroyCallback (const HDPA, DPAENUMPROC, LPARAM);
#define DPA_GetPtrCount(hdpa) (*(INT32*)(hdpa))
#define DPA_GetPtrPtr(hdpa) (*((LPVOID**)((BYTE*)(hdpa)+sizeof(INT32))))
#define DPA_FastGetPtr(hdpa,i) (DPA_GetPtrPtr(hdpa)[i])
......
......@@ -12,7 +12,7 @@ typedef struct
{
INT32 cxy;
HBITMAP32 hbm;
LPSTR pszText;
LPWSTR pszText;
INT32 fmt;
LPARAM lParam;
INT32 iImage;
......@@ -34,6 +34,7 @@ typedef struct
BOOL32 bCaptured; /* Is the mouse captured? */
BOOL32 bPressed; /* Is a header item pressed (down)? */
BOOL32 bTracking; /* Is in tracking mode? */
BOOL32 bUnicode; /* Unicode flag */
INT32 iMoveItem; /* index of tracked item. (Tracking mode) */
INT32 xTrackOffset; /* distance between the right side of the tracked item and the cursor */
INT32 xOldTrack; /* track offset (see above) after the last WM_MOUSEMOVE */
......
......@@ -35,6 +35,7 @@ typedef struct tagLISTVIEW_INFO
RECT32 rcList; /* "client" area of the list (without header) */
BOOL32 bFocus;
DWORD dwExStyle; /* extended listview style */
HDPA hdpaItems;
} LISTVIEW_INFO;
......
......@@ -8,7 +8,7 @@
/* to be implemented */
typedef LPVOID LPMESSAGEFILTER;
typedef LPVOID LPDROPTARGET;
typedef LPVOID LPMONIKER;
typedef struct tagMONIKER *LPMONIKER, IMoniker;
#define S_OK 0
#define S_FALSE 1
......
......@@ -34,7 +34,7 @@ typedef struct tagREBAR_BAND
RECT32 rcCapText; /* calculated caption text rectangle */
RECT32 rcChild; /* calculated child rectangle */
LPSTR lpText;
LPWSTR lpText;
HWND32 hwndPrevParent;
} REBAR_BAND;
......@@ -51,6 +51,7 @@ typedef struct tagREBAR_INFO
SIZE32 calcSize; /* calculated rebar size */
BOOL32 bAutoResize; /* auto resize deadlock flag */
BOOL32 bUnicode; /* Unicode flag */
HCURSOR32 hcurArrow; /* handle to the arrow cursor */
HCURSOR32 hcurHorz; /* handle to the EW cursor */
HCURSOR32 hcurVert; /* handle to the NS cursor */
......
......@@ -12,7 +12,7 @@ typedef struct
INT32 x;
INT32 style;
RECT32 bound;
LPSTR text;
LPWSTR text;
HICON32 hIcon;
} STATUSWINDOWPART;
......@@ -26,6 +26,7 @@ typedef struct
HFONT32 hFont;
HFONT32 hDefaultFont;
COLORREF clrBk; /* background color */
BOOL32 bUnicode; /* unicode flag */
STATUSWINDOWPART part0; /* simple window */
STATUSWINDOWPART *parts;
} STATUSWINDOWINFO;
......
......@@ -60,7 +60,7 @@ typedef struct tagTOOLBAR_INFO
RECT32 rcBound; /* bounding rectangle */
TBUTTON_INFO *buttons; /* pointer to button array */
CHAR **strings;
LPWSTR *strings; /* pointer to string array */
} TOOLBAR_INFO;
......
......@@ -23,14 +23,14 @@ typedef struct tagTTTOOL_INFO
UINT32 uId;
RECT32 rect;
HINSTANCE32 hinst;
LPSTR lpszText;
LPWSTR lpszText;
LPARAM lParam;
} TTTOOL_INFO;
typedef struct tagTOOLTIPS_INFO
{
CHAR szTipText[INFOTIPSIZE];
WCHAR szTipText[INFOTIPSIZE];
BOOL32 bActive;
BOOL32 bTrackActive;
UINT32 uNumTools;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment