Removed trailing whitespace.

oldstable
Vincent Béron 2002-05-31 23:06:46 +00:00 committed by Alexandre Julliard
parent 332d62ba10
commit 9a62491660
815 changed files with 22512 additions and 22512 deletions

View File

@ -225,7 +225,7 @@ static LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg,
set_button_state( hWnd, get_button_state( hWnd ) | BUTTON_BTNPRESSED );
}
break;
case WM_LBUTTONDBLCLK:
if(style & BS_NOTIFY ||
btn_type == BS_RADIOBUTTON ||
@ -342,7 +342,7 @@ static LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg,
if ((btn_type == BS_RADIOBUTTON || btn_type == BS_AUTORADIOBUTTON) && (GetCapture() != hWnd) &&
!(SendMessageW(hWnd, BM_GETCHECK, 0, 0) & BST_CHECKED))
{
/* The notification is sent when the button (BS_AUTORADIOBUTTON)
/* The notification is sent when the button (BS_AUTORADIOBUTTON)
is unchecked and the focus was not given by a mouse click. */
if (btn_type == BS_AUTORADIOBUTTON)
SendMessageW( hWnd, BM_SETCHECK, BUTTON_CHECKED, 0 );
@ -581,7 +581,7 @@ static UINT BUTTON_CalcLabelRect(HWND hwnd, HDC hdc, RECT *rc)
break;
default:
empty_rect:
empty_rect:
r.right = r.left;
r.bottom = r.top;
return (UINT)(LONG)-1;
@ -732,7 +732,7 @@ static void PB_Paint( HWND hwnd, HDC hDC, UINT action )
SetPixel( hDC, rc.right-1, rc.bottom-1, clr_wnd);
InflateRect( &rc, -1, -1 );
}
if (get_button_type(style) == BS_DEFPUSHBUTTON)
{
Rectangle(hDC, rc.left, rc.top, rc.right, rc.bottom);
@ -845,14 +845,14 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action )
if (!hBrush) /* did the app forget to call defwindowproc ? */
hBrush = DefWindowProcW( GetParent(hwnd), WM_CTLCOLORSTATIC, hDC, (LPARAM)hwnd );
if (style & BS_LEFTTEXT)
if (style & BS_LEFTTEXT)
{
/* magic +4 is what CTL3D expects */
rtext.right -= checkBoxWidth + 4;
rbox.left = rbox.right - checkBoxWidth;
}
else
else
{
rtext.left += checkBoxWidth + 4;
rbox.right = checkBoxWidth;
@ -860,7 +860,7 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action )
/* Draw the check-box bitmap */
if (action == ODA_DRAWENTIRE || action == ODA_SELECT)
{
{
/* Since WM_ERASEBKGND does nothing, first prepare background */
if (action == ODA_SELECT) FillRect( hDC, &rbox, hBrush );
else FillRect( hDC, &client, hBrush );
@ -905,10 +905,10 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action )
if (style & WS_DISABLED) flags |= DFCS_INACTIVE;
/* rbox must have the correct height */
/* rbox must have the correct height */
delta = rbox.bottom - rbox.top - checkBoxHeight;
if (delta > 0)
{
if (delta > 0)
{
int ofs = (abs(delta) / 2);
rbox.bottom -= ofs + 1;
rbox.top = rbox.bottom - checkBoxHeight;

View File

@ -1,8 +1,8 @@
/*
* Combo controls
*
*
* Copyright 1997 Alex Korobka
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@ -97,7 +97,7 @@ const struct builtin_class_descr COMBO_builtin_class =
static BOOL COMBO_Init()
{
HDC hDC;
if( hComboBmp ) return TRUE;
if( (hDC = CreateCompatibleDC(0)) )
{
@ -171,7 +171,7 @@ static LRESULT COMBO_NCDestroy( LPHEADCOMBO lphc )
{
TRACE("[%04x]: freeing storage\n", lphc->self);
if( (CB_GETTYPE(lphc) != CBS_SIMPLE) && lphc->hWndLBox )
if( (CB_GETTYPE(lphc) != CBS_SIMPLE) && lphc->hWndLBox )
DestroyWindow( lphc->hWndLBox );
SetWindowLongA( lphc->self, 0, 0 );
@ -183,9 +183,9 @@ static LRESULT COMBO_NCDestroy( LPHEADCOMBO lphc )
/***********************************************************************
* CBGetTextAreaHeight
*
* This method will calculate the height of the text area of the
* This method will calculate the height of the text area of the
* combobox.
* The height of the text area is set in two ways.
* The height of the text area is set in two ways.
* It can be set explicitly through a combobox message or through a
* WM_MEASUREITEM callback.
* If this is not the case, the height is set to 13 dialog units.
@ -207,19 +207,19 @@ static INT CBGetTextAreaHeight(
HDC hDC = GetDC(hwnd);
HFONT hPrevFont = 0;
INT baseUnitY;
if (lphc->hFont)
hPrevFont = SelectObject( hDC, lphc->hFont );
GetTextMetricsW(hDC, &tm);
baseUnitY = tm.tmHeight;
if( hPrevFont )
SelectObject( hDC, hPrevFont );
ReleaseDC(hwnd, hDC);
iTextItemHeight = ((13 * baseUnitY) / 8);
/*
@ -229,7 +229,7 @@ static INT CBGetTextAreaHeight(
*/
iTextItemHeight -= 2*COMBO_YBORDERSIZE();
}
/*
* Check the ownerdraw case if we haven't asked the parent the size
* of the item yet.
@ -246,9 +246,9 @@ static INT CBGetTextAreaHeight(
* We use the client rect for the width of the item.
*/
GetClientRect(hwnd, &clientRect);
lphc->wState &= ~CBF_MEASUREITEM;
/*
* Send a first one to measure the size of the text area
*/
@ -276,9 +276,9 @@ static INT CBGetTextAreaHeight(
SendMessageW(lphc->owner, WM_MEASUREITEM, id, (LPARAM)&measureItem);
lphc->fixedOwnerDrawHeight = measureItem.itemHeight;
}
/*
* Keep the size for the next time
* Keep the size for the next time
*/
lphc->editHeight = iTextItemHeight;
}
@ -300,7 +300,7 @@ static void CBForceDummyResize(
int newComboHeight;
newComboHeight = CBGetTextAreaHeight(lphc->self,lphc) + 2*COMBO_YBORDERSIZE();
GetWindowRect(lphc->self, &windowRect);
/*
@ -327,8 +327,8 @@ static void CBForceDummyResize(
static void CBCalcPlacement(
HWND hwnd,
LPHEADCOMBO lphc,
LPRECT lprEdit,
LPRECT lprButton,
LPRECT lprEdit,
LPRECT lprButton,
LPRECT lprLB)
{
/*
@ -354,7 +354,7 @@ static void CBCalcPlacement(
/*
* If the combobox is "simple" there is no button.
*/
if( CB_GETTYPE(lphc) == CBS_SIMPLE )
if( CB_GETTYPE(lphc) == CBS_SIMPLE )
lprButton->left = lprButton->right = lprButton->bottom = 0;
else
{
@ -366,7 +366,7 @@ static void CBCalcPlacement(
lprButton->left = lprButton->right - GetSystemMetrics(SM_CXVSCROLL);
lprEdit->right = lprButton->left;
}
/*
* In the case of a dropdown, there is an additional spacing between the
* text area and the button.
@ -383,7 +383,7 @@ static void CBCalcPlacement(
{
InflateRect(lprEdit, -EDIT_CONTROL_PADDING(), -EDIT_CONTROL_PADDING());
}
/*
* Adjust the size of the listbox popup.
*/
@ -410,7 +410,7 @@ static void CBCalcPlacement(
/*
* In the case of a dropdown, the popup listbox is offset to the right.
* so, we want to make sure it's flush with the right side of the
* so, we want to make sure it's flush with the right side of the
* combobox
*/
if( CB_GETTYPE(lphc) == CBS_DROPDOWN )
@ -422,11 +422,11 @@ static void CBCalcPlacement(
TRACE("\ttext\t= (%i,%i-%i,%i)\n",
lprEdit->left, lprEdit->top, lprEdit->right, lprEdit->bottom);
TRACE("\tbutton\t= (%i,%i-%i,%i)\n",
lprButton->left, lprButton->top, lprButton->right, lprButton->bottom);
TRACE("\tlbox\t= (%i,%i-%i,%i)\n",
TRACE("\tlbox\t= (%i,%i-%i,%i)\n",
lprLB->left, lprLB->top, lprLB->right, lprLB->bottom );
}
@ -437,7 +437,7 @@ static void CBGetDroppedControlRect( LPHEADCOMBO lphc, LPRECT lpRect)
{
/* In windows, CB_GETDROPPEDCONTROLRECT returns the upper left corner
of the combo box and the lower right corner of the listbox */
GetWindowRect(lphc->self, lpRect);
lpRect->right = lpRect->left + lphc->droppedRect.right - lphc->droppedRect.left;
@ -446,7 +446,7 @@ static void CBGetDroppedControlRect( LPHEADCOMBO lphc, LPRECT lpRect)
}
/***********************************************************************
* COMBO_WindowPosChanging
* COMBO_WindowPosChanging
*/
static LRESULT COMBO_WindowPosChanging(
HWND hwnd,
@ -459,7 +459,7 @@ static LRESULT COMBO_WindowPosChanging(
* always the same height. We have to make sure they are not resized
* to another value.
*/
if ( ( CB_GETTYPE(lphc) != CBS_SIMPLE ) &&
if ( ( CB_GETTYPE(lphc) != CBS_SIMPLE ) &&
((posChanging->flags & SWP_NOSIZE) == 0) )
{
int newComboHeight;
@ -547,7 +547,7 @@ static LRESULT COMBO_Create( HWND hwnd, LPHEADCOMBO lphc, HWND hwndParent, LONG
/* create listbox popup */
lbeStyle = (LBS_NOTIFY | WS_BORDER | WS_CLIPSIBLINGS | WS_CHILD) |
lbeStyle = (LBS_NOTIFY | WS_BORDER | WS_CLIPSIBLINGS | WS_CHILD) |
(style & (WS_VSCROLL | CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE));
if( lphc->dwStyle & CBS_SORT )
@ -558,7 +558,7 @@ static LRESULT COMBO_Create( HWND hwnd, LPHEADCOMBO lphc, HWND hwndParent, LONG
lbeStyle |= LBS_NOINTEGRALHEIGHT;
if( lphc->dwStyle & CBS_DISABLENOSCROLL )
lbeStyle |= LBS_DISABLENOSCROLL;
if( CB_GETTYPE(lphc) == CBS_SIMPLE ) /* child listbox */
{
lbeStyle |= WS_VISIBLE;
@ -576,12 +576,12 @@ static LRESULT COMBO_Create( HWND hwnd, LPHEADCOMBO lphc, HWND hwndParent, LONG
lphc->hWndLBox = CreateWindowExW(lbeExStyle,
clbName,
NULL,
lbeStyle,
lphc->droppedRect.left,
lphc->droppedRect.top,
lphc->droppedRect.right - lphc->droppedRect.left,
lphc->droppedRect.bottom - lphc->droppedRect.top,
NULL,
lbeStyle,
lphc->droppedRect.left,
lphc->droppedRect.top,
lphc->droppedRect.right - lphc->droppedRect.left,
lphc->droppedRect.bottom - lphc->droppedRect.top,
hwnd, (HMENU)ID_CB_LISTBOX,
GetWindowLongA( hwnd, GWL_HINSTANCE ), lphc );
@ -591,13 +591,13 @@ static LRESULT COMBO_Create( HWND hwnd, LPHEADCOMBO lphc, HWND hwndParent, LONG
lbeStyle = WS_CHILD | WS_VISIBLE | ES_NOHIDESEL | ES_LEFT | ES_COMBO;
/*
* In Win95 look, the border fo the edit control is
* In Win95 look, the border fo the edit control is
* provided by the combobox
*/
if (TWEAK_WineLook == WIN31_LOOK)
lbeStyle |= WS_BORDER;
if( lphc->wState & CBF_EDIT )
if( lphc->wState & CBF_EDIT )
{
if( lphc->dwStyle & CBS_OEMCONVERT )
lbeStyle |= ES_OEMCONVERT;
@ -611,18 +611,18 @@ static LRESULT COMBO_Create( HWND hwnd, LPHEADCOMBO lphc, HWND hwndParent, LONG
if (!IsWindowEnabled(hwnd)) lbeStyle |= WS_DISABLED;
lphc->hWndEdit = CreateWindowExW(0,
editName,
NULL,
editName,
NULL,
lbeStyle,
lphc->textRect.left, lphc->textRect.top,
lphc->textRect.left, lphc->textRect.top,
lphc->textRect.right - lphc->textRect.left,
lphc->textRect.bottom - lphc->textRect.top,
lphc->textRect.bottom - lphc->textRect.top,
hwnd, (HMENU)ID_CB_EDIT,
GetWindowLongA( hwnd, GWL_HINSTANCE ), NULL );
if( !lphc->hWndEdit )
bEdit = FALSE;
}
}
if( bEdit )
{
@ -630,7 +630,7 @@ static LRESULT COMBO_Create( HWND hwnd, LPHEADCOMBO lphc, HWND hwndParent, LONG
{
/* Now do the trick with parent */
SetParent(lphc->hWndLBox, HWND_DESKTOP);
/*
/*
* If the combo is a dropdown, we must resize the control
* to fit only the text area and button. To do this,
* we send a dummy resize and the WM_WINDOWPOSCHANGING message
@ -657,11 +657,11 @@ static LRESULT COMBO_Create( HWND hwnd, LPHEADCOMBO lphc, HWND hwndParent, LONG
* Paint combo button (normal, pressed, and disabled states).
*/
static void CBPaintButton(
LPHEADCOMBO lphc,
LPHEADCOMBO lphc,
HDC hdc,
RECT rectButton)
{
if( lphc->wState & CBF_NOREDRAW )
if( lphc->wState & CBF_NOREDRAW )
return;
if (TWEAK_WineLook == WIN31_LOOK)
@ -671,7 +671,7 @@ static void CBPaintButton(
HDC hMemDC;
HBRUSH hPrevBrush;
COLORREF oldTextColor, oldBkColor;
hPrevBrush = SelectObject(hdc, GetSysColorBrush(COLOR_BTNFACE));
@ -684,26 +684,26 @@ static void CBPaintButton(
rectButton.right-rectButton.left,
rectButton.bottom-rectButton.top,
PATCOPY );
if( (bBool = lphc->wState & CBF_BUTTONDOWN) )
{
DrawEdge( hdc, &rectButton, EDGE_SUNKEN, BF_RECT );
}
else
}
else
{
DrawEdge( hdc, &rectButton, EDGE_RAISED, BF_RECT );
}
/*
* Remove the edge of the button from the rectangle
* and calculate the position of the bitmap.
*/
InflateRect( &rectButton, -2, -2);
InflateRect( &rectButton, -2, -2);
x = (rectButton.left + rectButton.right - CBitWidth) >> 1;
y = (rectButton.top + rectButton.bottom - CBitHeight) >> 1;
hMemDC = CreateCompatibleDC( hdc );
SelectObject( hMemDC, hComboBmp );
oldTextColor = SetTextColor( hdc, GetSysColor(COLOR_BTNFACE) );
@ -732,7 +732,7 @@ static void CBPaintButton(
DrawFrameControl(hdc,
&rectButton,
DFC_SCROLL,
buttonState);
buttonState);
}
}
@ -742,7 +742,7 @@ static void CBPaintButton(
* Paint CBS_DROPDOWNLIST text field / update edit control contents.
*/
static void CBPaintText(
LPHEADCOMBO lphc,
LPHEADCOMBO lphc,
HDC hdc,
RECT rectEdit)
{
@ -753,7 +753,7 @@ static void CBPaintText(
TRACE("\n");
/* follow Windows combobox that sends a bunch of text
/* follow Windows combobox that sends a bunch of text
* inquiries to its listbox while processing WM_PAINT. */
if( (id = SendMessageW(lphc->hWndLBox, LB_GETCURSEL, 0, 0) ) != LB_ERR )
@ -774,7 +774,7 @@ static void CBPaintText(
{
static const WCHAR empty_stringW[] = { 0 };
if( CB_HASSTRINGS(lphc) ) SetWindowTextW( lphc->hWndEdit, pText ? pText : empty_stringW );
if( lphc->wState & CBF_FOCUSED )
if( lphc->wState & CBF_FOCUSED )
SendMessageW(lphc->hWndEdit, EM_SETSEL, 0, (LPARAM)(-1));
}
else /* paint text field ourselves */
@ -786,7 +786,7 @@ static void CBPaintText(
* Give ourselves some space.
*/
InflateRect( &rectEdit, -1, -1 );
if( CB_OWNERDRAWN(lphc) )
{
DRAWITEMSTRUCT dis;
@ -794,7 +794,7 @@ static void CBPaintText(
UINT ctlid = GetWindowLongA( lphc->self, GWL_ID );
/* setup state for DRAWITEM message. Owner will highlight */
if ( (lphc->wState & CBF_FOCUSED) &&
if ( (lphc->wState & CBF_FOCUSED) &&
!(lphc->wState & CBF_DROPPED) )
itemState |= ODS_SELECTED | ODS_FOCUS;
@ -804,7 +804,7 @@ static void CBPaintText(
* clip region.
*/
clipRegion = CreateRectRgnIndirect(&rectEdit);
if (GetClipRgn(hdc, clipRegion)!=1)
{
DeleteObject(clipRegion);
@ -821,9 +821,9 @@ static void CBPaintText(
dis.itemState = itemState;
dis.hDC = hdc;
dis.rcItem = rectEdit;
dis.itemData = SendMessageW(lphc->hWndLBox, LB_GETITEMDATA,
dis.itemData = SendMessageW(lphc->hWndLBox, LB_GETITEMDATA,
(WPARAM)id, 0 );
/*
* Clip the DC and have the parent draw the item.
*/
@ -836,33 +836,33 @@ static void CBPaintText(
/*
* Reset the clipping region.
*/
SelectClipRgn(hdc, clipRegion);
SelectClipRgn(hdc, clipRegion);
}
else
{
static const WCHAR empty_stringW[] = { 0 };
if ( (lphc->wState & CBF_FOCUSED) &&
if ( (lphc->wState & CBF_FOCUSED) &&
!(lphc->wState & CBF_DROPPED) ) {
/* highlight */
FillRect( hdc, &rectEdit, GetSysColorBrush(COLOR_HIGHLIGHT) );
SetBkColor( hdc, GetSysColor( COLOR_HIGHLIGHT ) );
SetTextColor( hdc, GetSysColor( COLOR_HIGHLIGHTTEXT ) );
}
ExtTextOutW( hdc,
rectEdit.left + 1,
}
ExtTextOutW( hdc,
rectEdit.left + 1,
rectEdit.top + 1,
ETO_OPAQUE | ETO_CLIPPED,
ETO_OPAQUE | ETO_CLIPPED,
&rectEdit,
pText ? pText : empty_stringW , size, NULL );
if(lphc->wState & CBF_FOCUSED && !(lphc->wState & CBF_DROPPED))
DrawFocusRect( hdc, &rectEdit );
}
if( hPrevFont )
if( hPrevFont )
SelectObject(hdc, hPrevFont );
}
if (pText)
@ -874,7 +874,7 @@ static void CBPaintText(
*/
static void CBPaintBorder(
HWND hwnd,
LPHEADCOMBO lphc,
LPHEADCOMBO lphc,
HDC hdc)
{
RECT clientRect;
@ -937,7 +937,7 @@ static HBRUSH COMBO_PrepareColors(
/*
* Catch errors.
*/
if( !hBkgBrush )
if( !hBkgBrush )
hBkgBrush = GetSysColorBrush(COLOR_WINDOW);
return hBkgBrush;
@ -947,7 +947,7 @@ static HBRUSH COMBO_PrepareColors(
* COMBO_EraseBackground
*/
static LRESULT COMBO_EraseBackground(
HWND hwnd,
HWND hwnd,
LPHEADCOMBO lphc,
HDC hParamDC)
{
@ -956,14 +956,14 @@ static LRESULT COMBO_EraseBackground(
if(lphc->wState & CBF_EDIT)
return TRUE;
hDC = (hParamDC) ? hParamDC
: GetDC(hwnd);
/*
* Retrieve the background brush
*/
hBkgBrush = COMBO_PrepareColors(lphc, hDC);
FillRect(hDC, &lphc->textRect, hBkgBrush);
if (!hParamDC)
@ -979,7 +979,7 @@ static LRESULT COMBO_Paint(LPHEADCOMBO lphc, HDC hParamDC)
{
PAINTSTRUCT ps;
HDC hDC;
hDC = (hParamDC) ? hParamDC
: BeginPaint( lphc->self, &ps);
@ -1019,7 +1019,7 @@ static LRESULT COMBO_Paint(LPHEADCOMBO lphc, HDC hParamDC)
FrameRect( hDC, &rPadEdit, GetSysColorBrush(COLOR_WINDOW) );
}
if( !(lphc->wState & CBF_EDIT) )
{
/*
@ -1028,8 +1028,8 @@ static LRESULT COMBO_Paint(LPHEADCOMBO lphc, HDC hParamDC)
if (TWEAK_WineLook == WIN31_LOOK)
{
HPEN hPrevPen = SelectObject( hDC, SYSCOLOR_GetPen(COLOR_WINDOWFRAME) );
Rectangle( hDC,
Rectangle( hDC,
lphc->textRect.left, lphc->textRect.top,
lphc->textRect.right - 1, lphc->textRect.bottom - 1);
@ -1043,7 +1043,7 @@ static LRESULT COMBO_Paint(LPHEADCOMBO lphc, HDC hParamDC)
SelectObject( hDC, hPrevBrush );
}
if( !hParamDC )
if( !hParamDC )
EndPaint(lphc->self, &ps);
return 0;
@ -1058,11 +1058,11 @@ static INT CBUpdateLBox( LPHEADCOMBO lphc, BOOL bSelect )
{
INT length, idx;
LPWSTR pText = NULL;
idx = LB_ERR;
length = SendMessageW( lphc->hWndEdit, WM_GETTEXTLENGTH, 0, 0 );
if( length > 0 )
if( length > 0 )
pText = HeapAlloc( GetProcessHeap(), 0, (length + 1) * sizeof(WCHAR));
TRACE("\t edit text length %i\n", length );
@ -1124,7 +1124,7 @@ static void CBUpdateEdit( LPHEADCOMBO lphc , INT index )
/***********************************************************************
* CBDropDown
*
*
* Show listbox popup.
*/
static void CBDropDown( LPHEADCOMBO lphc )
@ -1159,7 +1159,7 @@ static void CBDropDown( LPHEADCOMBO lphc )
/* now set popup position */
GetWindowRect( lphc->self, &rect );
/*
* If it's a dropdown, the listbox is offset
*/
@ -1193,14 +1193,14 @@ static void CBDropDown( LPHEADCOMBO lphc )
if( (rect.bottom + nDroppedHeight) >= GetSystemMetrics( SM_CYSCREEN ) )
rect.bottom = rect.top - nDroppedHeight;
SetWindowPos( lphc->hWndLBox, HWND_TOP, rect.left, rect.bottom,
SetWindowPos( lphc->hWndLBox, HWND_TOP, rect.left, rect.bottom,
lphc->droppedRect.right - lphc->droppedRect.left,
nDroppedHeight,
SWP_NOACTIVATE | SWP_SHOWWINDOW);
if( !(lphc->wState & CBF_NOREDRAW) )
RedrawWindow( lphc->self, NULL, 0, RDW_INVALIDATE |
RedrawWindow( lphc->self, NULL, 0, RDW_INVALIDATE |
RDW_ERASE | RDW_UPDATENOW | RDW_NOCHILDREN );
EnableWindow( lphc->hWndLBox, TRUE );
@ -1217,7 +1217,7 @@ static void CBRollUp( LPHEADCOMBO lphc, BOOL ok, BOOL bButton )
{
HWND hWnd = lphc->self;
TRACE("[%04x]: sel ok? [%i] dropped? [%i]\n",
TRACE("[%04x]: sel ok? [%i] dropped? [%i]\n",
lphc->self, (INT)ok, (INT)(lphc->wState & CBF_DROPPED));
CB_NOTIFY( lphc, (ok) ? CBN_SELENDOK : CBN_SELENDCANCEL );
@ -1225,7 +1225,7 @@ static void CBRollUp( LPHEADCOMBO lphc, BOOL ok, BOOL bButton )
if( IsWindow( hWnd ) && CB_GETTYPE(lphc) != CBS_SIMPLE )
{
if( lphc->wState & CBF_DROPPED )
if( lphc->wState & CBF_DROPPED )
{
RECT rect;
@ -1241,7 +1241,7 @@ static void CBRollUp( LPHEADCOMBO lphc, BOOL ok, BOOL bButton )
{
rect = lphc->buttonRect;
}
else
else
{
if( bButton )
{
@ -1256,7 +1256,7 @@ static void CBRollUp( LPHEADCOMBO lphc, BOOL ok, BOOL bButton )
}
if( bButton && !(lphc->wState & CBF_NOREDRAW) )
RedrawWindow( hWnd, &rect, 0, RDW_INVALIDATE |
RedrawWindow( hWnd, &rect, 0, RDW_INVALIDATE |
RDW_ERASE | RDW_UPDATENOW | RDW_NOCHILDREN );
CB_NOTIFY( lphc, CBN_CLOSEUP );
}
@ -1347,10 +1347,10 @@ static LRESULT COMBO_Command( LPHEADCOMBO lphc, WPARAM wParam, HWND hWnd )
/* ">> 8" makes gcc generate jump-table instead of cmp ladder */
switch( HIWORD(wParam) >> 8 )
{
{
case (EN_SETFOCUS >> 8):
TRACE("[%04x]: edit [%04x] got focus\n",
TRACE("[%04x]: edit [%04x] got focus\n",
lphc->self, lphc->hWndEdit );
COMBO_SetFocus( lphc );
@ -1363,7 +1363,7 @@ static LRESULT COMBO_Command( LPHEADCOMBO lphc, WPARAM wParam, HWND hWnd )
/* NOTE: it seems that Windows' edit control sends an
* undocumented message WM_USER + 0x1B instead of this
* notification (only when it happens to be a part of
* notification (only when it happens to be a part of
* the combo). ?? - AK.
*/
@ -1376,7 +1376,7 @@ static LRESULT COMBO_Command( LPHEADCOMBO lphc, WPARAM wParam, HWND hWnd )
* In some circumstances (when the selection of the combobox
* is changed for example) we don't wans the EN_CHANGE notification
* to be forwarded to the parent of the combobox. This code
* checks a flag that is set in these occasions and ignores the
* checks a flag that is set in these occasions and ignores the
* notification.
*/
if (lphc->wState & CBF_NOLBSELECT)
@ -1416,7 +1416,7 @@ static LRESULT COMBO_Command( LPHEADCOMBO lphc, WPARAM wParam, HWND hWnd )
case LBN_SELCHANGE:
case LBN_SELCANCEL:
TRACE("[%04x]: lbox selection change [%04x]\n",
TRACE("[%04x]: lbox selection change [%04x]\n",
lphc->self, lphc->wState );
if( HIWORD(wParam) == LBN_SELCHANGE)
@ -1433,7 +1433,7 @@ static LRESULT COMBO_Command( LPHEADCOMBO lphc, WPARAM wParam, HWND hWnd )
InvalidateRect(lphc->self, &lphc->textRect, TRUE);
}
/* do not roll up if selection is being tracked
/* do not roll up if selection is being tracked
* by arrowkeys in the dropdown listbox */
if( ((lphc->wState & CBF_DROPPED) && !(lphc->wState & CBF_NOROLLUP)) )
{
@ -1595,11 +1595,11 @@ static LRESULT COMBO_GetText( LPHEADCOMBO lphc, INT N, LPARAM lParam, BOOL unico
/***********************************************************************
* CBResetPos
*
* This function sets window positions according to the updated
* This function sets window positions according to the updated
* component placement struct.
*/
static void CBResetPos(
LPHEADCOMBO lphc,
LPHEADCOMBO lphc,
LPRECT rectEdit,
LPRECT rectLB,
BOOL bRedraw)
@ -1610,7 +1610,7 @@ static void CBResetPos(
* sizing messages */
if( lphc->wState & CBF_EDIT )
SetWindowPos( lphc->hWndEdit, 0,
SetWindowPos( lphc->hWndEdit, 0,
rectEdit->left, rectEdit->top,
rectEdit->right - rectEdit->left,
rectEdit->bottom - rectEdit->top,
@ -1618,8 +1618,8 @@ static void CBResetPos(
SetWindowPos( lphc->hWndLBox, 0,
rectLB->left, rectLB->top,
rectLB->right - rectLB->left,
rectLB->bottom - rectLB->top,
rectLB->right - rectLB->left,
rectLB->bottom - rectLB->top,
SWP_NOACTIVATE | SWP_NOZORDER | ((bDrop) ? SWP_NOREDRAW : 0) );
if( bDrop )
@ -1643,9 +1643,9 @@ static void CBResetPos(
static void COMBO_Size( LPHEADCOMBO lphc )
{
CBCalcPlacement(lphc->self,
lphc,
&lphc->textRect,
&lphc->buttonRect,
lphc,
&lphc->textRect,
&lphc->buttonRect,
&lphc->droppedRect);
CBResetPos( lphc, &lphc->textRect, &lphc->droppedRect, TRUE );
@ -1675,11 +1675,11 @@ static void COMBO_Font( LPHEADCOMBO lphc, HFONT hFont, BOOL bRedraw )
if ( CB_GETTYPE(lphc) == CBS_SIMPLE)
{
CBCalcPlacement(lphc->self,
lphc,
&lphc->textRect,
&lphc->buttonRect,
lphc,
&lphc->textRect,
&lphc->buttonRect,
&lphc->droppedRect);
CBResetPos( lphc, &lphc->textRect, &lphc->droppedRect, TRUE );
}
else
@ -1708,23 +1708,23 @@ static LRESULT COMBO_SetItemHeight( LPHEADCOMBO lphc, INT index, INT height )
if ( CB_GETTYPE(lphc) == CBS_SIMPLE)
{
CBCalcPlacement(lphc->self,
lphc,
&lphc->textRect,
&lphc->buttonRect,
lphc,
&lphc->textRect,
&lphc->buttonRect,
&lphc->droppedRect);
CBResetPos( lphc, &lphc->textRect, &lphc->droppedRect, TRUE );
}
else
{
CBForceDummyResize(lphc);
}
lRet = height;
}
}
}
else if ( CB_OWNERDRAWN(lphc) ) /* set listbox item height */
lRet = SendMessageW(lphc->hWndLBox, LB_SETITEMHEIGHT,
lRet = SendMessageW(lphc->hWndLBox, LB_SETITEMHEIGHT,
(WPARAM)index, (LPARAM)height );
return lRet;
}
@ -1833,10 +1833,10 @@ static void COMBO_MouseMove( LPHEADCOMBO lphc, WPARAM wParam, LPARAM lParam )
{
POINT pt;
RECT lbRect;
pt.x = LOWORD(lParam);
pt.y = HIWORD(lParam);
if( lphc->wState & CBF_BUTTONDOWN )
{
BOOL bButton;
@ -1878,23 +1878,23 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message,
hwnd, SPY_GetMsgName(message, hwnd), wParam, lParam );
if( lphc || message == WM_NCCREATE )
switch(message)
{
switch(message)
{
/* System messages */
case WM_NCCREATE:
case WM_NCCREATE:
{
LONG style = unicode ? ((LPCREATESTRUCTW)lParam)->style :
((LPCREATESTRUCTA)lParam)->style;
return COMBO_NCCreate(hwnd, style);
}
case WM_NCDESTROY:
case WM_NCDESTROY:
COMBO_NCDestroy(lphc);
break;/* -> DefWindowProc */
case WM_CREATE:
{
case WM_CREATE:
{
HWND hwndParent;
LONG style;
if(unicode)
@ -1942,7 +1942,7 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message,
*/
/* fall through */
case WM_SIZE:
if( lphc->hWndLBox &&
if( lphc->hWndLBox &&
!(lphc->wState & CBF_NORESIZE) ) COMBO_Size( lphc );
return TRUE;
case WM_SETFONT:
@ -1977,7 +1977,7 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message,
if (j == -1) return 0;
return SendMessageW(lphc->hWndLBox, LB_GETTEXTLEN, j, 0);
}
else if( lphc->wState & CBF_EDIT )
else if( lphc->wState & CBF_EDIT )
{
LRESULT ret;
lphc->wState |= CBF_NOEDITNOTIFY;
@ -1990,7 +1990,7 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message,
case WM_CUT:
case WM_PASTE:
case WM_COPY:
if( lphc->wState & CBF_EDIT )
if( lphc->wState & CBF_EDIT )
{
return unicode ? SendMessageW(lphc->hWndEdit, message, wParam, lParam) :
SendMessageA(lphc->hWndEdit, message, wParam, lParam);
@ -2004,7 +2004,7 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message,
return COMBO_ItemOp(lphc, message, lParam);
case WM_ENABLE:
if( lphc->wState & CBF_EDIT )
EnableWindow( lphc->hWndEdit, (BOOL)wParam );
EnableWindow( lphc->hWndEdit, (BOOL)wParam );
EnableWindow( lphc->hWndLBox, (BOOL)wParam );
/* Force the control to repaint when the enabled state changes. */
@ -2046,15 +2046,15 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message,
return unicode ? SendMessageW(hwndTarget, message, wParam, lParam) :
SendMessageA(hwndTarget, message, wParam, lParam);
}
case WM_LBUTTONDOWN:
case WM_LBUTTONDOWN:
if( !(lphc->wState & CBF_FOCUSED) ) SetFocus( lphc->self );
if( lphc->wState & CBF_FOCUSED ) COMBO_LButtonDown( lphc, lParam );
return TRUE;
case WM_LBUTTONUP:
COMBO_LButtonUp( lphc );
return TRUE;
case WM_MOUSEMOVE:
if( lphc->wState & CBF_CAPTURE )
case WM_MOUSEMOVE:
if( lphc->wState & CBF_CAPTURE )
COMBO_MouseMove( lphc, wParam, lParam );
return TRUE;
@ -2117,7 +2117,7 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message,
if( (INT)wParam >= 0 ) /* listbox item */
return SendMessageW(lphc->hWndLBox, LB_GETITEMHEIGHT, wParam, 0);
return CBGetTextAreaHeight(hwnd, lphc);
case CB_RESETCONTENT16:
case CB_RESETCONTENT16:
case CB_RESETCONTENT:
SendMessageW(lphc->hWndLBox, LB_RESETCONTENT, 0, 0);
if( (lphc->wState & CBF_EDIT) && CB_HASSTRINGS(lphc) )
@ -2150,7 +2150,7 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message,
return CB_ERR;
case CB_GETDROPPEDCONTROLRECT16:
lParam = (LPARAM)MapSL(lParam);
if( lParam )
if( lParam )
{
RECT r;
CBGetDroppedControlRect( lphc, &r );
@ -2163,7 +2163,7 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message,
case CB_GETDROPPEDSTATE16:
case CB_GETDROPPEDSTATE:
return (lphc->wState & CBF_DROPPED) ? TRUE : FALSE;
case CB_DIR16:
case CB_DIR16:
lParam = (LPARAM)MapSL(lParam);
message = LB_DIR16;
/* fall through */
@ -2181,15 +2181,15 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message,
if( !(lphc->wState & CBF_DROPPED) )
CBDropDown( lphc );
}
else
if( lphc->wState & CBF_DROPPED )
else
if( lphc->wState & CBF_DROPPED )
CBRollUp( lphc, FALSE, TRUE );
}
return TRUE;
case CB_GETCOUNT16:
case CB_GETCOUNT16:
case CB_GETCOUNT:
return SendMessageW(lphc->hWndLBox, LB_GETCOUNT, 0, 0);
case CB_GETCURSEL16:
case CB_GETCURSEL16:
case CB_GETCURSEL:
return SendMessageW(lphc->hWndLBox, LB_GETCURSEL, 0, 0);
case CB_SETCURSEL16:
@ -2207,14 +2207,14 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message,
InvalidateRect(lphc->self, &lphc->textRect, TRUE);
lphc->wState &= ~CBF_SELCHANGE;
return lParam;
case CB_GETLBTEXT16:
case CB_GETLBTEXT16:
wParam = (INT)(INT16)wParam;
lParam = (LPARAM)MapSL(lParam);
/* fall through */
case CB_GETLBTEXT:
return unicode ? SendMessageW(lphc->hWndLBox, LB_GETTEXT, wParam, lParam) :
SendMessageA(lphc->hWndLBox, LB_GETTEXT, wParam, lParam);
case CB_GETLBTEXTLEN16:
case CB_GETLBTEXTLEN16:
wParam = (INT)(INT16)wParam;
/* fall through */
case CB_GETLBTEXTLEN:
@ -2229,7 +2229,7 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message,
/* fall through */
case CB_SETITEMDATA:
return SendMessageW(lphc->hWndLBox, LB_SETITEMDATA, wParam, lParam);
case CB_GETEDITSEL16:
case CB_GETEDITSEL16:
wParam = lParam = 0; /* just in case */
/* fall through */
case CB_GETEDITSEL:
@ -2237,9 +2237,9 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message,
if( lphc->wState & CBF_EDIT )
return SendMessageW(lphc->hWndEdit, EM_GETSEL, wParam, lParam);
return CB_ERR;
case CB_SETEDITSEL16:
case CB_SETEDITSEL16:
case CB_SETEDITSEL:
if( lphc->wState & CBF_EDIT )
if( lphc->wState & CBF_EDIT )
return SendMessageW(lphc->hWndEdit, EM_SETSEL,
(INT)(INT16)LOWORD(lParam), (INT)(INT16)HIWORD(lParam) );
return CB_ERR;

View File

@ -91,7 +91,7 @@ static HBITMAP DESKTOP_LoadBitmap( HDC hdc, const char *filename )
_lclose( file );
fileHeader = (BITMAPFILEHEADER *)buffer;
bitmapInfo = (BITMAPINFO *)(buffer + sizeof(BITMAPFILEHEADER));
/* Check header content */
if ((fileHeader->bfType != 0x4d42) || (size < fileHeader->bfSize))
{

View File

@ -214,7 +214,7 @@ static void EDIT_MoveWordBackward(HWND hwnd, EDITSTATE *es, BOOL extend);
static void EDIT_MoveWordForward(HWND hwnd, EDITSTATE *es, BOOL extend);
static void EDIT_PaintLine(HWND hwnd, EDITSTATE *es, HDC hdc, INT line, BOOL rev);
static INT EDIT_PaintText(EDITSTATE *es, HDC hdc, INT x, INT y, INT line, INT col, INT count, BOOL rev);
static void EDIT_SetCaretPos(HWND hwnd, EDITSTATE *es, INT pos, BOOL after_wrap);
static void EDIT_SetCaretPos(HWND hwnd, EDITSTATE *es, INT pos, BOOL after_wrap);
static void EDIT_SetRectNP(HWND hwnd, EDITSTATE *es, LPRECT lprc);
static void EDIT_UnlockBuffer(HWND hwnd, EDITSTATE *es, BOOL force);
static void EDIT_UpdateScrollInfo(HWND hwnd, EDITSTATE *es);
@ -357,16 +357,16 @@ static inline void EDIT_WM_Cut(HWND hwnd, EDITSTATE *es)
*
* Returns the window version in case Wine emulates a later version
* of windows then the application expects.
*
*
* In a number of cases when windows runs an application that was
* designed for an earlier windows version, windows reverts
* to "old" behaviour of that earlier version.
*
* An example is a disabled edit control that needs to be painted.
* Old style behaviour is to send a WM_CTLCOLOREDIT message. This was
* changed in Win95, NT4.0 by a WM_CTLCOLORSTATIC message _only_ for
*
* An example is a disabled edit control that needs to be painted.
* Old style behaviour is to send a WM_CTLCOLOREDIT message. This was
* changed in Win95, NT4.0 by a WM_CTLCOLORSTATIC message _only_ for
* applications with an expected version 0f 4.0 or higher.
*
*
*/
static DWORD get_app_version(void)
{
@ -382,7 +382,7 @@ static DWORD get_app_version(void)
dwEmulatedVersion = MAKELONG( info.dwMinorVersion, info.dwMajorVersion );
/* FIXME: this may not be 100% correct; see discussion on the
* wine developer list in Nov 1999 */
version = dwProcVersion < dwEmulatedVersion ? dwProcVersion : dwEmulatedVersion;
version = dwProcVersion < dwEmulatedVersion ? dwProcVersion : dwEmulatedVersion;
}
return version;
}
@ -1002,8 +1002,8 @@ static LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg,
result = EDIT_WM_LButtonUp(hwnd, es);
break;
case WM_MBUTTONDOWN:
DPRINTF_EDIT_MSG32("WM_MBUTTONDOWN");
case WM_MBUTTONDOWN:
DPRINTF_EDIT_MSG32("WM_MBUTTONDOWN");
result = EDIT_WM_MButtonDown(hwnd);
break;
@ -1065,7 +1065,7 @@ static LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg,
DPRINTF_EDIT_MSG32("WM_STYLECHANGED");
result = EDIT_WM_StyleChanged (hwnd, es, wParam, (const STYLESTRUCT *)lParam);
break;
case WM_STYLECHANGING:
DPRINTF_EDIT_MSG32("WM_STYLECHANGING");
result = 0; /* See EDIT_WM_StyleChanged */
@ -1173,11 +1173,11 @@ static void EDIT_BuildLineDefs_ML(HWND hwnd, EDITSTATE *es, INT istart, INT iend
/* Find starting line. istart must lie inside an existing line or
* at the end of buffer */
do {
if (istart < current_line->index + current_line->length ||
if (istart < current_line->index + current_line->length ||
current_line->ending == END_0)
break;
previous_line = current_line;
previous_line = current_line;
current_line = current_line->next;
line_index++;
} while (current_line);
@ -1208,7 +1208,7 @@ static void EDIT_BuildLineDefs_ML(HWND hwnd, EDITSTATE *es, INT istart, INT iend
{
if (!current_line || current_line->index + delta > current_position - es->text)
{
/* The buffer has been expanded, create a new line and
/* The buffer has been expanded, create a new line and
insert it into the link list */
LINEDEF *new_line = HeapAlloc(GetProcessHeap(), 0, sizeof(LINEDEF));
new_line->next = previous_line->next;
@ -1288,15 +1288,15 @@ static void EDIT_BuildLineDefs_ML(HWND hwnd, EDITSTATE *es, INT istart, INT iend
prev = 1;
}
/* If the first line we are calculating, wrapped before istart, we must
/* If the first line we are calculating, wrapped before istart, we must
* adjust istart in order for this to be reflected in the update region. */
if (current_line->index == nstart_index && istart > current_line->index + prev)
istart = current_line->index + prev;
/* else if we are updating the previous line before the first line we
* are re-calculating and it expanded */
else if (current_line == start_line &&
else if (current_line == start_line &&
current_line->index != nstart_index && orig_net_length < prev)
{
{
/* Line expanded due to an upwards line wrap so we must partially include
* previous line in update region */
nstart_line = line_index;
@ -1361,16 +1361,16 @@ static void EDIT_BuildLineDefs_ML(HWND hwnd, EDITSTATE *es, INT istart, INT iend
if (hrgn)
{
HRGN tmphrgn;
/*
/*
* We calculate two rectangles. One for the first line which may have
* an indent with respect to the format rect. The other is a format-width
* rectangle that spans the rest of the lines that changed or moved.
*/
rc.top = es->format_rect.top + nstart_line * es->line_height -
rc.top = es->format_rect.top + nstart_line * es->line_height -
(es->y_offset * es->line_height); /* Adjust for vertical scrollbar */
rc.bottom = rc.top + es->line_height;
rc.left = es->format_rect.left + (INT)LOWORD(GetTabbedTextExtentW(dc,
es->text + nstart_index, istart - nstart_index,
rc.left = es->format_rect.left + (INT)LOWORD(GetTabbedTextExtentW(dc,
es->text + nstart_index, istart - nstart_index,
es->tabs_count, es->tabs)) - es->x_offset; /* Adjust for horz scroll */
rc.right = es->format_rect.right;
SetRectRgn(hrgn, rc.left, rc.top, rc.right, rc.bottom);
@ -1378,9 +1378,9 @@ static void EDIT_BuildLineDefs_ML(HWND hwnd, EDITSTATE *es, INT istart, INT iend
rc.top = rc.bottom;
rc.left = es->format_rect.left;
rc.right = es->format_rect.right;
/*
* If lines were added or removed we must re-paint the remainder of the
* lines since the remaining lines were either shifted up or down.
/*
* If lines were added or removed we must re-paint the remainder of the
* lines since the remaining lines were either shifted up or down.
*/
if (line_count < es->line_count) /* We added lines */
rc.bottom = es->line_count * es->line_height;
@ -2083,7 +2083,7 @@ static void EDIT_MovePageUp_ML(HWND hwnd, EDITSTATE *es, BOOL extend)
* Move the caret one line up, on a column with the nearest
* x coordinate on the screen (might be a different column).
*
*/
*/
static void EDIT_MoveUp_ML(HWND hwnd, EDITSTATE *es, BOOL extend)
{
INT s = es->selection_start;
@ -2533,7 +2533,7 @@ static INT CALLBACK EDIT_WordBreakProc(LPWSTR s, INT index, INT count, INT actio
* EM_CHARFROMPOS
*
* returns line number (not index) in high-order word of result.
* NB : Q137805 is unclear about this. POINT * pointer in lParam apply
* NB : Q137805 is unclear about this. POINT * pointer in lParam apply
* to Richedit, not to the edit control. Original documentation is valid.
* FIXME: do the specs mean to return -1 if outside client area or
* if outside formatting rectangle ???
@ -3104,7 +3104,7 @@ static void EDIT_EM_ReplaceSel(HWND hwnd, EDITSTATE *es, BOOL can_undo, LPCWSTR
INT s = min(es->selection_start, es->selection_end);
hrgn = CreateRectRgn(0, 0, 0, 0);
EDIT_BuildLineDefs_ML(hwnd, es, s, s + strl,
EDIT_BuildLineDefs_ML(hwnd, es, s, s + strl,
strl - abs(es->selection_end - es->selection_start), hrgn);
}
else
@ -3114,7 +3114,7 @@ static void EDIT_EM_ReplaceSel(HWND hwnd, EDITSTATE *es, BOOL can_undo, LPCWSTR
es->flags |= EF_MODIFIED;
if (send_update) es->flags |= EF_UPDATE;
EDIT_EM_ScrollCaret(hwnd, es);
/* force scroll info update */
EDIT_UpdateScrollInfo(hwnd, es);
@ -3431,7 +3431,7 @@ static void EDIT_EM_SetLimitText(EDITSTATE *es, INT limit)
/*********************************************************************
*
* EM_SETMARGINS
*
*
* EC_USEFONTINFO is used as a left or right value i.e. lParam and not as an
* action wParam despite what the docs say. EC_USEFONTINFO means one third
* of the char's width, according to the new docs.
@ -3521,11 +3521,11 @@ static void EDIT_EM_SetSel(HWND hwnd, EDITSTATE *es, UINT start, UINT end, BOOL
if (end != old_start)
{
/*
* One can also do
* One can also do
* ORDER_UINT32(end, old_start);
* EDIT_InvalidateText(hwnd, es, start, end);
* EDIT_InvalidateText(hwnd, es, old_start, old_end);
* in place of the following if statement.
* in place of the following if statement.
*/
if (old_start > end )
{
@ -3723,7 +3723,7 @@ static void EDIT_WM_Char(HWND hwnd, EDITSTATE *es, WCHAR c)
case 0x18: /* ^X */
SendMessageW(hwnd, WM_CUT, 0, 0);
break;
default:
if (!(es->style & ES_READONLY) && (c >= ' ') && (c != 127)) {
WCHAR str[2];
@ -4273,7 +4273,7 @@ static LRESULT EDIT_WM_KeyDown(HWND hwnd, EDITSTATE *es, INT key)
DWORD dw = SendMessageW( hwndParent, DM_GETDEFID, 0, 0 );
if (HIWORD(dw) == DC_HASDEFID)
{
SendMessageW( hwndParent, WM_COMMAND,
SendMessageW( hwndParent, WM_COMMAND,
MAKEWPARAM( LOWORD(dw), BN_CLICKED ),
(LPARAM)GetDlgItem( hwndParent, LOWORD(dw) ) );
}
@ -4376,8 +4376,8 @@ static LRESULT EDIT_WM_LButtonUp(HWND hwndSelf, EDITSTATE *es)
*
*/
static LRESULT EDIT_WM_MButtonDown(HWND hwnd)
{
SendMessageW(hwnd,WM_PASTE,0,0);
{
SendMessageW(hwnd,WM_PASTE,0,0);
return 0;
}
@ -4507,10 +4507,10 @@ static LRESULT EDIT_WM_NCCreate(HWND hwnd, DWORD style, HWND hwndParent, BOOL un
es->line_count = 1;
/*
* In Win95 look and feel, the WS_BORDER style is replaced by the
* WS_EX_CLIENTEDGE style for the edit control. This gives the edit
* In Win95 look and feel, the WS_BORDER style is replaced by the
* WS_EX_CLIENTEDGE style for the edit control. This gives the edit
* control a non client area. Not always. This coordinates in some
* way with the window creation code in dialog.c When making
* way with the window creation code in dialog.c When making
* modifications please ensure that the code still works for edit
* controls created directly with style 0x50800000, exStyle 0 (
* which should have a single pixel border)
@ -4643,7 +4643,7 @@ static void EDIT_WM_SetFocus(HWND hwnd, EDITSTATE *es)
*
* WM_SETFONT
*
* With Win95 look the margins are set to default font value unless
* With Win95 look the margins are set to default font value unless
* the system font (font == 0) is being set, in which case they are left
* unchanged.
*
@ -4773,7 +4773,7 @@ static void EDIT_WM_Size(HWND hwnd, EDITSTATE *es, UINT action, INT width, INT h
*
* It appears that the Windows version of the edit control allows the style
* (as retrieved by GetWindowLong) to be any value and maintains an internal
* style variable which will generally be different. In this function we
* style variable which will generally be different. In this function we
* update the internal style based on what changed in the externally visible
* style.
*
@ -4795,7 +4795,7 @@ static LRESULT EDIT_WM_StyleChanged (HWND hwnd,
*/
style_change_mask = ES_UPPERCASE | ES_LOWERCASE |
ES_NUMBER;
if (es->style & ES_MULTILINE)
if (es->style & ES_MULTILINE)
style_change_mask |= ES_WANTRETURN;
new_style = style->styleNew & style_change_mask;
@ -4809,7 +4809,7 @@ static LRESULT EDIT_WM_StyleChanged (HWND hwnd,
} else if (new_style & ES_LOWERCASE) {
new_style &= ~ES_UPPERCASE;
}
es->style = (es->style & ~style_change_mask) | new_style;
} else if (GWL_EXSTYLE == which) {
; /* FIXME - what is needed here */

View File

@ -142,10 +142,10 @@ static BOOL ICONTITLE_Paint( HWND hwnd, HWND owner, HDC hDC, BOOL bActive )
hBrush = GetSysColorBrush(COLOR_ACTIVECAPTION);
textColor = GetSysColor(COLOR_CAPTIONTEXT);
}
else
else
{
if( GetWindowLongA( hwnd, GWL_STYLE ) & WS_CHILD )
{
{
hBrush = (HBRUSH) GetClassLongA(hwnd, GCL_HBRBACKGROUND);
if( hBrush )
{
@ -164,7 +164,7 @@ static BOOL ICONTITLE_Paint( HWND hwnd, HWND owner, HDC hDC, BOOL bActive )
else
{
hBrush = GetStockObject( BLACK_BRUSH );
textColor = RGB( 0xFF, 0xFF, 0xFF );
textColor = RGB( 0xFF, 0xFF, 0xFF );
}
}

View File

@ -253,12 +253,12 @@ static void LISTBOX_UpdateScroll( HWND hwnd, LB_DESCR *descr )
if (!(descr->style & WS_VSCROLL)) return;
*/
/* It is important that we check descr->style, and not wnd->dwStyle,
for WS_VSCROLL, as the former is exactly the one passed in
argument to CreateWindow.
In Windows (and from now on in Wine :) a listbox created
with such a style (no WS_SCROLL) does not update
the scrollbar with listbox-related data, thus letting
/* It is important that we check descr->style, and not wnd->dwStyle,
for WS_VSCROLL, as the former is exactly the one passed in
argument to CreateWindow.
In Windows (and from now on in Wine :) a listbox created
with such a style (no WS_SCROLL) does not update
the scrollbar with listbox-related data, thus letting
the programmer use it for his/her own purposes. */
if (descr->style & LBS_NOREDRAW) return;
@ -1416,7 +1416,7 @@ static void LISTBOX_MoveCaret( HWND hwnd, LB_DESCR *descr, INT index,
/* Important, repaint needs to be done in this order if
you want to mimic Windows behavior:
1. Remove the focus and paint the item
1. Remove the focus and paint the item
2. Remove the selection and paint the item(s)
3. Set the selection and repaint the item(s)
4. Set the focus to 'index' and repaint the item */
@ -2089,7 +2089,7 @@ static LRESULT LISTBOX_HandleLButtonDownCombo( HWND hwnd, LB_DESCR *pDescr,
nHitTestType = HTHSCROLL;
}
}
/* Windows sends this message when a scrollbar is clicked
/* Windows sends this message when a scrollbar is clicked
*/
if(nHitTestType != 0)
@ -2097,7 +2097,7 @@ static LRESULT LISTBOX_HandleLButtonDownCombo( HWND hwnd, LB_DESCR *pDescr,
SendMessageW(hwnd, WM_NCLBUTTONDOWN, nHitTestType,
MAKELONG(screenMousePos.x, screenMousePos.y));
}
/* Resume the Capture after scrolling is complete
/* Resume the Capture after scrolling is complete
*/
if(hWndOldCapture != 0)
{
@ -3196,7 +3196,7 @@ static LRESULT WINAPI ComboLBWndProc_common( HWND hwnd, UINT msg,
/***********************************************************************
* ComboLBWndProcA
*
* NOTE: in Windows, winproc address of the ComboLBox is the same
* NOTE: in Windows, winproc address of the ComboLBox is the same
* as that of the Listbox.
*/
LRESULT WINAPI ComboLBWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )

View File

@ -169,7 +169,7 @@ static HFONT hMenuFontBold = 0;
static HMENU MENU_DefSysPopup = 0; /* Default system menu popup */
/* Use global popup window because there's no way 2 menus can
* be tracked at the same time. */
* be tracked at the same time. */
static HWND top_popup;
/* Flag set by EndMenu() to force an exit from menu tracking */
@ -210,7 +210,7 @@ const struct builtin_class_descr MENU_builtin_class =
if (flags & (bit)) { flags &= ~(bit); MENUOUT ((text)); } \
} while (0)
static void do_debug_print_menuitem(const char *prefix, MENUITEM * mp,
static void do_debug_print_menuitem(const char *prefix, MENUITEM * mp,
const char *postfix)
{
TRACE("%s ", prefix);
@ -298,7 +298,7 @@ static POPUPMENU *MENU_GetMenu(HMENU hMenu)
POPUPMENU *menu = USER_HEAP_LIN_ADDR(hMenu);
if (!menu || menu->wMagic != MENU_MAGIC)
{
WARN("invalid menu handle=%x, ptr=%p, magic=%x\n", hMenu, menu, menu? menu->wMagic:0);
WARN("invalid menu handle=%x, ptr=%p, magic=%x\n", hMenu, menu, menu? menu->wMagic:0);
menu = NULL;
}
return menu;
@ -349,8 +349,8 @@ static HMENU MENU_CopySysPopup(void)
*
* Create a copy of the system menu. System menu in Windows is
* a special menu bar with the single entry - system menu popup.
* This popup is presented to the outside world as a "system menu".
* However, the real system menu handle is sometimes seen in the
* This popup is presented to the outside world as a "system menu".
* However, the real system menu handle is sometimes seen in the
* WM_MENUSELECT parameters (and Word 6 likes it this way).
*/
HMENU MENU_GetSysMenu( HWND hWnd, HMENU hPopupMenu )
@ -365,7 +365,7 @@ HMENU MENU_GetSysMenu( HWND hWnd, HMENU hPopupMenu )
if (hPopupMenu == (HMENU)(-1))
hPopupMenu = MENU_CopySysPopup();
else if( !hPopupMenu ) hPopupMenu = MENU_DefSysPopup;
else if( !hPopupMenu ) hPopupMenu = MENU_DefSysPopup;
if (hPopupMenu)
{
@ -414,12 +414,12 @@ BOOL MENU_Init()
} else
return FALSE;
if (! (hBitmap = CreateBitmap( 8, 8, 1, 1, shade_bits)))
if (! (hBitmap = CreateBitmap( 8, 8, 1, 1, shade_bits)))
return FALSE;
if(!(hShadeBrush = CreatePatternBrush( hBitmap )))
if(!(hShadeBrush = CreatePatternBrush( hBitmap )))
return FALSE;
DeleteObject( hBitmap );
if (!(MENU_DefSysPopup = MENU_CopySysPopup()))
return FALSE;
@ -427,7 +427,7 @@ BOOL MENU_Init()
ncm.cbSize = sizeof (NONCLIENTMETRICSA);
if (!(SystemParametersInfoA(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICSA), &ncm, 0)))
return FALSE;
if (!(hMenuFont = CreateFontIndirectA( &ncm.lfMenuFont )))
return FALSE;
@ -582,7 +582,7 @@ static MENUITEM *MENU_FindItem( HMENU *hmenu, UINT *nPos, UINT wFlags )
/***********************************************************************
* MENU_FindSubMenu
*
* Find a Sub menu. Return the position of the submenu, and modifies
* Find a Sub menu. Return the position of the submenu, and modifies
* *hmenu in case it is found in another sub-menu.
* If the submenu cannot be found, NO_SELECTED_ITEM is returned.
*/
@ -591,8 +591,8 @@ UINT MENU_FindSubMenu( HMENU *hmenu, HMENU hSubTarget )
POPUPMENU *menu;
UINT i;
MENUITEM *item;
if (((*hmenu)==0xffff) ||
(!(menu = MENU_GetMenu(*hmenu))))
if (((*hmenu)==0xffff) ||
(!(menu = MENU_GetMenu(*hmenu))))
return NO_SELECTED_ITEM;
item = menu->items;
for (i = 0; i < menu->nItems; i++, item++) {
@ -625,11 +625,11 @@ static void MENU_FreeItemData( MENUITEM* item )
/***********************************************************************
* MENU_FindItemByCoords
*
* Find the item at the specified coordinates (screen coords). Does
* not work for child windows and therefore should not be called for
* Find the item at the specified coordinates (screen coords). Does
* not work for child windows and therefore should not be called for
* an arbitrary system menu.
*/
static MENUITEM *MENU_FindItemByCoords( POPUPMENU *menu,
static MENUITEM *MENU_FindItemByCoords( POPUPMENU *menu,
POINT pt, UINT *pos )
{
MENUITEM *item;
@ -658,7 +658,7 @@ static MENUITEM *MENU_FindItemByCoords( POPUPMENU *menu,
* Find the menu item selected by a key press.
* Return item id, -1 if none, -2 if we should close the menu.
*/
static UINT MENU_FindItemByKey( HWND hwndOwner, HMENU hmenu,
static UINT MENU_FindItemByKey( HWND hwndOwner, HMENU hmenu,
UINT key, BOOL forceMenuChar )
{
TRACE("\tlooking for '%c' in [%04x]\n", (char)key, (UINT16)hmenu );
@ -690,7 +690,7 @@ static UINT MENU_FindItemByKey( HWND hwndOwner, HMENU hmenu,
}
}
}
menuchar = SendMessageA( hwndOwner, WM_MENUCHAR,
menuchar = SendMessageA( hwndOwner, WM_MENUCHAR,
MAKEWPARAM( key, menu->wFlags ), hmenu );
if (HIWORD(menuchar) == 2) return LOWORD(menuchar);
if (HIWORD(menuchar) == 1) return (UINT)(-2);
@ -853,7 +853,7 @@ static void MENU_CalcItemSize( HDC hdc, MENUITEM *lpitem, HWND hwndOwner,
UINT check_bitmap_width = GetSystemMetrics( SM_CXMENUCHECK );
TRACE("dc=0x%04x owner=0x%04x (%d,%d)\n", hdc, hwndOwner, orgX, orgY);
debug_print_menuitem("MENU_CalcItemSize: menuitem:", lpitem,
debug_print_menuitem("MENU_CalcItemSize: menuitem:", lpitem,
(menuBar ? " (MenuBar)" : ""));
SetRect( &lpitem->rect, orgX, orgY, orgX, orgY );
@ -880,7 +880,7 @@ static void MENU_CalcItemSize( HDC hdc, MENUITEM *lpitem, HWND hwndOwner,
if (menuBar)
{
lpitem->rect.right += MENU_BAR_ITEMS_SPACE;
/* under at least win95 you seem to be given a standard
height for the menu and the height value is ignored */
@ -892,11 +892,11 @@ static void MENU_CalcItemSize( HDC hdc, MENUITEM *lpitem, HWND hwndOwner,
}
else
lpitem->rect.bottom += mis.itemHeight;
TRACE("id=%04x size=%dx%d\n",
lpitem->wID, mis.itemWidth, mis.itemHeight);
/* Fall through to get check/arrow width calculation. */
}
}
if (lpitem->fType & MF_SEPARATOR)
{
@ -928,14 +928,14 @@ static void MENU_CalcItemSize( HDC hdc, MENUITEM *lpitem, HWND hwndOwner,
lpitem->rect.bottom += 2;
}
}
/* it must be a text item - unless it's the system menu */
if (!(lpitem->fType & MF_SYSMENU) && IS_STRING_ITEM( lpitem->fType ))
{ SIZE size;
GetTextExtentPoint32W(hdc, lpitem->text, strlenW(lpitem->text), &size);
lpitem->rect.right += size.cx;
if (TWEAK_WineLook == WIN31_LOOK)
lpitem->rect.bottom += max( size.cy, GetSystemMetrics(SM_CYMENU) );
@ -958,7 +958,7 @@ static void MENU_CalcItemSize( HDC hdc, MENUITEM *lpitem, HWND hwndOwner,
{
if (strchrW( lpitem->text, '\b' ))
lpitem->rect.right += MENU_TAB_SPACE;
lpitem->xTab = lpitem->rect.right - check_bitmap_width
lpitem->xTab = lpitem->rect.right - check_bitmap_width
- arrow_bitmap_width;
}
}
@ -983,7 +983,7 @@ static void MENU_PopupMenuCalcSize( LPPOPUPMENU lppop, HWND hwndOwner )
hdc = GetDC( 0 );
SelectObject( hdc, hMenuFont);
start = 0;
maxX = (TWEAK_WineLook == WIN31_LOOK) ? GetSystemMetrics(SM_CXBORDER) : 2+1 ;
@ -1020,7 +1020,7 @@ static void MENU_PopupMenuCalcSize( LPPOPUPMENU lppop, HWND hwndOwner )
lpitem->rect.right = maxX;
if (IS_STRING_ITEM(lpitem->fType) && lpitem->xTab)
lpitem->xTab = maxTab;
}
lppop->Height = max( lppop->Height, orgY );
}
@ -1055,7 +1055,7 @@ static void MENU_MenuBarCalcSize( HDC hdc, LPRECT lprect,
if ((lprect == NULL) || (lppop == NULL)) return;
if (lppop->nItems == 0) return;
TRACE("left=%d top=%d right=%d bottom=%d\n",
TRACE("left=%d top=%d right=%d bottom=%d\n",
lprect->left, lprect->top, lprect->right, lprect->bottom);
lppop->Width = lprect->right - lprect->left;
lppop->Height = 0;
@ -1075,7 +1075,7 @@ static void MENU_MenuBarCalcSize( HDC hdc, LPRECT lprect,
if ((i != start) &&
(lpitem->fType & (MF_MENUBREAK | MF_MENUBARBREAK))) break;
TRACE("calling MENU_CalcItemSize org=(%d, %d)\n",
TRACE("calling MENU_CalcItemSize org=(%d, %d)\n",
orgX, orgY );
debug_print_menuitem (" item: ", lpitem, "");
MENU_CalcItemSize( hdc, lpitem, hwndOwner, orgX, orgY, TRUE );
@ -1132,7 +1132,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
lpitem->fState &
(MF_HILITE | MF_MOUSESELECT) );
else
NC_DrawSysButton( hwnd, hdc,
NC_DrawSysButton( hwnd, hdc,
lpitem->fState &
(MF_HILITE | MF_MOUSESELECT) );
}
@ -1167,7 +1167,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
dis.rcItem = lpitem->rect;
TRACE("Ownerdraw: owner=%04x itemID=%d, itemState=%d, itemAction=%d, "
"hwndItem=%04x, hdc=%04x, rcItem={%d,%d,%d,%d}\n", hwndOwner,
dis.itemID, dis.itemState, dis.itemAction, dis.hwndItem,
dis.itemID, dis.itemState, dis.itemAction, dis.hwndItem,
dis.hDC, dis.rcItem.left, dis.rcItem.top, dis.rcItem.right,
dis.rcItem.bottom);
SendMessageA( hwndOwner, WM_DRAWITEM, 0, (LPARAM)&dis );
@ -1209,14 +1209,14 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
/* vertical separator */
if (!menuBar && (lpitem->fType & MF_MENUBARBREAK))
{
if (TWEAK_WineLook > WIN31_LOOK)
if (TWEAK_WineLook > WIN31_LOOK)
{
RECT rc = rect;
rc.top = 3;
rc.bottom = height - 3;
DrawEdge (hdc, &rc, EDGE_ETCHED, BF_LEFT);
}
else
else
{
SelectObject( hdc, SYSCOLOR_GetPen(COLOR_WINDOWFRAME) );
MoveToEx( hdc, rect.left, 0, NULL );
@ -1227,7 +1227,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
/* horizontal separator */
if (lpitem->fType & MF_SEPARATOR)
{
if (TWEAK_WineLook > WIN31_LOOK)
if (TWEAK_WineLook > WIN31_LOOK)
{
RECT rc = rect;
rc.left++;
@ -1235,7 +1235,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
rc.top += SEPARATOR_HEIGHT / 2;
DrawEdge (hdc, &rc, EDGE_ETCHED, BF_TOP);
}
else
else
{
SelectObject( hdc, SYSCOLOR_GetPen(COLOR_WINDOWFRAME) );
MoveToEx( hdc, rect.left, rect.top + SEPARATOR_HEIGHT/2, NULL );
@ -1296,7 +1296,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
/* Draw the check mark
*
* FIXME:
* Custom checkmark bitmaps are monochrome but not always 1bpp.
* Custom checkmark bitmaps are monochrome but not always 1bpp.
*/
HBITMAP bm = (lpitem->fState & MF_CHECKED) ? lpitem->hCheckBit : lpitem->hUnCheckBit;
if (bm) /* we have a custom bitmap */
@ -1324,7 +1324,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
DeleteObject( bm );
}
}
/* Draw the popup-menu arrow */
if (lpitem->fType & MF_POPUP)
{
@ -1360,7 +1360,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
{
register int i;
HFONT hfontOld = 0;
UINT uFormat = (menuBar) ?
DT_CENTER | DT_VCENTER | DT_SINGLELINE :
DT_LEFT | DT_VCENTER | DT_SINGLELINE;
@ -1394,7 +1394,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
}
SetTextColor(hdc, RGB(0x80, 0x80, 0x80));
}
DrawTextW( hdc, lpitem->text, i, &rect, uFormat);
/* paint the shortcut text */
@ -1405,7 +1405,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
rect.left = lpitem->xTab;
uFormat = DT_LEFT | DT_VCENTER | DT_SINGLELINE;
}
else
else
{
uFormat = DT_RIGHT | DT_VCENTER | DT_SINGLELINE;
}
@ -1424,7 +1424,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
DrawTextW( hdc, lpitem->text + i + 1, -1, &rect, uFormat );
}
if (hfontOld)
if (hfontOld)
SelectObject (hdc, hfontOld);
}
}
@ -1444,17 +1444,17 @@ static void MENU_DrawPopupMenu( HWND hwnd, HDC hdc, HMENU hmenu )
GetClientRect( hwnd, &rect );
if(TWEAK_WineLook == WIN31_LOOK)
if(TWEAK_WineLook == WIN31_LOOK)
{
rect.bottom -= POPUP_YSHADE * GetSystemMetrics(SM_CYBORDER);
rect.right -= POPUP_XSHADE * GetSystemMetrics(SM_CXBORDER);
}
}
if((hPrevBrush = SelectObject( hdc, GetSysColorBrush(COLOR_MENU) ))
if((hPrevBrush = SelectObject( hdc, GetSysColorBrush(COLOR_MENU) ))
&& (SelectObject( hdc, hMenuFont)))
{
HPEN hPrevPen;
Rectangle( hdc, rect.left, rect.top, rect.right, rect.bottom );
hPrevPen = SelectObject( hdc, GetStockObject( NULL_PEN ) );
@ -1494,11 +1494,11 @@ static void MENU_DrawPopupMenu( HWND hwnd, HDC hdc, HMENU hmenu )
UINT u;
for (u = menu->nItems, item = menu->items; u > 0; u--, item++)
MENU_DrawMenuItem( hwnd, hmenu, menu->hwndOwner, hdc, item,
MENU_DrawMenuItem( hwnd, hmenu, menu->hwndOwner, hdc, item,
menu->Height, FALSE, ODA_DRAWENTIRE );
}
} else
} else
{
SelectObject( hdc, hPrevBrush );
}
@ -1543,13 +1543,13 @@ UINT MENU_DrawMenuBar( HDC hDC, LPRECT lprect, HWND hwnd,
FillRect(hDC, lprect, GetSysColorBrush(COLOR_MENU) );
if (TWEAK_WineLook == WIN31_LOOK)
if (TWEAK_WineLook == WIN31_LOOK)
{
SelectObject( hDC, SYSCOLOR_GetPen(COLOR_WINDOWFRAME) );
MoveToEx( hDC, lprect->left, lprect->bottom, NULL );
LineTo( hDC, lprect->right, lprect->bottom );
}
else
else
{
SelectObject( hDC, SYSCOLOR_GetPen(COLOR_3DFACE));
MoveToEx( hDC, lprect->left, lprect->bottom, NULL );
@ -1605,7 +1605,7 @@ static BOOL MENU_ShowPopup( HWND hwndOwner, HMENU hmenu, UINT id,
/* adjust popup menu pos so that it fits within the desktop */
width = menu->Width + GetSystemMetrics(SM_CXBORDER);
height = menu->Height + GetSystemMetrics(SM_CYBORDER);
height = menu->Height + GetSystemMetrics(SM_CYBORDER);
if( x + width > GetSystemMetrics(SM_CXSCREEN ))
{
@ -1670,7 +1670,7 @@ static void MENU_SelectItem( HWND hwndOwner, HMENU hmenu, UINT wIndex,
SelectObject( hdc, hMenuFont);
/* Clear previous highlighted item */
if (lppop->FocusedItem != NO_SELECTED_ITEM)
if (lppop->FocusedItem != NO_SELECTED_ITEM)
{
lppop->items[lppop->FocusedItem].fState &= ~(MF_HILITE|MF_MOUSESELECT);
MENU_DrawMenuItem(lppop->hWnd, hmenu, hwndOwner, hdc,&lppop->items[lppop->FocusedItem],
@ -1680,18 +1680,18 @@ static void MENU_SelectItem( HWND hwndOwner, HMENU hmenu, UINT wIndex,
/* Highlight new item (if any) */
lppop->FocusedItem = wIndex;
if (lppop->FocusedItem != NO_SELECTED_ITEM)
if (lppop->FocusedItem != NO_SELECTED_ITEM)
{
if(!(lppop->items[wIndex].fType & MF_SEPARATOR)) {
lppop->items[wIndex].fState |= MF_HILITE;
MENU_DrawMenuItem( lppop->hWnd, hmenu, hwndOwner, hdc,
MENU_DrawMenuItem( lppop->hWnd, hmenu, hwndOwner, hdc,
&lppop->items[wIndex], lppop->Height,
!(lppop->wFlags & MF_POPUP), ODA_SELECT );
}
if (sendMenuSelect)
{
MENUITEM *ip = &lppop->items[lppop->FocusedItem];
SendMessageA( hwndOwner, WM_MENUSELECT,
SendMessageA( hwndOwner, WM_MENUSELECT,
MAKELONG(ip->fType & MF_POPUP ? wIndex: ip->wID,
ip->fType | ip->fState | MF_MOUSESELECT |
(lppop->wFlags & MF_SYSMENU)), hmenu);
@ -1703,7 +1703,7 @@ static void MENU_SelectItem( HWND hwndOwner, HMENU hmenu, UINT wIndex,
if((pos=MENU_FindSubMenu(&topmenu, hmenu))!=NO_SELECTED_ITEM){
POPUPMENU *ptm = MENU_GetMenu( topmenu );
MENUITEM *ip = &ptm->items[pos];
SendMessageA( hwndOwner, WM_MENUSELECT, MAKELONG(pos,
SendMessageA( hwndOwner, WM_MENUSELECT, MAKELONG(pos,
ip->fType | ip->fState | MF_MOUSESELECT |
(ptm->wFlags & MF_SYSMENU)), topmenu);
}
@ -1733,7 +1733,7 @@ static void MENU_MoveSelection( HWND hwndOwner, HMENU hmenu, INT offset )
if ( menu->FocusedItem != NO_SELECTED_ITEM )
{
if( menu->nItems == 1 ) return; else
for (i = menu->FocusedItem + offset ; i >= 0 && i < menu->nItems
for (i = menu->FocusedItem + offset ; i >= 0 && i < menu->nItems
; i += offset)
if (!(menu->items[i].fType & MF_SEPARATOR))
{
@ -1742,7 +1742,7 @@ static void MENU_MoveSelection( HWND hwndOwner, HMENU hmenu, INT offset )
}
}
for ( i = (offset > 0) ? 0 : menu->nItems - 1;
for ( i = (offset > 0) ? 0 : menu->nItems - 1;
i >= 0 && i < menu->nItems ; i += offset)
if (!(menu->items[i].fType & MF_SEPARATOR))
{
@ -1792,7 +1792,7 @@ static BOOL MENU_SetItemData( MENUITEM *item, UINT flags, UINT id,
item->text = (LPWSTR)(HBITMAP)LOWORD(str);
else item->text = NULL;
if (flags & MF_OWNERDRAW)
if (flags & MF_OWNERDRAW)
item->dwItemData = (DWORD)str;
else
item->dwItemData = 0;
@ -1812,7 +1812,7 @@ static BOOL MENU_SetItemData( MENUITEM *item, UINT flags, UINT id,
item->fState = 0;
return FALSE;
}
}
}
item->wID = id;
if (flags & MF_POPUP)
@ -1846,16 +1846,16 @@ static MENUITEM *MENU_InsertItem( HMENU hMenu, UINT pos, UINT flags )
MENUITEM *newItems;
POPUPMENU *menu;
if (!(menu = MENU_GetMenu(hMenu)))
if (!(menu = MENU_GetMenu(hMenu)))
return NULL;
/* Find where to insert new item */
if (flags & MF_BYPOSITION) {
if (pos > menu->nItems)
if (pos > menu->nItems)
pos = menu->nItems;
} else {
if (!MENU_FindItem( &hMenu, &pos, flags ))
if (!MENU_FindItem( &hMenu, &pos, flags ))
pos = menu->nItems;
else {
if (!(menu = MENU_GetMenu( hMenu )))
@ -2082,7 +2082,7 @@ static HMENU MENU_ShowSubPopup( HWND hwndOwner, HMENU hmenu,
rect = item->rect;
/* correct item if modified as a reaction to WM_INITMENUPOPUP message */
if (!(item->fState & MF_HILITE))
if (!(item->fState & MF_HILITE))
{
if (menu->wFlags & MF_POPUP) hdc = GetDC( menu->hWnd );
else hdc = GetDCEx( menu->hWnd, 0, DCX_CACHE | DCX_WINDOW);
@ -2090,7 +2090,7 @@ static HMENU MENU_ShowSubPopup( HWND hwndOwner, HMENU hmenu,
SelectObject( hdc, hMenuFont);
item->fState |= MF_HILITE;
MENU_DrawMenuItem( menu->hWnd, hmenu, hwndOwner, hdc, item, menu->Height, !(menu->wFlags & MF_POPUP), ODA_DRAWENTIRE );
MENU_DrawMenuItem( menu->hWnd, hmenu, hwndOwner, hdc, item, menu->Height, !(menu->wFlags & MF_POPUP), ODA_DRAWENTIRE );
ReleaseDC( menu->hWnd, hdc );
}
if (!item->rect.top && !item->rect.left && !item->rect.bottom && !item->rect.right)
@ -2194,7 +2194,7 @@ static INT MENU_ExecFocusedItem( MTRACKER* pmt, HMENU hMenu, UINT wFlags )
TRACE("%p hmenu=0x%04x\n", pmt, hMenu);
if (!menu || !menu->nItems ||
if (!menu || !menu->nItems ||
(menu->FocusedItem == NO_SELECTED_ITEM)) return -1;
item = &menu->items[menu->FocusedItem];
@ -2206,8 +2206,8 @@ static INT MENU_ExecFocusedItem( MTRACKER* pmt, HMENU hMenu, UINT wFlags )
{
if (!(item->fState & (MF_GRAYED | MF_DISABLED)) && !(item->fType & MF_SEPARATOR))
{
/* If TPM_RETURNCMD is set you return the id, but
do not send a message to the owner */
/* If TPM_RETURNCMD is set you return the id, but
do not send a message to the owner */
if(!(wFlags & TPM_RETURNCMD))
{
if( menu->wFlags & MF_SYSMENU )
@ -2282,11 +2282,11 @@ static BOOL MENU_ButtonDown( MTRACKER* pmt, HMENU hPtMenu, UINT wFlags )
/* In win31, a newly popped menu always remains opened for the next buttonup */
if(TWEAK_WineLook == WIN31_LOOK)
ptmenu->bTimeToHide = FALSE;
ptmenu->bTimeToHide = FALSE;
}
return TRUE;
}
}
/* Else the click was on the menu bar, finish the tracking */
}
return FALSE;
@ -2349,13 +2349,13 @@ static BOOL MENU_MouseMove( MTRACKER* pmt, HMENU hPtMenu, UINT wFlags )
id = 0;
else
MENU_FindItemByCoords( ptmenu, pmt->pt, &id );
}
}
if( id == NO_SELECTED_ITEM )
{
MENU_SelectItem( pmt->hOwnerWnd, pmt->hCurrentMenu,
MENU_SelectItem( pmt->hOwnerWnd, pmt->hCurrentMenu,
NO_SELECTED_ITEM, TRUE, pmt->hTopMenu);
}
else if( ptmenu->FocusedItem != id )
{
@ -2443,21 +2443,21 @@ static LRESULT MENU_DoNextMenu( MTRACKER* pmt, UINT vk )
if( hNewMenu != pmt->hTopMenu )
{
MENU_SelectItem( pmt->hOwnerWnd, pmt->hTopMenu, NO_SELECTED_ITEM,
MENU_SelectItem( pmt->hOwnerWnd, pmt->hTopMenu, NO_SELECTED_ITEM,
FALSE, 0 );
if( pmt->hCurrentMenu != pmt->hTopMenu )
if( pmt->hCurrentMenu != pmt->hTopMenu )
MENU_HideSubPopups( pmt->hOwnerWnd, pmt->hTopMenu, FALSE );
}
if( hNewWnd != pmt->hOwnerWnd )
{
ReleaseCapture();
ReleaseCapture();
pmt->hOwnerWnd = hNewWnd;
EVENT_Capture( pmt->hOwnerWnd, HTMENU );
}
pmt->hTopMenu = pmt->hCurrentMenu = hNewMenu; /* all subpopups are hidden */
MENU_SelectItem( pmt->hOwnerWnd, pmt->hTopMenu, id, TRUE, 0 );
MENU_SelectItem( pmt->hOwnerWnd, pmt->hTopMenu, id, TRUE, 0 );
return TRUE;
}
@ -2505,7 +2505,7 @@ static BOOL MENU_SuspendPopup( MTRACKER* pmt, UINT16 uMsg )
/***********************************************************************
* MENU_KeyEscape
*
* Handle a VK_ESCAPE key event in a menu.
* Handle a VK_ESCAPE key event in a menu.
*/
static BOOL MENU_KeyEscape(MTRACKER* pmt, UINT wFlags)
{
@ -2540,7 +2540,7 @@ static BOOL MENU_KeyEscape(MTRACKER* pmt, UINT wFlags)
/***********************************************************************
* MENU_KeyLeft
*
* Handle a VK_LEFT key event in a menu.
* Handle a VK_LEFT key event in a menu.
*/
static void MENU_KeyLeft( MTRACKER* pmt, UINT wFlags )
{
@ -2552,9 +2552,9 @@ static void MENU_KeyLeft( MTRACKER* pmt, UINT wFlags )
menu = MENU_GetMenu( hmenutmp );
/* Try to move 1 column left (if possible) */
if( (prevcol = MENU_GetStartOfPrevColumn( pmt->hCurrentMenu )) !=
if( (prevcol = MENU_GetStartOfPrevColumn( pmt->hCurrentMenu )) !=
NO_SELECTED_ITEM ) {
MENU_SelectItem( pmt->hOwnerWnd, pmt->hCurrentMenu,
prevcol, TRUE, 0 );
return;
@ -2568,7 +2568,7 @@ static void MENU_KeyLeft( MTRACKER* pmt, UINT wFlags )
}
MENU_HideSubPopups( pmt->hOwnerWnd, hmenuprev, TRUE );
pmt->hCurrentMenu = hmenuprev;
pmt->hCurrentMenu = hmenuprev;
if ( (hmenuprev == pmt->hTopMenu) && !(menu->wFlags & MF_POPUP) )
{
@ -2619,7 +2619,7 @@ static void MENU_KeyRight( MTRACKER* pmt, UINT wFlags )
}
/* Check to see if there's another column */
if( (nextcol = MENU_GetStartOfNextColumn( pmt->hCurrentMenu )) !=
if( (nextcol = MENU_GetStartOfNextColumn( pmt->hCurrentMenu )) !=
NO_SELECTED_ITEM ) {
TRACE("Going to %d.\n", nextcol );
MENU_SelectItem( pmt->hOwnerWnd, pmt->hCurrentMenu,
@ -2641,7 +2641,7 @@ static void MENU_KeyRight( MTRACKER* pmt, UINT wFlags )
if( hmenutmp || pmt->trackFlags & TF_SUSPENDPOPUP )
if( !MENU_SuspendPopup(pmt, WM_KEYDOWN) )
pmt->hCurrentMenu = MENU_ShowSubPopup(pmt->hOwnerWnd,
pmt->hCurrentMenu = MENU_ShowSubPopup(pmt->hOwnerWnd,
pmt->hTopMenu, TRUE, wFlags);
}
}
@ -2675,11 +2675,11 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
fEndMenu = FALSE;
if (!(menu = MENU_GetMenu( hmenu ))) return FALSE;
if (wFlags & TPM_BUTTONDOWN)
if (wFlags & TPM_BUTTONDOWN)
{
/* Get the result in order to start the tracking or not */
fRemove = MENU_ButtonDown( &mt, hmenu, wFlags );
fEndMenu = !fRemove;
fEndMenu = !fRemove;
}
EVENT_Capture( mt.hOwnerWnd, HTMENU );
@ -2714,14 +2714,14 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
}
/* check if EndMenu() tried to cancel us, by posting this message */
if(msg.message == WM_CANCELMODE)
if(msg.message == WM_CANCELMODE)
{
/* we are now out of the loop */
fEndMenu = TRUE;
/* remove the message from the queue */
PeekMessageA( &msg, 0, msg.message, msg.message, PM_REMOVE );
/* break out of internal loop, ala ESCAPE */
break;
}
@ -2735,9 +2735,9 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
fRemove = FALSE;
if ((msg.message >= WM_MOUSEFIRST) && (msg.message <= WM_MOUSELAST))
{
/*
/*
* use the mouse coordinates in lParam instead of those in the MSG
* struct to properly handle synthetic messages. lParam coords are
* struct to properly handle synthetic messages. lParam coords are
* relative to client area, so they must be converted; since they can
* be negative, we must use SLOWORD/SHIWORD instead of LOWORD/HIWORD.
*/
@ -2763,7 +2763,7 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
fRemove = MENU_ButtonDown( &mt, hmenu, wFlags );
fEndMenu = !fRemove;
break;
case WM_RBUTTONUP:
if (!(wFlags & TPM_RIGHTBUTTON)) break;
/* fall through */
@ -2782,13 +2782,13 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
with the menu tracking. If not, stop it */
else
fEndMenu = ((wFlags & TPM_POPUPMENU) ? FALSE : TRUE);
break;
case WM_MOUSEMOVE:
/* In win95 winelook, the selected menu item must be changed every time the
mouse moves. In Win31 winelook, the mouse button has to be held down */
if ( hmenu && ((TWEAK_WineLook > WIN31_LOOK) ||
( (msg.wParam & MK_LBUTTON) ||
((wFlags & TPM_RIGHTBUTTON) && (msg.wParam & MK_RBUTTON)))) )
@ -2807,11 +2807,11 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
{
case VK_HOME:
case VK_END:
MENU_SelectItem( mt.hOwnerWnd, mt.hCurrentMenu,
MENU_SelectItem( mt.hOwnerWnd, mt.hCurrentMenu,
NO_SELECTED_ITEM, FALSE, 0 );
/* fall through */
case VK_UP:
MENU_MoveSelection( mt.hOwnerWnd, mt.hCurrentMenu,
MENU_MoveSelection( mt.hOwnerWnd, mt.hCurrentMenu,
(msg.wParam == VK_HOME)? ITEM_NEXT : ITEM_PREV );
break;
@ -2827,11 +2827,11 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
case VK_LEFT:
MENU_KeyLeft( &mt, wFlags );
break;
case VK_RIGHT:
MENU_KeyRight( &mt, wFlags );
break;
case VK_ESCAPE:
fEndMenu = MENU_KeyEscape(&mt, wFlags);
break;
@ -2841,10 +2841,10 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
HELPINFO hi;
hi.cbSize = sizeof(HELPINFO);
hi.iContextType = HELPINFO_MENUITEM;
if (menu->FocusedItem == NO_SELECTED_ITEM)
if (menu->FocusedItem == NO_SELECTED_ITEM)
hi.iCtrlId = 0;
else
hi.iCtrlId = menu->items[menu->FocusedItem].wID;
else
hi.iCtrlId = menu->items[menu->FocusedItem].wID;
hi.hItemHandle = hmenu;
hi.dwContextId = menu->dwContextHelpID;
hi.MousePos = msg.pt;
@ -2863,7 +2863,7 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
case VK_MENU:
fEndMenu = TRUE;
break;
}
break; /* WM_SYSKEYDOWN */
@ -2883,7 +2883,7 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
/* We will find a better way real soon... */
if ((msg.wParam <= 32) || (msg.wParam >= 127)) break;
pos = MENU_FindItemByKey( mt.hOwnerWnd, mt.hCurrentMenu,
pos = MENU_FindItemByKey( mt.hOwnerWnd, mt.hCurrentMenu,
LOWORD(msg.wParam), FALSE );
if (pos == (UINT)-2) fEndMenu = TRUE;
else if (pos == (UINT)-1) MessageBeep(0);
@ -2894,7 +2894,7 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
executedMenuId = MENU_ExecFocusedItem(&mt,mt.hCurrentMenu, wFlags);
fEndMenu = (executedMenuId != -1);
}
}
}
break;
} /* switch(msg.message) - kbd */
}
@ -2926,7 +2926,7 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
{
MENU_HideSubPopups( mt.hOwnerWnd, mt.hTopMenu, FALSE );
if (menu && menu->wFlags & MF_POPUP)
if (menu && menu->wFlags & MF_POPUP)
{
DestroyWindow( menu->hWnd );
menu->hWnd = 0;
@ -2967,7 +2967,7 @@ static BOOL MENU_InitTracking(HWND hWnd, HMENU hMenu, BOOL bPopup, UINT wFlags)
Recalculate menu sizes else clicks will not work */
SetWindowPos( hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED );
}
}
return TRUE;
@ -3185,9 +3185,9 @@ UINT MENU_GetMenuBarHeight( HWND hwnd, UINT menubarWidth,
if (!(lppop = MENU_GetMenu( GetMenu(hwnd) ))) return 0;
hdc = GetDCEx( hwnd, 0, DCX_CACHE | DCX_WINDOW );
SelectObject( hdc, hMenuFont);
SelectObject( hdc, hMenuFont);
SetRect(&rectBar, orgX, orgY, orgX+menubarWidth, orgY+GetSystemMetrics(SM_CYMENU));
MENU_MenuBarCalcSize( hdc, &rectBar, lppop, hwnd );
MENU_MenuBarCalcSize( hdc, &rectBar, lppop, hwnd );
ReleaseDC( hwnd, hdc );
return lppop->Height;
}
@ -3305,11 +3305,11 @@ UINT WINAPI EnableMenuItem( HMENU hMenu, UINT wItemID, UINT wFlags )
MENUITEM *item;
POPUPMENU *menu;
TRACE("(%04x, %04X, %04X) !\n",
TRACE("(%04x, %04X, %04X) !\n",
hMenu, wItemID, wFlags);
/* Get the Popupmenu to access the owner menu */
if (!(menu = MENU_GetMenu(hMenu)))
if (!(menu = MENU_GetMenu(hMenu)))
return (UINT)-1;
if (!(item = MENU_FindItem( &hMenu, &wItemID, wFlags )))
@ -3319,7 +3319,7 @@ UINT WINAPI EnableMenuItem( HMENU hMenu, UINT wItemID, UINT wFlags )
item->fState ^= (oldflags ^ wFlags) & (MF_GRAYED | MF_DISABLED);
/* In win95 if the close item in the system menu change update the close button */
if (TWEAK_WineLook == WIN95_LOOK)
if (TWEAK_WineLook == WIN95_LOOK)
if((item->wID == SC_CLOSE) && (oldflags != wFlags))
{
if (menu->hSysMenuOwner != 0)
@ -3327,7 +3327,7 @@ UINT WINAPI EnableMenuItem( HMENU hMenu, UINT wItemID, UINT wFlags )
POPUPMENU* parentMenu;
/* Get the parent menu to access*/
if (!(parentMenu = MENU_GetMenu(menu->hSysMenuOwner)))
if (!(parentMenu = MENU_GetMenu(menu->hSysMenuOwner)))
return (UINT)-1;
/* Refresh the frame to reflect the change*/
@ -3335,7 +3335,7 @@ UINT WINAPI EnableMenuItem( HMENU hMenu, UINT wItemID, UINT wFlags )
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER);
}
}
return oldflags;
}
@ -3353,12 +3353,12 @@ INT16 WINAPI GetMenuString16( HMENU16 hMenu, UINT16 wItemID,
/*******************************************************************
* GetMenuStringA (USER32.@)
*/
INT WINAPI GetMenuStringA(
INT WINAPI GetMenuStringA(
HMENU hMenu, /* [in] menuhandle */
UINT wItemID, /* [in] menu item (dep. on wFlags) */
LPSTR str, /* [out] outbuffer. If NULL, func returns entry length*/
INT nMaxSiz, /* [in] length of buffer. if 0, func returns entry len*/
UINT wFlags /* [in] MF_ flags */
UINT wFlags /* [in] MF_ flags */
) {
MENUITEM *item;
@ -3401,7 +3401,7 @@ BOOL WINAPI HiliteMenuItem( HWND hWnd, HMENU hMenu, UINT wItemID,
UINT wHilite )
{
LPPOPUPMENU menu;
TRACE("(%04x, %04x, %04x, %04x);\n",
TRACE("(%04x, %04x, %04x, %04x);\n",
hWnd, hMenu, wItemID, wHilite);
if (!MENU_FindItem( &hMenu, &wItemID, wHilite )) return FALSE;
if (!(menu = MENU_GetMenu(hMenu))) return FALSE;
@ -3427,7 +3427,7 @@ UINT16 WINAPI GetMenuState16( HMENU16 hMenu, UINT16 wItemID, UINT16 wFlags )
UINT WINAPI GetMenuState( HMENU hMenu, UINT wItemID, UINT wFlags )
{
MENUITEM *item;
TRACE("(menu=%04x, id=%04x, flags=%04x);\n",
TRACE("(menu=%04x, id=%04x, flags=%04x);\n",
hMenu, wItemID, wFlags);
if (!(item = MENU_FindItem( &hMenu, &wItemID, wFlags ))) return -1;
debug_print_menuitem (" item: ", item, "");
@ -3454,7 +3454,7 @@ INT16 WINAPI GetMenuItemCount16( HMENU16 hMenu )
{
LPPOPUPMENU menu = MENU_GetMenu(hMenu);
if (!menu) return -1;
TRACE("(%04x) returning %d\n",
TRACE("(%04x) returning %d\n",
hMenu, menu->nItems );
return menu->nItems;
}
@ -3467,7 +3467,7 @@ INT WINAPI GetMenuItemCount( HMENU hMenu )
{
LPPOPUPMENU menu = MENU_GetMenu(hMenu);
if (!menu) return -1;
TRACE("(%04x) returning %d\n",
TRACE("(%04x) returning %d\n",
hMenu, menu->nItems );
return menu->nItems;
}
@ -3612,7 +3612,7 @@ BOOL WINAPI RemoveMenu( HMENU hMenu, UINT nPos, UINT wFlags )
TRACE("(menu=%04x pos=%04x flags=%04x)\n",hMenu, nPos, wFlags);
if (!(item = MENU_FindItem( &hMenu, &nPos, wFlags ))) return FALSE;
if (!(menu = MENU_GetMenu(hMenu))) return FALSE;
/* Remove item */
MENU_FreeItemData( item );
@ -3884,20 +3884,20 @@ HMENU WINAPI GetSystemMenu( HWND hWnd, BOOL bRevert )
{
if( bRevert )
{
DestroyMenu(wndPtr->hSysMenu);
DestroyMenu(wndPtr->hSysMenu);
wndPtr->hSysMenu = 0;
}
else
{
POPUPMENU *menu = MENU_GetMenu( wndPtr->hSysMenu );
if( menu )
if( menu )
{
if( menu->nItems > 0 && menu->items[0].hSubMenu == MENU_DefSysPopup )
menu->items[0].hSubMenu = MENU_CopySysPopup();
}
else
else
{
WARN("Current sys-menu (%04x) of wnd %04x is broken\n",
WARN("Current sys-menu (%04x) of wnd %04x is broken\n",
wndPtr->hSysMenu, hWnd);
wndPtr->hSysMenu = 0;
}
@ -3945,7 +3945,7 @@ BOOL WINAPI SetSystemMenu( HWND hwnd, HMENU hMenu )
/**********************************************************************
* GetMenu (USER32.@)
*/
HMENU WINAPI GetMenu( HWND hWnd )
HMENU WINAPI GetMenu( HWND hWnd )
{
HMENU retvalue = (HMENU)GetWindowLongA( hWnd, GWL_ID );
TRACE("for %04x returning %04x\n", hWnd, retvalue);
@ -4033,7 +4033,7 @@ BOOL WINAPI DrawMenuBar( HWND hWnd )
* DrawMenuBarTemp (USER32.@)
*
* UNDOCUMENTED !!
*
*
* called by W98SE desk.cpl Control Panel Applet
*
* Not 100% sure about the param names, but close.
@ -4314,7 +4314,7 @@ static BOOL GetMenuItemInfo_common ( HMENU hmenu, UINT item, BOOL bypos,
BOOL WINAPI GetMenuItemInfoA( HMENU hmenu, UINT item, BOOL bypos,
LPMENUITEMINFOA lpmii)
{
return GetMenuItemInfo_common (hmenu, item, bypos,
return GetMenuItemInfo_common (hmenu, item, bypos,
(LPMENUITEMINFOW)lpmii, FALSE);
}
@ -4371,7 +4371,7 @@ static BOOL SetMenuItemInfo_common(MENUITEM * menu,
menu->text = NULL;
}
/* make only MENU_ITEM_TYPE bits in menu->fType equal lpmii->fType */
/* make only MENU_ITEM_TYPE bits in menu->fType equal lpmii->fType */
menu->fType &= ~MENU_ITEM_TYPE(menu->fType);
menu->fType |= MENU_ITEM_TYPE(lpmii->fType);
@ -4445,10 +4445,10 @@ static BOOL SetMenuItemInfo_common(MENUITEM * menu,
* SetMenuItemInfoA (USER32.@)
*/
BOOL WINAPI SetMenuItemInfoA(HMENU hmenu, UINT item, BOOL bypos,
const MENUITEMINFOA *lpmii)
const MENUITEMINFOA *lpmii)
{
if ((lpmii->fType & (MF_HILITE|MF_POPUP)) || (lpmii->fState)) {
/* QuickTime does pass invalid data into SetMenuItemInfo.
/* QuickTime does pass invalid data into SetMenuItemInfo.
* do some of the checks Windows does.
*/
WARN("Bad masks for type (0x%08x) or state (0x%08x)\n",
@ -4479,7 +4479,7 @@ BOOL WINAPI SetMenuDefaultItem(HMENU hmenu, UINT uItem, UINT bypos)
UINT i;
POPUPMENU *menu;
MENUITEM *item;
TRACE("(0x%x,%d,%d)\n", hmenu, uItem, bypos);
if (!(menu = MENU_GetMenu(hmenu))) return FALSE;
@ -4490,7 +4490,7 @@ BOOL WINAPI SetMenuDefaultItem(HMENU hmenu, UINT uItem, UINT bypos)
{
item->fState &= ~MFS_DEFAULT;
}
/* no default item */
if ( -1 == uItem)
{
@ -4514,7 +4514,7 @@ BOOL WINAPI SetMenuDefaultItem(HMENU hmenu, UINT uItem, UINT bypos)
return TRUE;
}
}
}
return FALSE;
}
@ -4534,16 +4534,16 @@ UINT WINAPI GetMenuDefaultItem(HMENU hmenu, UINT bypos, UINT flags)
/* find default item */
item = menu->items;
/* empty menu */
if (! item) return -1;
while ( !( item->fState & MFS_DEFAULT ) )
{
i++; item++;
if (i >= menu->nItems ) return -1;
}
/* default: don't return disabled items */
if ( (!(GMDI_USEDISABLED & flags)) && (item->fState & MFS_DISABLED )) return -1;
@ -4660,10 +4660,10 @@ BOOL16 WINAPI CheckMenuRadioItem16(HMENU16 hMenu,
/**********************************************************************
* GetMenuItemRect (USER32.@)
*
* ATTENTION: Here, the returned values in rect are the screen
* coordinates of the item just like if the menu was
* ATTENTION: Here, the returned values in rect are the screen
* coordinates of the item just like if the menu was
* always on the upper left side of the application.
*
*
*/
BOOL WINAPI GetMenuItemRect (HWND hwnd, HMENU hMenu, UINT uItem,
LPRECT rect)
@ -4680,7 +4680,7 @@ BOOL WINAPI GetMenuItemRect (HWND hwnd, HMENU hMenu, UINT uItem,
if(!hwnd)
{
itemMenu = MENU_GetMenu(hMenu);
if (itemMenu == NULL)
if (itemMenu == NULL)
return FALSE;
if(itemMenu->hWnd == 0)
@ -4688,7 +4688,7 @@ BOOL WINAPI GetMenuItemRect (HWND hwnd, HMENU hMenu, UINT uItem,
referenceHwnd = itemMenu->hWnd;
}
if ((rect == NULL) || (item == NULL))
if ((rect == NULL) || (item == NULL))
return FALSE;
*rect = item->rect;
@ -4803,7 +4803,7 @@ DWORD WINAPI GetMenuContextHelpId16( HMENU16 hMenu )
{
return GetMenuContextHelpId( hMenu );
}
/**********************************************************************
* GetMenuContextHelpId (USER32.@)
*/
@ -4966,11 +4966,11 @@ static BOOL translate_accelerator( HWND hWnd, UINT message, WPARAM wParam, LPARA
}
else
{
/* some reasons for NOT sending the WM_{SYS}COMMAND message:
/* some reasons for NOT sending the WM_{SYS}COMMAND message:
* #0: unknown (please report!)
* #1: for WM_KEYUP,WM_SYSKEYUP
* #2: mouse is captured
* #3: window is disabled
* #3: window is disabled
* #4: it's a disabled system menu option
* #5: it's a menu option, but window is iconic
* #6: it's a menu option, but disabled

View File

@ -111,9 +111,9 @@ static BOOL SCROLL_trackVertical;
static BOOL SCROLL_MovingThumb = FALSE;
/* Local functions */
static BOOL SCROLL_ShowScrollBar( HWND hwnd, INT nBar,
static BOOL SCROLL_ShowScrollBar( HWND hwnd, INT nBar,
BOOL fShowH, BOOL fShowV );
static INT SCROLL_SetScrollInfo( HWND hwnd, INT nBar,
static INT SCROLL_SetScrollInfo( HWND hwnd, INT nBar,
const SCROLLINFO *info, INT *action );
static void SCROLL_DrawInterior_9x( HWND hwnd, HDC hdc, INT nBar,
RECT *rect, INT arrowSize,
@ -519,7 +519,7 @@ static void SCROLL_DrawMovingThumb_31( HDC hdc, RECT *rect, BOOL vertical,
r.left = rect->left + arrowSize - SCROLL_ARROW_THUMB_OVERLAP;
if (r.left + thumbSize >
rect->right - (arrowSize - SCROLL_ARROW_THUMB_OVERLAP))
r.left = rect->right - (arrowSize - SCROLL_ARROW_THUMB_OVERLAP)
r.left = rect->right - (arrowSize - SCROLL_ARROW_THUMB_OVERLAP)
- thumbSize;
r.right = r.left + thumbSize;
}
@ -549,7 +549,7 @@ static void SCROLL_DrawMovingThumb_9x( HDC hdc, RECT *rect, BOOL vertical,
SCROLL_DrawInterior_9x( SCROLL_TrackingWin, hdc, SCROLL_TrackingBar,
rect, arrowSize, thumbSize, pos,
0, vertical, FALSE, FALSE );
SCROLL_MovingThumb = !SCROLL_MovingThumb;
}
@ -567,7 +567,7 @@ static void SCROLL_DrawMovingThumb( HDC hdc, RECT *rect, BOOL vertical,
*
* Draw the scroll bar interior (everything except the arrows).
*/
static void SCROLL_DrawInterior_9x( HWND hwnd, HDC hdc, INT nBar,
static void SCROLL_DrawInterior_9x( HWND hwnd, HDC hdc, INT nBar,
RECT *rect, INT arrowSize,
INT thumbSize, INT thumbPos,
UINT flags, BOOL vertical,
@ -582,7 +582,7 @@ static void SCROLL_DrawInterior_9x( HWND hwnd, HDC hdc, INT nBar,
* to correctly setup default scrollbar colors
*/
if (nBar == SB_CTL)
{
{
hBrush = (HBRUSH)SendMessageA( GetParent(hwnd), WM_CTLCOLORSCROLLBAR,
(WPARAM)hdc,(LPARAM)hwnd);
}
@ -656,7 +656,7 @@ static void SCROLL_DrawInterior_9x( HWND hwnd, HDC hdc, INT nBar,
}
static void SCROLL_DrawInterior( HWND hwnd, HDC hdc, INT nBar,
static void SCROLL_DrawInterior( HWND hwnd, HDC hdc, INT nBar,
RECT *rect, INT arrowSize,
INT thumbSize, INT thumbPos,
UINT flags, BOOL vertical,
@ -685,11 +685,11 @@ static void SCROLL_DrawInterior( HWND hwnd, HDC hdc, INT nBar,
* The window-owned scrollbars need to call DEFWND_ControlColor
* to correctly setup default scrollbar colors
*/
if (nBar == SB_CTL) {
if (nBar == SB_CTL) {
hBrush = (HBRUSH)SendMessageA( GetParent(hwnd), WM_CTLCOLORSCROLLBAR,
(WPARAM)hdc,(LPARAM)hwnd);
} else {
hBrush = DEFWND_ControlColor( hdc, CTLCOLOR_SCROLLBAR );
hBrush = DEFWND_ControlColor( hdc, CTLCOLOR_SCROLLBAR );
}
}
hSavePen = SelectObject( hdc, SYSCOLOR_GetPen(COLOR_WINDOWFRAME) );
@ -792,7 +792,7 @@ static void SCROLL_DrawInterior( HWND hwnd, HDC hdc, INT nBar,
*
* Redraw the whole scrollbar.
*/
void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, INT nBar,
void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, INT nBar,
BOOL arrows, BOOL interior )
{
INT arrowSize, thumbSize, thumbPos;
@ -829,7 +829,7 @@ void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, INT nBar,
(SCROLL_trackHitTest == SCROLL_TOP_ARROW),
(SCROLL_trackHitTest == SCROLL_BOTTOM_ARROW) );
else
SCROLL_DrawArrows( hdc, infoPtr, &rect, arrowSize, vertical,
SCROLL_DrawArrows( hdc, infoPtr, &rect, arrowSize, vertical,
FALSE, FALSE );
}
if( interior )
@ -865,7 +865,7 @@ END:
* Repaint the scroll bar interior after a SetScrollRange() or
* SetScrollPos() call.
*/
static void SCROLL_RefreshScrollBar( HWND hwnd, INT nBar,
static void SCROLL_RefreshScrollBar( HWND hwnd, INT nBar,
BOOL arrows, BOOL interior )
{
HDC hdc = GetDCEx( hwnd, 0,
@ -929,7 +929,7 @@ static void SCROLL_HandleScrollEvent( HWND hwnd, INT nBar, UINT msg, POINT pt)
SCROLLBAR_INFO *infoPtr = SCROLL_GetScrollInfo( hwnd, nBar );
if (!infoPtr) return;
if ((SCROLL_trackHitTest == SCROLL_NOWHERE) && (msg != WM_LBUTTONDOWN))
if ((SCROLL_trackHitTest == SCROLL_NOWHERE) && (msg != WM_LBUTTONDOWN))
return;
hdc = GetDCEx( hwnd, 0, DCX_CACHE | ((nBar == SB_CTL) ? 0 : DCX_WINDOW));
@ -991,7 +991,7 @@ static void SCROLL_HandleScrollEvent( HWND hwnd, INT nBar, UINT msg, POINT pt)
SendMessageA( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_LINEUP, (LPARAM)hwndCtl );
}
SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY,
(TIMERPROC)0 );
@ -1207,7 +1207,7 @@ static LRESULT WINAPI ScrollBarWndProc( HWND hwnd, UINT message, WPARAM wParam,
MoveWindow( hwnd, lpCreat->x, lpCreat->y,
GetSystemMetrics(SM_CXVSCROLL)+1, lpCreat->cy, FALSE );
else if (lpCreat->style & SBS_RIGHTALIGN)
MoveWindow( hwnd,
MoveWindow( hwnd,
lpCreat->x+lpCreat->cx-GetSystemMetrics(SM_CXVSCROLL)-1,
lpCreat->y,
GetSystemMetrics(SM_CXVSCROLL)+1, lpCreat->cy, FALSE );
@ -1218,7 +1218,7 @@ static LRESULT WINAPI ScrollBarWndProc( HWND hwnd, UINT message, WPARAM wParam,
MoveWindow( hwnd, lpCreat->x, lpCreat->y,
lpCreat->cx, GetSystemMetrics(SM_CYHSCROLL)+1, FALSE );
else if (lpCreat->style & SBS_BOTTOMALIGN)
MoveWindow( hwnd,
MoveWindow( hwnd,
lpCreat->x,
lpCreat->y+lpCreat->cy-GetSystemMetrics(SM_CYHSCROLL)-1,
lpCreat->cx, GetSystemMetrics(SM_CYHSCROLL)+1, FALSE );
@ -1397,7 +1397,7 @@ static LRESULT WINAPI ScrollBarWndProc( HWND hwnd, UINT message, WPARAM wParam,
/*************************************************************************
* SetScrollInfo (USER32.@)
* SetScrollInfo can be used to set the position, upper bound,
* SetScrollInfo can be used to set the position, upper bound,
* lower bound, and page size of a scrollbar control.
*
* RETURNS
@ -1409,9 +1409,9 @@ static LRESULT WINAPI ScrollBarWndProc( HWND hwnd, UINT message, WPARAM wParam,
* (corresponding to the 76 different positions of the window on
* the text), and info->nPage=25.
*/
INT WINAPI SetScrollInfo(
HWND hwnd /* [in] Handle of window whose scrollbar will be affected */,
INT nBar /* [in] One of SB_HORZ, SB_VERT, or SB_CTL */,
INT WINAPI SetScrollInfo(
HWND hwnd /* [in] Handle of window whose scrollbar will be affected */,
INT nBar /* [in] One of SB_HORZ, SB_VERT, or SB_CTL */,
const SCROLLINFO *info /* [in] Specifies what to change and new values */,
BOOL bRedraw /* [in] Should scrollbar be redrawn afterwards ? */)
{
@ -1434,10 +1434,10 @@ BOOL bRedraw /* [in] Should scrollbar be redrawn afterwards ? */)
return retVal;
}
INT SCROLL_SetScrollInfo( HWND hwnd, INT nBar,
INT SCROLL_SetScrollInfo( HWND hwnd, INT nBar,
const SCROLLINFO *info, INT *action )
{
/* Update the scrollbar state and set action flags according to
/* Update the scrollbar state and set action flags according to
* what has to be done graphics wise. */
SCROLLBAR_INFO *infoPtr;
@ -1468,7 +1468,7 @@ INT SCROLL_SetScrollInfo( HWND hwnd, INT nBar,
{
infoPtr->Page = info->nPage;
*action |= SA_SSI_REFRESH;
bChangeParams = TRUE;
bChangeParams = TRUE;
}
}
@ -1500,7 +1500,7 @@ INT SCROLL_SetScrollInfo( HWND hwnd, INT nBar,
if( infoPtr->MinVal != info->nMin ||
infoPtr->MaxVal != info->nMax )
{
*action |= SA_SSI_REFRESH;
*action |= SA_SSI_REFRESH;
infoPtr->MinVal = info->nMin;
infoPtr->MaxVal = info->nMax;
bChangeParams = TRUE;
@ -1525,7 +1525,7 @@ INT SCROLL_SetScrollInfo( HWND hwnd, INT nBar,
infoPtr->Page, infoPtr->CurVal,
infoPtr->MinVal, infoPtr->MaxVal );
/* don't change the scrollbar state if SetScrollInfo
/* don't change the scrollbar state if SetScrollInfo
* is just called with SIF_DISABLENOSCROLL
*/
if(!(info->fMask & SIF_ALL)) goto done;
@ -1572,14 +1572,14 @@ done:
/*************************************************************************
* GetScrollInfo (USER32.@)
* GetScrollInfo can be used to retrieve the position, upper bound,
* GetScrollInfo can be used to retrieve the position, upper bound,
* lower bound, and page size of a scrollbar control.
*
* RETURNS STD
*/
BOOL WINAPI GetScrollInfo(
HWND hwnd /* [in] Handle of window */ ,
INT nBar /* [in] One of SB_HORZ, SB_VERT, or SB_CTL */,
BOOL WINAPI GetScrollInfo(
HWND hwnd /* [in] Handle of window */ ,
INT nBar /* [in] One of SB_HORZ, SB_VERT, or SB_CTL */,
LPSCROLLINFO info /* [in/out] (info.fMask [in] specifies which values are to retrieve) */)
{
SCROLLBAR_INFO *infoPtr;
@ -1613,7 +1613,7 @@ BOOL WINAPI GetScrollInfo(
* Note the ambiguity when 0 is returned. Use GetLastError
* to make sure there was an error (and to know which one).
*/
INT WINAPI SetScrollPos(
INT WINAPI SetScrollPos(
HWND hwnd /* [in] Handle of window whose scrollbar will be affected */,
INT nBar /* [in] One of SB_HORZ, SB_VERT, or SB_CTL */,
INT nPos /* [in] New value */,
@ -1638,13 +1638,13 @@ BOOL bRedraw /* [in] Should scrollbar be redrawn afterwards ? */ )
*
* RETURNS
* Success: Current position
* Failure: 0
* Failure: 0
*
* REMARKS
* Note the ambiguity when 0 is returned. Use GetLastError
* to make sure there was an error (and to know which one).
*/
INT WINAPI GetScrollPos(
INT WINAPI GetScrollPos(
HWND hwnd, /* [in] Handle of window */
INT nBar /* [in] One of SB_HORZ, SB_VERT, or SB_CTL */)
{
@ -1660,7 +1660,7 @@ INT nBar /* [in] One of SB_HORZ, SB_VERT, or SB_CTL */)
*
* RETURNS STD
*/
BOOL WINAPI SetScrollRange(
BOOL WINAPI SetScrollRange(
HWND hwnd, /* [in] Handle of window whose scrollbar will be affected */
INT nBar, /* [in] One of SB_HORZ, SB_VERT, or SB_CTL */
INT MinVal, /* [in] New minimum value */
@ -1720,7 +1720,7 @@ INT SCROLL_SetNCSbState(HWND hwnd, int vMin, int vMax, int vPos,
*
* RETURNS STD
*/
BOOL WINAPI GetScrollRange(
BOOL WINAPI GetScrollRange(
HWND hwnd, /* [in] Handle of window */
INT nBar, /* [in] One of SB_HORZ, SB_VERT, or SB_CTL */
LPINT lpMin, /* [out] Where to store minimum value */
@ -1745,7 +1745,7 @@ LPINT lpMax /* [out] Where to store maximum value */)
*
* Back-end for ShowScrollBar(). Returns FALSE if no action was taken.
*/
BOOL SCROLL_ShowScrollBar( HWND hwnd, INT nBar,
BOOL SCROLL_ShowScrollBar( HWND hwnd, INT nBar,
BOOL fShowH, BOOL fShowV )
{
LONG style = GetWindowLongW( hwnd, GWL_STYLE );
@ -1847,7 +1847,7 @@ BOOL WINAPI EnableScrollBar( HWND hwnd, INT nBar, UINT flags )
}
else
bFineWithMe = TRUE;
if (!(infoPtr = SCROLL_GetScrollInfo( hwnd, nBar ))) return FALSE;
if (bFineWithMe && infoPtr->flags == flags) return FALSE;
infoPtr->flags = flags;

View File

@ -238,7 +238,7 @@ static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam,
/*
* FIXME
* DestroyIcon32( STATIC_SetIcon( wndPtr, 0 ) );
*
*
* We don't want to do this yet because DestroyIcon32 is broken. If the icon
* had already been loaded by the application the last thing we want to do is
* GlobalFree16 the handle.
@ -292,7 +292,7 @@ static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam,
STATIC_SetIcon(hwnd, hIcon, style);
break;
}
case SS_BITMAP:
case SS_BITMAP:
{
HBITMAP hBitmap;
if(unicode)
@ -485,7 +485,7 @@ static void STATIC_PaintRectfn( HWND hwnd, HDC hdc, DWORD style )
HBRUSH hBrush;
GetClientRect( hwnd, &rc);
switch (style & SS_TYPEMASK)
{
case SS_BLACKRECT:

View File

@ -103,9 +103,9 @@ static const signed char LTRBOuterFlat[] = {
static const signed char LTRBInnerFlat[] = {
-1, -1, -1, -1,
-1, COLOR_BTNFACE, COLOR_BTNFACE, COLOR_BTNFACE,
-1, COLOR_BTNFACE, COLOR_BTNFACE, COLOR_BTNFACE,
-1, COLOR_BTNFACE, COLOR_BTNFACE, COLOR_BTNFACE,
-1, COLOR_BTNFACE, COLOR_BTNFACE, COLOR_BTNFACE,
-1, COLOR_BTNFACE, COLOR_BTNFACE, COLOR_BTNFACE,
-1, COLOR_BTNFACE, COLOR_BTNFACE, COLOR_BTNFACE,
};
/***********************************************************************
@ -117,7 +117,7 @@ static const signed char LTRBInnerFlat[] = {
*
* See also comments with UITOOLS_DrawRectEdge()
*/
static BOOL UITOOLS95_DrawDiagEdge(HDC hdc, LPRECT rc,
static BOOL UITOOLS95_DrawDiagEdge(HDC hdc, LPRECT rc,
UINT uType, UINT uFlags)
{
POINT Points[4];
@ -140,7 +140,7 @@ static BOOL UITOOLS95_DrawDiagEdge(HDC hdc, LPRECT rc,
OuterPen = InnerPen = (HPEN)GetStockObject(NULL_PEN);
SavePen = (HPEN)SelectObject(hdc, InnerPen);
spx = spy = epx = epy = 0; /* Satisfy the compiler... */
/* Determine the colors of the edges */
if(uFlags & BF_MONO)
{
@ -430,7 +430,7 @@ static BOOL UITOOLS95_DrawDiagEdge(HDC hdc, LPRECT rc,
*/
static BOOL UITOOLS95_DrawRectEdge(HDC hdc, LPRECT rc,
static BOOL UITOOLS95_DrawRectEdge(HDC hdc, LPRECT rc,
UINT uType, UINT uFlags)
{
signed char LTInnerI, LTOuterI;
@ -447,7 +447,7 @@ static BOOL UITOOLS95_DrawRectEdge(HDC hdc, LPRECT rc,
BOOL retval = !( ((uType & BDR_INNER) == BDR_INNER
|| (uType & BDR_OUTER) == BDR_OUTER)
&& !(uFlags & (BF_FLAT|BF_MONO)) );
/* Init some vars */
LTInnerPen = LTOuterPen = RBInnerPen = RBOuterPen = (HPEN)GetStockObject(NULL_PEN);
SavePen = (HPEN)SelectObject(hdc, LTInnerPen);
@ -470,7 +470,7 @@ static BOOL UITOOLS95_DrawRectEdge(HDC hdc, LPRECT rc,
* otherwise.
* Dennis Björklund, 10 June, 99
*/
if( TWEAK_WineLook == WIN98_LOOK && LTInnerI != -1 )
if( TWEAK_WineLook == WIN98_LOOK && LTInnerI != -1 )
LTInnerI = RBInnerI = COLOR_BTNFACE;
}
else if(uFlags & BF_SOFT)
@ -559,8 +559,8 @@ static BOOL UITOOLS95_DrawRectEdge(HDC hdc, LPRECT rc,
if(uFlags & BF_BOTTOM) InnerRect.bottom -= add;
if((uFlags & BF_MIDDLE) && retval)
{
FillRect(hdc, &InnerRect, GetSysColorBrush(uFlags & BF_MONO ?
{
FillRect(hdc, &InnerRect, GetSysColorBrush(uFlags & BF_MONO ?
COLOR_WINDOW : COLOR_BTNFACE));
}
@ -944,8 +944,8 @@ static BOOL UITOOLS95_DrawFrameCaption(HDC dc, LPRECT r, UINT uFlags)
{
case DFCS_CAPTIONCLOSE:
{
/* The "X" is made by drawing a series of lines.
* The number of lines drawn depends on the size
/* The "X" is made by drawing a series of lines.
* The number of lines drawn depends on the size
* of the bounding rect. e.g. For a 6x5 inside rect,
* two lines are drawn from top-left to bottom-right,
* and two lines from top-right to bottom-left.
@ -1145,7 +1145,7 @@ static BOOL UITOOLS95_DrawFrameScroll(HDC dc, LPRECT r, UINT uFlags)
/*
* This fixes a problem with really tiny "scroll" buttons. In particular
* with the updown control.
* with the updown control.
* Making sure that the arrow is as least 3 pixels wide (or high).
*/
if (tri == 0)
@ -1405,7 +1405,7 @@ BOOL WINAPI DrawFrameControl( HDC hdc, LPRECT rc, UINT uType,
/* Win95 doesn't support drawing in other mapping modes */
if(GetMapMode(hdc) != MM_TEXT)
return FALSE;
switch(uType)
{
case DFC_BUTTON:

View File

@ -178,23 +178,23 @@ BOOL DEBUG_IsFctReturn(void)
void DEBUG_SetBreakpoints( BOOL set )
{
int i;
#ifdef __i386__
DEBUG_context.Dr7 &= ~DR7_LOCAL_ENABLE_MASK;
#endif
for (i = 0; i < next_bp; i++)
{
if (!(breakpoints[i].refcount && breakpoints[i].enabled))
continue;
switch (breakpoints[i].type) {
case DBG_BREAK:
{
#ifdef __i386__
char ch = set ? INT3 : breakpoints[i].u.b.opcode;
if (!DEBUG_WRITE_MEM( (void*)DEBUG_ToLinear(&breakpoints[i].addr),
if (!DEBUG_WRITE_MEM( (void*)DEBUG_ToLinear(&breakpoints[i].addr),
&ch, sizeof(ch) ))
{
DEBUG_Printf(DBG_CHN_MESG, "Invalid address for breakpoint %d, disabling it\n", i);
@ -204,14 +204,14 @@ void DEBUG_SetBreakpoints( BOOL set )
}
break;
case DBG_WATCH:
if (set)
if (set)
{
#ifdef __i386__
DWORD bits;
int reg = breakpoints[i].u.w.reg;
LPDWORD lpdr = NULL;
switch (reg)
switch (reg)
{
case 0: lpdr = &DEBUG_context.Dr0; break;
case 1: lpdr = &DEBUG_context.Dr1; break;
@ -219,7 +219,7 @@ void DEBUG_SetBreakpoints( BOOL set )
case 3: lpdr = &DEBUG_context.Dr3; break;
default: RaiseException(DEBUG_STATUS_INTERNAL_ERROR, 0, 0, NULL);
}
*lpdr = DEBUG_ToLinear(&breakpoints[i].addr);
bits = (breakpoints[i].u.w.rw) ? DR7_RW_WRITE : DR7_RW_READ;
switch (breakpoints[i].u.w.len + 1)
@ -229,7 +229,7 @@ void DEBUG_SetBreakpoints( BOOL set )
case 1: bits |= DR7_LEN_1; break;
default: RaiseException(DEBUG_STATUS_INTERNAL_ERROR, 0, 0, NULL);
}
DEBUG_context.Dr7 &= ~(0x0F << (DR7_CONTROL_SHIFT + DR7_CONTROL_SIZE * reg));
DEBUG_context.Dr7 |= bits << (DR7_CONTROL_SHIFT + DR7_CONTROL_SIZE * reg);
DEBUG_context.Dr7 |= DR7_ENABLE_MASK(reg) | DR7_LOCAL_SLOWDOWN;
@ -246,22 +246,22 @@ void DEBUG_SetBreakpoints( BOOL set )
* Find the breakpoint for a given address. Return the breakpoint
* number or -1 if none.
* If type is DBG_BREAKPOINT, addr is a complete addr
* If type is DBG_WATCHPOINT, only addr.off is meaningful and contains
* If type is DBG_WATCHPOINT, only addr.off is meaningful and contains
* linear address
*/
static int DEBUG_FindBreakpoint( const DBG_ADDR *addr, int type )
{
int i;
for (i = 0; i < next_bp; i++)
{
if (breakpoints[i].refcount && breakpoints[i].enabled &&
breakpoints[i].type == type )
{
if ((type == DBG_BREAK &&
if ((type == DBG_BREAK &&
breakpoints[i].addr.seg == addr->seg &&
breakpoints[i].addr.off == addr->off) ||
(type == DBG_WATCH &&
(type == DBG_WATCH &&
DEBUG_ToLinear(&breakpoints[i].addr) == addr->off))
return i;
}
@ -277,11 +277,11 @@ static int DEBUG_FindBreakpoint( const DBG_ADDR *addr, int type )
static int DEBUG_InitXPoint(int type, DBG_ADDR* addr)
{
int num;
for (num = (next_bp < MAX_BREAKPOINTS) ? next_bp++ : 1;
num < MAX_BREAKPOINTS; num++)
for (num = (next_bp < MAX_BREAKPOINTS) ? next_bp++ : 1;
num < MAX_BREAKPOINTS; num++)
{
if (breakpoints[num].refcount == 0)
if (breakpoints[num].refcount == 0)
{
breakpoints[num].refcount = 1;
breakpoints[num].enabled = TRUE;
@ -316,12 +316,12 @@ static int DEBUG_InitXPoint(int type, DBG_ADDR* addr)
static BOOL DEBUG_GetWatchedValue( int num, LPDWORD val )
{
BYTE buf[4];
if (!DEBUG_READ_MEM((void*)DEBUG_ToLinear(&breakpoints[num].addr),
if (!DEBUG_READ_MEM((void*)DEBUG_ToLinear(&breakpoints[num].addr),
buf, breakpoints[num].u.w.len + 1))
return FALSE;
switch (breakpoints[num].u.w.len + 1)
switch (breakpoints[num].u.w.len + 1)
{
case 4: *val = *(DWORD*)buf; break;
case 2: *val = *(WORD*)buf; break;
@ -355,7 +355,7 @@ void DEBUG_AddBreakpoint( const DBG_VALUE *_value, BOOL (*func)(void) )
value.addr.seg = seg2;
}
if ((num = DEBUG_FindBreakpoint(&value.addr, DBG_BREAK)) >= 1)
if ((num = DEBUG_FindBreakpoint(&value.addr, DBG_BREAK)) >= 1)
{
breakpoints[num].refcount++;
return;
@ -401,7 +401,7 @@ void DEBUG_AddBreakpointFromId(const char *name, int lineno)
return;
}
}
DEBUG_CurrProcess->delayed_bp = DBG_realloc(DEBUG_CurrProcess->delayed_bp,
DEBUG_CurrProcess->delayed_bp = DBG_realloc(DEBUG_CurrProcess->delayed_bp,
sizeof(DBG_DELAYED_BP) * ++DEBUG_CurrProcess->num_delayed_bp);
DEBUG_CurrProcess->delayed_bp[DEBUG_CurrProcess->num_delayed_bp - 1].name = strcpy(DBG_alloc(strlen(name) + 1), name);
@ -416,12 +416,12 @@ void DEBUG_AddBreakpointFromId(const char *name, int lineno)
void DEBUG_AddBreakpointFromLineno(int lineno)
{
DBG_VALUE value;
DEBUG_GetCurrentAddress(&value.addr);
if (lineno != -1) {
struct name_hash* nh;
DEBUG_FindNearestSymbol(&value.addr, TRUE, &nh, 0, NULL);
if (nh == NULL) {
DEBUG_Printf(DBG_CHN_MESG, "Unable to add breakpoint\n");
@ -429,7 +429,7 @@ void DEBUG_AddBreakpointFromLineno(int lineno)
}
DEBUG_GetLineNumberAddr(nh, lineno, &value.addr, TRUE);
}
value.type = NULL;
value.cookie = DV_TARGET;
DEBUG_AddBreakpoint( &value, NULL );
@ -467,13 +467,13 @@ void DEBUG_AddWatchpoint( const DBG_VALUE *_value, BOOL is_write )
int num, reg = -1;
unsigned seg2;
DWORD mask = 0;
assert(_value->cookie == DV_TARGET || _value->cookie == DV_HOST);
#ifdef __i386__
DEBUG_FixAddress( &value.addr, DEBUG_context.SegCs );
#endif
if ( value.type != NULL && value.type == DEBUG_GetBasicType(DT_BASIC_CONST_INT) )
{
/*
@ -486,10 +486,10 @@ void DEBUG_AddWatchpoint( const DBG_VALUE *_value, BOOL is_write )
value.addr.off = DEBUG_GetExprValue(&value, NULL);
value.addr.seg = seg2;
}
for (num = 1; num < next_bp; num++)
for (num = 1; num < next_bp; num++)
{
if (breakpoints[num].refcount && breakpoints[num].enabled &&
if (breakpoints[num].refcount && breakpoints[num].enabled &&
breakpoints[num].type == DBG_WATCH) {
mask |= (1 << breakpoints[num].u.w.reg);
}
@ -505,12 +505,12 @@ void DEBUG_AddWatchpoint( const DBG_VALUE *_value, BOOL is_write )
if ((num = DEBUG_InitXPoint(DBG_WATCH, &value.addr)) == -1)
return;
breakpoints[num].u.w.len = 4 - 1;
if (_value->type && DEBUG_GetObjectSize(_value->type) < 4)
breakpoints[num].u.w.len = 2 - 1;
if (!DEBUG_GetWatchedValue( num, &breakpoints[num].u.w.oldval))
if (!DEBUG_GetWatchedValue( num, &breakpoints[num].u.w.oldval))
{
DEBUG_Printf(DBG_CHN_MESG, "Bad address. Watchpoint not set\n");
breakpoints[num].refcount = 0;
@ -519,7 +519,7 @@ void DEBUG_AddWatchpoint( const DBG_VALUE *_value, BOOL is_write )
{
breakpoints[num].u.w.rw = (is_write) ? TRUE : FALSE;
breakpoints[reg].u.w.reg = reg;
DEBUG_Printf( DBG_CHN_MESG, "Watchpoint %d at ", num );
DEBUG_PrintAddress( &breakpoints[num].addr, breakpoints[num].is32 ? MODE_32 : MODE_16, TRUE );
DEBUG_Printf( DBG_CHN_MESG, "\n" );
@ -534,7 +534,7 @@ void DEBUG_AddWatchpoint( const DBG_VALUE *_value, BOOL is_write )
void DEBUG_AddWatchpointFromId(const char *name)
{
DBG_VALUE value;
if( DEBUG_GetSymbolValue(name, -1, &value, TRUE) )
DEBUG_AddWatchpoint( &value, 1 );
else
@ -593,7 +593,7 @@ void DEBUG_EnableBreakpoint( int num, BOOL enable )
* the value watched before the TRAP
* Return -1 if none found (*oldval is undetermined)
*
* Unfortunately, Linux does *NOT* (A REAL PITA) report with ptrace
* Unfortunately, Linux does *NOT* (A REAL PITA) report with ptrace
* the DR6 register value, so we have to look with our own need the
* cause of the TRAP.
* -EP
@ -603,20 +603,20 @@ static int DEBUG_FindTriggeredWatchpoint(LPDWORD oldval)
int found = -1;
#ifdef __i386__
int i;
/* Method 1 => get triggered watchpoint from context (doesn't work on Linux
* 2.2.x). This should be fixed in >= 2.2.16
*/
for (i = 0; i < next_bp; i++)
for (i = 0; i < next_bp; i++)
{
DWORD val = 0;
if (breakpoints[i].refcount && breakpoints[i].enabled &&
if (breakpoints[i].refcount && breakpoints[i].enabled &&
breakpoints[i].type == DBG_WATCH &&
(DEBUG_context.Dr6 & (1 << breakpoints[i].u.w.reg)))
{
DEBUG_context.Dr6 &= ~(1 << breakpoints[i].u.w.reg);
*oldval = breakpoints[i].u.w.oldval;
if (DEBUG_GetWatchedValue(i, &val)) {
breakpoints[i].u.w.oldval = val;
@ -624,23 +624,23 @@ static int DEBUG_FindTriggeredWatchpoint(LPDWORD oldval)
}
}
}
/* Method 1 failed, trying method 2 */
/* Method 2 => check if value has changed among registered watchpoints
* this really sucks, but this is how gdb 4.18 works on my linux box
* -EP
*/
for (i = 0; i < next_bp; i++)
for (i = 0; i < next_bp; i++)
{
DWORD val = 0;
if (breakpoints[i].refcount && breakpoints[i].enabled &&
breakpoints[i].type == DBG_WATCH &&
DEBUG_GetWatchedValue(i, &val))
if (breakpoints[i].refcount && breakpoints[i].enabled &&
breakpoints[i].type == DBG_WATCH &&
DEBUG_GetWatchedValue(i, &val))
{
*oldval = breakpoints[i].u.w.oldval;
if (val != *oldval)
if (val != *oldval)
{
DEBUG_context.Dr6 &= ~(1 << breakpoints[i].u.w.reg);
breakpoints[i].u.w.oldval = val;
@ -671,7 +671,7 @@ void DEBUG_InfoBreakpoints(void)
if (breakpoints[i].refcount && breakpoints[i].type == DBG_BREAK)
{
DEBUG_Printf( DBG_CHN_MESG, "%d: %c ", i, breakpoints[i].enabled ? 'y' : 'n');
DEBUG_PrintAddress( &breakpoints[i].addr,
DEBUG_PrintAddress( &breakpoints[i].addr,
breakpoints[i].is32 ? MODE_32 : MODE_16, TRUE);
DEBUG_Printf( DBG_CHN_MESG, " (%u)\n", breakpoints[i].refcount );
if( breakpoints[i].condition != NULL )
@ -688,10 +688,10 @@ void DEBUG_InfoBreakpoints(void)
if (breakpoints[i].refcount && breakpoints[i].type == DBG_WATCH)
{
DEBUG_Printf( DBG_CHN_MESG, "%d: %c ", i, breakpoints[i].enabled ? 'y' : 'n');
DEBUG_PrintAddress( &breakpoints[i].addr,
DEBUG_PrintAddress( &breakpoints[i].addr,
breakpoints[i].is32 ? MODE_32 : MODE_16, TRUE);
DEBUG_Printf( DBG_CHN_MESG, " on %d byte%s (%c)\n",
breakpoints[i].u.w.len + 1,
DEBUG_Printf( DBG_CHN_MESG, " on %d byte%s (%c)\n",
breakpoints[i].u.w.len + 1,
breakpoints[i].u.w.len > 0 ? "s" : "",
breakpoints[i].u.w.rw ? 'W' : 'R');
if( breakpoints[i].condition != NULL )
@ -731,7 +731,7 @@ static BOOL DEBUG_ShallBreak( int bpnum )
return FALSE;
}
}
if ( breakpoints[bpnum].skipcount > 0 && --breakpoints[bpnum].skipcount > 0 )
return FALSE;
@ -775,7 +775,7 @@ BOOL DEBUG_ShouldContinue( DBG_ADDR *addr, DWORD code, int * count )
syminfo = DEBUG_PrintAddress( &breakpoints[bpnum].addr,
breakpoints[bpnum].is32 ? MODE_32 : MODE_16, TRUE );
DEBUG_Printf( DBG_CHN_MESG, "\n" );
if( syminfo.list.sourcefile != NULL )
DEBUG_List(&syminfo.list, NULL, 0);
return FALSE;
@ -785,7 +785,7 @@ BOOL DEBUG_ShouldContinue( DBG_ADDR *addr, DWORD code, int * count )
if ((wpnum != 0) && (wpnum != -1))
{
/* If not single-stepping, do not back up over the int3 instruction */
if (code == EXCEPTION_BREAKPOINT)
if (code == EXCEPTION_BREAKPOINT)
{
#ifdef __i386__
DEBUG_context.Eip++;
@ -793,12 +793,12 @@ BOOL DEBUG_ShouldContinue( DBG_ADDR *addr, DWORD code, int * count )
#endif
}
if (!DEBUG_ShallBreak(wpnum)) return TRUE;
addr_mode = DEBUG_GetSelectorType( addr->seg );
DEBUG_Printf(DBG_CHN_MESG, "Stopped on watchpoint %d at ", wpnum);
syminfo = DEBUG_PrintAddress( addr, addr_mode, TRUE );
DEBUG_Printf(DBG_CHN_MESG, " values: old=%lu new=%lu\n",
DEBUG_Printf(DBG_CHN_MESG, " values: old=%lu new=%lu\n",
oldval, breakpoints[wpnum].u.w.oldval);
if (syminfo.list.sourcefile != NULL)
DEBUG_List(&syminfo.list, NULL, 0);
@ -829,7 +829,7 @@ BOOL DEBUG_ShouldContinue( DBG_ADDR *addr, DWORD code, int * count )
*/
return TRUE;
}
/*
* If we are about to stop, then print out the source line if we
* have it.
@ -893,7 +893,7 @@ void DEBUG_RestartExecution( int count )
*/
ret_mode = mode = DEBUG_CurrThread->exec_mode;
bp = DEBUG_FindBreakpoint( &addr, DBG_BREAK );
bp = DEBUG_FindBreakpoint( &addr, DBG_BREAK );
if ( bp != -1 && bp != 0)
{
/*
@ -912,7 +912,7 @@ void DEBUG_RestartExecution( int count )
DEBUG_Printf(DBG_CHN_MESG, "Not stopped at any breakpoint; argument ignored.\n");
}
}
if( mode == EXEC_FINISH && DEBUG_IsFctReturn() )
{
mode = ret_mode = EXEC_STEPI_INSTR;
@ -932,7 +932,7 @@ void DEBUG_RestartExecution( int count )
addr2 = addr;
DEBUG_Disasm(&addr2, FALSE);
addr2.off += delta;
status = DEBUG_CheckLinenoStatus(&addr2);
/*
* Anytime we have a trampoline, step over it.
@ -946,7 +946,7 @@ void DEBUG_RestartExecution( int count )
#endif
mode = EXEC_STEP_OVER_TRAMPOLINE;
}
if( mode == EXEC_STEP_INSTR && status == FUNC_HAS_NO_LINES )
{
#if 0
@ -964,7 +964,7 @@ void DEBUG_RestartExecution( int count )
{
DEBUG_Printf(DBG_CHN_MESG, "Single stepping until exit from function, \n");
DEBUG_Printf(DBG_CHN_MESG, "which has no line number information.\n");
ret_mode = mode = EXEC_FINISH;
}
}
@ -986,8 +986,8 @@ void DEBUG_RestartExecution( int count )
* address just after the call.
*/
#ifdef __i386__
DEBUG_READ_MEM((void*)(DEBUG_context.Esp +
2 * sizeof(unsigned int)),
DEBUG_READ_MEM((void*)(DEBUG_context.Esp +
2 * sizeof(unsigned int)),
&addr.off, sizeof(addr.off));
DEBUG_context.EFlags &= ~STEP_FLAG;
#endif
@ -995,7 +995,7 @@ void DEBUG_RestartExecution( int count )
breakpoints[0].enabled = TRUE;
breakpoints[0].refcount = 1;
breakpoints[0].skipcount = 0;
DEBUG_READ_MEM((void*)DEBUG_ToLinear( &addr ), &breakpoints[0].u.b.opcode,
DEBUG_READ_MEM((void*)DEBUG_ToLinear( &addr ), &breakpoints[0].u.b.opcode,
sizeof(char));
DEBUG_SetBreakpoints( TRUE );
break;

View File

@ -1,25 +1,25 @@
/*
/*
* Mach Operating System
* Copyright (c) 1991,1990 Carnegie Mellon University
* All Rights Reserved.
*
*
* Permission to use, copy, modify and distribute this software and its
* documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
*
* Carnegie Mellon requests users of this software to return to
*
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
*
* any improvements or extensions that they make and grant Carnegie Mellon
* the rights to redistribute these changes.
*/
@ -30,23 +30,23 @@
* Add a switch to disassemble 16-bit code.
* Fix spelling of 'lods' opcodes.
* [91/10/30 dbg]
*
*
* Revision 2.5 91/10/09 16:05:58 af
* Supported disassemble of non current task by passing task parameter.
* [91/08/29 tak]
*
*
* Revision 2.4 91/05/14 16:05:04 mrt
* Correcting copyright
*
*
* Revision 2.3 91/02/05 17:11:03 mrt
* Changed to new Mach copyright
* [91/02/01 17:31:03 mrt]
*
*
* Revision 2.2 90/08/27 21:55:56 dbg
* Fix register operand for move to/from control/test/debug
* register instructions. Add i486 instructions.
* [90/08/27 dbg]
*
*
* Import db_sym.h. Print instruction displacements in
* current radix (signed). Change calling sequence of
* db_disasm.
@ -55,7 +55,7 @@
* [90/08/08 dbg]
* Created.
* [90/07/25 dbg]
*
*
*/
/*
@ -280,23 +280,23 @@ static const struct inst db_inst_0f3x[] = {
};
static const struct inst db_inst_0f4x[] = {
/*40*/ { "cmovo", TRUE, NONE, op2(E, R), 0 },
/*41*/ { "cmovno", TRUE, NONE, op2(E, R), 0 },
/*42*/ { "cmovnae",TRUE, NONE, op2(E, R), 0 },
/*43*/ { "cmovnb", TRUE, NONE, op2(E, R), 0 },
/*44*/ { "cmove", TRUE, NONE, op2(E, R), 0 },
/*45*/ { "cmovne", TRUE, NONE, op2(E, R), 0 },
/*46*/ { "cmovna", TRUE, NONE, op2(E, R), 0 },
/*47*/ { "cmova", TRUE, NONE, op2(E, R), 0 },
/*40*/ { "cmovo", TRUE, NONE, op2(E, R), 0 },
/*41*/ { "cmovno", TRUE, NONE, op2(E, R), 0 },
/*42*/ { "cmovnae",TRUE, NONE, op2(E, R), 0 },
/*43*/ { "cmovnb", TRUE, NONE, op2(E, R), 0 },
/*44*/ { "cmove", TRUE, NONE, op2(E, R), 0 },
/*45*/ { "cmovne", TRUE, NONE, op2(E, R), 0 },
/*46*/ { "cmovna", TRUE, NONE, op2(E, R), 0 },
/*47*/ { "cmova", TRUE, NONE, op2(E, R), 0 },
/*48*/ { "cmovs", TRUE, NONE, op2(E, R), 0 },
/*49*/ { "cmovns", TRUE, NONE, op2(E, R), 0 },
/*4a*/ { "cmovpe", TRUE, NONE, op2(E, R), 0 },
/*4b*/ { "cmovpo", TRUE, NONE, op2(E, R), 0 },
/*4c*/ { "cmovl", TRUE, NONE, op2(E, R), 0 },
/*4d*/ { "cmovge", TRUE, NONE, op2(E, R), 0 },
/*4e*/ { "cmovle", TRUE, NONE, op2(E, R), 0 },
/*4f*/ { "cmovnle",TRUE, NONE, op2(E, R), 0 },
/*48*/ { "cmovs", TRUE, NONE, op2(E, R), 0 },
/*49*/ { "cmovns", TRUE, NONE, op2(E, R), 0 },
/*4a*/ { "cmovpe", TRUE, NONE, op2(E, R), 0 },
/*4b*/ { "cmovpo", TRUE, NONE, op2(E, R), 0 },
/*4c*/ { "cmovl", TRUE, NONE, op2(E, R), 0 },
/*4d*/ { "cmovge", TRUE, NONE, op2(E, R), 0 },
/*4e*/ { "cmovle", TRUE, NONE, op2(E, R), 0 },
/*4f*/ { "cmovnle",TRUE, NONE, op2(E, R), 0 },
};
static const struct inst db_inst_0f5x[] = {
@ -320,43 +320,43 @@ static const struct inst db_inst_0f5x[] = {
};
static const struct inst db_inst_0f6x[] = {
/*60*/ { "punpcklbw", TRUE, NONE, op2(E, MX), 0 },
/*61*/ { "punpcklwd", TRUE, NONE, op2(E, MX), 0 },
/*62*/ { "punpckldq", TRUE, NONE, op2(E, MX), 0 },
/*63*/ { "packsswb", TRUE, NONE, op2(E, MX), 0 },
/*64*/ { "pcmpgtb", TRUE, NONE, op2(E, MX), 0 },
/*65*/ { "pcmpgtw", TRUE, NONE, op2(E, MX), 0 },
/*66*/ { "pcmpgtd", TRUE, NONE, op2(E, MX), 0 },
/*67*/ { "packuswb", TRUE, NONE, op2(E, MX), 0 },
/*60*/ { "punpcklbw", TRUE, NONE, op2(E, MX), 0 },
/*61*/ { "punpcklwd", TRUE, NONE, op2(E, MX), 0 },
/*62*/ { "punpckldq", TRUE, NONE, op2(E, MX), 0 },
/*63*/ { "packsswb", TRUE, NONE, op2(E, MX), 0 },
/*64*/ { "pcmpgtb", TRUE, NONE, op2(E, MX), 0 },
/*65*/ { "pcmpgtw", TRUE, NONE, op2(E, MX), 0 },
/*66*/ { "pcmpgtd", TRUE, NONE, op2(E, MX), 0 },
/*67*/ { "packuswb", TRUE, NONE, op2(E, MX), 0 },
/*68*/ { "punpckhbw", TRUE, NONE, op2(E, MX), 0 },
/*69*/ { "punpckhwd", TRUE, NONE, op2(E, MX), 0 },
/*6a*/ { "punpckhdq", TRUE, NONE, op2(E, MX), 0 },
/*6b*/ { "packssdw", TRUE, NONE, op2(E, MX), 0 },
/*6c*/ { "(bad)", TRUE, NONE, 0, 0 },
/*6d*/ { "(bad)", TRUE, NONE, 0, 0 },
/*6e*/ { "movd", TRUE, NONE, op2(E, MX), 0 },
/*6f*/ { "movq", TRUE, NONE, op2(E, MX), 0 },
/*68*/ { "punpckhbw", TRUE, NONE, op2(E, MX), 0 },
/*69*/ { "punpckhwd", TRUE, NONE, op2(E, MX), 0 },
/*6a*/ { "punpckhdq", TRUE, NONE, op2(E, MX), 0 },
/*6b*/ { "packssdw", TRUE, NONE, op2(E, MX), 0 },
/*6c*/ { "(bad)", TRUE, NONE, 0, 0 },
/*6d*/ { "(bad)", TRUE, NONE, 0, 0 },
/*6e*/ { "movd", TRUE, NONE, op2(E, MX), 0 },
/*6f*/ { "movq", TRUE, NONE, op2(E, MX), 0 },
};
static const struct inst db_inst_0f7x[] = {
/*70*/ { "pshufw", TRUE, NONE, op2(MX, EMX), 0 },
/*70*/ { "pshufw", TRUE, NONE, op2(MX, EMX), 0 },
/*71*/ { "(grp10)", TRUE, BYTE, op2(EMX, I), (char*)db_Grp10 },
/*72*/ { "(grp11)", TRUE, BYTE, op2(EMX, I), (char*)db_Grp11 },
/*73*/ { "(grp12)", TRUE, BYTE, op2(EMX, I), (char*)db_Grp12 },
/*74*/ { "pcmpeqb", TRUE, NONE, op2(E, MX), 0 },
/*75*/ { "pcmpeqw", TRUE, NONE, op2(E, MX), 0 },
/*76*/ { "pcmpeqd", TRUE, NONE, op2(E, MX), 0 },
/*77*/ { "emms", FALSE,NONE, 0, 0 },
/*72*/ { "(grp11)", TRUE, BYTE, op2(EMX, I), (char*)db_Grp11 },
/*73*/ { "(grp12)", TRUE, BYTE, op2(EMX, I), (char*)db_Grp12 },
/*74*/ { "pcmpeqb", TRUE, NONE, op2(E, MX), 0 },
/*75*/ { "pcmpeqw", TRUE, NONE, op2(E, MX), 0 },
/*76*/ { "pcmpeqd", TRUE, NONE, op2(E, MX), 0 },
/*77*/ { "emms", FALSE,NONE, 0, 0 },
/*78*/ { "(bad)", TRUE, NONE, 0, 0 },
/*79*/ { "(bad)", TRUE, NONE, 0, 0 },
/*7a*/ { "(bad)", TRUE, NONE, 0, 0 },
/*7b*/ { "(bad)", TRUE, NONE, 0, 0 },
/*7c*/ { "(bad)", TRUE, NONE, 0, 0 },
/*7d*/ { "(bad)", TRUE, NONE, 0, 0 },
/*7e*/ { "movd", TRUE, NONE, op2(E, MX), 0 },
/*7f*/ { "movq", TRUE, NONE, op2(EMX, MX), 0 },
/*78*/ { "(bad)", TRUE, NONE, 0, 0 },
/*79*/ { "(bad)", TRUE, NONE, 0, 0 },
/*7a*/ { "(bad)", TRUE, NONE, 0, 0 },
/*7b*/ { "(bad)", TRUE, NONE, 0, 0 },
/*7c*/ { "(bad)", TRUE, NONE, 0, 0 },
/*7d*/ { "(bad)", TRUE, NONE, 0, 0 },
/*7e*/ { "movd", TRUE, NONE, op2(E, MX), 0 },
/*7f*/ { "movq", TRUE, NONE, op2(EMX, MX), 0 },
};
static const struct inst db_inst_0f8x[] = {
@ -1209,11 +1209,11 @@ void db_print_address(char *seg, int size, struct i_addr *addrp, int byref)
if (addrp->index)
DEBUG_Printf(DBG_CHN_MESG,",%s,%d", addrp->index, 1<<addrp->ss);
DEBUG_Printf(DBG_CHN_MESG,")");
}
}
else {
/* try to get destination of indirect call
does not work for segmented adresses */
does not work for segmented adresses */
if (!seg && byref) {
void* a1;
void* a2;
@ -1812,7 +1812,7 @@ void DEBUG_Disasm( DBG_ADDR *addr, int display )
{
DEBUG_PrintAddress( &address, short_addr ? MODE_16 : MODE_32, TRUE );
}
}
break;
}

View File

@ -40,22 +40,22 @@
#define SYM_TRAMPOLINE 0x10
#define SYM_STEP_THROUGH 0x20
enum debug_type {DT_BASIC, DT_POINTER, DT_ARRAY, DT_STRUCT, DT_ENUM,
enum debug_type {DT_BASIC, DT_POINTER, DT_ARRAY, DT_STRUCT, DT_ENUM,
DT_FUNC, DT_BITFIELD};
enum debug_type_basic {DT_BASIC_INT = 1, DT_BASIC_CHAR, DT_BASIC_LONGINT, DT_BASIC_UINT,
DT_BASIC_ULONGINT, DT_BASIC_LONGLONGINT, DT_BASIC_ULONGLONGINT,
DT_BASIC_SHORTINT, DT_BASIC_USHORTINT, DT_BASIC_SCHAR, DT_BASIC_UCHAR,
DT_BASIC_FLOAT, DT_BASIC_LONGDOUBLE, DT_BASIC_DOUBLE,
DT_BASIC_CMPLX_INT, DT_BASIC_CMPLX_FLOAT, DT_BASIC_CMPLX_DOUBLE,
DT_BASIC_CMPLX_LONGDOUBLE, DT_BASIC_VOID,
enum debug_type_basic {DT_BASIC_INT = 1, DT_BASIC_CHAR, DT_BASIC_LONGINT, DT_BASIC_UINT,
DT_BASIC_ULONGINT, DT_BASIC_LONGLONGINT, DT_BASIC_ULONGLONGINT,
DT_BASIC_SHORTINT, DT_BASIC_USHORTINT, DT_BASIC_SCHAR, DT_BASIC_UCHAR,
DT_BASIC_FLOAT, DT_BASIC_LONGDOUBLE, DT_BASIC_DOUBLE,
DT_BASIC_CMPLX_INT, DT_BASIC_CMPLX_FLOAT, DT_BASIC_CMPLX_DOUBLE,
DT_BASIC_CMPLX_LONGDOUBLE, DT_BASIC_VOID,
/* modifier on size isn't possible on current types definitions
* so we need to add more types... */
DT_BASIC_BOOL1, DT_BASIC_BOOL2, DT_BASIC_BOOL4,
DT_BASIC_BOOL1, DT_BASIC_BOOL2, DT_BASIC_BOOL4,
/* this is not really a basic type... */
DT_BASIC_STRING,
DT_BASIC_STRING,
/* this is for historical reasons... should take care of it RSN */
DT_BASIC_CONST_INT,
DT_BASIC_CONST_INT,
/* to be kept as last... sentinel entry... do not use */
DT_BASIC_LAST};
@ -85,7 +85,7 @@ typedef struct
# define DV_HOST 0x50DA
# define DV_INVALID 0x0000
DBG_ADDR addr;
DBG_ADDR addr;
} DBG_VALUE;
struct list_id
@ -157,7 +157,7 @@ enum exit_mode /* of exception handling */
typedef struct
{
DBG_ADDR addr;
WORD enabled : 1,
WORD enabled : 1,
type : 1,
is32 : 1,
refcount : 13;
@ -347,7 +347,7 @@ extern int DEBUG_FreeExpr(struct expr * exp);
extern int DEBUG_DisplayExpr(const struct expr * exp);
/* debugger/hash.c */
extern struct name_hash * DEBUG_AddSymbol( const char *name,
extern struct name_hash * DEBUG_AddSymbol( const char *name,
const DBG_VALUE *addr,
const char *sourcefile,
int flags);
@ -359,37 +359,37 @@ extern const char * DEBUG_FindNearestSymbol( const DBG_ADDR *addr, int flag,
unsigned int ebp,
struct list_id * source);
extern void DEBUG_ReadSymbolTable( const char * filename );
extern void DEBUG_AddLineNumber( struct name_hash * func, int line_num,
extern void DEBUG_AddLineNumber( struct name_hash * func, int line_num,
unsigned long offset );
extern struct wine_locals *
DEBUG_AddLocal( struct name_hash * func, int regno,
DEBUG_AddLocal( struct name_hash * func, int regno,
int offset,
int pc_start,
int pc_end,
char * name);
extern int DEBUG_CheckLinenoStatus(const DBG_ADDR *addr);
extern void DEBUG_GetFuncInfo(struct list_id * ret, const char * file,
extern void DEBUG_GetFuncInfo(struct list_id * ret, const char * file,
const char * func);
extern int DEBUG_SetSymbolSize(struct name_hash * sym, unsigned int len);
extern int DEBUG_SetSymbolBPOff(struct name_hash * sym, unsigned int len);
extern int DEBUG_GetSymbolAddr(struct name_hash * sym, DBG_ADDR * addr);
extern int DEBUG_cmp_sym(const void * p1, const void * p2);
extern BOOL DEBUG_GetLineNumberAddr( const struct name_hash *, const int lineno,
extern BOOL DEBUG_GetLineNumberAddr( const struct name_hash *, const int lineno,
DBG_ADDR *addr, int bp_flag );
extern int DEBUG_SetLocalSymbolType(struct wine_locals * sym,
extern int DEBUG_SetLocalSymbolType(struct wine_locals * sym,
struct datatype * type);
extern BOOL DEBUG_Normalize(struct name_hash * nh );
/* debugger/info.c */
extern void DEBUG_PrintBasic( const DBG_VALUE* value, int count, char format );
extern struct symbol_info DEBUG_PrintAddress( const DBG_ADDR *addr,
extern struct symbol_info DEBUG_PrintAddress( const DBG_ADDR *addr,
enum dbg_mode mode, int flag );
extern void DEBUG_Help(void);
extern void DEBUG_HelpInfo(void);
extern struct symbol_info DEBUG_PrintAddressAndArgs( const DBG_ADDR *addr,
extern struct symbol_info DEBUG_PrintAddressAndArgs( const DBG_ADDR *addr,
enum dbg_mode mode,
unsigned int ebp,
unsigned int ebp,
int flag );
extern void DEBUG_InfoClass(const char* clsName);
extern void DEBUG_WalkClasses(void);
@ -425,27 +425,27 @@ extern int DEBUG_PrintStringW( int chnl, const DBG_ADDR* address, int len );
/* debugger/module.c */
extern int DEBUG_LoadEntryPoints( const char * prefix );
extern void DEBUG_LoadModule32( const char* name, HANDLE hFile, DWORD base );
extern DBG_MODULE* DEBUG_AddModule(const char* name, enum DbgModuleType type,
extern DBG_MODULE* DEBUG_AddModule(const char* name, enum DbgModuleType type,
void* mod_addr, u_long size, HMODULE hmod);
extern DBG_MODULE* DEBUG_FindModuleByName(const char* name, enum DbgModuleType type);
extern DBG_MODULE* DEBUG_FindModuleByHandle(HANDLE handle, enum DbgModuleType type);
extern DBG_MODULE* DEBUG_FindModuleByAddr(void* addr, enum DbgModuleType type);
extern DBG_MODULE* DEBUG_GetProcessMainModule(DBG_PROCESS* process);
extern DBG_MODULE* DEBUG_RegisterPEModule(HMODULE, u_long load_addr, u_long size,
extern DBG_MODULE* DEBUG_RegisterPEModule(HMODULE, u_long load_addr, u_long size,
const char* name);
extern DBG_MODULE* DEBUG_RegisterELFModule(u_long load_addr, u_long size,
extern DBG_MODULE* DEBUG_RegisterELFModule(u_long load_addr, u_long size,
const char* name);
extern enum DbgInfoLoad DEBUG_RegisterPEDebugInfo(DBG_MODULE* wmod, HANDLE hFile,
void* _nth, unsigned long nth_ofs);
extern void DEBUG_ReportDIL(enum DbgInfoLoad dil, const char* pfx,
extern void DEBUG_ReportDIL(enum DbgInfoLoad dil, const char* pfx,
const char* filename, DWORD load_addr);
extern void DEBUG_InfoShare(void);
/* debugger/msc.c */
extern enum DbgInfoLoad DEBUG_RegisterMSCDebugInfo(DBG_MODULE* module, HANDLE hFile,
extern enum DbgInfoLoad DEBUG_RegisterMSCDebugInfo(DBG_MODULE* module, HANDLE hFile,
void* nth, unsigned long nth_ofs);
extern enum DbgInfoLoad DEBUG_RegisterStabsDebugInfo(DBG_MODULE* module,
HANDLE hFile, void* nth,
extern enum DbgInfoLoad DEBUG_RegisterStabsDebugInfo(DBG_MODULE* module,
HANDLE hFile, void* nth,
unsigned long nth_ofs);
extern void DEBUG_InitCVDataTypes(void);
@ -456,7 +456,7 @@ extern BOOL DEBUG_ValidateRegisters(void);
/* debugger/source.c */
extern void DEBUG_ShowDir(void);
extern void DEBUG_AddPath(const char * path);
extern void DEBUG_List(struct list_id * line1, struct list_id * line2,
extern void DEBUG_List(struct list_id * line1, struct list_id * line2,
int delta);
extern void DEBUG_NukePath(void);
extern void DEBUG_Disassemble(const DBG_VALUE *, const DBG_VALUE*, int offset);
@ -467,40 +467,40 @@ extern void DEBUG_InfoStack(void);
extern void DEBUG_BackTrace(DWORD threadID, BOOL noisy);
extern int DEBUG_InfoLocals(void);
extern int DEBUG_SetFrame(int newframe);
extern int DEBUG_GetCurrentFrame(struct name_hash ** name,
extern int DEBUG_GetCurrentFrame(struct name_hash ** name,
unsigned int * eip,
unsigned int * ebp);
/* debugger/stabs.c */
extern enum DbgInfoLoad DEBUG_ReadExecutableDbgInfo(const char* exe_name);
extern enum DbgInfoLoad DEBUG_ParseStabs(char * addr, unsigned int load_offset,
unsigned int staboff, int stablen,
extern enum DbgInfoLoad DEBUG_ParseStabs(char * addr, unsigned int load_offset,
unsigned int staboff, int stablen,
unsigned int strtaboff, int strtablen);
/* debugger/types.c */
extern int DEBUG_nchar;
extern void DEBUG_InitTypes(void);
extern struct datatype * DEBUG_NewDataType(enum debug_type xtype,
extern struct datatype * DEBUG_NewDataType(enum debug_type xtype,
const char * typename);
extern unsigned int DEBUG_TypeDerefPointer(const DBG_VALUE *value,
extern unsigned int DEBUG_TypeDerefPointer(const DBG_VALUE *value,
struct datatype ** newtype);
extern int DEBUG_AddStructElement(struct datatype * dt,
char * name, struct datatype * type,
extern int DEBUG_AddStructElement(struct datatype * dt,
char * name, struct datatype * type,
int offset, int size);
extern int DEBUG_SetStructSize(struct datatype * dt, int size);
extern int DEBUG_SetPointerType(struct datatype * dt, struct datatype * dt2);
extern int DEBUG_SetArrayParams(struct datatype * dt, int min, int max,
struct datatype * dt2);
extern void DEBUG_Print( const DBG_VALUE *addr, int count, char format, int level );
extern unsigned int DEBUG_FindStructElement(DBG_VALUE * addr,
extern unsigned int DEBUG_FindStructElement(DBG_VALUE * addr,
const char * ele_name, int * tmpbuf);
extern struct datatype * DEBUG_GetPointerType(struct datatype * dt);
extern int DEBUG_GetObjectSize(struct datatype * dt);
extern unsigned int DEBUG_ArrayIndex(const DBG_VALUE * addr, DBG_VALUE * result,
extern unsigned int DEBUG_ArrayIndex(const DBG_VALUE * addr, DBG_VALUE * result,
int index);
extern struct datatype * DEBUG_FindOrMakePointerType(struct datatype * reftype);
extern long long int DEBUG_GetExprValue(const DBG_VALUE * addr, char ** format);
extern int DEBUG_SetBitfieldParams(struct datatype * dt, int offset,
extern int DEBUG_SetBitfieldParams(struct datatype * dt, int offset,
int nbits, struct datatype * dt2);
extern int DEBUG_CopyFieldlist(struct datatype * dt, struct datatype * dt2);
extern enum debug_type DEBUG_GetType(struct datatype * dt);
@ -518,7 +518,7 @@ extern struct datatype * DEBUG_GetBasicType(enum debug_type_basic);
extern void DEBUG_OutputA(int chn, const char* buffer, int len);
extern void DEBUG_OutputW(int chn, const WCHAR* buffer, int len);
#ifdef __GNUC__
extern int DEBUG_Printf(int chn, const char* format, ...) __attribute__((format (printf,2,3)));
extern int DEBUG_Printf(int chn, const char* format, ...) __attribute__((format (printf,2,3)));
#else
extern int DEBUG_Printf(int chn, const char* format, ...);
#endif

View File

@ -109,14 +109,14 @@ DEBUG_DoDisplay(void)
DEBUG_Printf(DBG_CHN_MESG, " = ");
if( displaypoints[i].format == 'i' )
{
DEBUG_ExamineMemory( &value,
displaypoints[i].count,
DEBUG_ExamineMemory( &value,
displaypoints[i].count,
displaypoints[i].format);
}
else
{
DEBUG_Print( &value,
displaypoints[i].count,
DEBUG_Print( &value,
displaypoints[i].count,
displaypoints[i].format, 0);
}
}
@ -130,7 +130,7 @@ int
DEBUG_DelDisplay(int displaynum)
{
int i;
if( displaynum >= MAX_DISPLAY || displaynum == 0 || displaynum < -1 )
{
DEBUG_Printf(DBG_CHN_MESG, "Invalid display number\n");

View File

@ -351,7 +351,7 @@ DBG_VALUE DEBUG_EvalExpr(struct expr * exp)
break;
case EXPR_TYPE_SYMBOL:
if( !DEBUG_GetSymbolValue(exp->un.symbol.name, -1, &rtn, FALSE) )
{
{
DEBUG_Printf(DBG_CHN_MESG, "%s\n", exp->un.symbol.name);
RaiseException(DEBUG_STATUS_NO_SYMBOL, 0, 0, NULL);
}
@ -474,7 +474,7 @@ DBG_VALUE DEBUG_EvalExpr(struct expr * exp)
{
RaiseException(DEBUG_STATUS_BAD_TYPE, 0, 0, NULL);
}
if( exp1.type == DEBUG_GetBasicType(DT_BASIC_CONST_INT) &&
if( exp1.type == DEBUG_GetBasicType(DT_BASIC_CONST_INT) &&
exp2.type == DEBUG_GetBasicType(DT_BASIC_CONST_INT) )
{
rtn.type = exp1.type;
@ -643,11 +643,11 @@ DBG_VALUE DEBUG_EvalExpr(struct expr * exp)
* => exp1 is host, result is target
* x is a pointer to internal variable x
* => exp1 is host, result is host
* so we force DV_TARGET, because dereferencing pointers to
* so we force DV_TARGET, because dereferencing pointers to
* internal variables is very unlikely. a correct fix would be
* rather large.
*/
rtn.cookie = DV_TARGET;
rtn.cookie = DV_TARGET;
rtn.addr.off = (unsigned int) DEBUG_TypeDerefPointer(&exp1, &rtn.type);
if (!rtn.type)
{
@ -707,7 +707,7 @@ DEBUG_DisplayExpr(const struct expr * exp)
DEBUG_Printf(DBG_CHN_MESG, "%d", exp->un.u_const.value);
break;
case EXPR_TYPE_STRING:
DEBUG_Printf(DBG_CHN_MESG, "\"%s\"", exp->un.string.str);
DEBUG_Printf(DBG_CHN_MESG, "\"%s\"", exp->un.string.str);
break;
case EXPR_TYPE_SYMBOL:
DEBUG_Printf(DBG_CHN_MESG, "%s" , exp->un.symbol.name);

View File

@ -1,4 +1,4 @@
/*
/*
* Convenience functions to handle use of external debugger.
*
* Copyright 1999 Kevin Holbrook
@ -104,7 +104,7 @@ void DEBUG_ExternalDebugger(void)
const char *dbg_external;
const char *dbg_wine_location;
const char *dbg_no_xterm;
char pid_string[DBG_BUFF_SIZE];
char pid_string[DBG_BUFF_SIZE];
/* check settings in environment for debugger to use */
@ -134,15 +134,15 @@ void DEBUG_ExternalDebugger(void)
if (dbg_no_xterm)
status = execlp(dbg_external, dbg_external, dbg_wine_location, pid_string, NULL);
else
status = execlp("xterm", "xterm", "-e", dbg_external, dbg_wine_location, pid_string, NULL);
status = execlp("xterm", "xterm", "-e", dbg_external, dbg_wine_location, pid_string, NULL);
if (status == -1)
{
if (dbg_no_xterm)
fprintf(stderr, "DEBUG_ExternalDebugger failed to execute \"%s %s %s\" (%s)\n",
fprintf(stderr, "DEBUG_ExternalDebugger failed to execute \"%s %s %s\" (%s)\n",
dbg_external, dbg_wine_location, pid_string, strerror(errno));
else
fprintf(stderr, "DEBUG_ExternalDebugger failed to execute \"xterm -e %s %s %s\" (%s)\n",
fprintf(stderr, "DEBUG_ExternalDebugger failed to execute \"xterm -e %s %s %s\" (%s)\n",
dbg_external, dbg_wine_location, pid_string, strerror(errno));
}
@ -154,7 +154,7 @@ void DEBUG_ExternalDebugger(void)
}
else
fprintf(stderr, "DEBUG_ExternalDebugger failed.\n");
}

View File

@ -60,7 +60,7 @@ struct name_hash
int n_locals;
int locals_alloc;
WineLocals * local_vars;
int n_lines;
int lines_alloc;
WineLineNo * linetab;
@ -88,7 +88,7 @@ static unsigned int name_hash( const char * name )
p = name;
while (*p)
while (*p)
{
hash = (hash << 4) + *p++;
@ -170,7 +170,7 @@ DEBUG_ResortSymbols(void)
return;
}
addr_sorttab = (struct name_hash **) DBG_realloc(addr_sorttab,
addr_sorttab = (struct name_hash **) DBG_realloc(addr_sorttab,
nsym * sizeof(struct name_hash *));
nsym = 0;
@ -195,7 +195,7 @@ DEBUG_ResortSymbols(void)
* Add a symbol to the table.
*/
struct name_hash *
DEBUG_AddSymbol( const char * name, const DBG_VALUE *value,
DEBUG_AddSymbol( const char * name, const DBG_VALUE *value,
const char * source, int flags)
{
struct name_hash * new;
@ -248,7 +248,7 @@ DEBUG_AddSymbol( const char * name, const DBG_VALUE *value,
* First see if we already have an entry for this symbol. If so
* return it, so we don't end up with duplicates.
*/
new = (struct name_hash *) DBG_alloc(sizeof(struct name_hash));
new->value = *value;
new->name = DBG_strdup(name);
@ -347,7 +347,7 @@ BOOL DEBUG_Normalize(struct name_hash * nh )
*
* Get the address of a named symbol.
*/
static int DEBUG_GSV_Helper(const char* name, const int lineno,
static int DEBUG_GSV_Helper(const char* name, const int lineno,
DBG_VALUE* value, int num, int bp_flag)
{
struct name_hash* nh;
@ -369,7 +369,7 @@ static int DEBUG_GSV_Helper(const char* name, const int lineno,
return i;
}
BOOL DEBUG_GetSymbolValue( const char * name, const int lineno,
BOOL DEBUG_GetSymbolValue( const char * name, const int lineno,
DBG_VALUE *rtn, int bp_flag )
{
#define NUMDBGV 10
@ -382,7 +382,7 @@ BOOL DEBUG_GetSymbolValue( const char * name, const int lineno,
if (!num && (name[0] != '_'))
{
char buffer[512];
assert(strlen(name) < sizeof(buffer) - 2); /* one for '_', one for '\0' */
buffer[0] = '_';
strcpy(buffer + 1, name);
@ -390,7 +390,7 @@ BOOL DEBUG_GetSymbolValue( const char * name, const int lineno,
}
/* now get the local symbols if any */
if (DEBUG_GetStackSymbolValue(name, &vtmp) && num < NUMDBGV)
if (DEBUG_GetStackSymbolValue(name, &vtmp) && num < NUMDBGV)
{
value[num] = vtmp;
local = num;
@ -447,7 +447,7 @@ BOOL DEBUG_GetSymbolValue( const char * name, const int lineno,
*
* Get the address of a named symbol.
*/
BOOL DEBUG_GetLineNumberAddr( const struct name_hash * nh, const int lineno,
BOOL DEBUG_GetLineNumberAddr( const struct name_hash * nh, const int lineno,
DBG_ADDR *addr, int bp_flag )
{
int i;
@ -584,13 +584,13 @@ const char * DEBUG_FindNearestSymbol( const DBG_ADDR *addr, int flag,
low = 0;
high = sorttab_nsym;
if( addr_sorttab[0]->value.addr.seg > addr->seg
|| ( addr_sorttab[0]->value.addr.seg == addr->seg
|| ( addr_sorttab[0]->value.addr.seg == addr->seg
&& addr_sorttab[0]->value.addr.off > addr->off) )
{
nearest = NULL;
}
else if( addr_sorttab[high - 1]->value.addr.seg < addr->seg
|| ( addr_sorttab[high - 1]->value.addr.seg == addr->seg
|| ( addr_sorttab[high - 1]->value.addr.seg == addr->seg
&& addr_sorttab[high - 1]->value.addr.off < addr->off) )
{
nearest = addr_sorttab[high - 1];
@ -602,10 +602,10 @@ const char * DEBUG_FindNearestSymbol( const DBG_ADDR *addr, int flag,
mid = (high + low)/2;
if( mid == low )
{
/*
/*
* See if there are any other entries that might also
* have the same address, and would also have a line
* number table.
* number table.
*/
if( mid > 0 && addr_sorttab[mid]->linetab == NULL )
{
@ -643,7 +643,7 @@ const char * DEBUG_FindNearestSymbol( const DBG_ADDR *addr, int flag,
break;
}
if( (addr_sorttab[mid]->value.addr.seg < addr->seg)
|| ( addr_sorttab[mid]->value.addr.seg == addr->seg
|| ( addr_sorttab[mid]->value.addr.seg == addr->seg
&& addr_sorttab[mid]->value.addr.off <= addr->off) )
{
low = mid;
@ -724,7 +724,7 @@ const char * DEBUG_FindNearestSymbol( const DBG_ADDR *addr, int flag,
module = DEBUG_FindModuleByAddr((void*)DEBUG_ToLinear(addr), DMT_UNKNOWN);
if (module) {
char* ptr = strrchr(module->module_name, '/');
if (!ptr++) ptr = module->module_name;
sprintf( modbuf, " in %s", ptr);
}
@ -767,13 +767,13 @@ const char * DEBUG_FindNearestSymbol( const DBG_ADDR *addr, int flag,
sourcefile = strrchr( nearest->sourcefile, '/' );
if (!sourcefile) sourcefile = nearest->sourcefile;
else sourcefile++;
if (addr->off == nearest->value.addr.off)
sprintf( name_buffer, "%s%s [%s%s]%s", nearest->name,
sprintf( name_buffer, "%s%s [%s%s]%s", nearest->name,
arglist, sourcefile, lineinfo, modbuf);
else
sprintf( name_buffer, "%s+0x%lx%s [%s%s]%s", nearest->name,
addr->off - nearest->value.addr.off,
addr->off - nearest->value.addr.off,
arglist, sourcefile, lineinfo, modbuf );
}
else
@ -818,17 +818,17 @@ void DEBUG_ReadSymbolTable( const char* filename )
value.addr.seg = 0;
value.addr.off = 0;
value.cookie = DV_TARGET;
while (1)
{
fgets( buffer, sizeof(buffer), symbolfile );
if (feof(symbolfile)) break;
/* Strip any text after a # sign (i.e. comments) */
cpnt = buffer;
while (*cpnt)
if(*cpnt++ == '#') { *cpnt = 0; break; }
/* Quietly ignore any lines that have just whitespace */
cpnt = buffer;
while(*cpnt)
@ -837,7 +837,7 @@ void DEBUG_ReadSymbolTable( const char* filename )
cpnt++;
}
if (!(*cpnt) || *cpnt == '\n') continue;
if (sscanf(buffer, "%lx %c %s", &value.addr.off, &type, name) == 3)
DEBUG_AddSymbol( name, &value, NULL, SYM_WINE );
}
@ -846,7 +846,7 @@ void DEBUG_ReadSymbolTable( const char* filename )
void
DEBUG_AddLineNumber( struct name_hash * func, int line_num,
DEBUG_AddLineNumber( struct name_hash * func, int line_num,
unsigned long offset )
{
if( func == NULL )
@ -869,7 +869,7 @@ DEBUG_AddLineNumber( struct name_hash * func, int line_num,
struct wine_locals *
DEBUG_AddLocal( struct name_hash * func, int regno,
DEBUG_AddLocal( struct name_hash * func, int regno,
int offset,
int pc_start,
int pc_end,
@ -942,13 +942,13 @@ int DEBUG_CheckLinenoStatus( const DBG_ADDR *addr)
low = 0;
high = sorttab_nsym;
if( addr_sorttab[0]->value.addr.seg > addr->seg
|| ( addr_sorttab[0]->value.addr.seg == addr->seg
|| ( addr_sorttab[0]->value.addr.seg == addr->seg
&& addr_sorttab[0]->value.addr.off > addr->off) )
{
nearest = NULL;
}
else if( addr_sorttab[high - 1]->value.addr.seg < addr->seg
|| ( addr_sorttab[high - 1]->value.addr.seg == addr->seg
|| ( addr_sorttab[high - 1]->value.addr.seg == addr->seg
&& addr_sorttab[high - 1]->value.addr.off < addr->off) )
{
nearest = addr_sorttab[high - 1];
@ -960,10 +960,10 @@ int DEBUG_CheckLinenoStatus( const DBG_ADDR *addr)
mid = (high + low)/2;
if( mid == low )
{
/*
/*
* See if there are any other entries that might also
* have the same address, and would also have a line
* number table.
* number table.
*/
if( mid > 0 && addr_sorttab[mid]->linetab == NULL )
{
@ -1001,7 +1001,7 @@ int DEBUG_CheckLinenoStatus( const DBG_ADDR *addr)
break;
}
if( (addr_sorttab[mid]->value.addr.seg < addr->seg)
|| ( addr_sorttab[mid]->value.addr.seg == addr->seg
|| ( addr_sorttab[mid]->value.addr.seg == addr->seg
&& addr_sorttab[mid]->value.addr.off <= addr->off) )
{
low = mid;
@ -1078,7 +1078,7 @@ int DEBUG_CheckLinenoStatus( const DBG_ADDR *addr)
* handler can deal with.
*/
void
DEBUG_GetFuncInfo( struct list_id * ret, const char * filename,
DEBUG_GetFuncInfo( struct list_id * ret, const char * filename,
const char * name)
{
char buffer[256];
@ -1185,14 +1185,14 @@ BOOL DEBUG_GetStackSymbolValue( const char * name, DBG_VALUE *value )
* comes up with RBRAC/LBRAC stabs in particular.
*/
if( (curr_func->local_vars[i].pc_start != 0)
&& ((eip - curr_func->value.addr.off)
&& ((eip - curr_func->value.addr.off)
< curr_func->local_vars[i].pc_start) )
{
continue;
}
if( (curr_func->local_vars[i].pc_end != 0)
&& ((eip - curr_func->value.addr.off)
&& ((eip - curr_func->value.addr.off)
> curr_func->local_vars[i].pc_end) )
{
continue;
@ -1209,11 +1209,11 @@ BOOL DEBUG_GetStackSymbolValue( const char * name, DBG_VALUE *value )
* Register variable. Point to DEBUG_context field.
*/
assert(curr_func->local_vars[i].regno - 1 < sizeof(reg_ofs)/sizeof(reg_ofs[0]));
value->addr.off = ((DWORD)&DEBUG_context) +
value->addr.off = ((DWORD)&DEBUG_context) +
reg_ofs[curr_func->local_vars[i].regno - 1];
value->cookie = DV_HOST;
}
else
else
{
value->addr.off = ebp + curr_func->local_vars[i].offset;
value->cookie = DV_TARGET;
@ -1252,19 +1252,19 @@ DEBUG_InfoLocals(void)
* comes up with RBRAC/LBRAC stabs in particular.
*/
if( (curr_func->local_vars[i].pc_start != 0)
&& ((eip - curr_func->value.addr.off)
&& ((eip - curr_func->value.addr.off)
< curr_func->local_vars[i].pc_start) )
{
continue;
}
if( (curr_func->local_vars[i].pc_end != 0)
&& ((eip - curr_func->value.addr.off)
&& ((eip - curr_func->value.addr.off)
> curr_func->local_vars[i].pc_end) )
{
continue;
}
DEBUG_PrintTypeCast(curr_func->local_vars[i].type);
if( curr_func->local_vars[i].regno != 0 )
@ -1278,7 +1278,7 @@ DEBUG_InfoLocals(void)
}
else
{
DEBUG_READ_MEM_VERBOSE((void*)(ebp + curr_func->local_vars[i].offset),
DEBUG_READ_MEM_VERBOSE((void*)(ebp + curr_func->local_vars[i].offset),
&val, sizeof(val));
DEBUG_Printf(DBG_CHN_MESG, " %s == 0x%8.8x\n",
curr_func->local_vars[i].name, val);

View File

@ -38,39 +38,39 @@ void DEBUG_PrintBasic( const DBG_VALUE* value, int count, char format )
{
char * default_format;
long long int res;
assert(value->cookie == DV_TARGET || value->cookie == DV_HOST);
if (value->type == NULL)
if (value->type == NULL)
{
DEBUG_Printf(DBG_CHN_MESG, "Unable to evaluate expression\n");
return;
}
default_format = NULL;
res = DEBUG_GetExprValue(value, &default_format);
switch (format)
{
case 'x':
if (value->addr.seg)
if (value->addr.seg)
{
DEBUG_nchar += DEBUG_Printf(DBG_CHN_MESG, "0x%04lx", (long unsigned int)res);
}
else
else
{
DEBUG_nchar += DEBUG_Printf(DBG_CHN_MESG, "0x%08lx", (long unsigned int)res);
}
break;
case 'd':
DEBUG_nchar += DEBUG_Printf(DBG_CHN_MESG, "%ld\n", (long int)res);
break;
case 'c':
DEBUG_nchar += DEBUG_Printf(DBG_CHN_MESG, "%d = '%c'",
(char)(res & 0xff), (char)(res & 0xff));
break;
case 'u':
{
WCHAR wch = (WCHAR)(res & 0xFFFF);
@ -79,7 +79,7 @@ void DEBUG_PrintBasic( const DBG_VALUE* value, int count, char format )
DEBUG_Printf(DBG_CHN_MESG, "'");
}
break;
case 'i':
case 's':
case 'w':
@ -92,27 +92,27 @@ void DEBUG_PrintBasic( const DBG_VALUE* value, int count, char format )
{
char* ptr;
int state = 0;
/* FIXME: simplistic implementation for default_format being
* foo%Sbar => will print foo, then string then bar
*/
for (ptr = default_format; *ptr; ptr++)
for (ptr = default_format; *ptr; ptr++)
{
if (*ptr == '%')
{
if (*ptr == '%')
{
state++;
}
else if (state == 1)
}
else if (state == 1)
{
if (*ptr == 'S')
if (*ptr == 'S')
{
DBG_ADDR addr;
addr.seg = 0;
addr.off = (long)res;
DEBUG_nchar += DEBUG_PrintStringA(DBG_CHN_MESG, &addr, -1);
}
else
else
{
/* shouldn't happen */
DEBUG_Printf(DBG_CHN_MESG, "%%%c", *ptr);
@ -126,7 +126,7 @@ void DEBUG_PrintBasic( const DBG_VALUE* value, int count, char format )
DEBUG_nchar++;
}
}
}
}
else if (strcmp(default_format, "%B") == 0)
{
DEBUG_nchar += DEBUG_Printf(DBG_CHN_MESG, "%s", res ? "true" : "false");
@ -151,7 +151,7 @@ DEBUG_PrintAddress( const DBG_ADDR *addr, enum dbg_mode mode, int flag )
{
struct symbol_info rtn;
const char *name = DEBUG_FindNearestSymbol( addr, flag, &rtn.sym, 0,
const char *name = DEBUG_FindNearestSymbol( addr, flag, &rtn.sym, 0,
&rtn.list );
if (addr->seg) DEBUG_Printf( DBG_CHN_MESG, "0x%04lx:", addr->seg&0xFFFF );
@ -173,7 +173,7 @@ DEBUG_PrintAddressAndArgs( const DBG_ADDR *addr, enum dbg_mode mode,
{
struct symbol_info rtn;
const char *name = DEBUG_FindNearestSymbol( addr, flag, &rtn.sym, ebp,
const char *name = DEBUG_FindNearestSymbol( addr, flag, &rtn.sym, ebp,
&rtn.list );
if (addr->seg) DEBUG_Printf( DBG_CHN_MESG, "0x%04lx:", addr->seg );
@ -274,7 +274,7 @@ void DEBUG_InfoClass(const char* name)
}
DEBUG_Printf(DBG_CHN_MESG, "Class '%s':\n", name);
DEBUG_Printf(DBG_CHN_MESG,
DEBUG_Printf(DBG_CHN_MESG,
"style=%08x wndProc=%08lx\n"
"inst=%p icon=%p cursor=%p bkgnd=%p\n"
"clsExtra=%d winExtra=%d\n",
@ -282,7 +282,7 @@ void DEBUG_InfoClass(const char* name)
wca.hIcon, wca.hCursor, wca.hbrBackground,
wca.cbClsExtra, wca.cbWndExtra);
/* FIXME:
/* FIXME:
* + print #windows (or even list of windows...)
* + print extra bytes => this requires a window handle on this very class...
*/
@ -298,7 +298,7 @@ static void DEBUG_InfoClass2(HWND hWnd, const char* name)
}
DEBUG_Printf(DBG_CHN_MESG, "Class '%s':\n", name);
DEBUG_Printf(DBG_CHN_MESG,
DEBUG_Printf(DBG_CHN_MESG,
"style=%08x wndProc=%08lx\n"
"inst=%p icon=%p cursor=%p bkgnd=%p\n"
"clsExtra=%d winExtra=%d\n",
@ -402,20 +402,20 @@ void DEBUG_InfoWindow(HWND hWnd)
"inst=%p active=%p idmenu=%08lx\n"
"style=%08lx exstyle=%08lx wndproc=%08lx text='%s'\n"
"client=%d,%d-%d,%d window=%d,%d-%d,%d sysmenu=%p\n",
GetWindow(hWnd, GW_HWNDNEXT),
GetWindow(hWnd, GW_HWNDNEXT),
GetWindow(hWnd, GW_CHILD),
GetParent(hWnd),
GetParent(hWnd),
GetWindow(hWnd, GW_OWNER),
clsName,
(HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE),
(HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE),
GetLastActivePopup(hWnd),
GetWindowLong(hWnd, GWL_ID),
GetWindowLong(hWnd, GWL_STYLE),
GetWindowLong(hWnd, GWL_EXSTYLE),
GetWindowLong(hWnd, GWL_WNDPROC),
wndName,
clientRect.left, clientRect.top, clientRect.right, clientRect.bottom,
windowRect.left, windowRect.top, windowRect.right, windowRect.bottom,
wndName,
clientRect.left, clientRect.top, clientRect.right, clientRect.bottom,
windowRect.left, windowRect.top, windowRect.right, windowRect.bottom,
GetSystemMenu(hWnd, FALSE));
if (GetClassLong(hWnd, GCL_CBWNDEXTRA)) {
@ -441,7 +441,7 @@ void DEBUG_WalkWindows(HWND hWnd, int indent)
hWnd = GetDesktopWindow();
if (!indent) /* first time around */
DEBUG_Printf(DBG_CHN_MESG,
DEBUG_Printf(DBG_CHN_MESG,
"%-16.16s %-17.17s %-8.8s %s\n",
"hwnd", "Class Name", " Style", " WndProc Text");
@ -450,7 +450,7 @@ void DEBUG_WalkWindows(HWND hWnd, int indent)
strcpy(clsName, "-- Unknown --");
if (!GetWindowText(hWnd, wndName, sizeof(wndName)))
strcpy(wndName, "-- Empty --");
/* FIXME: missing hmemTaskQ */
DEBUG_Printf(DBG_CHN_MESG, "%*s%04x%*s", indent, "", (UINT)hWnd, 13-indent,"");
DEBUG_Printf(DBG_CHN_MESG, "%-17.17s %08lx %08lx %.14s\n",
@ -515,12 +515,12 @@ void DEBUG_WalkThreads(void)
{
DBG_PROCESS* p = DEBUG_GetProcess(entry.th32OwnerProcessID);
DEBUG_Printf(DBG_CHN_MESG, "%08lx%s %s\n",
DEBUG_Printf(DBG_CHN_MESG, "%08lx%s %s\n",
entry.th32OwnerProcessID, p ? " (D)" : "", p ? p->imageName : "");
lastProcessId = entry.th32OwnerProcessID;
}
DEBUG_Printf(DBG_CHN_MESG, "\t%08lx %4ld%s\n",
entry.th32ThreadID, entry.tpBasePri,
entry.th32ThreadID, entry.tpBasePri,
(entry.th32ThreadID == current) ? " <==" : "");
}
@ -549,7 +549,7 @@ void DEBUG_InfoSegments(DWORD start, int length)
if (!GetThreadSelectorEntry(DEBUG_CurrThread->handle, (i << 3)|7, &le))
continue;
if (le.HighWord.Bits.Type & 0x08)
if (le.HighWord.Bits.Type & 0x08)
{
flags[0] = (le.HighWord.Bits.Type & 0x2) ? 'r' : '-';
flags[1] = '-';
@ -561,12 +561,12 @@ void DEBUG_InfoSegments(DWORD start, int length)
flags[1] = (le.HighWord.Bits.Type & 0x2) ? 'w' : '-';
flags[2] = '-';
}
DEBUG_Printf(DBG_CHN_MESG,
DEBUG_Printf(DBG_CHN_MESG,
"%04lx: sel=%04lx base=%08x limit=%08x %d-bit %c%c%c\n",
i, (i<<3)|7,
(le.HighWord.Bits.BaseHi << 24) +
i, (i<<3)|7,
(le.HighWord.Bits.BaseHi << 24) +
(le.HighWord.Bits.BaseMid << 16) + le.BaseLow,
((le.HighWord.Bits.LimitHi << 8) + le.LimitLow) <<
((le.HighWord.Bits.LimitHi << 8) + le.LimitLow) <<
(le.HighWord.Bits.Granularity ? 12 : 0),
le.HighWord.Bits.Default_Big ? 32 : 16,
flags[0], flags[1], flags[2] );

View File

@ -71,7 +71,7 @@ enum dbg_mode DEBUG_GetSelectorType( WORD sel )
if (IS_VM86_MODE()) return MODE_VM86;
if (sel == 0) return MODE_32;
if (GetThreadSelectorEntry( DEBUG_CurrThread->handle, sel, &le))
if (GetThreadSelectorEntry( DEBUG_CurrThread->handle, sel, &le))
return le.HighWord.Bits.Default_Big ? MODE_32 : MODE_16;
/* selector doesn't exist */
return MODE_INVALID;
@ -80,7 +80,7 @@ enum dbg_mode DEBUG_GetSelectorType( WORD sel )
#endif
}
#ifdef __i386__
void DEBUG_FixAddress( DBG_ADDR *addr, DWORD def)
void DEBUG_FixAddress( DBG_ADDR *addr, DWORD def)
{
if (addr->seg == 0xffffffff) addr->seg = def;
if (DEBUG_IsSelectorSystem(addr->seg)) addr->seg = 0;
@ -98,12 +98,12 @@ DWORD DEBUG_ToLinear( const DBG_ADDR *addr )
{
#ifdef __i386__
LDT_ENTRY le;
if (IS_VM86_MODE()) return (DWORD)(LOWORD(addr->seg) << 4) + addr->off;
if (DEBUG_IsSelectorSystem(addr->seg))
return addr->off;
if (GetThreadSelectorEntry( DEBUG_CurrThread->handle, addr->seg, &le)) {
return (le.HighWord.Bits.BaseHi << 24) + (le.HighWord.Bits.BaseMid << 16) + le.BaseLow + addr->off;
}
@ -151,7 +151,7 @@ void DEBUG_InvalLinAddr( void* addr )
*
* Read a memory value.
*/
/* FIXME: this function is now getting closer and closer to
/* FIXME: this function is now getting closer and closer to
* DEBUG_ExprGetValue. They should be merged...
*/
int DEBUG_ReadMemory( const DBG_VALUE* val )
@ -171,7 +171,7 @@ int DEBUG_ReadMemory( const DBG_VALUE* val )
DEBUG_FixAddress( &addr, DEBUG_context.SegDs );
#endif
lin = (void*)DEBUG_ToLinear( &addr );
DEBUG_READ_MEM_VERBOSE(lin, &value, os);
} else {
if (val->addr.off)
@ -218,7 +218,7 @@ BOOL DEBUG_GrabAddress( DBG_VALUE* value, BOOL fromCode )
assert(value->cookie == DV_TARGET || value->cookie == DV_HOST);
#ifdef __i386__
DEBUG_FixAddress( &value->addr,
DEBUG_FixAddress( &value->addr,
(fromCode) ? DEBUG_context.SegCs : DEBUG_context.SegDs);
#endif
@ -303,10 +303,10 @@ void DEBUG_ExamineMemory( const DBG_VALUE *_value, int count, char format )
DEBUG_Printf(DBG_CHN_MESG,"\n"); \
} \
return
#define DO_DUMP(_t,_l,_f) DO_DUMP2(_t,_l,_f,_v)
#define DO_DUMP(_t,_l,_f) DO_DUMP2(_t,_l,_f,_v)
case 'x': DO_DUMP(int, 4, " %8.8x");
case 'd': DO_DUMP(unsigned int, 4, " %10d");
case 'd': DO_DUMP(unsigned int, 4, " %10d");
case 'w': DO_DUMP(unsigned short, 8, " %04x");
case 'c': DO_DUMP2(char, 32, " %c", (_v < 0x20) ? ' ' : _v);
case 'b': DO_DUMP2(char, 16, " %02x", (_v) & 0xff);

View File

@ -28,10 +28,10 @@
#include "winuser.h"
/***********************************************************************
* Creates and links a new module to the current process
* Creates and links a new module to the current process
*
*/
DBG_MODULE* DEBUG_AddModule(const char* name, enum DbgModuleType type,
DBG_MODULE* DEBUG_AddModule(const char* name, enum DbgModuleType type,
void* mod_addr, u_long size, HMODULE hmodule)
{
DBG_MODULE* wmod;
@ -65,10 +65,10 @@ DBG_MODULE* DEBUG_FindModuleByName(const char* name, enum DbgModuleType type)
{
int i;
DBG_MODULE** amod = DEBUG_CurrProcess->modules;
for (i = 0; i < DEBUG_CurrProcess->num_modules; i++) {
if ((type == DMT_UNKNOWN || type == amod[i]->type) &&
!strcasecmp(name, amod[i]->module_name))
!strcasecmp(name, amod[i]->module_name))
return amod[i];
}
return NULL;
@ -77,7 +77,7 @@ DBG_MODULE* DEBUG_FindModuleByName(const char* name, enum DbgModuleType type)
/***********************************************************************
* DEBUG_FindModuleByAddr
*
* either the addr where module is loaded, or any address inside the
* either the addr where module is loaded, or any address inside the
* module
*/
DBG_MODULE* DEBUG_FindModuleByAddr(void* addr, enum DbgModuleType type)
@ -85,7 +85,7 @@ DBG_MODULE* DEBUG_FindModuleByAddr(void* addr, enum DbgModuleType type)
int i;
DBG_MODULE** amod = DEBUG_CurrProcess->modules;
DBG_MODULE* res = NULL;
for (i = 0; i < DEBUG_CurrProcess->num_modules; i++) {
if ((type == DMT_UNKNOWN || type == amod[i]->type) &&
(u_long)addr >= (u_long)amod[i]->load_addr &&
@ -105,10 +105,10 @@ DBG_MODULE* DEBUG_FindModuleByHandle(HANDLE handle, enum DbgModuleType type)
{
int i;
DBG_MODULE** amod = DEBUG_CurrProcess->modules;
for (i = 0; i < DEBUG_CurrProcess->num_modules; i++) {
if ((type == DMT_UNKNOWN || type == amod[i]->type) &&
handle == amod[i]->handle)
if ((type == DMT_UNKNOWN || type == amod[i]->type) &&
handle == amod[i]->handle)
return amod[i];
}
return NULL;
@ -120,7 +120,7 @@ DBG_MODULE* DEBUG_FindModuleByHandle(HANDLE handle, enum DbgModuleType type)
DBG_MODULE* DEBUG_GetProcessMainModule(DBG_PROCESS* process)
{
if (!process || !process->num_modules) return NULL;
/* main module is the first to be loaded on a given process, so it's the first
* in the array */
assert(process->modules[0]->main);
@ -180,7 +180,7 @@ DBG_MODULE* DEBUG_RegisterNEModule(HMODULE hModule, void* load_addr, u_long size
* Helper function fo DEBUG_LoadModuleEPs16:
* finds the address of a given entry point from a given module
*/
static BOOL DEBUG_GetEP16(char* moduleAddr, const NE_MODULE* module,
static BOOL DEBUG_GetEP16(char* moduleAddr, const NE_MODULE* module,
WORD ordinal, DBG_ADDR* addr)
{
void* idx;
@ -196,18 +196,18 @@ static BOOL DEBUG_GetEP16(char* moduleAddr, const NE_MODULE* module,
if (!DEBUG_READ_MEM_VERBOSE(idx, &bundle, sizeof(bundle)))
return FALSE;
} while ((ordinal < bundle.first + 1) || (ordinal > bundle.last));
if (!DEBUG_READ_MEM_VERBOSE((char*)idx + sizeof(ET_BUNDLE) +
(ordinal - bundle.first - 1) * sizeof(ET_ENTRY),
if (!DEBUG_READ_MEM_VERBOSE((char*)idx + sizeof(ET_BUNDLE) +
(ordinal - bundle.first - 1) * sizeof(ET_ENTRY),
&entry, sizeof(ET_ENTRY)))
return FALSE;
addr->seg = entry.segnum;
addr->off = entry.offs;
if (addr->seg == 0xfe) addr->seg = 0xffff; /* constant entry */
else {
if (!DEBUG_READ_MEM_VERBOSE(moduleAddr + module->seg_table +
if (!DEBUG_READ_MEM_VERBOSE(moduleAddr + module->seg_table +
sizeof(ste) * (addr->seg - 1),
&ste, sizeof(ste)))
return FALSE;
@ -235,16 +235,16 @@ static void DEBUG_LoadModule16(HMODULE hModule, NE_MODULE* module, char* moduleA
value.cookie = DV_TARGET;
value.addr.seg = 0;
value.addr.off = 0;
cpnt = moduleAddr + module->name_table;
/* First search the resident names */
/* skip module name */
if (!DEBUG_READ_MEM_VERBOSE(cpnt, buf, sizeof(buf)) || !buf[0])
return;
cpnt += 1 + buf[0] + sizeof(WORD);
while (DEBUG_READ_MEM_VERBOSE(cpnt, buf, sizeof(buf)) && buf[0]) {
sprintf(epname, "%s.%.*s", name, buf[0], &buf[1]);
if (DEBUG_GetEP16(moduleAddr, module, *(WORD*)&buf[1 + buf[0]], &value.addr)) {
@ -252,7 +252,7 @@ static void DEBUG_LoadModule16(HMODULE hModule, NE_MODULE* module, char* moduleA
}
cpnt += buf[0] + 1 + sizeof(WORD);
}
/* Now search the non-resident names table */
if (!module->nrname_handle) return; /* No non-resident table */
cpnt = (char *)GlobalLock16(module->nrname_handle);
@ -286,10 +286,10 @@ void DEBUG_LoadModule32(const char* name, HANDLE hFile, DWORD base)
&nth_ofs, sizeof(nth_ofs)) ||
!DEBUG_READ_MEM_VERBOSE((void*)(base + nth_ofs), &pe_header, sizeof(pe_header)))
return;
pe_seg_ofs = nth_ofs + OFFSET_OF(IMAGE_NT_HEADERS, OptionalHeader) +
pe_header.FileHeader.SizeOfOptionalHeader;
for (i = 0; i < pe_header.FileHeader.NumberOfSections; i++, pe_seg_ofs += sizeof(pe_seg)) {
if (!DEBUG_READ_MEM_VERBOSE((void*)(base + pe_seg_ofs), &pe_seg, sizeof(pe_seg)))
continue;
@ -304,7 +304,7 @@ void DEBUG_LoadModule32(const char* name, HANDLE hFile, DWORD base)
if (dil != DIL_LOADED)
dil = DEBUG_RegisterMSCDebugInfo(wmod, hFile, &pe_header, nth_ofs);
if (dil != DIL_LOADED)
dil = DEBUG_RegisterPEDebugInfo(wmod, hFile, &pe_header, nth_ofs);
dil = DEBUG_RegisterPEDebugInfo(wmod, hFile, &pe_header, nth_ofs);
wmod->dil = dil;
}
@ -333,14 +333,14 @@ enum DbgInfoLoad DEBUG_RegisterPEDebugInfo(DBG_MODULE* wmod, HANDLE hFile,
value.cookie = DV_TARGET;
value.addr.seg = 0;
value.addr.off = 0;
/* Add start of DLL */
value.addr.off = base;
if ((prefix = strrchr(wmod->module_name, '\\' ))) prefix++;
else prefix = wmod->module_name;
DEBUG_AddSymbol(prefix, &value, NULL, SYM_WIN32 | SYM_FUNC);
/* Add entry point */
snprintf(buffer, sizeof(buffer), "%s.EntryPoint", prefix);
value.addr.off = base + nth->OptionalHeader.AddressOfEntryPoint;
@ -349,7 +349,7 @@ enum DbgInfoLoad DEBUG_RegisterPEDebugInfo(DBG_MODULE* wmod, HANDLE hFile,
/* Add start of sections */
pe_seg_ofs = nth_ofs + OFFSET_OF(IMAGE_NT_HEADERS, OptionalHeader) +
nth->FileHeader.SizeOfOptionalHeader;
for (i = 0; i < nth->FileHeader.NumberOfSections; i++, pe_seg_ofs += sizeof(pe_seg)) {
if (!DEBUG_READ_MEM_VERBOSE((void*)(base + pe_seg_ofs), &pe_seg, sizeof(pe_seg)))
continue;
@ -357,10 +357,10 @@ enum DbgInfoLoad DEBUG_RegisterPEDebugInfo(DBG_MODULE* wmod, HANDLE hFile,
value.addr.off = base + pe_seg.VirtualAddress;
DEBUG_AddSymbol(buffer, &value, NULL, SYM_WIN32 | SYM_FUNC);
}
/* Add exported functions */
dir_ofs = nth_ofs +
OFFSET_OF(IMAGE_NT_HEADERS,
dir_ofs = nth_ofs +
OFFSET_OF(IMAGE_NT_HEADERS,
OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT]);
if (DEBUG_READ_MEM_VERBOSE((void*)(base + dir_ofs), &dir, sizeof(dir)) && dir.Size) {
IMAGE_EXPORT_DIRECTORY exports;
@ -368,18 +368,18 @@ enum DbgInfoLoad DEBUG_RegisterPEDebugInfo(DBG_MODULE* wmod, HANDLE hFile,
void** functions = NULL;
DWORD* names = NULL;
unsigned int j;
if (DEBUG_READ_MEM_VERBOSE((void*)(base + dir.VirtualAddress),
if (DEBUG_READ_MEM_VERBOSE((void*)(base + dir.VirtualAddress),
&exports, sizeof(exports)) &&
((functions = DBG_alloc(sizeof(functions[0]) * exports.NumberOfFunctions))) &&
DEBUG_READ_MEM_VERBOSE((void*)(base + (DWORD)exports.AddressOfFunctions),
functions, sizeof(functions[0]) * exports.NumberOfFunctions) &&
((ordinals = DBG_alloc(sizeof(ordinals[0]) * exports.NumberOfNames))) &&
DEBUG_READ_MEM_VERBOSE((void*)(base + (DWORD)exports.AddressOfNameOrdinals),
ordinals, sizeof(ordinals[0]) * exports.NumberOfNames) &&
((names = DBG_alloc(sizeof(names[0]) * exports.NumberOfNames))) &&
DEBUG_READ_MEM_VERBOSE((void*)(base + (DWORD)exports.AddressOfNames),
names, sizeof(names[0]) * exports.NumberOfNames)) {
@ -393,7 +393,7 @@ enum DbgInfoLoad DEBUG_RegisterPEDebugInfo(DBG_MODULE* wmod, HANDLE hFile,
value.addr.off = base + (DWORD)functions[ordinals[i]];
DEBUG_AddSymbol(buffer, &value, NULL, SYM_WIN32 | SYM_FUNC);
}
for (i = 0; i < exports.NumberOfFunctions; i++) {
if (!functions[i]) continue;
/* Check if we already added it with a name */
@ -448,7 +448,7 @@ int DEBUG_LoadEntryPoints(const char* pfx)
rowcount = 3 + (pfx ? strlen(pfx) : 0);
first = 1;
}
len = strlen(entry.szModule);
if ((rowcount + len) > 76) {
DEBUG_Printf(DBG_CHN_MESG, "\n ");
@ -456,12 +456,12 @@ int DEBUG_LoadEntryPoints(const char* pfx)
}
DEBUG_Printf(DBG_CHN_MESG, " %s", entry.szModule);
rowcount += len + 1;
DEBUG_LoadModule16(entry.hModule, &module, moduleAddr, entry.szModule);
} while (ModuleNext16(&entry));
#endif
if (first) DEBUG_Printf(DBG_CHN_MESG, "\n");
if (first) DEBUG_Printf(DBG_CHN_MESG, "\n");
return first;
}
@ -470,23 +470,23 @@ void DEBUG_ReportDIL(enum DbgInfoLoad dil, const char* pfx, const char* filename
const char* fmt;
switch (dil) {
case DIL_DEFERRED:
case DIL_DEFERRED:
fmt = "Deferring debug information loading for %s '%s' (0x%08x)\n";
break;
case DIL_LOADED:
fmt = "Loaded debug information from %s '%s' (0x%08x)\n";
case DIL_LOADED:
fmt = "Loaded debug information from %s '%s' (0x%08x)\n";
break;
case DIL_NOINFO:
fmt = "No debug information in %s '%s' (0x%08x)\n";
case DIL_NOINFO:
fmt = "No debug information in %s '%s' (0x%08x)\n";
break;
case DIL_ERROR:
fmt = "Can't find file for %s '%s' (0x%08x)\n";
case DIL_ERROR:
fmt = "Can't find file for %s '%s' (0x%08x)\n";
break;
default:
DEBUG_Printf(DBG_CHN_ERR, "Oooocch (%d)\n", dil);
default:
DEBUG_Printf(DBG_CHN_ERR, "Oooocch (%d)\n", dil);
return;
}
DEBUG_Printf(DBG_CHN_MESG, fmt, pfx, filename, load_addr);
}
@ -496,7 +496,7 @@ static const char* DEBUG_GetModuleType(enum DbgModuleType type)
case DMT_NE: return "NE";
case DMT_PE: return "PE";
case DMT_ELF: return "ELF";
default: return "???";;
default: return "???";
}
}
@ -519,7 +519,7 @@ static const char* DEBUG_GetDbgInfo(enum DbgInfoLoad dil)
*/
static int DEBUG_ModuleCompare(const void* p1, const void* p2)
{
return (*((const DBG_MODULE**)p1))->load_addr -
return (*((const DBG_MODULE**)p1))->load_addr -
(*((const DBG_MODULE**)p2))->load_addr;
}
@ -528,22 +528,22 @@ static int DEBUG_ModuleCompare(const void* p1, const void* p2)
*
* returns TRUE is wmod_child is contained (inside bounds) of wmod_cntnr
*/
static inline BOOL DEBUG_IsContainer(const DBG_MODULE* wmod_cntnr,
static inline BOOL DEBUG_IsContainer(const DBG_MODULE* wmod_cntnr,
const DBG_MODULE* wmod_child)
{
return wmod_cntnr->load_addr < wmod_child->load_addr &&
(DWORD)wmod_cntnr->load_addr + wmod_cntnr->size >
(DWORD)wmod_cntnr->load_addr + wmod_cntnr->size >
(DWORD)wmod_child->load_addr + wmod_child->size;
}
static void DEBUG_InfoShareModule(const DBG_MODULE* module, int ident)
{
if (ident) DEBUG_Printf(DBG_CHN_MESG, " \\-");
DEBUG_Printf(DBG_CHN_MESG, "%s\t0x%08lx-%08lx\t%s\n",
DEBUG_Printf(DBG_CHN_MESG, "%s\t0x%08lx-%08lx\t%s\n",
DEBUG_GetModuleType(module->type),
(DWORD)module->load_addr, (DWORD)module->load_addr + module->size,
module->module_name);
}
}
/***********************************************************************
* DEBUG_InfoShare
@ -554,16 +554,16 @@ void DEBUG_InfoShare(void)
{
DBG_MODULE** ref;
int i, j;
ref = DBG_alloc(sizeof(DBG_MODULE*) * DEBUG_CurrProcess->num_modules);
if (!ref) return;
DEBUG_Printf(DBG_CHN_MESG, "Module\tAddress\t\t\tName\t%d modules\n",
DEBUG_Printf(DBG_CHN_MESG, "Module\tAddress\t\t\tName\t%d modules\n",
DEBUG_CurrProcess->num_modules);
memcpy(ref, DEBUG_CurrProcess->modules,
memcpy(ref, DEBUG_CurrProcess->modules,
sizeof(DBG_MODULE*) * DEBUG_CurrProcess->num_modules);
qsort(ref, DEBUG_CurrProcess->num_modules, sizeof(DBG_MODULE*),
qsort(ref, DEBUG_CurrProcess->num_modules, sizeof(DBG_MODULE*),
DEBUG_ModuleCompare);
for (i = 0; i < DEBUG_CurrProcess->num_modules; i++) {
switch (ref[i]->type) {
@ -582,7 +582,7 @@ void DEBUG_InfoShare(void)
DEBUG_IsContainer(ref[j], ref[i]))
break;
}
if (j >= DEBUG_CurrProcess->num_modules)
if (j >= DEBUG_CurrProcess->num_modules)
DEBUG_InfoShareModule(ref[i], 0);
break;
default:
@ -621,21 +621,21 @@ void DEBUG_WalkModules(void)
{
DBG_MODULE** amod;
int i;
DEBUG_Printf(DBG_CHN_MESG, "Address\t\t\tModule\tName\n");
amod = DBG_alloc(sizeof(DBG_MODULE*) * DEBUG_CurrProcess->num_modules);
if (!amod) return;
memcpy(amod, DEBUG_CurrProcess->modules,
memcpy(amod, DEBUG_CurrProcess->modules,
sizeof(DBG_MODULE*) * DEBUG_CurrProcess->num_modules);
qsort(amod, DEBUG_CurrProcess->num_modules, sizeof(DBG_MODULE*),
qsort(amod, DEBUG_CurrProcess->num_modules, sizeof(DBG_MODULE*),
DEBUG_ModuleCompare);
for (i = 0; i < DEBUG_CurrProcess->num_modules; i++) {
if (amod[i]->type == DMT_ELF) continue;
DEBUG_Printf(DBG_CHN_MESG, "0x%08lx-%08lx\t(%s)\t%s\n",
(DWORD)amod[i]->load_addr,
DEBUG_Printf(DBG_CHN_MESG, "0x%08lx-%08lx\t(%s)\t%s\n",
(DWORD)amod[i]->load_addr,
(DWORD)amod[i]->load_addr + amod[i]->size,
DEBUG_GetModuleType(amod[i]->type), amod[i]->module_name);
}

View File

@ -74,7 +74,7 @@ static void DEBUG_LocateDebugInfoFile(const char *filename, char *dbg_filename)
char *str2 = DBG_alloc(MAX_PATHNAME_LEN*10);
const char *file;
char *name_part;
file = strrchr(filename, '\\');
if( file == NULL ) file = filename; else file++;
@ -121,7 +121,7 @@ static void* DEBUG_MapDebugInfoFile(const char* name, DWORD offset, DWORD size,
if ((*hMap = CreateFileMapping(*hFile, NULL, PAGE_READONLY, 0, 0, NULL)) == 0)
return NULL;
if ((ret = MapViewOfFile(*hMap, FILE_MAP_READ, 0, g_offset, g_size)) != NULL)
ret += offset - g_offset;
@ -178,7 +178,7 @@ static const char* DEBUG_GetCoffName( PIMAGE_SYMBOL coff_sym, const char* coff_s
{
nampnt = coff_strtab + coff_sym->N.Name.Long;
}
if( nampnt[0] == '_' )
nampnt++;
return nampnt;
@ -193,7 +193,7 @@ static int DEBUG_AddCoffFile( struct CoffFileSet* coff_files, const char* filena
coff_files->nfiles_alloc += 10;
coff_files->files = (struct CoffFile *) DBG_realloc(coff_files->files,
coff_files->nfiles_alloc * sizeof(struct CoffFile));
}
}
file = coff_files->files + coff_files->nfiles;
file->startaddr = 0xffffffff;
file->endaddr = 0;
@ -202,7 +202,7 @@ static int DEBUG_AddCoffFile( struct CoffFileSet* coff_files, const char* filena
file->linecnt = 0;
file->entries = NULL;
file->neps = file->neps_alloc = 0;
return coff_files->nfiles++;
}
@ -211,8 +211,8 @@ static void DEBUG_AddCoffSymbol( struct CoffFile* coff_file, struct name_hash* s
if( coff_file->neps + 1 >= coff_file->neps_alloc )
{
coff_file->neps_alloc += 10;
coff_file->entries = (struct name_hash **)
DBG_realloc(coff_file->entries,
coff_file->entries = (struct name_hash **)
DBG_realloc(coff_file->entries,
coff_file->neps_alloc * sizeof(struct name_hash *));
}
coff_file->entries[coff_file->neps++] = sym;
@ -246,7 +246,7 @@ static enum DbgInfoLoad DEBUG_ProcessCoff( DBG_MODULE *module, LPBYTE root )
coff_files.files = NULL;
coff_files.nfiles = coff_files.nfiles_alloc = 0;
coff = (PIMAGE_COFF_SYMBOLS_HEADER) root;
coff_symbols = (PIMAGE_SYMBOL) ((unsigned int) coff + coff->LvaToFirstSymbol);
@ -305,7 +305,7 @@ static enum DbgInfoLoad DEBUG_ProcessCoff( DBG_MODULE *module, LPBYTE root )
aux->Section.NumberOfLinenumbers,
aux->Section.Number,
aux->Section.Selection);
DEBUG_Printf(DBG_CHN_TRACE, "More sect %d %s %08lx %d %d %d\n",
DEBUG_Printf(DBG_CHN_TRACE, "More sect %d %s %08lx %d %d %d\n",
coff_sym->SectionNumber,
DEBUG_GetCoffName( coff_sym, coff_strtab ),
coff_sym->Value,
@ -337,12 +337,12 @@ static enum DbgInfoLoad DEBUG_ProcessCoff( DBG_MODULE *module, LPBYTE root )
{
coff_files.files[curr_file_idx].startaddr = coff_sym->Value;
}
if( coff_files.files[curr_file_idx].endaddr < coff_sym->Value + aux->Section.Length )
{
coff_files.files[curr_file_idx].endaddr = coff_sym->Value + aux->Section.Length;
}
coff_files.files[curr_file_idx].linetab_offset = linetab_indx;
coff_files.files[curr_file_idx].linecnt = aux->Section.NumberOfLinenumbers;
linetab_indx += aux->Section.NumberOfLinenumbers;
@ -370,9 +370,9 @@ static enum DbgInfoLoad DEBUG_ProcessCoff( DBG_MODULE *module, LPBYTE root )
#endif
/* FIXME: was adding symbol to this_file ??? */
DEBUG_AddCoffSymbol( &coff_files.files[curr_file_idx],
DEBUG_AddSymbol( nampnt, &new_value,
coff_files.files[curr_file_idx].filename,
DEBUG_AddCoffSymbol( &coff_files.files[curr_file_idx],
DEBUG_AddSymbol( nampnt, &new_value,
coff_files.files[curr_file_idx].filename,
SYM_WIN32 | SYM_FUNC ) );
i += naux;
continue;
@ -392,7 +392,7 @@ static enum DbgInfoLoad DEBUG_ProcessCoff( DBG_MODULE *module, LPBYTE root )
#ifdef MORE_DBG
DEBUG_Printf(DBG_CHN_TRACE, "%d: %lx %s\n", i, new_value.addr.off, nampnt);
DEBUG_Printf(DBG_CHN_TRACE,"\tAdding global symbol %s (sect=%s)\n",
DEBUG_Printf(DBG_CHN_TRACE,"\tAdding global symbol %s (sect=%s)\n",
nampnt, MSC_INFO(module)->sectp[coff_sym->SectionNumber - 1].Name);
#endif
@ -409,7 +409,7 @@ static enum DbgInfoLoad DEBUG_ProcessCoff( DBG_MODULE *module, LPBYTE root )
}
}
if (j < coff_files.nfiles) {
DEBUG_AddCoffSymbol( &coff_files.files[j],
DEBUG_AddCoffSymbol( &coff_files.files[j],
DEBUG_AddSymbol( nampnt, &new_value, this_file, SYM_WIN32 | SYM_FUNC ) );
} else {
DEBUG_AddSymbol( nampnt, &new_value, NULL, SYM_WIN32 | SYM_FUNC );
@ -444,7 +444,7 @@ static enum DbgInfoLoad DEBUG_ProcessCoff( DBG_MODULE *module, LPBYTE root )
i += naux;
continue;
}
if( (coff_sym->StorageClass == IMAGE_SYM_CLASS_STATIC)
&& (naux == 0) )
{
@ -457,7 +457,7 @@ static enum DbgInfoLoad DEBUG_ProcessCoff( DBG_MODULE *module, LPBYTE root )
}
#ifdef MORE_DBG
DEBUG_Printf(DBG_CHN_TRACE,"Skipping unknown entry '%s' %d %d %d\n",
DEBUG_Printf(DBG_CHN_TRACE,"Skipping unknown entry '%s' %d %d %d\n",
DEBUG_GetCoffName( coff_sym, coff_strtab ),
coff_sym->StorageClass, coff_sym->SectionNumber, naux);
#endif
@ -466,9 +466,9 @@ static enum DbgInfoLoad DEBUG_ProcessCoff( DBG_MODULE *module, LPBYTE root )
* For now, skip past the aux entries.
*/
i += naux;
}
/*
* OK, we now should have a list of files, and we should have a list
* of entrypoints. We need to sort the entrypoints so that we are
@ -518,10 +518,10 @@ static enum DbgInfoLoad DEBUG_ProcessCoff( DBG_MODULE *module, LPBYTE root )
* first.
*/
DEBUG_GetSymbolAddr(coff_files.files[j].entries[l], &new_value.addr);
DEBUG_AddLineNumber(coff_files.files[j].entries[l],
DEBUG_AddLineNumber(coff_files.files[j].entries[l],
linepnt->Linenumber,
(unsigned int) module->load_addr
+ linepnt->Type.VirtualAddress
(unsigned int) module->load_addr
+ linepnt->Type.VirtualAddress
- new_value.addr.off);
}
}
@ -1164,7 +1164,7 @@ numeric_leaf( int *value, unsigned short int *leaf )
*value = type;
}
else
{
{
switch ( type )
{
case LF_CHAR:
@ -1275,7 +1275,7 @@ terminate_string( unsigned char *name )
return symname;
}
static
static
struct datatype * DEBUG_GetCVType(unsigned int typeno)
{
struct datatype * dt = NULL;
@ -1305,7 +1305,7 @@ DEBUG_AddCVType( unsigned int typeno, struct datatype *dt )
while ( typeno - 0x1000 >= num_cv_defined_types )
{
num_cv_defined_types += 0x100;
cv_defined_types = (struct datatype **)
cv_defined_types = (struct datatype **)
DBG_realloc( cv_defined_types,
num_cv_defined_types * sizeof(struct datatype *) );
@ -1334,12 +1334,12 @@ DEBUG_ClearTypeTable( void )
static int
DEBUG_AddCVType_Pointer( unsigned int typeno, unsigned int datatype )
{
struct datatype *dt =
struct datatype *dt =
DEBUG_FindOrMakePointerType( DEBUG_GetCVType( datatype ) );
return DEBUG_AddCVType( typeno, dt );
}
static int
DEBUG_AddCVType_Array( unsigned int typeno, char *name,
unsigned int elemtype, unsigned int arr_len )
@ -1351,10 +1351,10 @@ DEBUG_AddCVType_Array( unsigned int typeno, char *name,
DEBUG_SetArrayParams( dt, 0, arr_max, elem );
return DEBUG_AddCVType( typeno, dt );
}
}
static int
DEBUG_AddCVType_Bitfield( unsigned int typeno,
DEBUG_AddCVType_Bitfield( unsigned int typeno,
unsigned int bitoff, unsigned int nbits,
unsigned int basetype )
{
@ -1364,7 +1364,7 @@ DEBUG_AddCVType_Bitfield( unsigned int typeno,
DEBUG_SetBitfieldParams( dt, bitoff, nbits, base );
return DEBUG_AddCVType( typeno, dt );
}
static int
DEBUG_AddCVType_EnumFieldList( unsigned int typeno, unsigned char *list, int len )
{
@ -1388,7 +1388,7 @@ DEBUG_AddCVType_EnumFieldList( unsigned int typeno, unsigned char *list, int len
int value, vlen = numeric_leaf( &value, &type->enumerate.value );
unsigned char *name = (unsigned char *)&type->enumerate.value + vlen;
DEBUG_AddStructElement( dt, terminate_string( name ),
DEBUG_AddStructElement( dt, terminate_string( name ),
NULL, value, 0 );
ptr += 2 + 2 + vlen + (1 + name[0]);
@ -1404,7 +1404,7 @@ DEBUG_AddCVType_EnumFieldList( unsigned int typeno, unsigned char *list, int len
return DEBUG_AddCVType( typeno, dt );
}
static int
DEBUG_AddCVType_StructFieldList( unsigned int typeno, unsigned char *list, int len )
{
@ -1477,7 +1477,7 @@ DEBUG_AddCVType_StructFieldList( unsigned int typeno, unsigned char *list, int l
struct datatype *subtype = DEBUG_GetCVType( type->member.type );
int elem_size = subtype? DEBUG_GetObjectSize( subtype ) : 0;
DEBUG_AddStructElement( dt, terminate_string( name ),
DEBUG_AddStructElement( dt, terminate_string( name ),
subtype, offset << 3, elem_size << 3 );
ptr += 2 + 2 + 2 + olen + (1 + name[0]);
@ -1492,7 +1492,7 @@ DEBUG_AddCVType_StructFieldList( unsigned int typeno, unsigned char *list, int l
struct datatype *subtype = DEBUG_GetCVType( type->member32.type );
int elem_size = subtype? DEBUG_GetObjectSize( subtype ) : 0;
DEBUG_AddStructElement( dt, terminate_string( name ),
DEBUG_AddStructElement( dt, terminate_string( name ),
subtype, offset << 3, elem_size << 3 );
ptr += 2 + 2 + 4 + olen + (1 + name[0]);
@ -1533,7 +1533,7 @@ DEBUG_AddCVType_StructFieldList( unsigned int typeno, unsigned char *list, int l
/* FIXME: ignored for now */
ptr += 2 + 2;
break;
case LF_VFUNCTAB_32:
/* FIXME: ignored for now */
ptr += 2 + 2 + 4;
@ -1560,7 +1560,7 @@ DEBUG_AddCVType_StructFieldList( unsigned int typeno, unsigned char *list, int l
case 4: case 6: /* (pure) introducing virtual method */
ptr += 2 + 2 + 4 + 4 + (1 + type->onemethod32_virt.name[0]);
break;
default:
ptr += 2 + 2 + 4 + (1 + type->onemethod32.name[0]);
break;
@ -1576,7 +1576,7 @@ DEBUG_AddCVType_StructFieldList( unsigned int typeno, unsigned char *list, int l
return DEBUG_AddCVType( typeno, dt );
}
static int
DEBUG_AddCVType_Enum( unsigned int typeno, char *name, unsigned int fieldlist )
{
@ -1646,12 +1646,12 @@ DEBUG_ParseTypeTable( char *table, int len )
}
case LF_BITFIELD:
retv = DEBUG_AddCVType_Bitfield( curr_type, type->bitfield.bitoff,
retv = DEBUG_AddCVType_Bitfield( curr_type, type->bitfield.bitoff,
type->bitfield.nbits,
type->bitfield.type );
break;
case LF_BITFIELD_32:
retv = DEBUG_AddCVType_Bitfield( curr_type, type->bitfield32.bitoff,
retv = DEBUG_AddCVType_Bitfield( curr_type, type->bitfield32.bitoff,
type->bitfield32.nbits,
type->bitfield32.type );
break;
@ -1742,7 +1742,7 @@ DEBUG_ParseTypeTable( char *table, int len )
curr_type++;
ptr += type->generic.len + 2;
}
return TRUE;
}
@ -1819,7 +1819,7 @@ DEBUG_SnarfLinetab(char * linetab,
* There is one header for each segment, so that we can reach in
* and pull bits as required.
*/
lt_hdr = (struct codeview_linetab_hdr *)
lt_hdr = (struct codeview_linetab_hdr *)
DBG_alloc((nseg + 1) * sizeof(*lt_hdr));
if( lt_hdr == NULL )
{
@ -1865,7 +1865,7 @@ DEBUG_SnarfLinetab(char * linetab,
lt_hdr[this_seg].segno = *pnt2.s++;
lt_hdr[this_seg].nline = *pnt2.s++;
lt_hdr[this_seg].offtab = pnt2.ui;
lt_hdr[this_seg].linetab = (unsigned short *)
lt_hdr[this_seg].linetab = (unsigned short *)
(pnt2.ui + lt_hdr[this_seg].nline);
}
}
@ -2039,7 +2039,7 @@ union codeview_symbol
static unsigned int
static unsigned int
DEBUG_MapCVOffset( DBG_MODULE *module, unsigned int offset )
{
int nomap = module->msc_info->nomap;
@ -2060,7 +2060,7 @@ DEBUG_MapCVOffset( DBG_MODULE *module, unsigned int offset )
static struct name_hash *
DEBUG_AddCVSymbol( DBG_MODULE *module, char *name, int namelen,
int type, unsigned int seg, unsigned int offset,
int size, int cookie, int flags,
int size, int cookie, int flags,
struct codeview_linetab_hdr *linetab )
{
int nsect = module->msc_info->nsect;
@ -2074,7 +2074,7 @@ DEBUG_AddCVSymbol( DBG_MODULE *module, char *name, int namelen,
* Some sanity checks
*/
if ( !name || !namelen )
if ( !name || !namelen )
return NULL;
if ( !seg || seg > nsect )
@ -2087,7 +2087,7 @@ DEBUG_AddCVSymbol( DBG_MODULE *module, char *name, int namelen,
value.cookie = cookie;
value.addr.seg = 0;
value.addr.off = (unsigned int) module->load_addr +
value.addr.off = (unsigned int) module->load_addr +
DEBUG_MapCVOffset( module, sectp[seg-1].VirtualAddress + offset );
memcpy( symname, name, namelen );
@ -2112,8 +2112,8 @@ DEBUG_AddCVSymbol( DBG_MODULE *module, char *name, int namelen,
/*
* Create Wine symbol record
*/
symbol = DEBUG_AddSymbol( symname, &value,
*/
symbol = DEBUG_AddSymbol( symname, &value,
linetab? linetab->sourcefile : NULL, flags );
if ( size )
@ -2181,7 +2181,7 @@ DEBUG_SnarfCodeView( DBG_MODULE *module, LPBYTE root, int offset, int size,
case S_LDATA:
case S_PUB:
DEBUG_AddCVSymbol( module, sym->data.name, sym->data.namelen,
sym->data.symtype, sym->data.seg,
sym->data.symtype, sym->data.seg,
sym->data.offset, 0,
DV_TARGET, SYM_WIN32 | SYM_DATA, NULL );
break;
@ -2189,7 +2189,7 @@ DEBUG_SnarfCodeView( DBG_MODULE *module, LPBYTE root, int offset, int size,
case S_LDATA_32:
case S_PUB_32:
DEBUG_AddCVSymbol( module, sym->data32.name, sym->data32.namelen,
sym->data32.symtype, sym->data32.seg,
sym->data32.symtype, sym->data32.seg,
sym->data32.offset, 0,
DV_TARGET, SYM_WIN32 | SYM_DATA, NULL );
break;
@ -2201,7 +2201,7 @@ DEBUG_SnarfCodeView( DBG_MODULE *module, LPBYTE root, int offset, int size,
*/
case S_THUNK:
DEBUG_AddCVSymbol( module, sym->thunk.name, sym->thunk.namelen,
0, sym->thunk.segment,
0, sym->thunk.segment,
sym->thunk.offset, sym->thunk.thunk_len,
DV_TARGET, SYM_WIN32 | SYM_FUNC, NULL );
break;
@ -2214,7 +2214,7 @@ DEBUG_SnarfCodeView( DBG_MODULE *module, LPBYTE root, int offset, int size,
DEBUG_Normalize( curr_func );
curr_func = DEBUG_AddCVSymbol( module, sym->proc.name, sym->proc.namelen,
sym->proc.proctype, sym->proc.segment,
sym->proc.proctype, sym->proc.segment,
sym->proc.offset, sym->proc.proc_len,
DV_TARGET, SYM_WIN32 | SYM_FUNC, linetab );
@ -2225,7 +2225,7 @@ DEBUG_SnarfCodeView( DBG_MODULE *module, LPBYTE root, int offset, int size,
DEBUG_Normalize( curr_func );
curr_func = DEBUG_AddCVSymbol( module, sym->proc32.name, sym->proc32.namelen,
sym->proc32.proctype, sym->proc32.segment,
sym->proc32.proctype, sym->proc32.segment,
sym->proc32.offset, sym->proc32.proc_len,
DV_TARGET, SYM_WIN32 | SYM_FUNC, linetab );
@ -2250,7 +2250,7 @@ DEBUG_SnarfCodeView( DBG_MODULE *module, LPBYTE root, int offset, int size,
* These are special, in that they are always followed by an
* additional length-prefixed string which is *not* included
* into the symbol length count. We need to skip it.
*/
*/
case S_PROCREF:
case S_DATAREF:
case S_LPROCREF:
@ -2511,7 +2511,7 @@ static void pdb_convert_types_header( PDB_TYPES *types, char *image )
}
}
static void pdb_convert_symbols_header( PDB_SYMBOLS *symbols,
static void pdb_convert_symbols_header( PDB_SYMBOLS *symbols,
int *header_size, char *image )
{
memset( symbols, 0, sizeof(PDB_SYMBOLS) );
@ -2542,7 +2542,7 @@ static void pdb_convert_symbols_header( PDB_SYMBOLS *symbols,
}
}
static enum DbgInfoLoad DEBUG_ProcessPDBFile( DBG_MODULE *module,
static enum DbgInfoLoad DEBUG_ProcessPDBFile( DBG_MODULE *module,
const char *filename, DWORD timestamp )
{
enum DbgInfoLoad dil = DIL_ERROR;
@ -2619,7 +2619,7 @@ static enum DbgInfoLoad DEBUG_ProcessPDBFile( DBG_MODULE *module,
}
/*
/*
* Check .PDB time stamp
*/
@ -2629,23 +2629,23 @@ static enum DbgInfoLoad DEBUG_ProcessPDBFile( DBG_MODULE *module,
filename, root->TimeDateStamp, timestamp );
}
/*
/*
* Read type table
*/
DEBUG_ParseTypeTable( types_image + types.type_offset, types.type_size );
/*
* Read type-server .PDB imports
*/
if ( symbols.pdbimport_size )
{
{
/* FIXME */
DEBUG_Printf(DBG_CHN_ERR, "-Type server .PDB imports ignored!\n" );
}
/*
/*
* Read global symbol table
*/
@ -2704,10 +2704,10 @@ static enum DbgInfoLoad DEBUG_ProcessPDBFile( DBG_MODULE *module,
file_name += strlen(file_name) + 1;
file = (char *)( (DWORD)(file_name + strlen(file_name) + 1 + 3) & ~3 );
}
dil = DIL_LOADED;
leave:
leave:
/*
* Cleanup
@ -2735,22 +2735,22 @@ static enum DbgInfoLoad DEBUG_ProcessPDBFile( DBG_MODULE *module,
#define CODEVIEW_NB09_SIG ( 'N' | ('B' << 8) | ('0' << 16) | ('9' << 24) )
#define CODEVIEW_NB10_SIG ( 'N' | ('B' << 8) | ('1' << 16) | ('0' << 24) )
#define CODEVIEW_NB11_SIG ( 'N' | ('B' << 8) | ('1' << 16) | ('1' << 24) )
typedef struct _CODEVIEW_HEADER
{
DWORD dwSignature;
DWORD lfoDirectory;
} CODEVIEW_HEADER, *PCODEVIEW_HEADER;
typedef struct _CODEVIEW_PDB_DATA
{
DWORD timestamp;
DWORD unknown;
CHAR name[ 1 ];
} CODEVIEW_PDB_DATA, *PCODEVIEW_PDB_DATA;
typedef struct _CV_DIRECTORY_HEADER
{
WORD cbDirHeader;
@ -2758,16 +2758,16 @@ typedef struct _CV_DIRECTORY_HEADER
DWORD cDir;
DWORD lfoNextDir;
DWORD flags;
} CV_DIRECTORY_HEADER, *PCV_DIRECTORY_HEADER;
typedef struct _CV_DIRECTORY_ENTRY
{
WORD subsection;
WORD iMod;
DWORD lfo;
DWORD cb;
} CV_DIRECTORY_ENTRY, *PCV_DIRECTORY_ENTRY;
@ -2779,7 +2779,7 @@ static enum DbgInfoLoad DEBUG_ProcessCodeView( DBG_MODULE *module, LPBYTE root )
{
PCODEVIEW_HEADER cv = (PCODEVIEW_HEADER)root;
enum DbgInfoLoad dil = DIL_ERROR;
switch ( cv->dwSignature )
{
case CODEVIEW_NB09_SIG:
@ -2792,16 +2792,16 @@ static enum DbgInfoLoad DEBUG_ProcessCodeView( DBG_MODULE *module, LPBYTE root )
ent = (PCV_DIRECTORY_ENTRY)((LPBYTE)hdr + hdr->cbDirHeader);
for ( i = 0; i < hdr->cDir; i++, ent = next )
{
next = (i == hdr->cDir-1)? NULL :
next = (i == hdr->cDir-1)? NULL :
(PCV_DIRECTORY_ENTRY)((LPBYTE)ent + hdr->cbDirEntry);
prev = (i == 0)? NULL :
prev = (i == 0)? NULL :
(PCV_DIRECTORY_ENTRY)((LPBYTE)ent - hdr->cbDirEntry);
if ( ent->subsection == sstAlignSym )
{
/*
* Check the next and previous entry. If either is a
* sstSrcModule, it contains the line number info for
* sstSrcModule, it contains the line number info for
* this file.
*
* FIXME: This is not a general solution!
@ -2815,7 +2815,7 @@ static enum DbgInfoLoad DEBUG_ProcessCodeView( DBG_MODULE *module, LPBYTE root )
if ( prev && prev->iMod == ent->iMod
&& prev->subsection == sstSrcModule )
linetab = DEBUG_SnarfLinetab( root + prev->lfo, prev->cb );
DEBUG_SnarfCodeView( module, root + ent->lfo, sizeof(DWORD),
ent->cb, linetab );
@ -2825,7 +2825,7 @@ static enum DbgInfoLoad DEBUG_ProcessCodeView( DBG_MODULE *module, LPBYTE root )
dil = DIL_LOADED;
break;
}
case CODEVIEW_NB10_SIG:
{
PCODEVIEW_PDB_DATA pdb = (PCODEVIEW_PDB_DATA)(cv + 1);
@ -2833,9 +2833,9 @@ static enum DbgInfoLoad DEBUG_ProcessCodeView( DBG_MODULE *module, LPBYTE root )
dil = DEBUG_ProcessPDBFile( module, pdb->name, pdb->timestamp );
break;
}
default:
DEBUG_Printf( DBG_CHN_ERR, "Unknown CODEVIEW signature %08lX in module %s\n",
DEBUG_Printf( DBG_CHN_ERR, "Unknown CODEVIEW signature %08lX in module %s\n",
cv->dwSignature, module->module_name );
break;
}
@ -2847,9 +2847,9 @@ static enum DbgInfoLoad DEBUG_ProcessCodeView( DBG_MODULE *module, LPBYTE root )
/*========================================================================
* Process debug directory.
*/
static enum DbgInfoLoad DEBUG_ProcessDebugDirectory( DBG_MODULE *module,
static enum DbgInfoLoad DEBUG_ProcessDebugDirectory( DBG_MODULE *module,
LPBYTE file_map,
PIMAGE_DEBUG_DIRECTORY dbg,
PIMAGE_DEBUG_DIRECTORY dbg,
int nDbg )
{
enum DbgInfoLoad dil = DIL_ERROR;
@ -2916,14 +2916,14 @@ typedef struct _FPO_DATA {
/*========================================================================
* Process DBG file.
*/
static enum DbgInfoLoad DEBUG_ProcessDBGFile( DBG_MODULE *module,
static enum DbgInfoLoad DEBUG_ProcessDBGFile( DBG_MODULE *module,
const char *filename, DWORD timestamp )
{
enum DbgInfoLoad dil = DIL_ERROR;
HANDLE hFile = INVALID_HANDLE_VALUE, hMap = 0;
LPBYTE file_map = NULL;
PIMAGE_SEPARATE_DEBUG_HEADER hdr;
PIMAGE_DEBUG_DIRECTORY dbg;
PIMAGE_DEBUG_DIRECTORY dbg;
int nDbg;
@ -2950,8 +2950,8 @@ static enum DbgInfoLoad DEBUG_ProcessDBGFile( DBG_MODULE *module,
}
dbg = (PIMAGE_DEBUG_DIRECTORY) ( file_map + sizeof(*hdr)
+ hdr->NumberOfSections * sizeof(IMAGE_SECTION_HEADER)
dbg = (PIMAGE_DEBUG_DIRECTORY) ( file_map + sizeof(*hdr)
+ hdr->NumberOfSections * sizeof(IMAGE_SECTION_HEADER)
+ hdr->ExportedNamesSize );
nDbg = hdr->DebugDirectorySize / sizeof(*dbg);
@ -2968,7 +2968,7 @@ static enum DbgInfoLoad DEBUG_ProcessDBGFile( DBG_MODULE *module,
/*========================================================================
* Process MSC debug information in PE file.
*/
enum DbgInfoLoad DEBUG_RegisterMSCDebugInfo( DBG_MODULE *module, HANDLE hFile,
enum DbgInfoLoad DEBUG_RegisterMSCDebugInfo( DBG_MODULE *module, HANDLE hFile,
void *_nth, unsigned long nth_ofs )
{
enum DbgInfoLoad dil = DIL_ERROR;
@ -2989,7 +2989,7 @@ enum DbgInfoLoad DEBUG_RegisterMSCDebugInfo( DBG_MODULE *module, HANDLE hFile,
if ( !extra_info.sectp )
goto leave;
if ( !DEBUG_READ_MEM_VERBOSE( (char *)module->load_addr +
if ( !DEBUG_READ_MEM_VERBOSE( (char *)module->load_addr +
nth_ofs + OFFSET_OF(IMAGE_NT_HEADERS, OptionalHeader) +
nth->FileHeader.SizeOfOptionalHeader,
extra_info.sectp,
@ -2999,14 +2999,14 @@ enum DbgInfoLoad DEBUG_RegisterMSCDebugInfo( DBG_MODULE *module, HANDLE hFile,
/* Read in debug directory */
nDbg = dir->Size / sizeof(IMAGE_DEBUG_DIRECTORY);
if ( !nDbg )
if ( !nDbg )
goto leave;
dbg = (PIMAGE_DEBUG_DIRECTORY) DBG_alloc( nDbg * sizeof(IMAGE_DEBUG_DIRECTORY) );
if ( !dbg )
if ( !dbg )
goto leave;
if ( !DEBUG_READ_MEM_VERBOSE( (char *)module->load_addr + dir->VirtualAddress,
if ( !DEBUG_READ_MEM_VERBOSE( (char *)module->load_addr + dir->VirtualAddress,
dbg, nDbg * sizeof(IMAGE_DEBUG_DIRECTORY) ) )
goto leave;
@ -3025,10 +3025,10 @@ enum DbgInfoLoad DEBUG_RegisterMSCDebugInfo( DBG_MODULE *module, HANDLE hFile,
PIMAGE_DEBUG_MISC misc = (PIMAGE_DEBUG_MISC)(file_map + dbg->PointerToRawData);
if ( nDbg != 1 || dbg->Type != IMAGE_DEBUG_TYPE_MISC
if ( nDbg != 1 || dbg->Type != IMAGE_DEBUG_TYPE_MISC
|| misc->DataType != IMAGE_DEBUG_MISC_EXENAME )
{
DEBUG_Printf( DBG_CHN_ERR, "-Debug info stripped, but no .DBG file in module %s\n",
DEBUG_Printf( DBG_CHN_ERR, "-Debug info stripped, but no .DBG file in module %s\n",
module->module_name );
goto leave;
}
@ -3048,14 +3048,14 @@ enum DbgInfoLoad DEBUG_RegisterMSCDebugInfo( DBG_MODULE *module, HANDLE hFile,
PIMAGE_NT_HEADERS mpd_nth = (PIMAGE_NT_HEADERS)(file_map + nth_ofs);
PIMAGE_DATA_DIRECTORY mpd_dir;
PIMAGE_DEBUG_DIRECTORY mpd_dbg = NULL;
/* sanity checks */
if ( mpd_nth->Signature != IMAGE_NT_SIGNATURE ||
if ( mpd_nth->Signature != IMAGE_NT_SIGNATURE ||
mpd_nth->FileHeader.NumberOfSections != nth->FileHeader.NumberOfSections ||
!(mpd_nth->FileHeader.Characteristics & IMAGE_FILE_DEBUG_STRIPPED ))
goto leave;
mpd_dir = mpd_nth->OptionalHeader.DataDirectory + IMAGE_DIRECTORY_ENTRY_DEBUG;
if ((mpd_dir->Size / sizeof(IMAGE_DEBUG_DIRECTORY)) != nDbg)
goto leave;
@ -3079,7 +3079,7 @@ enum DbgInfoLoad DEBUG_RegisterMSCDebugInfo( DBG_MODULE *module, HANDLE hFile,
* look for stabs information in PE header (it's how mingw compiler provides its
* debugging information), and also wine PE <-> ELF linking through .wsolnk sections
*/
enum DbgInfoLoad DEBUG_RegisterStabsDebugInfo(DBG_MODULE* module, HANDLE hFile,
enum DbgInfoLoad DEBUG_RegisterStabsDebugInfo(DBG_MODULE* module, HANDLE hFile,
void* _nth, unsigned long nth_ofs)
{
IMAGE_SECTION_HEADER pe_seg;
@ -3093,7 +3093,7 @@ enum DbgInfoLoad DEBUG_RegisterStabsDebugInfo(DBG_MODULE* module, HANDLE hFile,
nth->FileHeader.SizeOfOptionalHeader;
for (i = 0; i < nth->FileHeader.NumberOfSections; i++, pe_seg_ofs += sizeof(pe_seg)) {
if (!DEBUG_READ_MEM_VERBOSE((void*)((char *)module->load_addr + pe_seg_ofs),
if (!DEBUG_READ_MEM_VERBOSE((void*)((char *)module->load_addr + pe_seg_ofs),
&pe_seg, sizeof(pe_seg)))
continue;
@ -3111,7 +3111,7 @@ enum DbgInfoLoad DEBUG_RegisterStabsDebugInfo(DBG_MODULE* module, HANDLE hFile,
if (s1) {
if (DEBUG_READ_MEM_VERBOSE((char*)module->load_addr + stabs, s1, stabsize) &&
DEBUG_READ_MEM_VERBOSE((char*)module->load_addr + stabstr,
DEBUG_READ_MEM_VERBOSE((char*)module->load_addr + stabstr,
s1 + stabsize, stabstrsize)) {
dil = DEBUG_ParseStabs(s1, 0, 0, stabsize, stabsize, stabstrsize);
} else {
@ -3119,7 +3119,7 @@ enum DbgInfoLoad DEBUG_RegisterStabsDebugInfo(DBG_MODULE* module, HANDLE hFile,
}
DBG_free(s1);
} else {
DEBUG_Printf(DBG_CHN_MESG, "couldn't alloc %d bytes\n",
DEBUG_Printf(DBG_CHN_MESG, "couldn't alloc %d bytes\n",
stabsize + stabstrsize);
}
} else {

View File

@ -84,7 +84,7 @@ char *DEBUG_Flags( DWORD flag, char *buf )
/***********************************************************************
* DEBUG_InfoRegisters
*
* Display registers information.
* Display registers information.
*/
void DEBUG_InfoRegisters(void)
{
@ -113,11 +113,11 @@ void DEBUG_InfoRegisters(void)
{
char flag[33];
DEBUG_Printf( DBG_CHN_MESG, "\n EIP:%08lx ESP:%08lx EBP:%08lx EFLAGS:%08lx(%s)\n",
DEBUG_Printf( DBG_CHN_MESG, "\n EIP:%08lx ESP:%08lx EBP:%08lx EFLAGS:%08lx(%s)\n",
DEBUG_context.Eip, DEBUG_context.Esp,
DEBUG_context.Ebp, DEBUG_context.EFlags,
DEBUG_Flags(DEBUG_context.EFlags, flag));
DEBUG_Printf( DBG_CHN_MESG, " EAX:%08lx EBX:%08lx ECX:%08lx EDX:%08lx\n",
DEBUG_Printf( DBG_CHN_MESG, " EAX:%08lx EBX:%08lx ECX:%08lx EDX:%08lx\n",
DEBUG_context.Eax, DEBUG_context.Ebx,
DEBUG_context.Ecx, DEBUG_context.Edx );
DEBUG_Printf( DBG_CHN_MESG, " ESI:%08lx EDI:%08lx\n",

View File

@ -156,7 +156,7 @@ DEBUG_DisplaySource(char * sourcefile, int start, int end)
break;
}
}
}
if( ol == NULL )
@ -186,14 +186,14 @@ DEBUG_DisplaySource(char * sourcefile, int start, int end)
* Now append the base file name.
*/
strcat(tmppath, basename);
status = stat(tmppath, &statbuf);
if( status != -1 )
{
break;
}
}
if( sl == NULL )
{
char zbuf[256];
@ -202,12 +202,12 @@ DEBUG_DisplaySource(char * sourcefile, int start, int end)
*/
sprintf(zbuf, "Enter path to file '%s': ", sourcefile);
DEBUG_ReadLine(zbuf, tmppath, sizeof(tmppath), FALSE, FALSE);
if( tmppath[strlen(tmppath)-1] == '\n' )
{
tmppath[strlen(tmppath)-1] = '\0';
}
if( tmppath[strlen(tmppath)-1] != '/' )
{
strcat(tmppath, "/");
@ -216,7 +216,7 @@ DEBUG_DisplaySource(char * sourcefile, int start, int end)
* Now append the base file name.
*/
strcat(tmppath, basename);
status = stat(tmppath, &statbuf);
if( status == -1 )
{
@ -302,14 +302,14 @@ DEBUG_DisplaySource(char * sourcefile, int start, int end)
{
return FALSE;
}
addr = mmap(0, ol->size, PROT_READ, MAP_PRIVATE, fd, 0);
if( addr == (char *) -1 )
{
return FALSE;
}
}
/*
* All we need to do is to display the source lines here.
*/
@ -325,7 +325,7 @@ DEBUG_DisplaySource(char * sourcefile, int start, int end)
memset(&buffer, 0, sizeof(buffer));
if( ol->linelist[i+1] != ol->linelist[i] )
{
memcpy(&buffer, addr + ol->linelist[i],
memcpy(&buffer, addr + ol->linelist[i],
(ol->linelist[i+1] - ol->linelist[i]) - 1);
}
DEBUG_Printf(DBG_CHN_MESG,"%d\t%s\n", i + 1, buffer);
@ -351,10 +351,10 @@ DEBUG_List(struct list_id * source1, struct list_id * source2,
* We need to see what source file we need. Hopefully we only have
* one specified, otherwise we might as well punt.
*/
if( source1 != NULL
&& source2 != NULL
if( source1 != NULL
&& source2 != NULL
&& source1->sourcefile != NULL
&& source2->sourcefile != NULL
&& source2->sourcefile != NULL
&& strcmp(source1->sourcefile, source2->sourcefile) != 0 )
{
DEBUG_Printf(DBG_CHN_MESG, "Ambiguous source file specification.\n");
@ -367,8 +367,8 @@ DEBUG_List(struct list_id * source1, struct list_id * source2,
sourcefile = source1->sourcefile;
}
if( sourcefile == NULL
&& source2 != NULL
if( sourcefile == NULL
&& source2 != NULL
&& source2->sourcefile != NULL )
{
sourcefile = source2->sourcefile;

View File

@ -129,11 +129,11 @@ static int cu_include_stk_idx = 0;
static struct datatype** cu_vector = NULL;
static int cu_nrofentries = 0;
static
int
static
int
DEBUG_CreateInclude(const char* file, unsigned long val)
{
if (num_include_def == num_alloc_include_def)
if (num_include_def == num_alloc_include_def)
{
num_alloc_include_def += 256;
include_defs = DBG_realloc(include_defs, sizeof(include_defs[0])*num_alloc_include_def);
@ -143,35 +143,35 @@ DEBUG_CreateInclude(const char* file, unsigned long val)
include_defs[num_include_def].value = val;
include_defs[num_include_def].vector = NULL;
include_defs[num_include_def].nrofentries = 0;
return num_include_def++;
}
static
int
static
int
DEBUG_FindInclude(const char* file, unsigned long val)
{
int i;
for (i = 0; i < num_include_def; i++)
for (i = 0; i < num_include_def; i++)
{
if (val == include_defs[i].value &&
if (val == include_defs[i].value &&
strcmp(file, include_defs[i].name) == 0)
return i;
}
return -1;
}
static
static
int
DEBUG_AddInclude(int idx)
{
++cu_include_stk_idx;
/* is this happen, just bump MAX_INCLUDES */
/* we could also handle this as another dynarray */
assert(cu_include_stk_idx < MAX_INCLUDES);
cu_include_stack[cu_include_stk_idx] = idx;
return cu_include_stk_idx;
}
@ -193,10 +193,10 @@ void
DEBUG_FreeIncludes(void)
{
int i;
DEBUG_ResetIncludes();
for (i = 0; i < num_include_def; i++)
for (i = 0; i < num_include_def; i++)
{
DBG_free(include_defs[i].name);
DBG_free(include_defs[i].vector);
@ -212,18 +212,18 @@ DEBUG_FreeIncludes(void)
static
struct datatype**
DEBUG_FileSubNr2StabEnum(int filenr, int subnr)
DEBUG_FileSubNr2StabEnum(int filenr, int subnr)
{
struct datatype** ret;
/* DEBUG_Printf(DBG_CHN_MESG, "creating type id for (%d,%d)\n", filenr, subnr); */
/* FIXME: I could perhaps create a dummy include_def for each compilation
* unit which would allow not to handle those two cases separately
*/
if (filenr == 0)
if (filenr == 0)
{
if (cu_nrofentries <= subnr)
if (cu_nrofentries <= subnr)
{
cu_vector = DBG_realloc(cu_vector, sizeof(cu_vector[0])*(subnr+1));
memset(cu_vector+cu_nrofentries, 0, sizeof(cu_vector[0])*(subnr+1-cu_nrofentries));
@ -234,11 +234,11 @@ DEBUG_FileSubNr2StabEnum(int filenr, int subnr)
else
{
include_def* idef;
assert(filenr <= cu_include_stk_idx);
idef = &include_defs[cu_include_stack[filenr]];
if (idef->nrofentries <= subnr)
{
idef->vector = DBG_realloc(idef->vector, sizeof(idef->vector[0])*(subnr+1));
@ -251,7 +251,7 @@ DEBUG_FileSubNr2StabEnum(int filenr, int subnr)
return ret;
}
static
static
struct datatype**
DEBUG_ReadTypeEnum(char **x) {
int filenr,subnr;
@ -303,7 +303,7 @@ static int DEBUG_PTS_ReadNum(struct ParseTypedefData* ptd, int* v)
return 0;
}
static int DEBUG_PTS_ReadTypeReference(struct ParseTypedefData* ptd,
static int DEBUG_PTS_ReadTypeReference(struct ParseTypedefData* ptd,
int* filenr, int* subnr)
{
if (*ptd->ptr == '(') {
@ -320,7 +320,7 @@ static int DEBUG_PTS_ReadTypeReference(struct ParseTypedefData* ptd,
return 0;
}
static int DEBUG_PTS_ReadRange(struct ParseTypedefData* ptd, struct datatype** dt,
static int DEBUG_PTS_ReadRange(struct ParseTypedefData* ptd, struct datatype** dt,
int* lo, int* hi)
{
/* type ';' <int> ';' <int> ';' */
@ -350,7 +350,7 @@ static inline int DEBUG_PTS_ReadAggregate(struct ParseTypedefData* ptd, struct d
* but don't store results into the struct
* FIXME: there's a quite ugly memory leak in there...
*/
/* Now parse the individual elements of the structure/union. */
while (*ptd->ptr != ';') {
/* agg_name : type ',' <int:offset> ',' <int:size> */
@ -396,7 +396,7 @@ static inline int DEBUG_PTS_ReadArray(struct ParseTypedefData* ptd, struct datat
struct datatype* rdt;
/* ar<typeinfo_nodef>;<int>;<int>;<typeinfo> */
if (*ptd->ptr++ != 'r') return -1;
/* FIXME: range type is lost, always assume int */
if (DEBUG_PTS_ReadRange(ptd, &rdt, &lo, &hi) == -1) return -1;
@ -470,7 +470,7 @@ static int DEBUG_PTS_ReadTypedef(struct ParseTypedefData* ptd, const char* typen
} else if (!dt1 && !dt2) {
new_dt = NULL;
} else {
DEBUG_Printf(DBG_CHN_MESG, "Unknown condition %08lx %08lx (%s)\n",
DEBUG_Printf(DBG_CHN_MESG, "Unknown condition %08lx %08lx (%s)\n",
(unsigned long)dt1, (unsigned long)dt2, ptd->ptr);
return -1;
}
@ -502,13 +502,13 @@ static int DEBUG_PTS_ReadTypedef(struct ParseTypedefData* ptd, const char* typen
dt2 = DEBUG_TypeCast(DT_STRUCT, typename);
if (!dt1) {
new_dt = DEBUG_NewDataType(DT_STRUCT, typename);
/* we need to set it here, because a struct can hold a pointer
* to itself
/* we need to set it here, because a struct can hold a pointer
* to itself
*/
*DEBUG_FileSubNr2StabEnum(filenr1, subnr1) = new_dt;
} else {
if (DEBUG_GetType(dt1) != DT_STRUCT) {
DEBUG_Printf(DBG_CHN_MESG,
DEBUG_Printf(DBG_CHN_MESG,
"Forward declaration is not an aggregate\n");
return -1;
}
@ -524,10 +524,10 @@ static int DEBUG_PTS_ReadTypedef(struct ParseTypedefData* ptd, const char* typen
case 's': case 'u': lo = DT_STRUCT; break;
default: return -1;
}
idx = ptd->idx;
if (DEBUG_PTS_ReadID(ptd) == -1) return -1;
new_dt = DEBUG_NewDataType(lo, ptd->buf + idx);
new_dt = DEBUG_NewDataType(lo, ptd->buf + idx);
ptd->idx = idx;
break;
case '-':
@ -538,7 +538,7 @@ static int DEBUG_PTS_ReadTypedef(struct ParseTypedefData* ptd, const char* typen
enum debug_type_basic basic = DT_BASIC_LAST;
switch (lo)
{
case 1: basic = DT_BASIC_INT; break;
case 1: basic = DT_BASIC_INT; break;
case 2: basic = DT_BASIC_CHAR; break;
case 3: basic = DT_BASIC_SHORTINT; break;
case 4: basic = DT_BASIC_LONGINT; break;
@ -622,7 +622,7 @@ static int DEBUG_ParseTypedefStab(char* ptr, const char* typename)
int ret = -1;
/* check for already existing definition */
ptd.idx = 0;
if ((ptd.ptr = strchr(ptr, ':'))) {
ptd.ptr++;
@ -659,7 +659,7 @@ DEBUG_ParseStabType(const char * stab)
*/
if (*c != '(')
c++;
/*
/*
* The next is either an integer or a (integer,integer).
* The DEBUG_ReadTypeEnum takes care that stab_types is large enough.
*/
@ -667,7 +667,7 @@ DEBUG_ParseStabType(const char * stab)
}
enum DbgInfoLoad DEBUG_ParseStabs(char * addr, unsigned int load_offset,
unsigned int staboff, int stablen,
unsigned int staboff, int stablen,
unsigned int strtaboff, int strtablen)
{
struct name_hash * curr_func = NULL;
@ -794,7 +794,7 @@ enum DbgInfoLoad DEBUG_ParseStabs(char * addr, unsigned int load_offset,
new_value.cookie = DV_TARGET;
stab_strcpy(symname, sizeof(symname), ptr);
curr_sym = DEBUG_AddSymbol( symname, &new_value, currpath,
curr_sym = DEBUG_AddSymbol( symname, &new_value, currpath,
SYM_WINE | SYM_DATA );
break;
case N_PSYM:
@ -804,7 +804,7 @@ enum DbgInfoLoad DEBUG_ParseStabs(char * addr, unsigned int load_offset,
if( curr_func != NULL && !in_external_file )
{
stab_strcpy(symname, sizeof(symname), ptr);
curr_loc = DEBUG_AddLocal( curr_func, 0,
curr_loc = DEBUG_AddLocal( curr_func, 0,
stab_ptr->n_value, 0, 0, symname );
DEBUG_SetLocalSymbolType( curr_loc, DEBUG_ParseStabType(ptr) );
}
@ -813,7 +813,7 @@ enum DbgInfoLoad DEBUG_ParseStabs(char * addr, unsigned int load_offset,
if( curr_func != NULL && !in_external_file )
{
stab_strcpy(symname, sizeof(symname), ptr);
curr_loc = DEBUG_AddLocal( curr_func, stab_ptr->n_value + 1,
curr_loc = DEBUG_AddLocal( curr_func, stab_ptr->n_value + 1,
0, 0, 0, symname );
DEBUG_SetLocalSymbolType( curr_loc, DEBUG_ParseStabType(ptr) );
}
@ -822,7 +822,7 @@ enum DbgInfoLoad DEBUG_ParseStabs(char * addr, unsigned int load_offset,
if( curr_func != NULL && !in_external_file )
{
stab_strcpy(symname, sizeof(symname), ptr);
curr_loc = DEBUG_AddLocal( curr_func, 0,
curr_loc = DEBUG_AddLocal( curr_func, 0,
stab_ptr->n_value, 0, 0, symname );
DEBUG_SetLocalSymbolType( curr_loc, DEBUG_ParseStabType(ptr) );
}
@ -835,7 +835,7 @@ enum DbgInfoLoad DEBUG_ParseStabs(char * addr, unsigned int load_offset,
if( curr_func != NULL && !in_external_file )
{
#ifdef __ELF__
DEBUG_AddLineNumber(curr_func, stab_ptr->n_desc,
DEBUG_AddLineNumber(curr_func, stab_ptr->n_desc,
stab_ptr->n_value);
#else
#if 0
@ -844,7 +844,7 @@ enum DbgInfoLoad DEBUG_ParseStabs(char * addr, unsigned int load_offset,
* a.out, and as a result we would end up attaching the line
* number to the wrong function.
*/
DEBUG_AddLineNumber(curr_func, stab_ptr->n_desc,
DEBUG_AddLineNumber(curr_func, stab_ptr->n_desc,
stab_ptr->n_value - curr_func->addr.off);
#endif
#endif
@ -884,7 +884,7 @@ enum DbgInfoLoad DEBUG_ParseStabs(char * addr, unsigned int load_offset,
curr_func = DEBUG_AddSymbol( symname, &new_value, currpath,
SYM_WINE | SYM_FUNC );
#endif
}
}
else
{
/* some GCC seem to use a N_FUN "" to mark the end of a function */
@ -979,7 +979,7 @@ enum DbgInfoLoad DEBUG_ParseStabs(char * addr, unsigned int load_offset,
stabbuff[0] = '\0';
#if 0
DEBUG_Printf(DBG_CHN_MESG, "%d %x %s\n", stab_ptr->n_type,
DEBUG_Printf(DBG_CHN_MESG, "%d %x %s\n", stab_ptr->n_type,
(unsigned int) stab_ptr->n_value,
strs + (unsigned int) stab_ptr->n_un.n_name);
#endif
@ -1001,8 +1001,8 @@ enum DbgInfoLoad DEBUG_ParseStabs(char * addr, unsigned int load_offset,
* This is all really quite easy, since we don't have to worry about line
* numbers or local data variables.
*/
static int DEBUG_ProcessElfSymtab(DBG_MODULE* module, char* addr,
u_long load_addr, Elf32_Shdr* symtab,
static int DEBUG_ProcessElfSymtab(DBG_MODULE* module, char* addr,
u_long load_addr, Elf32_Shdr* symtab,
Elf32_Shdr* strtab)
{
char * curfile = NULL;
@ -1058,7 +1058,7 @@ static int DEBUG_ProcessElfSymtab(DBG_MODULE* module, char* addr,
new_value.type = NULL;
new_value.addr.off = load_addr + symp->st_value;
new_value.cookie = DV_TARGET;
flags = SYM_WINE | ((ELF32_ST_TYPE(symp->st_info) == STT_FUNC)
flags = SYM_WINE | ((ELF32_ST_TYPE(symp->st_info) == STT_FUNC)
? SYM_FUNC : SYM_DATA);
if( ELF32_ST_BIND(symp->st_info) == STB_GLOBAL )
curr_sym = DEBUG_AddSymbol( symname, &new_value, NULL, flags );
@ -1080,9 +1080,9 @@ static int DEBUG_ProcessElfSymtab(DBG_MODULE* module, char* addr,
* Loads the symbolic information from ELF module stored in 'filename'
* the module has been loaded at 'load_offset' address, so symbols' address
* relocation is performed
* returns
* returns
* -1 if the file cannot be found/opened
* 0 if the file doesn't contain symbolic info (or this info cannot be
* 0 if the file doesn't contain symbolic info (or this info cannot be
* read or parsed)
* 1 on success
*/
@ -1112,14 +1112,14 @@ enum DbgInfoLoad DEBUG_LoadElfStabs(DBG_MODULE* module)
* Now open the file, so that we can mmap() it.
*/
if ((fd = open(module->module_name, O_RDONLY)) == -1) goto leave;
dil = DIL_NOINFO;
/*
* Now mmap() the file.
*/
addr = mmap(0, statbuf.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
if (addr == (char*)0xffffffff) goto leave;
/*
* Next, we need to find a few of the internal ELF headers within
* this thing. We need the main executable header, and the section
@ -1128,27 +1128,27 @@ enum DbgInfoLoad DEBUG_LoadElfStabs(DBG_MODULE* module)
ehptr = (Elf32_Ehdr*) addr;
spnt = (Elf32_Shdr*) (addr + ehptr->e_shoff);
shstrtab = (addr + spnt[ehptr->e_shstrndx].sh_offset);
stabsect = stabstrsect = -1;
for (i = 0; i < ehptr->e_shnum; i++) {
if (strcmp(shstrtab + spnt[i].sh_name, ".stab") == 0)
stabsect = i;
if (strcmp(shstrtab + spnt[i].sh_name, ".stabstr") == 0)
stabstrsect = i;
}
if (stabsect == -1 || stabstrsect == -1) {
DEBUG_Printf(DBG_CHN_WARN, "no .stab section\n");
goto leave;
}
/*
* OK, now just parse all of the stabs.
*/
if (DEBUG_ParseStabs(addr,
module->elf_info->elf_addr,
if (DEBUG_ParseStabs(addr,
module->elf_info->elf_addr,
spnt[stabsect].sh_offset,
spnt[stabsect].sh_size,
spnt[stabstrsect].sh_offset,
@ -1159,36 +1159,36 @@ enum DbgInfoLoad DEBUG_LoadElfStabs(DBG_MODULE* module)
DEBUG_Printf(DBG_CHN_WARN, "bad stabs\n");
goto leave;
}
for (i = 0; i < ehptr->e_shnum; i++) {
if ( (strcmp(shstrtab + spnt[i].sh_name, ".symtab") == 0)
&& (spnt[i].sh_type == SHT_SYMTAB))
DEBUG_ProcessElfSymtab(module, addr, module->elf_info->elf_addr,
spnt + i, spnt + spnt[i].sh_link);
if ( (strcmp(shstrtab + spnt[i].sh_name, ".dynsym") == 0)
&& (spnt[i].sh_type == SHT_DYNSYM))
DEBUG_ProcessElfSymtab(module, addr, module->elf_info->elf_addr,
DEBUG_ProcessElfSymtab(module, addr, module->elf_info->elf_addr,
spnt + i, spnt + spnt[i].sh_link);
}
leave:
if (addr != (char*)0xffffffff) munmap(addr, statbuf.st_size);
if (fd != -1) close(fd);
return dil;
}
/*
* Loads the information for ELF module stored in 'filename'
* the module has been loaded at 'load_offset' address
* returns
* returns
* -1 if the file cannot be found/opened
* 0 if the file doesn't contain symbolic info (or this info cannot be
* 0 if the file doesn't contain symbolic info (or this info cannot be
* read or parsed)
* 1 on success
*/
static enum DbgInfoLoad DEBUG_ProcessElfFile(const char* filename,
static enum DbgInfoLoad DEBUG_ProcessElfFile(const char* filename,
unsigned int load_offset,
unsigned int* dyn_addr)
{
@ -1210,12 +1210,12 @@ static enum DbgInfoLoad DEBUG_ProcessElfFile(const char* filename,
/* check that the file exists, and that the module hasn't been loaded yet */
if (stat(filename, &statbuf) == -1) goto leave;
/*
* Now open the file, so that we can mmap() it.
*/
if ((fd = open(filename, O_RDONLY)) == -1) goto leave;
/*
* Now mmap() the file.
*/
@ -1223,7 +1223,7 @@ static enum DbgInfoLoad DEBUG_ProcessElfFile(const char* filename,
if (addr == (char*)0xffffffff) goto leave;
dil = DIL_NOINFO;
/*
* Next, we need to find a few of the internal ELF headers within
* this thing. We need the main executable header, and the section
@ -1248,7 +1248,7 @@ static enum DbgInfoLoad DEBUG_ProcessElfFile(const char* filename,
if (size < ppnt[i].p_vaddr - delta + ppnt[i].p_memsz)
size = ppnt[i].p_vaddr - delta + ppnt[i].p_memsz;
}
for (i = 0; i < ehptr->e_shnum; i++) {
if (strcmp(shstrtab + spnt[i].sh_name, ".bss") == 0 &&
spnt[i].sh_type == SHT_NOBITS) {
@ -1260,8 +1260,8 @@ static enum DbgInfoLoad DEBUG_ProcessElfFile(const char* filename,
if (dyn_addr) *dyn_addr = spnt[i].sh_addr;
}
}
module = DEBUG_RegisterELFModule((load_offset == 0) ? ehptr->e_entry : load_offset,
module = DEBUG_RegisterELFModule((load_offset == 0) ? ehptr->e_entry : load_offset,
size, filename);
if (!module) {
dil = DIL_ERROR;
@ -1280,13 +1280,13 @@ static enum DbgInfoLoad DEBUG_ProcessElfFile(const char* filename,
if (addr != (char*)0xffffffff) munmap(addr, statbuf.st_size);
if (fd != -1) close(fd);
if (module) module->dil = dil;
return dil;
}
static enum DbgInfoLoad DEBUG_ProcessElfFileFromPath(const char * filename,
unsigned int load_offset,
unsigned int* dyn_addr,
static enum DbgInfoLoad DEBUG_ProcessElfFileFromPath(const char * filename,
unsigned int load_offset,
unsigned int* dyn_addr,
const char* path)
{
enum DbgInfoLoad dil = DIL_ERROR;
@ -1313,7 +1313,7 @@ static enum DbgInfoLoad DEBUG_ProcessElfFileFromPath(const char * filename,
return dil;
}
static enum DbgInfoLoad DEBUG_ProcessElfObject(const char* filename,
static enum DbgInfoLoad DEBUG_ProcessElfObject(const char* filename,
unsigned int load_offset,
unsigned int* dyn_addr)
{
@ -1335,7 +1335,7 @@ static enum DbgInfoLoad DEBUG_ProcessElfObject(const char* filename,
return dil;
}
static BOOL DEBUG_WalkList(struct r_debug* dbg_hdr)
{
u_long lm_addr;
@ -1361,7 +1361,7 @@ static BOOL DEBUG_WalkList(struct r_debug* dbg_hdr)
DEBUG_ProcessElfObject(bufstr, (unsigned)lm.l_addr, NULL);
}
}
return TRUE;
}
@ -1369,12 +1369,12 @@ static BOOL DEBUG_RescanElf(void)
{
struct r_debug dbg_hdr;
if (!DEBUG_CurrProcess ||
if (!DEBUG_CurrProcess ||
!DEBUG_READ_MEM_VERBOSE((void*)DEBUG_CurrProcess->dbg_hdr_addr, &dbg_hdr, sizeof(dbg_hdr)))
return FALSE;
switch (dbg_hdr.r_state) {
case RT_CONSISTENT:
case RT_CONSISTENT:
DEBUG_WalkList(&dbg_hdr);
DEBUG_CheckDelayedBP();
break;
@ -1393,35 +1393,35 @@ enum DbgInfoLoad DEBUG_ReadExecutableDbgInfo(const char* exe_name)
struct r_debug dbg_hdr;
enum DbgInfoLoad dil = DIL_NOINFO;
unsigned int dyn_addr;
/*
* Make sure we can stat and open this file.
*/
if (exe_name == NULL) goto leave;
DEBUG_ProcessElfObject(exe_name, 0, &dyn_addr);
do {
if (!DEBUG_READ_MEM_VERBOSE((void*)dyn_addr, &dyn, sizeof(dyn)))
goto leave;
dyn_addr += sizeof(dyn);
} while (dyn.d_tag != DT_DEBUG && dyn.d_tag != DT_NULL);
if (dyn.d_tag == DT_NULL) goto leave;
/*
* OK, now dig into the actual tables themselves.
*/
if (!DEBUG_READ_MEM_VERBOSE((void*)dyn.d_un.d_ptr, &dbg_hdr, sizeof(dbg_hdr)))
goto leave;
assert(!DEBUG_CurrProcess->dbg_hdr_addr);
DEBUG_CurrProcess->dbg_hdr_addr = (u_long)dyn.d_un.d_ptr;
if (dbg_hdr.r_brk) {
DBG_VALUE value;
DEBUG_Printf(DBG_CHN_TRACE, "Setting up a breakpoint on r_brk(%lx)\n",
(unsigned long)dbg_hdr.r_brk);
DEBUG_SetBreakpoints(FALSE);
value.type = NULL;
value.cookie = DV_TARGET;
@ -1430,9 +1430,9 @@ enum DbgInfoLoad DEBUG_ReadExecutableDbgInfo(const char* exe_name)
DEBUG_AddBreakpoint(&value, DEBUG_RescanElf);
DEBUG_SetBreakpoints(TRUE);
}
dil = DEBUG_WalkList(&dbg_hdr);
leave:
return dil;
}

View File

@ -70,7 +70,7 @@ void DEBUG_InfoStack(void)
{
#ifdef __i386__
DBG_VALUE value;
value.type = NULL;
value.cookie = DV_TARGET;
value.addr.seg = DEBUG_context.SegSs;
@ -109,8 +109,8 @@ static void DEBUG_ForceFrame(DBG_ADDR *stack, DBG_ADDR *code, int frameno, enum
if (noisy)
frames[theframe].frame = DEBUG_PrintAddressAndArgs( code, mode, stack->off, TRUE );
else
DEBUG_FindNearestSymbol( code, TRUE,
&frames[theframe].frame.sym, stack->off,
DEBUG_FindNearestSymbol( code, TRUE,
&frames[theframe].frame.sym, stack->off,
&frames[theframe].frame.list);
frames[theframe].ss = stack->seg;
frames[theframe].ebp = stack->off;
@ -126,9 +126,9 @@ static BOOL DEBUG_Frame16(DBG_THREAD* thread, DBG_ADDR *addr, unsigned int *cs,
FRAME16 frame;
void* p = (void*)DEBUG_ToLinear(addr);
DBG_ADDR code;
if (!p) return FALSE;
if (!DEBUG_READ_MEM(p, &frame, sizeof(frame))) {
if (noisy) DEBUG_InvalAddr(addr);
return FALSE;
@ -141,7 +141,7 @@ static BOOL DEBUG_Frame16(DBG_THREAD* thread, DBG_ADDR *addr, unsigned int *cs,
* but check whether it could be anyway */
if (((frame.cs&7)==7) && (frame.cs != *cs)) {
LDT_ENTRY le;
if (GetThreadSelectorEntry( thread->handle, frame.cs, &le) &&
(le.HighWord.Bits.Type & 0x08)) { /* code segment */
/* it is very uncommon to push a code segment cs as
@ -164,9 +164,9 @@ static BOOL DEBUG_Frame32(DBG_ADDR *addr, unsigned int *cs, int frameno, int noi
void* p = (void*)DEBUG_ToLinear(addr);
DBG_ADDR code;
DWORD old_bp = addr->off;
if (!p) return FALSE;
if (!DEBUG_READ_MEM(p, &frame, sizeof(frame))) {
if (noisy) DEBUG_InvalAddr(addr);
return FALSE;
@ -204,7 +204,7 @@ void DEBUG_BackTrace(DWORD tid, BOOL noisy)
int copy_nframe = 0;
int copy_curr_frame = 0;
struct bt_info* copy_frames = NULL;
if (noisy) DEBUG_Printf( DBG_CHN_MESG, "Backtrace:\n" );
if (tid == DEBUG_CurrTid)
@ -284,8 +284,8 @@ void DEBUG_BackTrace(DWORD tid, BOOL noisy)
return;
}
/* cur_switch holds address of curr_stack's field in TEB in debuggee
* address space
/* cur_switch holds address of curr_stack's field in TEB in debuggee
* address space
*/
cur_switch = (DWORD)thread->teb + OFFSET_OF(TEB, cur_stack);
if (!DEBUG_READ_MEM((void*)cur_switch, &next_switch, sizeof(next_switch))) {
@ -295,7 +295,7 @@ void DEBUG_BackTrace(DWORD tid, BOOL noisy)
if (is16) {
if (!DEBUG_READ_MEM((void*)next_switch, &frame32, sizeof(STACK32FRAME))) {
if (noisy) DEBUG_Printf( DBG_CHN_MESG, "Bad stack frame 0x%08lx\n",
if (noisy) DEBUG_Printf( DBG_CHN_MESG, "Bad stack frame 0x%08lx\n",
(unsigned long)(STACK32FRAME*)next_switch );
return;
}
@ -306,9 +306,9 @@ void DEBUG_BackTrace(DWORD tid, BOOL noisy)
tmp.seg = SELECTOROF(next_switch);
tmp.off = OFFSETOF(next_switch);
p = DEBUG_ToLinear(&tmp);
if (!DEBUG_READ_MEM((void*)p, &frame16, sizeof(STACK16FRAME))) {
if (noisy) DEBUG_Printf( DBG_CHN_MESG, "Bad stack frame 0x%08lx\n",
if (noisy) DEBUG_Printf( DBG_CHN_MESG, "Bad stack frame 0x%08lx\n",
(unsigned long)(STACK16FRAME*)p );
return;
}
@ -320,7 +320,7 @@ void DEBUG_BackTrace(DWORD tid, BOOL noisy)
sw_addr.seg = (DWORD)-1;
sw_addr.off = (DWORD)-1;
}
for (ok = TRUE; ok;) {
if ((frames[frameno].ss == sw_addr.seg) &&
sw_addr.off && (frames[frameno].ebp >= sw_addr.off))
@ -328,65 +328,65 @@ void DEBUG_BackTrace(DWORD tid, BOOL noisy)
/* 16<->32 switch...
* yes, I know this is confusing, it gave me a headache too */
if (is16) {
if (!DEBUG_READ_MEM((void*)next_switch, &frame32, sizeof(STACK32FRAME))) {
if (noisy) DEBUG_Printf( DBG_CHN_MESG, "Bad stack frame 0x%08lx\n",
if (noisy) DEBUG_Printf( DBG_CHN_MESG, "Bad stack frame 0x%08lx\n",
(unsigned long)(STACK32FRAME*)next_switch );
return;
}
code.seg = 0;
code.off = frame32.retaddr;
cs = 0;
addr.seg = 0;
addr.off = frame32.ebp;
DEBUG_ForceFrame( &addr, &code, ++frameno, MODE_32, noisy, NULL );
next_switch = cur_switch;
tmp.seg = SELECTOROF(next_switch);
tmp.off = OFFSETOF(next_switch);
p = DEBUG_ToLinear(&tmp);
if (!DEBUG_READ_MEM((void*)p, &frame16, sizeof(STACK16FRAME))) {
if (noisy) DEBUG_Printf( DBG_CHN_MESG, "Bad stack frame 0x%08lx\n",
if (noisy) DEBUG_Printf( DBG_CHN_MESG, "Bad stack frame 0x%08lx\n",
(unsigned long)(STACK16FRAME*)p );
return;
}
cur_switch = (DWORD)frame16.frame32;
sw_addr.seg = 0;
sw_addr.off = cur_switch;
is16 = FALSE;
} else {
tmp.seg = SELECTOROF(next_switch);
tmp.off = OFFSETOF(next_switch);
p = DEBUG_ToLinear(&tmp);
if (!DEBUG_READ_MEM((void*)p, &frame16, sizeof(STACK16FRAME))) {
if (noisy) DEBUG_Printf( DBG_CHN_MESG, "Bad stack frame 0x%08lx\n",
(unsigned long)(STACK16FRAME*)p );
return;
}
code.seg = frame16.cs;
code.off = frame16.ip;
cs = frame16.cs;
addr.seg = SELECTOROF(next_switch);
addr.off = frame16.bp;
DEBUG_ForceFrame( &addr, &code, ++frameno, MODE_16, noisy, NULL );
next_switch = cur_switch;
if (!DEBUG_READ_MEM((void*)next_switch, &frame32, sizeof(STACK32FRAME))) {
if (noisy) DEBUG_Printf( DBG_CHN_MESG, "Bad stack frame 0x%08lx\n",
if (noisy) DEBUG_Printf( DBG_CHN_MESG, "Bad stack frame 0x%08lx\n",
(unsigned long)(STACK32FRAME*)next_switch );
return;
}
cur_switch = (DWORD)frame32.frame16;
sw_addr.seg = SELECTOROF(cur_switch);
sw_addr.off = OFFSETOF(cur_switch);
is16 = TRUE;
}
if (!DEBUG_READ_MEM((void*)DEBUG_ToLinear(&sw_addr), &ch, sizeof(ch))) {

View File

@ -116,7 +116,7 @@ static unsigned int type_hash( const char * name )
p = name;
while (*p)
while (*p)
{
hash = (hash << 4) + *p++;
@ -131,7 +131,7 @@ static unsigned int type_hash( const char * name )
static struct datatype *
DEBUG_InitBasic(int type, char * name, int size, int b_signed,
DEBUG_InitBasic(int type, char * name, int size, int b_signed,
char * output_format)
{
int hash;
@ -174,12 +174,12 @@ DEBUG_LookupDataType(enum debug_type xtype, int hash, const char * typename)
{
for( dt = type_hash_table[hash]; dt; dt = dt->next )
{
if( xtype != dt->type || dt->name == NULL
if( xtype != dt->type || dt->name == NULL
|| dt->name[0] != typename[0])
{
continue;
}
if( strcmp(dt->name, typename) == 0 )
{
return dt;
@ -223,11 +223,11 @@ DEBUG_NewDataType(enum debug_type xtype, const char * typename)
if( dt == NULL )
{
dt = (struct datatype *) DBG_alloc(sizeof(struct datatype));
if( dt != NULL )
{
memset(dt, 0, sizeof(*dt));
dt->type = xtype;
if( typename != NULL )
{
@ -266,7 +266,7 @@ DEBUG_FindOrMakePointerType(struct datatype * reftype)
{
continue;
}
if( dt->un.pointer.pointsto == reftype )
{
return dt;
@ -277,7 +277,7 @@ DEBUG_FindOrMakePointerType(struct datatype * reftype)
if( dt == NULL )
{
dt = (struct datatype *) DBG_alloc(sizeof(struct datatype));
if( dt != NULL )
{
dt->type = DT_POINTER;
@ -351,33 +351,33 @@ DEBUG_GetExprValue(const DBG_VALUE* _value, char** format)
struct en_values * e;
char * def_format = "0x%x";
DBG_VALUE value = *_value;
assert(_value->cookie == DV_TARGET || _value->cookie == DV_HOST);
rtn = 0; rtn2 = 0;
/* FIXME? I don't quite get this...
* if this is wrong, value.addr shall be linearized
* if this is wrong, value.addr shall be linearized
*/
value.addr.seg = 0;
value.addr.seg = 0;
assert(value.type != NULL);
switch (value.type->type) {
case DT_BASIC:
if (value.type->un.basic.basic_size > sizeof(rtn)) {
DEBUG_Printf(DBG_CHN_ERR, "Size too large (%d)\n",
DEBUG_Printf(DBG_CHN_ERR, "Size too large (%d)\n",
value.type->un.basic.basic_size);
return 0;
}
/* FIXME: following code implies i386 byte ordering */
if (_value->cookie == DV_TARGET) {
if (!DEBUG_READ_MEM_VERBOSE((void*)value.addr.off, &rtn,
if (!DEBUG_READ_MEM_VERBOSE((void*)value.addr.off, &rtn,
value.type->un.basic.basic_size))
return 0;
} else {
memcpy(&rtn, (void*)value.addr.off, value.type->un.basic.basic_size);
}
if ( (value.type->un.basic.b_signed)
&& ((value.type->un.basic.basic_size & 3) != 0)
&& ((rtn >> (value.type->un.basic.basic_size * 8 - 1)) != 0)) {
@ -394,12 +394,12 @@ DEBUG_GetExprValue(const DBG_VALUE* _value, char** format)
if (value.type->un.basic.output_format != NULL) {
def_format = value.type->un.basic.output_format;
}
/*
* Check for single character prints that are out of range.
*/
if ( value.type->un.basic.basic_size == 1
&& strcmp(def_format, "'%c'") == 0
&& strcmp(def_format, "'%c'") == 0
&& ((rtn < 0x20) || (rtn > 0x80))) {
def_format = "%d";
}
@ -411,16 +411,16 @@ DEBUG_GetExprValue(const DBG_VALUE* _value, char** format)
} else {
rtn2 = *(unsigned int*)(value.addr.off);
}
type2 = value.type->un.pointer.pointsto;
if (!type2) {
def_format = "Internal symbol error: unable to access memory location 0x%08x";
rtn = 0;
break;
}
if (type2->type == DT_BASIC && type2->un.basic.basic_size == 1) {
if (type2->type == DT_BASIC && type2->un.basic.basic_size == 1) {
if (_value->cookie == DV_TARGET) {
char ch;
def_format = "\"%S\"";
@ -461,8 +461,8 @@ DEBUG_GetExprValue(const DBG_VALUE* _value, char** format)
rtn = 0;
break;
}
if (format != NULL) {
*format = def_format;
}
@ -594,7 +594,7 @@ DEBUG_CopyFieldlist(struct datatype * dt, struct datatype * dt2)
}
int
DEBUG_AddStructElement(struct datatype * dt, char * name, struct datatype * type,
DEBUG_AddStructElement(struct datatype * dt, char * name, struct datatype * type,
int offset, int size)
{
struct member * m;
@ -605,7 +605,7 @@ DEBUG_AddStructElement(struct datatype * dt, char * name, struct datatype * type
{
for(last = dt->un.structure.members; last; last = last->next)
{
if( (last->name[0] == name[0])
if( (last->name[0] == name[0])
&& (strcmp(last->name, name) == 0) )
{
return TRUE;
@ -620,7 +620,7 @@ DEBUG_AddStructElement(struct datatype * dt, char * name, struct datatype * type
{
return FALSE;
}
m->name = DBG_strdup(name);
m->type = type;
m->offset = offset;
@ -653,7 +653,7 @@ DEBUG_AddStructElement(struct datatype * dt, char * name, struct datatype * type
{
return FALSE;
}
e->name = DBG_strdup(name);
e->value = offset;
e->next = dt->un.enumeration.members;
@ -666,7 +666,7 @@ DEBUG_AddStructElement(struct datatype * dt, char * name, struct datatype * type
return TRUE;
}
struct datatype *
struct datatype *
DEBUG_GetPointerType(struct datatype * dt)
{
if( dt->type == DT_POINTER )
@ -707,7 +707,7 @@ DEBUG_SetArrayParams(struct datatype * dt, int min, int max, struct datatype * d
}
int
DEBUG_SetBitfieldParams(struct datatype * dt, int offset, int nbits,
DEBUG_SetBitfieldParams(struct datatype * dt, int offset, int nbits,
struct datatype * dt2)
{
assert(dt->type == DT_BITFIELD);
@ -736,7 +736,7 @@ int DEBUG_GetObjectSize(struct datatype * dt)
case DT_ENUM:
return sizeof(int);
case DT_ARRAY:
return (dt->un.array.end - dt->un.array.start)
return (dt->un.array.end - dt->un.array.start)
* DEBUG_GetObjectSize(dt->un.array.basictype);
case DT_BITFIELD:
/*
@ -780,7 +780,7 @@ DEBUG_ArrayIndex(const DBG_VALUE * value, DBG_VALUE * result, int index)
size = DEBUG_GetObjectSize(value->type->un.array.basictype);
result->type = value->type->un.array.basictype;
result->addr.off = value->addr.off + size * (index - value->type->un.array.start);
/* Contents of array must be on same target */
result->cookie = value->cookie;
}
@ -814,7 +814,7 @@ DEBUG_Print( const DBG_VALUE *value, int count, char format, int level )
DEBUG_Printf( DBG_CHN_MESG, "Count other than 1 is meaningless in 'print' command\n" );
return;
}
if( value->type == NULL )
{
/* No type, just print the addr value */
@ -823,7 +823,7 @@ DEBUG_Print( const DBG_VALUE *value, int count, char format, int level )
DEBUG_nchar += DEBUG_Printf( DBG_CHN_MESG, "0x%08lx", value->addr.off );
goto leave;
}
if( level == 0 )
{
DEBUG_nchar = 0;
@ -897,7 +897,7 @@ DEBUG_Print( const DBG_VALUE *value, int count, char format, int level )
default: assert(0);
}
DEBUG_nchar += clen;
if (clen != len)
if (clen != len)
{
DEBUG_Printf(DBG_CHN_MESG, "...\"");
goto leave;
@ -929,7 +929,7 @@ DEBUG_Print( const DBG_VALUE *value, int count, char format, int level )
break;
case DT_FUNC:
DEBUG_Printf(DBG_CHN_MESG, "Function at ???\n");
break;
break;
default:
DEBUG_Printf(DBG_CHN_MESG, "Unknown type (%d)\n", value->type->type);
assert(FALSE);
@ -986,7 +986,7 @@ DEBUG_DumpTypes(void)
nm++;
}
}
DEBUG_Printf(DBG_CHN_MESG, "0x%08lx - STRUCT(%s) %d %d %s\n",
DEBUG_Printf(DBG_CHN_MESG, "0x%08lx - STRUCT(%s) %d %d %s\n",
(unsigned long)dt, name, dt->un.structure.size, nm, member_name);
break;
case DT_ARRAY:
@ -994,11 +994,11 @@ DEBUG_DumpTypes(void)
(unsigned long)dt, name, (unsigned long)dt->un.array.basictype);
break;
case DT_ENUM:
DEBUG_Printf(DBG_CHN_MESG, "0x%08lx - ENUM(%s)\n",
DEBUG_Printf(DBG_CHN_MESG, "0x%08lx - ENUM(%s)\n",
(unsigned long)dt, name);
break;
case DT_BITFIELD:
DEBUG_Printf(DBG_CHN_MESG, "0x%08lx - BITFIELD(%s)\n",
DEBUG_Printf(DBG_CHN_MESG, "0x%08lx - BITFIELD(%s)\n",
(unsigned long)dt, name);
break;
case DT_FUNC:
@ -1093,7 +1093,7 @@ int DEBUG_PrintType( const DBG_VALUE *value )
{
assert(value->cookie == DV_TARGET || value->cookie == DV_HOST);
if (!value->type)
if (!value->type)
{
DEBUG_Printf(DBG_CHN_MESG, "Unknown type\n");
return FALSE;

View File

@ -113,7 +113,7 @@ static BOOL DEBUG_IntVarsRW(int read)
for (i = 0; i < DBG_IV_LAST; i++) {
if (read) {
if (!DEBUG_IntVars[i].pval) {
if (!RegQueryValueEx(hkey, DEBUG_IntVars[i].name, 0,
if (!RegQueryValueEx(hkey, DEBUG_IntVars[i].name, 0,
&type, (LPSTR)&val, &count))
DEBUG_IntVars[i].val = val;
DEBUG_IntVars[i].pval = &DEBUG_IntVars[i].val;
@ -123,7 +123,7 @@ static BOOL DEBUG_IntVarsRW(int read)
} else {
/* FIXME: type should be infered from basic type -if any- of intvar */
if (DEBUG_IntVars[i].pval == &DEBUG_IntVars[i].val)
RegSetValueEx(hkey, DEBUG_IntVars[i].name, 0,
RegSetValueEx(hkey, DEBUG_IntVars[i].name, 0,
type, (LPCVOID)DEBUG_IntVars[i].pval, count);
}
}
@ -141,7 +141,7 @@ DBG_INTVAR* DEBUG_GetIntVar(const char* name)
}
return NULL;
}
static WINE_EXCEPTION_FILTER(wine_dbg)
{
DEBUG_Printf(DBG_CHN_MESG, "\nwine_dbg: Exception (%lx) inside debugger, continuing...\n", GetExceptionCode());
@ -152,7 +152,7 @@ static WINE_EXCEPTION_FILTER(wine_dbg)
DBG_PROCESS* DEBUG_GetProcess(DWORD pid)
{
DBG_PROCESS* p;
for (p = DEBUG_ProcessList; p; p = p->next)
if (p->pid == pid) break;
return p;
@ -220,11 +220,11 @@ static BOOL DEBUG_ProcessGetStringIndirect(char* buffer, int size, HANDLE hp, LP
{
LPVOID ad;
DWORD sz;
if ( addr
&& ReadProcessMemory(hp, addr, &ad, sizeof(ad), &sz)
&& sz == sizeof(ad)
&& ad
if ( addr
&& ReadProcessMemory(hp, addr, &ad, sizeof(ad), &sz)
&& sz == sizeof(ad)
&& ad
&& ReadProcessMemory(hp, ad, buffer, size, &sz))
return TRUE;
*(WCHAR*)buffer = 0;
@ -234,19 +234,19 @@ static BOOL DEBUG_ProcessGetStringIndirect(char* buffer, int size, HANDLE hp, LP
DBG_THREAD* DEBUG_GetThread(DBG_PROCESS* p, DWORD tid)
{
DBG_THREAD* t;
for (t = p->threads; t; t = t->next)
if (t->tid == tid) break;
return t;
}
static DBG_THREAD* DEBUG_AddThread(DBG_PROCESS* p, DWORD tid,
static DBG_THREAD* DEBUG_AddThread(DBG_PROCESS* p, DWORD tid,
HANDLE h, LPVOID start, LPVOID teb)
{
DBG_THREAD* t = DBG_alloc(sizeof(DBG_THREAD));
if (!t)
return NULL;
t->handle = h;
t->tid = tid;
t->start = start;
@ -270,10 +270,10 @@ static DBG_THREAD* DEBUG_AddThread(DBG_PROCESS* p, DWORD tid,
static void DEBUG_InitCurrThread(void)
{
if (DEBUG_CurrThread->start) {
if (DEBUG_CurrThread->process->num_threads == 1 ||
if (DEBUG_CurrThread->process->num_threads == 1 ||
DBG_IVAR(BreakAllThreadsStartup)) {
DBG_VALUE value;
DEBUG_SetBreakpoints(FALSE);
value.type = NULL;
value.cookie = DV_TARGET;
@ -315,7 +315,7 @@ BOOL DEBUG_Detach(void)
{
/* remove all set breakpoints in debuggee code */
DEBUG_SetBreakpoints(FALSE);
/* needed for single stepping (ugly).
/* needed for single stepping (ugly).
* should this be handled inside the server ??? */
#ifdef __i386__
DEBUG_context.EFlags &= ~STEP_FLAG;
@ -357,11 +357,11 @@ static BOOL DEBUG_ExceptionProlog(BOOL is_debug, BOOL force, DWORD code)
}
DEBUG_Printf(DBG_CHN_MESG, ".\n");
}
DEBUG_LoadEntryPoints("Loading new modules symbols:\n");
if (!force && is_debug &&
DEBUG_ShouldContinue(&addr, code,
if (!force && is_debug &&
DEBUG_ShouldContinue(&addr, code,
&DEBUG_CurrThread->exec_count))
return FALSE;
@ -407,7 +407,7 @@ static BOOL DEBUG_ExceptionProlog(BOOL is_debug, BOOL force, DWORD code)
DEBUG_DisassembleInstruction(&addr);
/* resets list internal arguments so we can look at source code when needed */
DEBUG_FindNearestSymbol(&addr, TRUE, NULL, 0, &list);
DEBUG_FindNearestSymbol(&addr, TRUE, NULL, 0, &list);
if (list.sourcefile) DEBUG_List(&list, NULL, 0);
}
return TRUE;
@ -490,7 +490,7 @@ static void DEBUG_HandleException(EXCEPTION_RECORD *rec, BOOL first_chance, BOOL
break;
case EXCEPTION_ACCESS_VIOLATION:
if (rec->NumberParameters == 2)
DEBUG_Printf(DBG_CHN_MESG, "page fault on %s access to 0x%08lx",
DEBUG_Printf(DBG_CHN_MESG, "page fault on %s access to 0x%08lx",
rec->ExceptionInformation[0] ? "write" : "read",
rec->ExceptionInformation[1]);
else
@ -548,10 +548,10 @@ static void DEBUG_HandleException(EXCEPTION_RECORD *rec, BOOL first_chance, BOOL
}
#if 0
DEBUG_Printf(DBG_CHN_TRACE,
DEBUG_Printf(DBG_CHN_TRACE,
"Entering debugger PC=%lx EFL=%08lx mode=%d count=%d\n",
#ifdef __i386__
DEBUG_context.Eip, DEBUG_context.EFlags,
DEBUG_context.Eip, DEBUG_context.EFlags,
#else
0L, 0L,
#endif
@ -583,10 +583,10 @@ static void DEBUG_HandleException(EXCEPTION_RECORD *rec, BOOL first_chance, BOOL
DEBUG_ExceptionEpilog();
#if 0
DEBUG_Printf(DBG_CHN_TRACE,
DEBUG_Printf(DBG_CHN_TRACE,
"Exiting debugger PC=%lx EFL=%08lx mode=%d count=%d\n",
#ifdef __i386__
DEBUG_context.Eip, DEBUG_context.EFlags,
DEBUG_context.Eip, DEBUG_context.EFlags,
#else
0L, 0L,
#endif
@ -605,9 +605,9 @@ static void DEBUG_HandleDebugEvent(DEBUG_EVENT* de)
__TRY {
if ((DEBUG_CurrProcess = DEBUG_GetProcess(de->dwProcessId)) != NULL)
DEBUG_CurrThread = DEBUG_GetThread(DEBUG_CurrProcess, de->dwThreadId);
else
else
DEBUG_CurrThread = NULL;
switch (de->dwDebugEventCode) {
case EXCEPTION_DEBUG_EVENT:
if (!DEBUG_CurrThread) {
@ -615,9 +615,9 @@ static void DEBUG_HandleDebugEvent(DEBUG_EVENT* de)
de->dwProcessId, de->dwThreadId);
break;
}
DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: exception code=%08lx\n",
de->dwProcessId, de->dwThreadId,
DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: exception code=%08lx\n",
de->dwProcessId, de->dwThreadId,
de->u.Exception.ExceptionRecord.ExceptionCode);
if (DEBUG_CurrProcess->continue_on_first_exception) {
@ -641,20 +641,20 @@ static void DEBUG_HandleDebugEvent(DEBUG_EVENT* de)
DEBUG_Printf(DBG_CHN_WARN, "Can't get thread's context\n");
break;
}
DEBUG_HandleException(&de->u.Exception.ExceptionRecord,
de->u.Exception.dwFirstChance,
DEBUG_HandleException(&de->u.Exception.ExceptionRecord,
de->u.Exception.dwFirstChance,
DEBUG_CurrThread->wait_for_first_exception);
if (DEBUG_CurrThread) {
DEBUG_CurrThread->wait_for_first_exception = 0;
SetThreadContext(DEBUG_CurrThread->handle, &DEBUG_context);
}
break;
case CREATE_THREAD_DEBUG_EVENT:
DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: create thread D @%08lx\n", de->dwProcessId, de->dwThreadId,
DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: create thread D @%08lx\n", de->dwProcessId, de->dwThreadId,
(unsigned long)(LPVOID)de->u.CreateThread.lpStartAddress);
if (DEBUG_CurrProcess == NULL) {
DEBUG_Printf(DBG_CHN_ERR, "Unknown process\n");
break;
@ -663,11 +663,11 @@ static void DEBUG_HandleDebugEvent(DEBUG_EVENT* de)
DEBUG_Printf(DBG_CHN_TRACE, "Thread already listed, skipping\n");
break;
}
DEBUG_CurrThread = DEBUG_AddThread(DEBUG_CurrProcess,
de->dwThreadId,
de->u.CreateThread.hThread,
de->u.CreateThread.lpStartAddress,
DEBUG_CurrThread = DEBUG_AddThread(DEBUG_CurrProcess,
de->dwThreadId,
de->u.CreateThread.hThread,
de->u.CreateThread.lpStartAddress,
de->u.CreateThread.lpThreadLocalBase);
if (!DEBUG_CurrThread) {
DEBUG_Printf(DBG_CHN_ERR, "Couldn't create thread\n");
@ -675,20 +675,20 @@ static void DEBUG_HandleDebugEvent(DEBUG_EVENT* de)
}
DEBUG_InitCurrThread();
break;
case CREATE_PROCESS_DEBUG_EVENT:
DEBUG_ProcessGetStringIndirect(buffer, sizeof(buffer),
de->u.CreateProcessInfo.hProcess,
DEBUG_ProcessGetStringIndirect(buffer, sizeof(buffer),
de->u.CreateProcessInfo.hProcess,
de->u.CreateProcessInfo.lpImageName);
/* FIXME unicode ? de->u.CreateProcessInfo.fUnicode */
DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: create process '%s'/%p @%08lx (%ld<%ld>)\n",
de->dwProcessId, de->dwThreadId,
DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: create process '%s'/%p @%08lx (%ld<%ld>)\n",
de->dwProcessId, de->dwThreadId,
buffer, de->u.CreateProcessInfo.lpImageName,
(unsigned long)(LPVOID)de->u.CreateProcessInfo.lpStartAddress,
de->u.CreateProcessInfo.dwDebugInfoFileOffset,
de->u.CreateProcessInfo.nDebugInfoSize);
if ((DEBUG_CurrProcess = DEBUG_GetProcess(de->dwProcessId)) != NULL) {
if (DEBUG_CurrProcess->handle) {
DEBUG_Printf(DBG_CHN_ERR, "Skipping already defined process\n");
@ -707,44 +707,44 @@ static void DEBUG_HandleDebugEvent(DEBUG_EVENT* de)
break;
}
}
DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: create thread I @%08lx\n",
de->dwProcessId, de->dwThreadId,
DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: create thread I @%08lx\n",
de->dwProcessId, de->dwThreadId,
(unsigned long)(LPVOID)de->u.CreateProcessInfo.lpStartAddress);
DEBUG_CurrThread = DEBUG_AddThread(DEBUG_CurrProcess,
de->dwThreadId,
de->u.CreateProcessInfo.hThread,
de->u.CreateProcessInfo.lpStartAddress,
DEBUG_CurrThread = DEBUG_AddThread(DEBUG_CurrProcess,
de->dwThreadId,
de->u.CreateProcessInfo.hThread,
de->u.CreateProcessInfo.lpStartAddress,
de->u.CreateProcessInfo.lpThreadLocalBase);
if (!DEBUG_CurrThread) {
DEBUG_Printf(DBG_CHN_ERR, "Couldn't create thread\n");
break;
}
DEBUG_InitCurrProcess();
DEBUG_InitCurrThread();
/* module is either PE, NE or ELF module (for WineLib), but all
* are loaded with wine, so load its symbols, then the main module
*/
do
do
{
char* ptr = getenv("WINELOADER");
if (!ptr || DEBUG_ReadExecutableDbgInfo( ptr ) == DIL_ERROR)
DEBUG_ReadExecutableDbgInfo( "wine" );
} while (0);
DEBUG_LoadModule32(DEBUG_CurrProcess->imageName, de->u.CreateProcessInfo.hFile,
DEBUG_LoadModule32(DEBUG_CurrProcess->imageName, de->u.CreateProcessInfo.hFile,
(DWORD)de->u.CreateProcessInfo.lpBaseOfImage);
break;
case EXIT_THREAD_DEBUG_EVENT:
DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: exit thread (%ld)\n",
DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: exit thread (%ld)\n",
de->dwProcessId, de->dwThreadId, de->u.ExitThread.dwExitCode);
if (DEBUG_CurrThread == NULL) {
DEBUG_Printf(DBG_CHN_ERR, "Unknown thread\n");
break;
@ -752,11 +752,11 @@ static void DEBUG_HandleDebugEvent(DEBUG_EVENT* de)
/* FIXME: remove break point set on thread startup */
DEBUG_DelThread(DEBUG_CurrThread);
break;
case EXIT_PROCESS_DEBUG_EVENT:
DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: exit process (%ld)\n",
DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: exit process (%ld)\n",
de->dwProcessId, de->dwThreadId, de->u.ExitProcess.dwExitCode);
if (DEBUG_CurrProcess == NULL) {
DEBUG_Printf(DBG_CHN_ERR, "Unknown process\n");
break;
@ -769,19 +769,19 @@ static void DEBUG_HandleDebugEvent(DEBUG_EVENT* de)
DEBUG_Printf(DBG_CHN_MESG, "Process of pid=%08lx has terminated\n", DEBUG_CurrPid);
break;
case LOAD_DLL_DEBUG_EVENT:
if (DEBUG_CurrThread == NULL) {
DEBUG_Printf(DBG_CHN_ERR, "Unknown thread\n");
break;
}
DEBUG_ProcessGetStringIndirect(buffer, sizeof(buffer),
DEBUG_CurrThread->process->handle,
DEBUG_ProcessGetStringIndirect(buffer, sizeof(buffer),
DEBUG_CurrThread->process->handle,
de->u.LoadDll.lpImageName);
/* FIXME unicode: de->u.LoadDll.fUnicode */
DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: loads DLL %s @%08lx (%ld<%ld>)\n",
de->dwProcessId, de->dwThreadId,
DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: loads DLL %s @%08lx (%ld<%ld>)\n",
de->dwProcessId, de->dwThreadId,
buffer, (unsigned long)de->u.LoadDll.lpBaseOfDll,
de->u.LoadDll.dwDebugInfoFileOffset,
de->u.LoadDll.nDebugInfoSize);
@ -789,43 +789,43 @@ static void DEBUG_HandleDebugEvent(DEBUG_EVENT* de)
DEBUG_LoadModule32(buffer, de->u.LoadDll.hFile, (DWORD)de->u.LoadDll.lpBaseOfDll);
DEBUG_CheckDelayedBP();
if (DBG_IVAR(BreakOnDllLoad)) {
DEBUG_Printf(DBG_CHN_MESG, "Stopping on DLL %s loading at %08lx\n",
DEBUG_Printf(DBG_CHN_MESG, "Stopping on DLL %s loading at %08lx\n",
buffer, (unsigned long)de->u.LoadDll.lpBaseOfDll);
DEBUG_Parser();
}
break;
case UNLOAD_DLL_DEBUG_EVENT:
DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: unload DLL @%08lx\n", de->dwProcessId, de->dwThreadId,
DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: unload DLL @%08lx\n", de->dwProcessId, de->dwThreadId,
(unsigned long)de->u.UnloadDll.lpBaseOfDll);
break;
case OUTPUT_DEBUG_STRING_EVENT:
if (DEBUG_CurrThread == NULL) {
DEBUG_Printf(DBG_CHN_ERR, "Unknown thread\n");
break;
}
DEBUG_ProcessGetString(buffer, sizeof(buffer),
DEBUG_CurrThread->process->handle,
DEBUG_ProcessGetString(buffer, sizeof(buffer),
DEBUG_CurrThread->process->handle,
de->u.DebugString.lpDebugStringData);
/* FIXME unicode de->u.DebugString.fUnicode ? */
DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: output debug string (%s)\n",
DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: output debug string (%s)\n",
de->dwProcessId, de->dwThreadId, buffer);
break;
case RIP_EVENT:
DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: rip error=%ld type=%ld\n",
de->dwProcessId, de->dwThreadId, de->u.RipInfo.dwError,
DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: rip error=%ld type=%ld\n",
de->dwProcessId, de->dwThreadId, de->u.RipInfo.dwError,
de->u.RipInfo.dwType);
break;
default:
DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: unknown event (%ld)\n",
DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: unknown event (%ld)\n",
de->dwProcessId, de->dwThreadId, de->dwDebugEventCode);
}
} __EXCEPT(wine_dbg) {
DEBUG_ExitMode = EXIT_CONTINUE;
}
@ -837,8 +837,8 @@ static DWORD DEBUG_MainLoop(void)
DEBUG_EVENT de;
DEBUG_Printf(DBG_CHN_MESG, " on pid %lx\n", DEBUG_CurrPid);
while (DEBUG_ExitMode == EXIT_CONTINUE)
while (DEBUG_ExitMode == EXIT_CONTINUE)
{
/* wait until we get at least one loaded process */
while (!DEBUG_ProcessList)
@ -848,12 +848,12 @@ static DWORD DEBUG_MainLoop(void)
}
if (DEBUG_ExitMode != EXIT_CONTINUE) break;
while ((DEBUG_ExitMode == EXIT_CONTINUE || DEBUG_ExitMode == EXIT_PASS) &&
DEBUG_ProcessList &&
WaitForDebugEvent(&de, INFINITE))
while ((DEBUG_ExitMode == EXIT_CONTINUE || DEBUG_ExitMode == EXIT_PASS) &&
DEBUG_ProcessList &&
WaitForDebugEvent(&de, INFINITE))
{
DEBUG_HandleDebugEvent(&de);
ContinueDebugEvent(de.dwProcessId, de.dwThreadId,
ContinueDebugEvent(de.dwProcessId, de.dwThreadId,
(DEBUG_ExitMode == EXIT_PASS) ? DBG_EXCEPTION_NOT_HANDLED : DBG_CONTINUE);
}
if (DEBUG_ExitMode == EXIT_DETACH && DEBUG_Detach())
@ -865,7 +865,7 @@ static DWORD DEBUG_MainLoop(void)
DEBUG_ExitMode = EXIT_QUIT;
}
}
DEBUG_Printf(DBG_CHN_MESG, "WineDbg terminated on pid %lx\n", DEBUG_CurrPid);
return 0;
@ -878,11 +878,11 @@ static DWORD DEBUG_AutoMode(void)
DEBUG_Printf(DBG_CHN_MESG, " on pid %lx\n", DEBUG_CurrPid);
while ((DEBUG_ExitMode == EXIT_CONTINUE || DEBUG_ExitMode == EXIT_PASS) &&
DEBUG_ProcessList &&
DEBUG_ProcessList &&
WaitForDebugEvent(&de, INFINITE))
{
DEBUG_HandleDebugEvent(&de);
ContinueDebugEvent(de.dwProcessId, de.dwThreadId,
ContinueDebugEvent(de.dwProcessId, de.dwThreadId,
(DEBUG_ExitMode == EXIT_PASS) ? DBG_EXCEPTION_NOT_HANDLED : DBG_CONTINUE);
}
/* print some extra information */
@ -904,8 +904,8 @@ static BOOL DEBUG_Start(LPSTR cmdLine)
startup.cb = sizeof(startup);
startup.dwFlags = STARTF_USESHOWWINDOW;
startup.wShowWindow = SW_SHOWNORMAL;
if (!CreateProcess(NULL, cmdLine, NULL, NULL,
if (!CreateProcess(NULL, cmdLine, NULL, NULL,
FALSE, DEBUG_PROCESS|DETACHED_PROCESS, NULL, NULL, &startup, &info)) {
DEBUG_Printf(DBG_CHN_MESG, "Couldn't start process '%s'\n", cmdLine);
return FALSE;
@ -938,10 +938,10 @@ static void DEBUG_InitConsole(void)
SMALL_RECT sr;
DWORD mode;
/* keep it as a cuiexe for now, so that Wine won't touch the Unix stdin,
/* keep it as a cuiexe for now, so that Wine won't touch the Unix stdin,
* stdout and stderr streams
*/
if (DBG_IVAR(UseXTerm))
if (DBG_IVAR(UseXTerm))
{
FreeConsole();
AllocConsole();
@ -970,7 +970,7 @@ int main(int argc, char** argv)
/* Initialize the type handling stuff. */
DEBUG_InitTypes();
DEBUG_InitCVDataTypes();
DEBUG_InitCVDataTypes();
/* Initialize internal vars (types must have been initialized before) */
if (!DEBUG_IntVarsRW(TRUE)) return -1;
@ -988,9 +988,9 @@ int main(int argc, char** argv)
}
DEBUG_InitConsole();
DEBUG_Printf(DBG_CHN_MESG, "WineDbg starting... ");
if (argc == 3) {
HANDLE hEvent;
DWORD pid;
@ -1009,11 +1009,11 @@ int main(int argc, char** argv)
DEBUG_CurrPid = pid;
}
}
if (DEBUG_CurrPid == 0 && argc > 1) {
int i, len;
LPSTR cmdLine;
if (!(cmdLine = DBG_alloc(len = 1))) goto oom_leave;
cmdLine[0] = '\0';

View File

@ -160,7 +160,7 @@ OpenBackupEventLogW( LPCWSTR lpUNCServerName, LPCWSTR lpFileName )
/******************************************************************************
* OpenEventLogA [ADVAPI32.@]
*/
HANDLE WINAPI OpenEventLogA(LPCSTR uncname,LPCSTR source)
HANDLE WINAPI OpenEventLogA(LPCSTR uncname,LPCSTR source)
{
FIXME("(%s,%s),stub!\n",uncname,source);
return 0xcafe4242;
@ -204,7 +204,7 @@ BOOL WINAPI ReadEventLogA( HANDLE hEventLog, DWORD dwReadFlags, DWORD dwRecordOf
*/
BOOL WINAPI
ReadEventLogW( HANDLE hEventLog, DWORD dwReadFlags, DWORD dwRecordOffset,
LPVOID lpBuffer, DWORD nNumberOfBytesToRead,
LPVOID lpBuffer, DWORD nNumberOfBytesToRead,
DWORD *pnBytesRead, DWORD *pnMinNumberOfBytesNeeded )
{
FIXME("stub\n");
@ -269,8 +269,8 @@ BOOL WINAPI ReportEventA ( HANDLE hEventLog, WORD wType, WORD wCategory, DWORD d
* lpRawData []
*/
BOOL WINAPI
ReportEventW( HANDLE hEventLog, WORD wType, WORD wCategory,
DWORD dwEventID, PSID lpUserSid, WORD wNumStrings,
ReportEventW( HANDLE hEventLog, WORD wType, WORD wCategory,
DWORD dwEventID, PSID lpUserSid, WORD wNumStrings,
DWORD dwDataSize, LPCWSTR *lpStrings, LPVOID lpRawData )
{
FIXME("stub\n");

View File

@ -76,7 +76,7 @@ inline static int is_version_nt(void)
* FIXME MAXIMUM_ALLOWED in access mask not supported by server
*/
DWORD WINAPI RegCreateKeyExW( HKEY hkey, LPCWSTR name, DWORD reserved, LPWSTR class,
DWORD options, REGSAM access, SECURITY_ATTRIBUTES *sa,
DWORD options, REGSAM access, SECURITY_ATTRIBUTES *sa,
LPHKEY retkey, LPDWORD dispos )
{
OBJECT_ATTRIBUTES attr;
@ -105,7 +105,7 @@ DWORD WINAPI RegCreateKeyExW( HKEY hkey, LPCWSTR name, DWORD reserved, LPWSTR cl
* FIXME MAXIMUM_ALLOWED in access mask not supported by server
*/
DWORD WINAPI RegCreateKeyExA( HKEY hkey, LPCSTR name, DWORD reserved, LPSTR class,
DWORD options, REGSAM access, SECURITY_ATTRIBUTES *sa,
DWORD options, REGSAM access, SECURITY_ATTRIBUTES *sa,
LPHKEY retkey, LPDWORD dispos )
{
OBJECT_ATTRIBUTES attr;
@ -442,9 +442,9 @@ DWORD WINAPI RegEnumKeyA( HKEY hkey, DWORD index, LPSTR name, DWORD name_len )
* security [O] Buffer for security descriptor length
* modif [O] Modification time
*
* - win95 allows class to be valid and class_len to be NULL
* - win95 allows class to be valid and class_len to be NULL
* - winnt returns ERROR_INVALID_PARAMETER if class is valid and class_len is NULL
* - both allow class to be NULL and class_len to be NULL
* - both allow class to be NULL and class_len to be NULL
* (it's hard to test validity, so test !NULL instead)
*/
DWORD WINAPI RegQueryInfoKeyW( HKEY hkey, LPWSTR class, LPDWORD class_len, LPDWORD reserved,
@ -652,7 +652,7 @@ DWORD WINAPI RegDeleteKeyA( HKEY hkey, LPCSTR name )
* Failure: Error code
*
* NOTES
* win95 does not care about count for REG_SZ and finds out the len by itself (js)
* win95 does not care about count for REG_SZ and finds out the len by itself (js)
* NT does definitely care (aj)
*/
DWORD WINAPI RegSetValueExW( HKEY hkey, LPCWSTR name, DWORD reserved,
@ -780,7 +780,7 @@ DWORD WINAPI RegSetValueA( HKEY hkey, LPCSTR name, DWORD type, LPCSTR data, DWOR
* not required.
* count [I/O] Address of data buffer size
*
* RETURNS
* RETURNS
* ERROR_SUCCESS: Success
* ERROR_MORE_DATA: !!! if the specified buffer is not big enough to hold the data
* buffer is left untouched. The MS-documentation is wrong (js) !!!
@ -850,7 +850,7 @@ DWORD WINAPI RegQueryValueExW( HKEY hkey, LPCWSTR name, LPDWORD reserved, LPDWOR
* RegQueryValueExA [ADVAPI32.@]
*
* NOTES:
* the documentation is wrong: if the buffer is too small it remains untouched
* the documentation is wrong: if the buffer is too small it remains untouched
*/
DWORD WINAPI RegQueryValueExA( HKEY hkey, LPCSTR name, LPDWORD reserved, LPDWORD type,
LPBYTE data, LPDWORD count )
@ -1441,7 +1441,7 @@ LONG WINAPI RegUnLoadKeyA( HKEY hkey, LPCSTR lpSubKey )
LONG WINAPI RegReplaceKeyW( HKEY hkey, LPCWSTR lpSubKey, LPCWSTR lpNewFile,
LPCWSTR lpOldFile )
{
FIXME("(%x,%s,%s,%s): stub\n", hkey, debugstr_w(lpSubKey),
FIXME("(%x,%s,%s,%s): stub\n", hkey, debugstr_w(lpSubKey),
debugstr_w(lpNewFile),debugstr_w(lpOldFile));
return ERROR_SUCCESS;
}
@ -1560,7 +1560,7 @@ DWORD WINAPI RegFlushKey( HKEY hkey )
* hHey [I] Predefined registry handle
* phkResult [I] Address of buffer for remote registry handle
*/
LONG WINAPI RegConnectRegistryW( LPCWSTR lpMachineName, HKEY hKey,
LONG WINAPI RegConnectRegistryW( LPCWSTR lpMachineName, HKEY hKey,
LPHKEY phkResult )
{
TRACE("(%s,%x,%p): stub\n",debugstr_w(lpMachineName),hKey,phkResult);
@ -1597,7 +1597,7 @@ LONG WINAPI RegConnectRegistryA( LPCSTR machine, HKEY hkey, LPHKEY reskey )
* hEvent [I] Handle of signaled event
* fAsync [I] Flag for asynchronous reporting
*/
LONG WINAPI RegNotifyChangeKeyValue( HKEY hkey, BOOL fWatchSubTree,
LONG WINAPI RegNotifyChangeKeyValue( HKEY hkey, BOOL fWatchSubTree,
DWORD fdwNotifyFilter, HANDLE hEvent,
BOOL fAsync )
{

View File

@ -65,7 +65,7 @@ static void dumpLsaAttributes( PLSA_OBJECT_ATTRIBUTES oa )
* RETURNS STD
*/
BOOL WINAPI
OpenProcessToken( HANDLE ProcessHandle, DWORD DesiredAccess,
OpenProcessToken( HANDLE ProcessHandle, DWORD DesiredAccess,
HANDLE *TokenHandle )
{
CallWin32ToNt(NtOpenProcessToken( ProcessHandle, DesiredAccess, TokenHandle ));
@ -81,7 +81,7 @@ OpenProcessToken( HANDLE ProcessHandle, DWORD DesiredAccess,
* thandle []
*/
BOOL WINAPI
OpenThreadToken( HANDLE ThreadHandle, DWORD DesiredAccess,
OpenThreadToken( HANDLE ThreadHandle, DWORD DesiredAccess,
BOOL OpenAsSelf, HANDLE *TokenHandle)
{
CallWin32ToNt (NtOpenThreadToken(ThreadHandle, DesiredAccess, OpenAsSelf, TokenHandle));
@ -192,7 +192,7 @@ AllocateAndInitializeSid( PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
PSID *pSid )
{
CallWin32ToNt (RtlAllocateAndInitializeSid(
pIdentifierAuthority, nSubAuthorityCount,
pIdentifierAuthority, nSubAuthorityCount,
nSubAuthority0, nSubAuthority1, nSubAuthority2, nSubAuthority3,
nSubAuthority4, nSubAuthority5, nSubAuthority6, nSubAuthority7,
pSid ));
@ -207,7 +207,7 @@ AllocateAndInitializeSid( PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
PVOID WINAPI
FreeSid( PSID pSid )
{
RtlFreeSid(pSid);
RtlFreeSid(pSid);
return NULL; /* is documented like this */
}
@ -253,7 +253,7 @@ EqualSid( PSID pSid1, PSID pSid2 )
/******************************************************************************
* EqualPrefixSid [ADVAPI32.@]
*/
BOOL WINAPI EqualPrefixSid (PSID pSid1, PSID pSid2)
BOOL WINAPI EqualPrefixSid (PSID pSid1, PSID pSid2)
{
return RtlEqualPrefixSid(pSid1, pSid2);
}
@ -338,7 +338,7 @@ GetLengthSid (PSID pSid)
###### SECURITY DESCRIPTOR FUNCTIONS ######
##############################################
*/
/******************************************************************************
* InitializeSecurityDescriptor [ADVAPI32.@]
*
@ -379,7 +379,7 @@ GetSecurityDescriptorOwner( SECURITY_DESCRIPTOR *pDescr, PSID *pOwner,
*
* PARAMS
*/
BOOL WINAPI SetSecurityDescriptorOwner( PSECURITY_DESCRIPTOR pSecurityDescriptor,
BOOL WINAPI SetSecurityDescriptorOwner( PSECURITY_DESCRIPTOR pSecurityDescriptor,
PSID pOwner, BOOL bOwnerDefaulted)
{
CallWin32ToNt (RtlSetOwnerSecurityDescriptor(pSecurityDescriptor, pOwner, bOwnerDefaulted));
@ -393,7 +393,7 @@ BOOL WINAPI GetSecurityDescriptorGroup(
LPBOOL GroupDefaulted)
{
CallWin32ToNt (RtlGetGroupSecurityDescriptor(SecurityDescriptor, Group, (PBOOLEAN)GroupDefaulted));
}
}
/******************************************************************************
* SetSecurityDescriptorGroup [ADVAPI32.@]
*/
@ -426,12 +426,12 @@ BOOL WINAPI GetSecurityDescriptorDacl(
{
CallWin32ToNt (RtlGetDaclSecurityDescriptor(pSecurityDescriptor, (PBOOLEAN)lpbDaclPresent,
pDacl, (PBOOLEAN)lpbDaclDefaulted));
}
}
/******************************************************************************
* SetSecurityDescriptorDacl [ADVAPI32.@]
*/
BOOL WINAPI
BOOL WINAPI
SetSecurityDescriptorDacl (
PSECURITY_DESCRIPTOR lpsd,
BOOL daclpresent,
@ -451,7 +451,7 @@ BOOL WINAPI GetSecurityDescriptorSacl(
{
CallWin32ToNt (RtlGetSaclSecurityDescriptor(lpsd,
(PBOOLEAN)lpbSaclPresent, pSacl, (PBOOLEAN)lpbSaclDefaulted));
}
}
/**************************************************************************
* SetSecurityDescriptorSacl [ADVAPI32.@]
@ -489,7 +489,7 @@ BOOL WINAPI GetSecurityDescriptorControl ( PSECURITY_DESCRIPTOR pSecurityDescri
PSECURITY_DESCRIPTOR_CONTROL pControl, LPDWORD lpdwRevision)
{
CallWin32ToNt (RtlGetControlSecurityDescriptor(pSecurityDescriptor,pControl,lpdwRevision));
}
}
/* ##############################
###### ACL FUNCTIONS ######
@ -526,7 +526,7 @@ DWORD WINAPI InitializeAcl(PACL acl, DWORD size, DWORD rev)
BOOL WINAPI
LookupPrivilegeValueW( LPCWSTR lpSystemName, LPCWSTR lpName, LPVOID lpLuid )
{
FIXME("(%s,%s,%p): stub\n",debugstr_w(lpSystemName),
FIXME("(%s,%s,%p): stub\n",debugstr_w(lpSystemName),
debugstr_w(lpName), lpLuid);
return TRUE;
}
@ -555,7 +555,7 @@ LookupPrivilegeValueA( LPCSTR lpSystemName, LPCSTR lpName, LPVOID lpLuid )
* privileges
*/
BOOL WINAPI
GetFileSecurityA( LPCSTR lpFileName,
GetFileSecurityA( LPCSTR lpFileName,
SECURITY_INFORMATION RequestedInformation,
PSECURITY_DESCRIPTOR pSecurityDescriptor,
DWORD nLength, LPDWORD lpnLengthNeeded )
@ -579,12 +579,12 @@ GetFileSecurityA( LPCSTR lpFileName,
* lpnLengthNeeded []
*/
BOOL WINAPI
GetFileSecurityW( LPCWSTR lpFileName,
GetFileSecurityW( LPCWSTR lpFileName,
SECURITY_INFORMATION RequestedInformation,
PSECURITY_DESCRIPTOR pSecurityDescriptor,
DWORD nLength, LPDWORD lpnLengthNeeded )
{
FIXME("(%s) : stub\n", debugstr_w(lpFileName) );
FIXME("(%s) : stub\n", debugstr_w(lpFileName) );
return TRUE;
}
@ -686,11 +686,11 @@ BOOL WINAPI SetFileSecurityA( LPCSTR lpFileName,
* pSecurityDescriptor []
*/
BOOL WINAPI
SetFileSecurityW( LPCWSTR lpFileName,
SetFileSecurityW( LPCWSTR lpFileName,
SECURITY_INFORMATION RequestedInformation,
PSECURITY_DESCRIPTOR pSecurityDescriptor )
{
FIXME("(%s) : stub\n", debugstr_w(lpFileName) );
FIXME("(%s) : stub\n", debugstr_w(lpFileName) );
return TRUE;
}
@ -752,7 +752,7 @@ LsaOpenPolicy(
* LsaQueryInformationPolicy [ADVAPI32.@]
*/
NTSTATUS WINAPI
LsaQueryInformationPolicy(
LsaQueryInformationPolicy(
IN LSA_HANDLE PolicyHandle,
IN POLICY_INFORMATION_CLASS InformationClass,
OUT PVOID *Buffer)
@ -778,7 +778,7 @@ LsaQueryInformationPolicy(
SID sid;
};
SID_IDENTIFIER_AUTHORITY localSidAuthority = {SECURITY_NT_AUTHORITY};
struct di * xdi = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(xdi));
RtlInitUnicodeString(&(xdi->ppdi.Name), HEAP_strdupAtoW(GetProcessHeap(),0,"DOMAIN"));
xdi->ppdi.Sid = &(xdi->sid);
@ -789,8 +789,8 @@ LsaQueryInformationPolicy(
*Buffer = xdi;
}
break;
case PolicyAuditLogInformation:
case PolicyPdAccountInformation:
case PolicyAuditLogInformation:
case PolicyPdAccountInformation:
case PolicyLsaServerRoleInformation:
case PolicyReplicaSourceInformation:
case PolicyDefaultQuotaInformation:
@ -803,8 +803,8 @@ LsaQueryInformationPolicy(
return FALSE;
}
}
return TRUE;
}
return TRUE;
}
/******************************************************************************
* LsaLookupSids [ADVAPI32.@]
@ -816,13 +816,13 @@ typedef struct
LONG DomainIndex;
} LSA_TRANSLATED_NAME, *PLSA_TRANSLATED_NAME;
typedef struct
typedef struct
{
LSA_UNICODE_STRING Name;
PSID Sid;
} LSA_TRUST_INFORMATION, *PLSA_TRUST_INFORMATION;
typedef struct
typedef struct
{
ULONG Entries;
PLSA_TRUST_INFORMATION Domains;
@ -977,7 +977,7 @@ BOOL WINAPI GetAce(PACL pAcl,DWORD dwAceIndex,LPVOID *pAce )
BOOL WINAPI PrivilegeCheck( HANDLE ClientToken, PPRIVILEGE_SET RequiredPrivileges, LPBOOL pfResult)
{
FIXME("stub %d %p %p\n", ClientToken, RequiredPrivileges, pfResult);
if (pfResult)
if (pfResult)
*pfResult=TRUE;
return TRUE;
}

View File

@ -42,7 +42,7 @@ EnumServicesStatusA( SC_HANDLE hSCManager, DWORD dwServiceType,
DWORD dwServiceState, LPENUM_SERVICE_STATUSA lpServices,
DWORD cbBufSize, LPDWORD pcbBytesNeeded,
LPDWORD lpServicesReturned, LPDWORD lpResumeHandle )
{ FIXME("%x type=%lx state=%lx %p %lx %p %p %p\n", hSCManager,
{ FIXME("%x type=%lx state=%lx %p %lx %p %p %p\n", hSCManager,
dwServiceType, dwServiceState, lpServices, cbBufSize,
pcbBytesNeeded, lpServicesReturned, lpResumeHandle);
SetLastError (ERROR_ACCESS_DENIED);
@ -57,7 +57,7 @@ EnumServicesStatusW( SC_HANDLE hSCManager, DWORD dwServiceType,
DWORD dwServiceState, LPENUM_SERVICE_STATUSW lpServices,
DWORD cbBufSize, LPDWORD pcbBytesNeeded,
LPDWORD lpServicesReturned, LPDWORD lpResumeHandle )
{ FIXME("%x type=%lx state=%lx %p %lx %p %p %p\n", hSCManager,
{ FIXME("%x type=%lx state=%lx %p %lx %p %p %p\n", hSCManager,
dwServiceType, dwServiceState, lpServices, cbBufSize,
pcbBytesNeeded, lpServicesReturned, lpResumeHandle);
SetLastError (ERROR_ACCESS_DENIED);
@ -69,14 +69,14 @@ EnumServicesStatusW( SC_HANDLE hSCManager, DWORD dwServiceType,
*/
BOOL WINAPI
StartServiceCtrlDispatcherA( LPSERVICE_TABLE_ENTRYA servent )
{
{
LPSERVICE_MAIN_FUNCTIONA fpMain;
HANDLE wait;
DWORD dwNumServiceArgs ;
LPWSTR *lpArgVecW;
LPSTR *lpArgVecA;
int i;
TRACE("(%p)\n", servent);
wait = OpenSemaphoreA(SEMAPHORE_ALL_ACCESS, FALSE, "ADVAPI32_ServiceStartData");
if(wait == 0)
@ -93,7 +93,7 @@ StartServiceCtrlDispatcherA( LPSERVICE_TABLE_ENTRYA servent )
/* Convert the Unicode arg vectors back to ASCII */
if(dwNumServiceArgs)
lpArgVecA = (LPSTR*) HeapAlloc( GetProcessHeap(), 0,
lpArgVecA = (LPSTR*) HeapAlloc( GetProcessHeap(), 0,
dwNumServiceArgs*sizeof(LPSTR) );
else
lpArgVecA = NULL;
@ -102,7 +102,7 @@ StartServiceCtrlDispatcherA( LPSERVICE_TABLE_ENTRYA servent )
lpArgVecA[i]=HEAP_strdupWtoA(GetProcessHeap(), 0, lpArgVecW[i]);
/* FIXME: should we blindly start all services? */
while (servent->lpServiceName) {
while (servent->lpServiceName) {
TRACE("%s at %p)\n", debugstr_a(servent->lpServiceName),servent);
fpMain = servent->lpServiceProc;
@ -131,12 +131,12 @@ StartServiceCtrlDispatcherA( LPSERVICE_TABLE_ENTRYA servent )
*/
BOOL WINAPI
StartServiceCtrlDispatcherW( LPSERVICE_TABLE_ENTRYW servent )
{
{
LPSERVICE_MAIN_FUNCTIONW fpMain;
HANDLE wait;
DWORD dwNumServiceArgs ;
LPWSTR *lpServiceArgVectors ;
TRACE("(%p)\n", servent);
wait = OpenSemaphoreA(SEMAPHORE_ALL_ACCESS, FALSE, "ADVAPI32_ServiceStartData");
if(wait == 0)
@ -152,7 +152,7 @@ StartServiceCtrlDispatcherW( LPSERVICE_TABLE_ENTRYW servent )
ReleaseSemaphore(wait, 1, NULL);
/* FIXME: should we blindly start all services? */
while (servent->lpServiceName) {
while (servent->lpServiceName) {
TRACE("%s at %p)\n", debugstr_w(servent->lpServiceName),servent);
fpMain = servent->lpServiceProc;
@ -172,7 +172,7 @@ SERVICE_STATUS_HANDLE WINAPI
RegisterServiceCtrlHandlerA( LPCSTR lpServiceName,
LPHANDLER_FUNCTION lpfHandler )
{ FIXME("%s %p\n", lpServiceName, lpfHandler);
return 0xcacacafe;
return 0xcacacafe;
}
/******************************************************************************
@ -183,10 +183,10 @@ RegisterServiceCtrlHandlerA( LPCSTR lpServiceName,
* lpfHandler []
*/
SERVICE_STATUS_HANDLE WINAPI
RegisterServiceCtrlHandlerW( LPCWSTR lpServiceName,
RegisterServiceCtrlHandlerW( LPCWSTR lpServiceName,
LPHANDLER_FUNCTION lpfHandler )
{ FIXME("%s %p\n", debugstr_w(lpServiceName), lpfHandler);
return 0xcacacafe;
return 0xcacacafe;
}
/******************************************************************************
@ -215,7 +215,7 @@ SetServiceStatus( SERVICE_STATUS_HANDLE hService, LPSERVICE_STATUS lpStatus )
SC_HANDLE WINAPI
OpenSCManagerA( LPCSTR lpMachineName, LPCSTR lpDatabaseName,
DWORD dwDesiredAccess )
{
{
LPWSTR lpMachineNameW = HEAP_strdupAtoW(GetProcessHeap(),0,lpMachineName);
LPWSTR lpDatabaseNameW = HEAP_strdupAtoW(GetProcessHeap(),0,lpDatabaseName);
SC_HANDLE ret = OpenSCManagerW(lpMachineNameW,lpDatabaseNameW,
@ -248,7 +248,7 @@ OpenSCManagerW( LPCWSTR lpMachineName, LPCWSTR lpDatabaseName,
HKEY hKey;
LONG r;
TRACE("(%s,%s,0x%08lx)\n", debugstr_w(lpMachineName),
TRACE("(%s,%s,0x%08lx)\n", debugstr_w(lpMachineName),
debugstr_w(lpDatabaseName), dwDesiredAccess);
/*
@ -294,7 +294,7 @@ AllocateLocallyUniqueId( PLUID lpluid )
* RETURNS STD
*/
BOOL WINAPI
ControlService( SC_HANDLE hService, DWORD dwControl,
ControlService( SC_HANDLE hService, DWORD dwControl,
LPSERVICE_STATUS lpServiceStatus )
{
FIXME("(%d,%ld,%p): stub\n",hService,dwControl,lpServiceStatus);
@ -317,7 +317,7 @@ CloseServiceHandle( SC_HANDLE hSCObject )
TRACE("(%x)\n", hSCObject);
RegCloseKey(hSCObject);
return TRUE;
}
@ -326,7 +326,7 @@ CloseServiceHandle( SC_HANDLE hSCObject )
* OpenServiceA [ADVAPI32.@]
*/
SC_HANDLE WINAPI
OpenServiceA( SC_HANDLE hSCManager, LPCSTR lpServiceName,
OpenServiceA( SC_HANDLE hSCManager, LPCSTR lpServiceName,
DWORD dwDesiredAccess )
{
LPWSTR lpServiceNameW = HEAP_strdupAtoW(GetProcessHeap(),0,lpServiceName);
@ -387,11 +387,11 @@ OpenServiceW(SC_HANDLE hSCManager, LPCWSTR lpServiceName,
*/
SC_HANDLE WINAPI
CreateServiceW( SC_HANDLE hSCManager, LPCWSTR lpServiceName,
LPCWSTR lpDisplayName, DWORD dwDesiredAccess,
DWORD dwServiceType, DWORD dwStartType,
LPCWSTR lpDisplayName, DWORD dwDesiredAccess,
DWORD dwServiceType, DWORD dwStartType,
DWORD dwErrorControl, LPCWSTR lpBinaryPathName,
LPCWSTR lpLoadOrderGroup, LPDWORD lpdwTagId,
LPCWSTR lpDependencies, LPCWSTR lpServiceStartName,
LPCWSTR lpLoadOrderGroup, LPDWORD lpdwTagId,
LPCWSTR lpDependencies, LPCWSTR lpServiceStartName,
LPCWSTR lpPassword )
{
FIXME("(%u,%s,%s,...)\n", hSCManager, debugstr_w(lpServiceName), debugstr_w(lpDisplayName));
@ -404,11 +404,11 @@ CreateServiceW( SC_HANDLE hSCManager, LPCWSTR lpServiceName,
*/
SC_HANDLE WINAPI
CreateServiceA( SC_HANDLE hSCManager, LPCSTR lpServiceName,
LPCSTR lpDisplayName, DWORD dwDesiredAccess,
DWORD dwServiceType, DWORD dwStartType,
LPCSTR lpDisplayName, DWORD dwDesiredAccess,
DWORD dwServiceType, DWORD dwStartType,
DWORD dwErrorControl, LPCSTR lpBinaryPathName,
LPCSTR lpLoadOrderGroup, LPDWORD lpdwTagId,
LPCSTR lpDependencies, LPCSTR lpServiceStartName,
LPCSTR lpLoadOrderGroup, LPDWORD lpdwTagId,
LPCSTR lpDependencies, LPCSTR lpServiceStartName,
LPCSTR lpPassword )
{
HKEY hKey;
@ -417,7 +417,7 @@ CreateServiceA( SC_HANDLE hSCManager, LPCSTR lpServiceName,
TRACE("(%u,%s,%s,...)\n", hSCManager, debugstr_a(lpServiceName), debugstr_a(lpDisplayName));
r = RegCreateKeyExA(hSCManager, lpServiceName, 0, NULL,
r = RegCreateKeyExA(hSCManager, lpServiceName, 0, NULL,
REG_OPTION_NON_VOLATILE, dwDesiredAccess, NULL, &hKey, &dp);
if (r!=ERROR_SUCCESS)
return 0;
@ -439,14 +439,14 @@ CreateServiceA( SC_HANDLE hSCManager, LPCSTR lpServiceName,
if (r!=ERROR_SUCCESS)
return 0;
r = RegSetValueExA(hKey, "ErrorControl", 0, REG_DWORD,
r = RegSetValueExA(hKey, "ErrorControl", 0, REG_DWORD,
(LPVOID)&dwErrorControl, sizeof (DWORD) );
if (r!=ERROR_SUCCESS)
return 0;
if(lpBinaryPathName)
{
r = RegSetValueExA(hKey, "ImagePath", 0, REG_SZ,
r = RegSetValueExA(hKey, "ImagePath", 0, REG_SZ,
lpBinaryPathName,strlen(lpBinaryPathName)+1 );
if (r!=ERROR_SUCCESS)
return 0;
@ -454,28 +454,28 @@ CreateServiceA( SC_HANDLE hSCManager, LPCSTR lpServiceName,
if(lpLoadOrderGroup)
{
r = RegSetValueExA(hKey, "Group", 0, REG_SZ,
r = RegSetValueExA(hKey, "Group", 0, REG_SZ,
lpLoadOrderGroup, strlen(lpLoadOrderGroup)+1 );
if (r!=ERROR_SUCCESS)
return 0;
}
r = RegSetValueExA(hKey, "ErrorControl", 0, REG_DWORD,
r = RegSetValueExA(hKey, "ErrorControl", 0, REG_DWORD,
(LPVOID)&dwErrorControl, sizeof (DWORD) );
if (r!=ERROR_SUCCESS)
return 0;
if(lpDependencies)
{
DWORD len = 0;
DWORD len = 0;
/* determine the length of a double null terminated multi string */
do {
len += (strlen(&lpDependencies[len])+1);
} while (lpDependencies[len++]);
} while (lpDependencies[len++]);
/* FIXME: this should be unicode */
r = RegSetValueExA(hKey, "Dependencies", 0, REG_MULTI_SZ,
r = RegSetValueExA(hKey, "Dependencies", 0, REG_MULTI_SZ,
lpDependencies, len );
if (r!=ERROR_SUCCESS)
return 0;
@ -526,7 +526,7 @@ StartServiceA( SC_HANDLE hService, DWORD dwNumServiceArgs,
TRACE("(%d,%ld,%p)\n",hService,dwNumServiceArgs,lpServiceArgVectors);
if(dwNumServiceArgs)
lpwstr = (LPWSTR*) HeapAlloc( GetProcessHeap(), 0,
lpwstr = (LPWSTR*) HeapAlloc( GetProcessHeap(), 0,
dwNumServiceArgs*sizeof(LPWSTR) );
else
lpwstr = NULL;
@ -615,14 +615,14 @@ StartServiceW( SC_HANDLE hService, DWORD dwNumServiceArgs,
}
}
/*
/*
* FIXME: lpServiceArgsVectors need to be stored and returned to
* the service when it calls StartServiceCtrlDispatcher
*
* Chuck these in a global (yuk) so we can pass them to
* another process - address space separation will break this.
*/
r = WaitForSingleObject(data,INFINITE);
if( r == WAIT_FAILED)
@ -635,8 +635,8 @@ StartServiceW( SC_HANDLE hService, DWORD dwNumServiceArgs,
ZeroMemory(&startupinfo,sizeof(STARTUPINFOA));
startupinfo.cb = sizeof(STARTUPINFOA);
r = CreateProcessA(path,
NULL,
r = CreateProcessA(path,
NULL,
NULL, /* process security attribs */
NULL, /* thread security attribs */
FALSE, /* inherit handles */
@ -655,7 +655,7 @@ StartServiceW( SC_HANDLE hService, DWORD dwNumServiceArgs,
/* docs for StartServiceCtrlDispatcher say this should be 30 sec */
r = WaitForSingleObject(wait,30000);
ReleaseSemaphore(data, 1, NULL);
if( r == WAIT_FAILED)
@ -670,7 +670,7 @@ StartServiceW( SC_HANDLE hService, DWORD dwNumServiceArgs,
* PARAMS
* hService []
* lpservicestatus []
*
*
*/
BOOL WINAPI
QueryServiceStatus( SC_HANDLE hService, LPSERVICE_STATUS lpservicestatus )

View File

@ -1,4 +1,4 @@
/*
/*
* Copyright 1999 Marcus Meissner
*
* This library is free software; you can redistribute it and/or
@ -144,14 +144,14 @@ static HRESULT WINAPI IAVIFile_fnQueryInterface(IAVIFile* iface,REFIID refiid,LP
static ULONG WINAPI IAVIFile_fnAddRef(IAVIFile* iface) {
ICOM_THIS(IAVIFileImpl,iface);
FIXME("(%p)->AddRef()\n",iface);
return ++(This->ref);
}
static ULONG WINAPI IAVIFile_fnRelease(IAVIFile* iface) {
ICOM_THIS(IAVIFileImpl,iface);
FIXME("(%p)->Release()\n",iface);
if (!--(This->ref)) {
HeapFree(GetProcessHeap(),0,iface);
@ -253,14 +253,14 @@ static HRESULT WINAPI IAVIStream_fnQueryInterface(IAVIStream*iface,REFIID refiid
static ULONG WINAPI IAVIStream_fnAddRef(IAVIStream*iface) {
ICOM_THIS(IAVIStreamImpl,iface);
FIXME("(%p)->AddRef()\n",iface);
return ++(This->ref);
}
static ULONG WINAPI IAVIStream_fnRelease(IAVIStream* iface) {
ICOM_THIS(IAVIStreamImpl,iface);
FIXME("(%p)->Release()\n",iface);
if (!--(This->ref)) {
HeapFree(GetProcessHeap(),0,This);
@ -301,7 +301,7 @@ static HRESULT WINAPI IAVIStream_fnSetFormat(IAVIStream*iface,LONG pos,LPVOID fo
as->lpInputFormat = HeapAlloc(GetProcessHeap(),0,formatsize);
memcpy(as->lpInputFormat,format,formatsize);
if (as->iscompressing) {
int xsize;
int xsize;
/* Set up the Compressor part */
xsize = ICCompressGetFormatSize(as->hic,as->lpInputFormat);
as->lpCompressFormat = HeapAlloc(GetProcessHeap(),0,xsize);
@ -384,7 +384,7 @@ static HRESULT WINAPI IAVIStream_fnSetInfo(IAVIStream*iface,AVISTREAMINFOW*info,
*/
HRESULT WINAPI AVIFileCreateStreamA(PAVIFILE iface,PAVISTREAM *ppavi,AVISTREAMINFOA * psi) {
AVISTREAMINFOW psiw;
/* Only the szName at the end is different */
memcpy(&psiw,psi,sizeof(*psi)-sizeof(psi->szName));
MultiByteToWideChar( CP_ACP, 0, psi->szName, -1,
@ -481,7 +481,7 @@ HRESULT WINAPI AVIMakeCompressedStream(PAVISTREAM *ppsCompressed,PAVISTREAM ppsS
as->hic = ICOpen(aco->fccType,aco->fccHandler,ICMODE_COMPRESS);
/* May happen. for instance if the codec is not able to compress */
if (!as->hic)
if (!as->hic)
return AVIERR_UNSUPPORTED;
ICGetInfo(as->hic,&(as->icinfo),sizeof(ICINFO));

View File

@ -79,7 +79,7 @@ static ULONG WINAPI COMCAT_IClassFactory_Release(LPCLASSFACTORY iface)
if (InterlockedDecrement(&This->ref) == 0) {
InterlockedDecrement(&dll_ref);
}
return This->ref;;
return This->ref;
}
/**********************************************************************

View File

@ -71,7 +71,7 @@ typedef struct
int nLoop;
int currFrame;
/* tranparency info*/
COLORREF transparentColor;
COLORREF transparentColor;
HBRUSH hbrushBG;
HBITMAP hbmPrevFrame;
} ANIMATE_INFO;
@ -81,8 +81,8 @@ typedef struct
static void ANIMATE_Notify(ANIMATE_INFO* infoPtr, UINT notif)
{
SendMessageA(GetParent(infoPtr->hWnd), WM_COMMAND,
MAKEWPARAM(GetDlgCtrlID(infoPtr->hWnd), notif),
SendMessageA(GetParent(infoPtr->hWnd), WM_COMMAND,
MAKEWPARAM(GetDlgCtrlID(infoPtr->hWnd), notif),
(LPARAM)infoPtr->hWnd);
}
@ -91,19 +91,19 @@ static BOOL ANIMATE_LoadResA(ANIMATE_INFO *infoPtr, HINSTANCE hInst, LPSTR lpNam
HRSRC hrsrc;
MMIOINFO mminfo;
LPVOID lpAvi;
hrsrc = FindResourceA(hInst, lpName, "AVI");
if (!hrsrc)
return FALSE;
infoPtr->hRes = LoadResource(hInst, hrsrc);
if (!infoPtr->hRes)
return FALSE;
lpAvi = LockResource(infoPtr->hRes);
if (!lpAvi)
return FALSE;
memset(&mminfo, 0, sizeof(mminfo));
mminfo.fccIOProc = FOURCC_MEM;
mminfo.pchBuffer = (LPSTR)lpAvi;
@ -122,10 +122,10 @@ static BOOL ANIMATE_LoadFileA(ANIMATE_INFO *infoPtr, LPSTR lpName)
{
infoPtr->hMMio = mmioOpenA((LPSTR)lpName, NULL,
MMIO_ALLOCBUF | MMIO_READ | MMIO_DENYWRITE);
if (!infoPtr->hMMio)
return FALSE;
return TRUE;
}
@ -135,7 +135,7 @@ static LRESULT ANIMATE_DoStop(ANIMATE_INFO *infoPtr)
EnterCriticalSection(&infoPtr->cs);
/* should stop playing */
if (infoPtr->hThread)
if (infoPtr->hThread)
{
if (!TerminateThread(infoPtr->hThread,0))
WARN("could not destroy animation thread!\n");
@ -197,36 +197,36 @@ static void ANIMATE_Free(ANIMATE_INFO *infoPtr)
infoPtr->indata = infoPtr->outdata = NULL;
infoPtr->hWnd = 0;
infoPtr->hMMio = 0;
memset(&infoPtr->mah, 0, sizeof(infoPtr->mah));
memset(&infoPtr->ash, 0, sizeof(infoPtr->ash));
infoPtr->nFromFrame = infoPtr->nToFrame = infoPtr->nLoop = infoPtr->currFrame = 0;
}
infoPtr->transparentColor = ANIMATE_COLOR_NONE;
infoPtr->transparentColor = ANIMATE_COLOR_NONE;
}
static void ANIMATE_TransparentBlt(ANIMATE_INFO* infoPtr, HDC hdcDest, HDC hdcSource)
{
{
HDC hdcMask;
HBITMAP hbmMask;
HBITMAP hbmOld;
HBITMAP hbmOld;
/* create a transparency mask */
hdcMask = CreateCompatibleDC(hdcDest);
hbmMask = CreateBitmap(infoPtr->inbih->biWidth, infoPtr->inbih->biHeight, 1,1,NULL);
hbmOld = SelectObject(hdcMask, hbmMask);
hbmMask = CreateBitmap(infoPtr->inbih->biWidth, infoPtr->inbih->biHeight, 1,1,NULL);
hbmOld = SelectObject(hdcMask, hbmMask);
SetBkColor(hdcSource,infoPtr->transparentColor);
BitBlt(hdcMask,0,0,infoPtr->inbih->biWidth, infoPtr->inbih->biHeight,hdcSource,0,0,SRCCOPY);
/* mask the source bitmap */
SetBkColor(hdcSource, RGB(0,0,0));
SetTextColor(hdcSource, RGB(255,255,255));
SetBkColor(hdcSource, RGB(0,0,0));
SetTextColor(hdcSource, RGB(255,255,255));
BitBlt(hdcSource, 0, 0, infoPtr->inbih->biWidth, infoPtr->inbih->biHeight, hdcMask, 0, 0, SRCAND);
/* mask the destination bitmap */
SetBkColor(hdcDest, RGB(255,255,255));
SetTextColor(hdcDest, RGB(0,0,0));
SetBkColor(hdcDest, RGB(255,255,255));
SetTextColor(hdcDest, RGB(0,0,0));
BitBlt(hdcDest, 0, 0, infoPtr->inbih->biWidth, infoPtr->inbih->biHeight, hdcMask, 0, 0, SRCAND);
/* combine source and destination */
@ -260,48 +260,48 @@ static LRESULT ANIMATE_PaintFrame(ANIMATE_INFO* infoPtr, HDC hDC)
pBitmapInfo = (LPBITMAPINFO)infoPtr->outbih;
nWidth = infoPtr->outbih->biWidth;
nHeight = infoPtr->outbih->biHeight;
nHeight = infoPtr->outbih->biHeight;
} else
{
{
pBitmapData = infoPtr->indata;
pBitmapInfo = (LPBITMAPINFO)infoPtr->inbih;
nWidth = infoPtr->inbih->biWidth;
nHeight = infoPtr->inbih->biHeight;
}
nHeight = infoPtr->inbih->biHeight;
}
if(!infoPtr->hbmPrevFrame)
{
infoPtr->hbmPrevFrame=CreateCompatibleBitmap(hDC, nWidth,nHeight );
}
SetDIBits(hDC, infoPtr->hbmPrevFrame, 0, nHeight, pBitmapData, (LPBITMAPINFO)pBitmapInfo, DIB_RGB_COLORS);
SetDIBits(hDC, infoPtr->hbmPrevFrame, 0, nHeight, pBitmapData, (LPBITMAPINFO)pBitmapInfo, DIB_RGB_COLORS);
hdcMem = CreateCompatibleDC(hDC);
hbmOld = SelectObject(hdcMem, infoPtr->hbmPrevFrame);
/*
* we need to get the transparent color even without ACS_TRANSPARENT,
/*
* we need to get the transparent color even without ACS_TRANSPARENT,
* because the style can be changed later on and the color should always
* be obtained in the first frame
* be obtained in the first frame
*/
if(infoPtr->transparentColor == ANIMATE_COLOR_NONE)
{
infoPtr->transparentColor = GetPixel(hdcMem,0,0);
}
}
if(GetWindowLongA(infoPtr->hWnd, GWL_STYLE) & ACS_TRANSPARENT)
{
if(GetWindowLongA(infoPtr->hWnd, GWL_STYLE) & ACS_TRANSPARENT)
{
HDC hdcFinal = CreateCompatibleDC(hDC);
HBITMAP hbmFinal = CreateCompatibleBitmap(hDC,nWidth, nHeight);
HBITMAP hbmOld2 = SelectObject(hdcFinal, hbmFinal);
RECT rect;
rect.left = 0;
rect.top = 0;
rect.right = nWidth;
rect.bottom = nHeight;
if(!infoPtr->hbrushBG)
infoPtr->hbrushBG = GetCurrentObject(hDC, OBJ_BRUSH);
@ -314,16 +314,16 @@ static LRESULT ANIMATE_PaintFrame(ANIMATE_INFO* infoPtr, HDC hDC)
DeleteObject(infoPtr->hbmPrevFrame);
infoPtr->hbmPrevFrame = hbmFinal;
}
if (GetWindowLongA(infoPtr->hWnd, GWL_STYLE) & ACS_CENTER)
if (GetWindowLongA(infoPtr->hWnd, GWL_STYLE) & ACS_CENTER)
{
RECT rect;
RECT rect;
GetWindowRect(infoPtr->hWnd, &rect);
nOffsetX = ((rect.right - rect.left) - nWidth)/2;
nOffsetY = ((rect.bottom - rect.top) - nHeight)/2;
nOffsetX = ((rect.right - rect.left) - nWidth)/2;
nOffsetY = ((rect.bottom - rect.top) - nHeight)/2;
}
BitBlt(hDC, nOffsetX, nOffsetY, nWidth, nHeight, hdcMem, 0, 0, SRCCOPY);
BitBlt(hDC, nOffsetX, nOffsetY, nWidth, nHeight, hdcMem, 0, 0, SRCCOPY);
SelectObject(hdcMem, hbmOld);
DeleteDC(hdcMem);
@ -340,9 +340,9 @@ static LRESULT ANIMATE_DrawFrame(ANIMATE_INFO* infoPtr)
mmioSeek(infoPtr->hMMio, infoPtr->lpIndex[infoPtr->currFrame], SEEK_SET);
mmioRead(infoPtr->hMMio, infoPtr->indata, infoPtr->ash.dwSuggestedBufferSize);
if (infoPtr->hic &&
fnIC.fnICDecompress(infoPtr->hic, 0, infoPtr->inbih, infoPtr->indata,
fnIC.fnICDecompress(infoPtr->hic, 0, infoPtr->inbih, infoPtr->indata,
infoPtr->outbih, infoPtr->outdata) != ICERR_OK) {
LeaveCriticalSection(&infoPtr->cs);
WARN("Decompression error\n");
@ -371,7 +371,7 @@ static DWORD CALLBACK ANIMATE_AnimationThread(LPVOID ptr_)
{
ANIMATE_INFO* infoPtr = (ANIMATE_INFO*)ptr_;
HDC hDC;
if(!infoPtr)
{
WARN("animation structure undefined!\n");
@ -379,8 +379,8 @@ static DWORD CALLBACK ANIMATE_AnimationThread(LPVOID ptr_)
}
while(1)
{
if(GetWindowLongA(infoPtr->hWnd, GWL_STYLE) & ACS_TRANSPARENT)
{
if(GetWindowLongA(infoPtr->hWnd, GWL_STYLE) & ACS_TRANSPARENT)
{
hDC = GetDC(infoPtr->hWnd);
/* sometimes the animation window will be destroyed in between
@ -388,11 +388,11 @@ static DWORD CALLBACK ANIMATE_AnimationThread(LPVOID ptr_)
infoPtr->hbrushBG = SendMessageA(GetParent(infoPtr->hWnd),WM_CTLCOLORSTATIC,hDC, infoPtr->hWnd);
ReleaseDC(infoPtr->hWnd,hDC);
}
EnterCriticalSection(&infoPtr->cs);
ANIMATE_DrawFrame(infoPtr);
LeaveCriticalSection(&infoPtr->cs);
/* time is in microseconds, we should convert it to milliseconds */
Sleep((infoPtr->mah.dwMicroSecPerFrame+500)/1000);
}
@ -419,7 +419,7 @@ static LRESULT ANIMATE_Play(HWND hWnd, WPARAM wParam, LPARAM lParam)
if (infoPtr->nToFrame == 0xFFFF)
infoPtr->nToFrame = infoPtr->mah.dwTotalFrames - 1;
TRACE("(repeat=%d from=%d to=%d);\n",
TRACE("(repeat=%d from=%d to=%d);\n",
infoPtr->nLoop, infoPtr->nFromFrame, infoPtr->nToFrame);
if (infoPtr->nFromFrame >= infoPtr->nToFrame ||
@ -442,9 +442,9 @@ static LRESULT ANIMATE_Play(HWND hWnd, WPARAM wParam, LPARAM lParam)
ERR("Could not create animation thread!\n");
return FALSE;
}
}
ANIMATE_Notify(infoPtr, ACN_START);
return TRUE;
@ -512,13 +512,13 @@ static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr)
mmioRead(infoPtr->hMMio, (LPSTR)&infoPtr->ash, sizeof(infoPtr->ash));
TRACE("ash.fccType='%c%c%c%c'\n", LOBYTE(LOWORD(infoPtr->ash.fccType)),
HIBYTE(LOWORD(infoPtr->ash.fccType)),
LOBYTE(HIWORD(infoPtr->ash.fccType)),
TRACE("ash.fccType='%c%c%c%c'\n", LOBYTE(LOWORD(infoPtr->ash.fccType)),
HIBYTE(LOWORD(infoPtr->ash.fccType)),
LOBYTE(HIWORD(infoPtr->ash.fccType)),
HIBYTE(HIWORD(infoPtr->ash.fccType)));
TRACE("ash.fccHandler='%c%c%c%c'\n", LOBYTE(LOWORD(infoPtr->ash.fccHandler)),
HIBYTE(LOWORD(infoPtr->ash.fccHandler)),
LOBYTE(HIWORD(infoPtr->ash.fccHandler)),
TRACE("ash.fccHandler='%c%c%c%c'\n", LOBYTE(LOWORD(infoPtr->ash.fccHandler)),
HIBYTE(LOWORD(infoPtr->ash.fccHandler)),
LOBYTE(HIWORD(infoPtr->ash.fccHandler)),
HIBYTE(HIWORD(infoPtr->ash.fccHandler)));
TRACE("ash.dwFlags=%ld\n", infoPtr->ash.dwFlags);
TRACE("ash.wPriority=%d\n", infoPtr->ash.wPriority);
@ -531,7 +531,7 @@ static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr)
TRACE("ash.dwSuggestedBufferSize=%ld\n", infoPtr->ash.dwSuggestedBufferSize);
TRACE("ash.dwQuality=%ld\n", infoPtr->ash.dwQuality);
TRACE("ash.dwSampleSize=%ld\n", infoPtr->ash.dwSampleSize);
TRACE("ash.rcFrame=(%d,%d,%d,%d)\n", infoPtr->ash.rcFrame.top, infoPtr->ash.rcFrame.left,
TRACE("ash.rcFrame=(%d,%d,%d,%d)\n", infoPtr->ash.rcFrame.top, infoPtr->ash.rcFrame.left,
infoPtr->ash.rcFrame.bottom, infoPtr->ash.rcFrame.right);
mmioAscend(infoPtr->hMMio, &mmckInfo, 0);
@ -565,10 +565,10 @@ static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr)
mmioAscend(infoPtr->hMMio, &mmckInfo, 0);
mmioAscend(infoPtr->hMMio, &mmckList, 0);
#if 0
/* an AVI has 0 or 1 video stream, and to be animated should not contain
* an audio stream, so only one strl is allowed
* an audio stream, so only one strl is allowed
*/
mmckList.fccType = mmioFOURCC('s', 't', 'r', 'l');
if (mmioDescend(infoPtr->hMMio, &mmckList, &mmckHead, MMIO_FINDLIST) == 0) {
@ -589,7 +589,7 @@ static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr)
/* FIXME: should handle the 'rec ' LIST when present */
infoPtr->lpIndex = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
infoPtr->lpIndex = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
infoPtr->mah.dwTotalFrames * sizeof(DWORD));
if (!infoPtr->lpIndex) {
WARN("Can't alloc index array\n");
@ -597,7 +597,7 @@ static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr)
}
numFrame = insize = 0;
while (mmioDescend(infoPtr->hMMio, &mmckInfo, &mmckList, 0) == 0 &&
while (mmioDescend(infoPtr->hMMio, &mmckInfo, &mmckList, 0) == 0 &&
numFrame < infoPtr->mah.dwTotalFrames) {
infoPtr->lpIndex[numFrame] = mmckInfo.dwDataOffset;
if (insize < mmckInfo.cksize)
@ -633,7 +633,7 @@ static BOOL ANIMATE_GetAviCodec(ANIMATE_INFO *infoPtr)
(infoPtr->ash.fccHandler == mmioFOURCC('R', 'L', 'E', ' ')) ||
(infoPtr->ash.fccHandler == mmioFOURCC(0, 0, 0, 0)))
{
infoPtr->hic = 0;
infoPtr->hic = 0;
return TRUE;
}
@ -643,8 +643,8 @@ static BOOL ANIMATE_GetAviCodec(ANIMATE_INFO *infoPtr)
WARN("Can't load codec for the file\n");
return FALSE;
}
outSize = fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_GET_FORMAT,
outSize = fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_GET_FORMAT,
(DWORD)infoPtr->inbih, 0L);
infoPtr->outbih = HeapAlloc(GetProcessHeap(), 0, outSize);
@ -653,7 +653,7 @@ static BOOL ANIMATE_GetAviCodec(ANIMATE_INFO *infoPtr)
return FALSE;
}
if (fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_GET_FORMAT,
if (fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_GET_FORMAT,
(DWORD)infoPtr->inbih, (DWORD)infoPtr->outbih) != ICERR_OK) {
WARN("Can't get output BIH\n");
return FALSE;
@ -665,7 +665,7 @@ static BOOL ANIMATE_GetAviCodec(ANIMATE_INFO *infoPtr)
return FALSE;
}
if (fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_BEGIN,
if (fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_BEGIN,
(DWORD)infoPtr->inbih, (DWORD)infoPtr->outbih) != ICERR_OK) {
WARN("Can't begin decompression\n");
return FALSE;
@ -686,7 +686,7 @@ static LRESULT ANIMATE_OpenA(HWND hWnd, WPARAM wParam, LPARAM lParam)
TRACE("Closing avi!\n");
return TRUE;
}
if (!hInstance)
hInstance = GetWindowLongA(hWnd, GWL_HINSTANCE);
@ -786,7 +786,7 @@ static LRESULT ANIMATE_Create(HWND hWnd, WPARAM wParam, LPARAM lParam)
infoPtr->hbmPrevFrame = 0;
InitializeCriticalSection(&infoPtr->cs);
return 0;
}
@ -810,11 +810,11 @@ static LRESULT ANIMATE_Destroy(HWND hWnd, WPARAM wParam, LPARAM lParam)
static LRESULT ANIMATE_EraseBackground(HWND hWnd, WPARAM wParam, LPARAM lParam)
{
RECT rect;
HBRUSH hBrush = 0;
HBRUSH hBrush = 0;
if(GetWindowLongA(hWnd, GWL_STYLE) & ACS_TRANSPARENT)
if(GetWindowLongA(hWnd, GWL_STYLE) & ACS_TRANSPARENT)
{
hBrush = SendMessageA(GetParent(hWnd),WM_CTLCOLORSTATIC,(HDC)wParam, hWnd);
hBrush = SendMessageA(GetParent(hWnd),WM_CTLCOLORSTATIC,(HDC)wParam, hWnd);
}
GetClientRect(hWnd, &rect);
@ -840,27 +840,27 @@ static LRESULT WINAPI ANIMATE_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP
{
case ACM_OPENA:
return ANIMATE_OpenA(hWnd, wParam, lParam);
/* case ACM_OPEN32W: FIXME!! */
/* return ANIMATE_Open32W(hWnd, wParam, lParam); */
case ACM_PLAY:
return ANIMATE_Play(hWnd, wParam, lParam);
case ACM_STOP:
return ANIMATE_Stop(hWnd, wParam, lParam);
case WM_NCCREATE:
ANIMATE_Create(hWnd, wParam, lParam);
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
case WM_NCHITTEST:
return HTTRANSPARENT;
case WM_DESTROY:
ANIMATE_Destroy(hWnd, wParam, lParam);
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
case WM_ERASEBKGND:
ANIMATE_EraseBackground(hWnd, wParam, lParam);
break;
@ -874,7 +874,7 @@ static LRESULT WINAPI ANIMATE_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP
infoPtr->hbrushBG = SendMessageA(GetParent(hWnd),WM_CTLCOLORSTATIC,(HDC)wParam, hWnd);
}
return ANIMATE_DrawFrame(ANIMATE_GetInfoPtr(hWnd));
case WM_CLOSE:
ANIMATE_Free(ANIMATE_GetInfoPtr(hWnd));
return TRUE;
@ -882,16 +882,16 @@ static LRESULT WINAPI ANIMATE_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP
case WM_PAINT:
{
ANIMATE_INFO* infoPtr = ANIMATE_GetInfoPtr(hWnd);
/* the animation isn't playing, don't paint */
if(!infoPtr->uTimer && !infoPtr->hThread)
/* default paint handling */
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
if (GetWindowLongA(hWnd, GWL_STYLE) & ACS_TRANSPARENT)
infoPtr->hbrushBG = SendMessageA(GetParent(hWnd), WM_CTLCOLORSTATIC,
(HDC)wParam, hWnd);
if (wParam)
{
EnterCriticalSection(&infoPtr->cs);
@ -906,7 +906,7 @@ static LRESULT WINAPI ANIMATE_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP
EnterCriticalSection(&infoPtr->cs);
ANIMATE_PaintFrame(infoPtr, hDC);
LeaveCriticalSection(&infoPtr->cs);
EndPaint(hWnd, &ps);
}
}
@ -919,7 +919,7 @@ static LRESULT WINAPI ANIMATE_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP
default:
if (uMsg >= WM_USER)
ERR("unknown msg %04x wp=%08x lp=%08lx\n", uMsg, wParam, lParam);
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
}
return 0;
@ -937,7 +937,7 @@ void ANIMATE_Register(void)
wndClass.hCursor = LoadCursorA(0, IDC_ARROWA);
wndClass.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
wndClass.lpszClassName = ANIMATE_CLASSA;
RegisterClassA(&wndClass);
}

View File

@ -87,12 +87,12 @@ typedef struct
/*
* Special flag set in DRAWITEMSTRUCT itemState field. It is set by
* the ComboEx version of the Combo Window Proc so that when the
* WM_DRAWITEM message is then passed to ComboEx, we know that this
* the ComboEx version of the Combo Window Proc so that when the
* WM_DRAWITEM message is then passed to ComboEx, we know that this
* particular WM_DRAWITEM message is for listbox only items. Any messasges
* without this flag is then for the Edit control field.
*
* We really cannot use the ODS_COMBOBOXEDIT flag because MSDN states that
* We really cannot use the ODS_COMBOBOXEDIT flag because MSDN states that
* only version 4.0 applications will have ODS_COMBOBOXEDIT set.
*/
#define ODS_COMBOEXLBOX 0x4000
@ -163,7 +163,7 @@ static void COMBOEX_DumpInput (COMBOBOXEXITEMW *input)
inline static CBE_ITEMDATA *get_item_data(COMBOEX_INFO *infoPtr, INT index)
{
return (CBE_ITEMDATA *)SendMessageW (infoPtr->hwndCombo, CB_GETITEMDATA,
return (CBE_ITEMDATA *)SendMessageW (infoPtr->hwndCombo, CB_GETITEMDATA,
(WPARAM)index, 0);
}
@ -206,14 +206,14 @@ COMBOEX_NotifyItem (COMBOEX_INFO *infoPtr, INT code, NMCOMBOBOXEXW *hdr)
if (code == CBEN_ENDEDITW) code = CBEN_ENDEDITA;
else if (code == CBEN_GETDISPINFOW) code = CBEN_GETDISPINFOA;
else if (code == CBEN_DRAGBEGINW) code = CBEN_DRAGBEGINA;
ret = COMBOEX_Notify (infoPtr, code, (NMHDR *)hdr);
if (astr && hdr->ceItem.pszText == (LPWSTR)astr)
hdr->ceItem.pszText = wstr;
if (astr) COMCTL32_Free(astr);
return ret;
}
}
@ -227,7 +227,7 @@ static INT COMBOEX_NotifyEndEdit (COMBOEX_INFO *infoPtr, NMCBEENDEDITW *neew, LP
return COMBOEX_Notify (infoPtr, CBEN_ENDEDITW, &neew->hdr);
} else {
NMCBEENDEDITA neea;
memcpy (&neea.hdr, &neew->hdr, sizeof(NMHDR));
neea.fChanged = neew->fChanged;
neea.iNewSelection = neew->iNewSelection;
@ -253,10 +253,10 @@ static LPCWSTR COMBOEX_GetText(COMBOEX_INFO *infoPtr, CBE_ITEMDATA *item)
NMCOMBOBOXEXW nmce;
LPWSTR text, buf;
INT len;
if (item->pszText != LPSTR_TEXTCALLBACKW)
if (item->pszText != LPSTR_TEXTCALLBACKW)
return item->pszText;
ZeroMemory(&nmce, sizeof(nmce));
nmce.ceItem.mask = CBEIF_TEXT;
COMBOEX_NotifyItem(infoPtr, CBEN_GETDISPINFOW, &nmce);
@ -276,7 +276,7 @@ static LPCWSTR COMBOEX_GetText(COMBOEX_INFO *infoPtr, CBE_ITEMDATA *item)
text = buf;
} else
text = nmce.ceItem.pszText;
if (nmce.ceItem.mask & CBEIF_DI_SETITEM)
item->pszText = text;
return text;
@ -395,7 +395,7 @@ static void COMBOEX_SetEditText (COMBOEX_INFO *infoPtr, CBE_ITEMDATA *item)
}
}
static CBE_ITEMDATA * COMBOEX_FindItem(COMBOEX_INFO *infoPtr, INT index)
{
CBE_ITEMDATA *item;
@ -425,7 +425,7 @@ static inline BOOL COMBOEX_HasEdit(COMBOEX_INFO *infoPtr)
{
return infoPtr->hwndEdit;
}
/* *** CBEM_xxx message support *** */
@ -480,7 +480,7 @@ static BOOL COMBOEX_GetItemA (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA *cit)
if(!COMBOEX_GetItemW (infoPtr, &tmpcit)) return FALSE;
if (is_textW(tmpcit.pszText) && cit->pszText)
WideCharToMultiByte (CP_ACP, 0, tmpcit.pszText, -1,
WideCharToMultiByte (CP_ACP, 0, tmpcit.pszText, -1,
cit->pszText, cit->cchTextMax, NULL, NULL);
else if (cit->pszText) cit->pszText[0] = 0;
else cit->pszText = (LPSTR)tmpcit.pszText;
@ -519,7 +519,7 @@ static INT COMBOEX_InsertItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit)
/* get zero-filled space and chain it in */
if(!(item = (CBE_ITEMDATA *)COMCTL32_Alloc (sizeof(*item)))) return -1;
/* locate position to insert new item in */
if (index == infoPtr->nb_items) {
/* fast path for iItem = -1 */
@ -575,7 +575,7 @@ static INT COMBOEX_InsertItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit)
if (TRACE_ON(comboex)) COMBOEX_DumpItem (item);
SendMessageW (infoPtr->hwndCombo, CB_INSERTSTRING,
SendMessageW (infoPtr->hwndCombo, CB_INSERTSTRING,
(WPARAM)cit->iItem, (LPARAM)item);
memset (&nmcit.ceItem, 0, sizeof(nmcit.ceItem));
@ -601,15 +601,15 @@ static INT COMBOEX_InsertItemA (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA *cit)
MultiByteToWideChar (CP_ACP, 0, cit->pszText, -1, wstr, len);
citW.pszText = wstr;
}
ret = COMBOEX_InsertItemW(infoPtr, &citW);;
ret = COMBOEX_InsertItemW(infoPtr, &citW);
if (wstr) COMCTL32_Free(wstr);
return ret;
}
static DWORD
static DWORD
COMBOEX_SetExtendedStyle (COMBOEX_INFO *infoPtr, DWORD mask, DWORD style)
{
DWORD dwTemp;
@ -675,7 +675,7 @@ static BOOL COMBOEX_SetItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit)
if (!(item = COMBOEX_FindItem(infoPtr, index))) return FALSE;
/* add/change stuff to the internal item structure */
/* add/change stuff to the internal item structure */
item->mask |= cit->mask;
if (cit->mask & CBEIF_TEXT) {
INT len = 0;
@ -725,7 +725,7 @@ static BOOL COMBOEX_SetItemA (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA *cit)
MultiByteToWideChar (CP_ACP, 0, cit->pszText, -1, wstr, len);
citW.pszText = wstr;
}
ret = COMBOEX_SetItemW(infoPtr, &citW);;
ret = COMBOEX_SetItemW(infoPtr, &citW);
if (wstr) COMCTL32_Free(wstr);
@ -856,7 +856,7 @@ static INT COMBOEX_SetItemHeight (COMBOEX_INFO *infoPtr, INT index, UINT height)
GetWindowRect (infoPtr->hwndCombo, &cb_wrect);
GetWindowRect (infoPtr->hwndSelf, &cbx_wrect);
GetClientRect (infoPtr->hwndSelf, &cbx_crect);
/* the height of comboex as height of the combo + comboex border */
/* the height of comboex as height of the combo + comboex border */
height = cb_wrect.bottom-cb_wrect.top
+ cbx_wrect.bottom-cbx_wrect.top
- (cbx_crect.bottom-cbx_crect.top);
@ -894,7 +894,7 @@ static LRESULT COMBOEX_Create (HWND hwnd, LPCREATESTRUCTA cs)
/* initialize info structure */
/* note that infoPtr is allocated zero-filled */
infoPtr->hwndSelf = hwnd;
infoPtr->selected = -1;
@ -933,14 +933,14 @@ static LRESULT COMBOEX_Create (HWND hwnd, LPCREATESTRUCTA cs)
infoPtr->hwndCombo = CreateWindowW (COMBOBOX, NIL,
/* following line added to match native */
WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VSCROLL |
CBS_NOINTEGRALHEIGHT | CBS_DROPDOWNLIST |
CBS_NOINTEGRALHEIGHT | CBS_DROPDOWNLIST |
/* was base and is necessary */
WS_CHILD | WS_VISIBLE | CBS_OWNERDRAWFIXED | dwComboStyle,
cs->y, cs->x, cs->cx, cs->cy, hwnd,
(HMENU) GetWindowLongW (hwnd, GWL_ID),
GetWindowLongW (hwnd, GWL_HINSTANCE), NULL);
/*
/*
* native does the following at this point according to trace:
* GetWindowThreadProcessId(hwndCombo,0)
* GetCurrentThreadId()
@ -949,11 +949,11 @@ static LRESULT COMBOEX_Create (HWND hwnd, LPCREATESTRUCTA cs)
*/
/*
* Setup a property to hold the pointer to the COMBOBOXEX
* Setup a property to hold the pointer to the COMBOBOXEX
* data structure.
*/
SetPropA(infoPtr->hwndCombo, COMBOEX_SUBCLASS_PROP, hwnd);
infoPtr->prevComboWndProc = (WNDPROC)SetWindowLongW(infoPtr->hwndCombo,
infoPtr->prevComboWndProc = (WNDPROC)SetWindowLongW(infoPtr->hwndCombo,
GWL_WNDPROC, (LONG)COMBOEX_ComboWndProc);
infoPtr->font = SendMessageW (infoPtr->hwndCombo, WM_GETFONT, 0, 0);
@ -966,7 +966,7 @@ static LRESULT COMBOEX_Create (HWND hwnd, LPCREATESTRUCTA cs)
infoPtr->hwndEdit = CreateWindowExW (0, EDIT, NIL,
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | ES_AUTOHSCROLL,
0, 0, 0, 0, /* will set later */
infoPtr->hwndCombo,
infoPtr->hwndCombo,
(HMENU) GetWindowLongW (hwnd, GWL_ID),
GetWindowLongW (hwnd, GWL_HINSTANCE),
NULL);
@ -979,11 +979,11 @@ static LRESULT COMBOEX_Create (HWND hwnd, LPCREATESTRUCTA cs)
*/
/*
* Setup a property to hold the pointer to the COMBOBOXEX
* Setup a property to hold the pointer to the COMBOBOXEX
* data structure.
*/
SetPropA(infoPtr->hwndEdit, COMBOEX_SUBCLASS_PROP, hwnd);
infoPtr->prevEditWndProc = (WNDPROC)SetWindowLongW(infoPtr->hwndEdit,
infoPtr->prevEditWndProc = (WNDPROC)SetWindowLongW(infoPtr->hwndEdit,
GWL_WNDPROC, (LONG)COMBOEX_EditWndProc);
infoPtr->font = SendMessageW (infoPtr->hwndCombo, WM_GETFONT, 0, 0);
}
@ -993,7 +993,7 @@ static LRESULT COMBOEX_Create (HWND hwnd, LPCREATESTRUCTA cs)
* all associated controls
*/
if (!infoPtr->font) {
SystemParametersInfoW (SPI_GETICONTITLELOGFONT, sizeof(mylogfont),
SystemParametersInfoW (SPI_GETICONTITLELOGFONT, sizeof(mylogfont),
&mylogfont, 0);
infoPtr->font = infoPtr->defaultFont = CreateFontIndirectW (&mylogfont);
}
@ -1014,21 +1014,21 @@ static LRESULT COMBOEX_Create (HWND hwnd, LPCREATESTRUCTA cs)
wnrc1.left, wnrc1.top, wnrc1.right, wnrc1.bottom,
clrc1.left, clrc1.top, clrc1.right, clrc1.bottom,
cmbwrc.left, cmbwrc.top, cmbwrc.right, cmbwrc.bottom);
SetWindowPos(infoPtr->hwndCombo, HWND_TOP,
SetWindowPos(infoPtr->hwndCombo, HWND_TOP,
0, 0, wnrc1.right-wnrc1.left, wnrc1.bottom-wnrc1.top,
SWP_NOACTIVATE | SWP_NOREDRAW);
GetWindowRect(infoPtr->hwndCombo, &cmbwrc);
TRACE("CB window=(%d,%d)-(%d,%d)\n",
cmbwrc.left, cmbwrc.top, cmbwrc.right, cmbwrc.bottom);
SetWindowPos(hwnd, HWND_TOP,
SetWindowPos(hwnd, HWND_TOP,
0, 0, cmbwrc.right-cmbwrc.left, cmbwrc.bottom-cmbwrc.top,
SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOMOVE);
COMBOEX_AdjustEditPos (infoPtr);
/*
* Create an item structure to represent the data in the
* Create an item structure to represent the data in the
* EDIT control. It is allocated zero-filled.
*/
infoPtr->edit = (CBE_ITEMDATA *)COMCTL32_Alloc (sizeof (CBE_ITEMDATA));
@ -1060,11 +1060,11 @@ static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam, LPARAM lPa
SetFocus (infoPtr->hwndCombo);
ShowWindow (infoPtr->hwndEdit, SW_HIDE);
return SendMessageW (parent, WM_COMMAND, wParam, (LPARAM)infoPtr->hwndSelf);
case CBN_CLOSEUP:
SendMessageW (parent, WM_COMMAND, wParam, (LPARAM)infoPtr->hwndSelf);
/*
* from native trace of first dropdown after typing in URL in IE4
* from native trace of first dropdown after typing in URL in IE4
* CB_GETCURSEL(Combo)
* GetWindowText(Edit)
* CB_GETCURSEL(Combo)
@ -1074,7 +1074,7 @@ static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam, LPARAM lPa
* CB_GETCURSEL(Combo)
* CB_SETCURSEL(COMBOEX, n)
* SetFocus(Combo)
* the rest is supposition
* the rest is supposition
*/
ShowWindow (infoPtr->hwndEdit, SW_SHOW);
InvalidateRect (infoPtr->hwndCombo, 0, TRUE);
@ -1154,7 +1154,7 @@ static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam, LPARAM lPa
return SendMessageW (parent, WM_COMMAND, wParam, (LPARAM)infoPtr->hwndSelf);
case CBN_SELENDOK:
/*
/*
* We have to change the handle since we are the control
* issuing the message. IE4 depends on this.
*/
@ -1188,7 +1188,7 @@ static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam, LPARAM lPa
return 0;
default:
/*
/*
* We have to change the handle since we are the control
* issuing the message. IE4 depends on this.
* We also need to set the focus back to the Edit control
@ -1263,13 +1263,13 @@ static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT *dis)
if (!IsWindowEnabled(infoPtr->hwndCombo)) return 0;
TRACE("DRAWITEMSTRUCT: CtlType=0x%08x CtlID=0x%08x\n",
TRACE("DRAWITEMSTRUCT: CtlType=0x%08x CtlID=0x%08x\n",
dis->CtlType, dis->CtlID);
TRACE("itemID=0x%08x itemAction=0x%08x itemState=0x%08x\n",
TRACE("itemID=0x%08x itemAction=0x%08x itemState=0x%08x\n",
dis->itemID, dis->itemAction, dis->itemState);
TRACE("hWnd=0x%04x hDC=0x%04x (%d,%d)-(%d,%d) itemData=0x%08lx\n",
dis->hwndItem, dis->hDC, dis->rcItem.left,
dis->rcItem.top, dis->rcItem.right, dis->rcItem.bottom,
dis->hwndItem, dis->hDC, dis->rcItem.left,
dis->rcItem.top, dis->rcItem.right, dis->rcItem.bottom,
dis->itemData);
/* MSDN says: */
@ -1285,13 +1285,13 @@ static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT *dis)
/* though the list box or combo box has the focus. */
if (dis->itemID == 0xffffffff) {
if ( ( (dis->itemAction & ODA_FOCUS) && (dis->itemState & ODS_SELECTED)) ||
( (dis->itemAction & (ODA_SELECT | ODA_DRAWENTIRE)) && (dis->itemState & ODS_FOCUS) ) ) {
( (dis->itemAction & (ODA_SELECT | ODA_DRAWENTIRE)) && (dis->itemState & ODS_FOCUS) ) ) {
TRACE("drawing item -1 special focus, rect=(%d,%d)-(%d,%d)\n",
dis->rcItem.left, dis->rcItem.top,
dis->rcItem.right, dis->rcItem.bottom);
}
else if ((dis->CtlType == ODT_COMBOBOX) &&
else if ((dis->CtlType == ODT_COMBOBOX) &&
(dis->itemAction == ODA_DRAWENTIRE)) {
/* draw of edit control data */
@ -1333,7 +1333,7 @@ static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT *dis)
item->pszText = (LPWSTR)COMCTL32_Alloc ((len + 1)*sizeof(WCHAR));
if (item->pszText)
GetWindowTextW(infoPtr->hwndEdit, item->pszText, len+1);
TRACE("edit control hwndEdit=%0x, text len=%d str=%s\n",
infoPtr->hwndEdit, len, debugstr_txt(item->pszText));
}
@ -1381,8 +1381,8 @@ static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT *dis)
} else {
/* drawing combo/edit entry */
if (IsWindowVisible(infoPtr->hwndEdit)) {
/* if we have an edit control, the slave the
* selection state to the Edit focus state
/* if we have an edit control, the slave the
* selection state to the Edit focus state
*/
if (infoPtr->flags & WCBE_EDITFOCUSED) {
if (item->mask & CBEIF_SELECTEDIMAGE)
@ -1390,7 +1390,7 @@ static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT *dis)
drawstate = ILD_SELECTED;
}
} else {
/* if we don't have an edit control, use
/* if we don't have an edit control, use
* the requested state.
*/
if (dis->itemState & ODS_SELECTED) {
@ -1414,10 +1414,10 @@ static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT *dis)
len = strlenW (str);
GetTextExtentPoint32W (dis->hDC, str, len, &txtsize);
if (dis->itemAction & (ODA_SELECT | ODA_DRAWENTIRE)) {
int overlay = item->iOverlay;
if (drawimage == I_IMAGECALLBACK) {
NMCOMBOBOXEXW nmce;
ZeroMemory(&nmce, sizeof(nmce));
@ -1441,11 +1441,11 @@ static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT *dis)
item->iOverlay = nmce.ceItem.iOverlay;
overlay = nmce.ceItem.iOverlay;
}
if (drawimage >= 0 &&
if (drawimage >= 0 &&
!(infoPtr->dwExtStyle & (CBES_EX_NOEDITIMAGE | CBES_EX_NOEDITIMAGEINDENT))) {
if (overlay > 0) ImageList_SetOverlayImage (infoPtr->himl, overlay, 1);
ImageList_Draw (infoPtr->himl, drawimage, dis->hDC, xbase, dis->rcItem.top,
ImageList_Draw (infoPtr->himl, drawimage, dis->hDC, xbase, dis->rcItem.top,
drawstate | (overlay > 0 ? INDEXTOOVERLAYMASK(1) : 0));
}
@ -1472,7 +1472,7 @@ static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT *dis)
SetTextColor (dis->hDC, txc);
}
}
if (dis->itemAction & ODA_FOCUS) {
rect.left = xbase + xioff - 1;
rect.right = rect.left + txtsize.cx + 2;
@ -1508,7 +1508,7 @@ static LRESULT COMBOEX_Destroy (COMBOEX_INFO *infoPtr)
infoPtr->items = 0;
}
if (infoPtr->defaultFont)
if (infoPtr->defaultFont)
DeleteObject (infoPtr->defaultFont);
/* free comboex info data */
@ -1564,7 +1564,7 @@ static LRESULT COMBOEX_NotifyFormat (COMBOEX_INFO *infoPtr, LPARAM lParam)
static LRESULT COMBOEX_Size (COMBOEX_INFO *infoPtr, INT width, INT height)
{
TRACE("(width=%d, height=%d)\n", width, height);
TRACE("(width=%d, height=%d)\n", width, height);
MoveWindow (infoPtr->hwndCombo, 0, 0, width, height, TRUE);
@ -1585,8 +1585,8 @@ static LRESULT COMBOEX_WindowPosChanging (COMBOEX_INFO *infoPtr, WINDOWPOS *wp)
/* width is winpos value + border width of comboex */
width = wp->cx
+ (cbx_wrect.right-cbx_wrect.left)
- (cbx_crect.right-cbx_crect.left);
+ (cbx_wrect.right-cbx_wrect.left)
- (cbx_crect.right-cbx_crect.left);
TRACE("winpos=(%d,%d %dx%d) flags=0x%08x\n",
wp->x, wp->y, wp->cx, wp->cy, wp->flags);
@ -1630,7 +1630,7 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
RECT rect;
LRESULT lret;
TRACE("hwnd=%x msg=%x wparam=%x lParam=%lx, info_ptr=%p\n",
TRACE("hwnd=%x msg=%x wparam=%x lParam=%lx, info_ptr=%p\n",
hwnd, uMsg, wParam, lParam, infoPtr);
if (!infoPtr) return 0;
@ -1642,12 +1642,12 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
/* handle (ignore) the return character */
if (wParam == VK_RETURN) return 0;
/* all other characters pass into the real Edit */
return CallWindowProcW (infoPtr->prevEditWndProc,
return CallWindowProcW (infoPtr->prevEditWndProc,
hwnd, uMsg, wParam, lParam);
case WM_ERASEBKGND:
/*
* The following was determined by traces of the native
* The following was determined by traces of the native
*/
hDC = (HDC) wParam;
obkc = SetBkColor (hDC, GetSysColor (COLOR_WINDOW));
@ -1656,7 +1656,7 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
rect.left, rect.top, rect.right, rect.bottom);
ExtTextOutW (hDC, 0, 0, ETO_OPAQUE, &rect, 0, 0, 0);
SetBkColor (hDC, obkc);
return CallWindowProcW (infoPtr->prevEditWndProc,
return CallWindowProcW (infoPtr->prevEditWndProc,
hwnd, uMsg, wParam, lParam);
case WM_KEYDOWN: {
@ -1671,7 +1671,7 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
* GetWindowTextA(Edit,&?, 0x104) x
* CB_GETCURSEL to Combo rets -1 x
* WM_NOTIFY to COMBOEX parent (rebar) x
* (CBEN_ENDEDIT{A|W}
* (CBEN_ENDEDIT{A|W}
* fChanged = FALSE x
* inewSelection = -1 x
* txt="www.hoho" x
@ -1700,9 +1700,9 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
ERR("item %d not found. Problem!\n", oldItem);
break;
}
infoPtr->selected = oldItem;
infoPtr->selected = oldItem;
COMBOEX_SetEditText (infoPtr, item);
RedrawWindow (infoPtr->hwndCombo, 0, 0, RDW_ERASE |
RedrawWindow (infoPtr->hwndCombo, 0, 0, RDW_ERASE |
RDW_INVALIDATE);
break;
@ -1712,9 +1712,9 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
* GetWindowTextA(Edit,&?, 0x104) x
* CB_GETCURSEL to Combo rets -1 x
* CB_GETCOUNT to Combo rets 0
* if >0 loop
* if >0 loop
* CB_GETITEMDATA to match
* *** above 3 lines simulated by FindItem x
* *** above 3 lines simulated by FindItem x
* WM_NOTIFY to COMBOEX parent (rebar) x
* (CBEN_ENDEDIT{A|W} x
* fChanged = TRUE (-1) x
@ -1749,20 +1749,20 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
}
cbeend.iNewSelection = selected;
cbeend.fChanged = TRUE;
cbeend.fChanged = TRUE;
cbeend.iWhy = CBENF_RETURN;
if (COMBOEX_NotifyEndEdit (infoPtr, &cbeend, edit_text)) {
/* abort the change, restore previous */
TRACE("Notify requested abort of change\n");
COMBOEX_SetEditText (infoPtr, infoPtr->edit);
RedrawWindow (infoPtr->hwndCombo, 0, 0, RDW_ERASE |
RedrawWindow (infoPtr->hwndCombo, 0, 0, RDW_ERASE |
RDW_INVALIDATE);
return 0;
}
oldItem = SendMessageW (infoPtr->hwndCombo,CB_GETCURSEL, 0, 0);
if (oldItem != -1) {
/* if something is selected, then deselect it */
SendMessageW (infoPtr->hwndCombo, CB_SETCURSEL,
SendMessageW (infoPtr->hwndCombo, CB_SETCURSEL,
(WPARAM)-1, 0);
}
InvalidateRect (infoPtr->hwndCombo, 0, 0);
@ -1786,13 +1786,13 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_SETFOCUS:
/* remember the focus to set state of icon */
lret = CallWindowProcW (infoPtr->prevEditWndProc,
lret = CallWindowProcW (infoPtr->prevEditWndProc,
hwnd, uMsg, wParam, lParam);
infoPtr->flags |= WCBE_EDITFOCUSED;
return lret;
case WM_KILLFOCUS:
/*
/*
* do NOTIFY CBEN_ENDEDIT with CBENF_KILLFOCUS
*/
infoPtr->flags &= ~WCBE_EDITFOCUSED;
@ -1810,7 +1810,7 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
/* fall through */
default:
return CallWindowProcW (infoPtr->prevEditWndProc,
return CallWindowProcW (infoPtr->prevEditWndProc,
hwnd, uMsg, wParam, lParam);
}
return 0;
@ -1830,7 +1830,7 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
RECT rect;
WCHAR edit_text[260];
TRACE("hwnd=%x msg=%x wparam=%x lParam=%lx, info_ptr=%p\n",
TRACE("hwnd=%x msg=%x wparam=%x lParam=%lx, info_ptr=%p\n",
hwnd, uMsg, wParam, lParam, infoPtr);
if (!infoPtr) return 0;
@ -1848,12 +1848,12 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
* that ComboEx knows this is listbox.
*/
((DRAWITEMSTRUCT *)lParam)->itemState |= ODS_COMBOEXLBOX;
return CallWindowProcW (infoPtr->prevComboWndProc,
return CallWindowProcW (infoPtr->prevComboWndProc,
hwnd, uMsg, wParam, lParam);
case WM_ERASEBKGND:
/*
* The following was determined by traces of the native
* The following was determined by traces of the native
*/
hDC = (HDC) wParam;
obkc = SetBkColor (hDC, GetSysColor (COLOR_WINDOW));
@ -1862,7 +1862,7 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
rect.left, rect.top, rect.right, rect.bottom);
ExtTextOutW (hDC, 0, 0, ETO_OPAQUE, &rect, 0, 0, 0);
SetBkColor (hDC, obkc);
return CallWindowProcW (infoPtr->prevComboWndProc,
return CallWindowProcW (infoPtr->prevComboWndProc,
hwnd, uMsg, wParam, lParam);
case WM_SETCURSOR:
@ -1877,7 +1877,7 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
nmmse.pt.y = 0;
nmmse.dwHitInfo = lParam;
COMBOEX_Notify (infoPtr, NM_SETCURSOR, (NMHDR *)&nmmse);
return CallWindowProcW (infoPtr->prevComboWndProc,
return CallWindowProcW (infoPtr->prevComboWndProc,
hwnd, uMsg, wParam, lParam);
case WM_COMMAND:
@ -1917,11 +1917,11 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
InvalidateRect (infoPtr->hwndCombo, 0, 0);
if (focusedhwnd)
SendMessageW (infoPtr->hwndCombo, WM_KILLFOCUS,
(WPARAM)focusedhwnd, 0);
(WPARAM)focusedhwnd, 0);
return 0;
case EN_SETFOCUS: {
/*
/*
* For EN_SETFOCUS this issues the same calls and messages
* as the native seems to do.
*
@ -1947,7 +1947,7 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
}
case EN_CHANGE: {
/*
/*
* For EN_CHANGE this issues the same calls and messages
* as the native seems to do.
*/
@ -2023,7 +2023,7 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
break;
}/* fall through */
default:
return CallWindowProcW (infoPtr->prevComboWndProc,
return CallWindowProcW (infoPtr->prevComboWndProc,
hwnd, uMsg, wParam, lParam);
}
return 0;
@ -2114,7 +2114,7 @@ COMBOEX_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
uMsg, wParam, lParam);
/* Combo messages OK to just forward to the regular COMBO */
case CB_GETCOUNT:
case CB_GETCOUNT:
case CB_GETCURSEL:
case CB_GETDROPPEDSTATE:
case CB_SETDROPPEDWIDTH:
@ -2194,7 +2194,7 @@ void COMBOEX_Register (void)
wndClass.hCursor = LoadCursorW (0, IDC_ARROWW);
wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
wndClass.lpszClassName = WC_COMBOBOXEXW;
RegisterClassW (&wndClass);
}

View File

@ -1,5 +1,5 @@
/******************************************************************************
*
*
* Common definitions (resource ids and global variables)
*
* Copyright 1999 Thuy Nguyen
@ -93,7 +93,7 @@ extern HBRUSH COMCTL32_hPattern55AABrush;
/* DragList icon */
#define IDI_DRAGARROW 150
typedef struct
typedef struct
{
COLORREF clrBtnHighlight; /* COLOR_BTNHIGHLIGHT */
COLORREF clrBtnShadow; /* COLOR_BTNSHADOW */
@ -121,7 +121,7 @@ VOID COMCTL32_RefreshSysColors(void);
INT Str_GetPtrWtoA (LPCWSTR lpSrc, LPSTR lpDest, INT nMaxLen);
BOOL Str_SetPtrAtoW (LPWSTR *lppDest, LPCSTR lpSrc);
#define COMCTL32_VERSION_MINOR 0
#define COMCTL32_VERSION_MINOR 0
#define WINE_FILEVERSION 5, COMCTL32_VERSION_MINOR, 0, 0
#define WINE_FILEVERSIONSTR "5.00"

View File

@ -273,7 +273,7 @@ DPA_Merge (const HDPA hdpa1, const HDPA hdpa2, DWORD dwFlags,
break;
}
nResult = (pfnCompare)(*pWork1, *pWork2, lParam);
TRACE("compare result=%d, dpa1.cnt=%d, dpa2.cnt=%d\n",
TRACE("compare result=%d, dpa1.cnt=%d, dpa2.cnt=%d\n",
nResult, nIndex, nCount);
if (nResult == 0)
@ -522,7 +522,7 @@ VOID MRU_SaveChanged( LPWINEMRULIST mp )
*/
/* open the sub key */
if ((err = RegOpenKeyExW( mp->extview.hKey, mp->extview.lpszSubKey,
if ((err = RegOpenKeyExW( mp->extview.hKey, mp->extview.lpszSubKey,
0, KEY_WRITE, &newkey))) {
/* not present - what to do ??? */
ERR("Can not open key, error=%d, attempting to create\n",
@ -542,7 +542,7 @@ VOID MRU_SaveChanged( LPWINEMRULIST mp )
}
if (mp->wineFlags & WMRUF_CHANGED) {
mp->wineFlags &= ~WMRUF_CHANGED;
err = RegSetValueExA(newkey, "MRUList", 0, REG_SZ,
err = RegSetValueExA(newkey, "MRUList", 0, REG_SZ,
mp->realMRU, strlen(mp->realMRU) + 1);
if (err) {
ERR("error saving MRUList, err=%d\n", err);
@ -555,8 +555,8 @@ VOID MRU_SaveChanged( LPWINEMRULIST mp )
if (witem->itemFlag & WMRUIF_CHANGED) {
witem->itemFlag &= ~WMRUIF_CHANGED;
realname[0] = 'a' + i;
err = RegSetValueExW(newkey, realname, 0,
(mp->extview.dwFlags & MRUF_BINARY_LIST) ?
err = RegSetValueExW(newkey, realname, 0,
(mp->extview.dwFlags & MRUF_BINARY_LIST) ?
REG_BINARY : REG_SZ,
&witem->datastart, witem->size);
if (err) {
@ -601,7 +601,7 @@ FreeMRUList (HANDLE hMRUList)
/**************************************************************************
* FindMRUData [COMCTL32.169]
*
*
* Searches binary list for item that matches lpData of length cbData.
* Returns position in list order 0 -> MRU and if lpRegNum != NULL then value
* corresponding to item's reg. name will be stored in it ('a' -> 0).
@ -636,7 +636,7 @@ FindMRUData (HANDLE hList, LPCVOID lpData, DWORD cbData, LPINT lpRegNum)
for(i=0; i<mp->cursize; i++) {
if (mp->extview.dwFlags & MRUF_BINARY_LIST) {
if (!mp->extview.lpfnCompare(lpData, &mp->array[i]->datastart,
if (!mp->extview.lpfnCompare(lpData, &mp->array[i]->datastart,
cbData))
break;
}
@ -678,7 +678,7 @@ FindMRUData (HANDLE hList, LPCVOID lpData, DWORD cbData, LPINT lpRegNum)
/**************************************************************************
* AddMRUData [COMCTL32.167]
*
*
* Add item to MRU binary list. If item already exists in list then it is
* simply moved up to the top of the list and not added again. If list is
* full then the least recently used item is removed to make room.
@ -718,7 +718,7 @@ AddMRUData (HANDLE hList, LPCVOID lpData, DWORD cbData)
}
/* Allocate space for new item and move in the data */
mp->array[replace] = witem = (LPWINEMRUITEM)COMCTL32_Alloc(cbData +
mp->array[replace] = witem = (LPWINEMRUITEM)COMCTL32_Alloc(cbData +
sizeof(WINEMRUITEM));
witem->itemFlag |= WMRUIF_CHANGED;
witem->size = cbData;
@ -730,7 +730,7 @@ AddMRUData (HANDLE hList, LPCVOID lpData, DWORD cbData)
mp->realMRU[i] = mp->realMRU[i-1];
}
mp->realMRU[0] = replace + 'a';
TRACE("(%08x, %p, %ld) adding data, /%c/ now most current\n",
TRACE("(%08x, %p, %ld) adding data, /%c/ now most current\n",
hList, lpData, cbData, replace+'a');
ret = replace;
@ -744,7 +744,7 @@ AddMRUData (HANDLE hList, LPCVOID lpData, DWORD cbData)
/**************************************************************************
* AddMRUStringW [COMCTL32.401]
*
*
* Add item to MRU string list. If item already exists in list them it is
* simply moved up to the top of the list and not added again. If list is
* full then the least recently used item is removed to make room.
@ -807,7 +807,7 @@ FindMRUStringW (HANDLE hList, LPCWSTR lpszString, LPINT lpRegNum)
/**************************************************************************
* FindMRUStringA [COMCTL32.155]
*
*
* Searches string list for item that matches lpszString.
* Returns position in list order 0 -> MRU and if lpRegNum != NULL then value
* corresponding to item's reg. name will be stored in it ('a' -> 0).
@ -858,10 +858,10 @@ HANDLE CreateMRUListLazy_common(LPWINEMRULIST mp)
sizeof(LPVOID));
/* open the sub key */
if ((err = RegCreateKeyExW( mp->extview.hKey, mp->extview.lpszSubKey,
if ((err = RegCreateKeyExW( mp->extview.hKey, mp->extview.lpszSubKey,
0,
emptyW,
REG_OPTION_NON_VOLATILE,
REG_OPTION_NON_VOLATILE,
KEY_READ | KEY_WRITE,
0,
&newkey,
@ -877,7 +877,7 @@ HANDLE CreateMRUListLazy_common(LPWINEMRULIST mp)
/* get values from key 'MRUList' */
if (newkey) {
datasize = mp->extview.nMaxItems + 1;
if((err=RegQueryValueExA( newkey, "MRUList", 0, &type, mp->realMRU,
if((err=RegQueryValueExA( newkey, "MRUList", 0, &type, mp->realMRU,
&datasize))) {
/* not present - set size to 1 (will become 0 later) */
datasize = 1;
@ -897,10 +897,10 @@ HANDLE CreateMRUListLazy_common(LPWINEMRULIST mp)
/* not present - what to do ??? */
ERR("Key %s not found 1\n", debugstr_w(realname));
}
mp->array[i] = witem = (LPWINEMRUITEM)COMCTL32_Alloc(datasize +
mp->array[i] = witem = (LPWINEMRUITEM)COMCTL32_Alloc(datasize +
sizeof(WINEMRUITEM));
witem->size = datasize;
if(RegQueryValueExW( newkey, realname, 0, &type,
if(RegQueryValueExW( newkey, realname, 0, &type,
&witem->datastart, &datasize)) {
/* not present - what to do ??? */
ERR("Key %s not found 2\n", debugstr_w(realname));
@ -939,7 +939,7 @@ CreateMRUListLazyW (LPCREATEMRULISTW lpcml, DWORD dwParam2, DWORD dwParam3, DWOR
strcpyW((LPWSTR)mp->extview.lpszSubKey, lpcml->lpszSubKey);
mp->isUnicode = TRUE;
return CreateMRUListLazy_common(mp);
return CreateMRUListLazy_common(mp);
}
/**************************************************************************
@ -1008,7 +1008,7 @@ CreateMRUListA (LPCREATEMRULISTA lpcml)
* string lists specifies full length of string. Enumerating past the end
* of list returns -1.
* If lpBuffer == NULL or nItemPos is -ve return value is no. of items in
* the list.
* the list.
*/
INT WINAPI EnumMRUListW(HANDLE hList, INT nItemPos, LPVOID lpBuffer,
DWORD nBufferSize)
@ -1023,16 +1023,16 @@ DWORD nBufferSize)
desired -= 'a';
TRACE("nItemPos=%d, desired=%d\n", nItemPos, desired);
witem = mp->array[desired];
datasize = min( witem->size, nBufferSize );
datasize = min( witem->size, nBufferSize );
memcpy( lpBuffer, &witem->datastart, datasize);
TRACE("(%08x, %d, %p, %ld): returning len=%d\n",
TRACE("(%08x, %d, %p, %ld): returning len=%d\n",
hList, nItemPos, lpBuffer, nBufferSize, datasize);
return datasize;
}
/**************************************************************************
* EnumMRUListA [COMCTL32.154]
*
*
*/
INT WINAPI EnumMRUListA(HANDLE hList, INT nItemPos, LPVOID lpBuffer,
DWORD nBufferSize)
@ -1049,7 +1049,7 @@ DWORD nBufferSize)
TRACE("nItemPos=%d, desired=%d\n", nItemPos, desired);
witem = mp->array[desired];
if(mp->extview.dwFlags & MRUF_BINARY_LIST) {
datasize = min( witem->size, nBufferSize );
datasize = min( witem->size, nBufferSize );
memcpy( lpBuffer, &witem->datastart, datasize);
} else {
lenA = WideCharToMultiByte(CP_ACP, 0, (LPWSTR)&witem->datastart, -1,
@ -1058,11 +1058,11 @@ DWORD nBufferSize)
WideCharToMultiByte(CP_ACP, 0, (LPWSTR)&witem->datastart, -1,
lpBuffer, datasize, NULL, NULL);
}
TRACE("(%08x, %d, %p, %ld): returning len=%d\n",
TRACE("(%08x, %d, %p, %ld): returning len=%d\n",
hList, nItemPos, lpBuffer, nBufferSize, datasize);
return datasize;
}
/**************************************************************************
* Str_GetPtrA [COMCTL32.233]
@ -1118,7 +1118,7 @@ BOOL WINAPI
Str_SetPtrA (LPSTR *lppDest, LPCSTR lpSrc)
{
TRACE("(%p %p)\n", lppDest, lpSrc);
if (lpSrc) {
LPSTR ptr = COMCTL32_ReAlloc (*lppDest, strlen (lpSrc) + 1);
if (!ptr)
@ -1191,7 +1191,7 @@ BOOL WINAPI
Str_SetPtrW (LPWSTR *lppDest, LPCWSTR lpSrc)
{
TRACE("(%p %p)\n", lppDest, lpSrc);
if (lpSrc) {
INT len = strlenW (lpSrc) + 1;
LPWSTR ptr = COMCTL32_ReAlloc (*lppDest, len * sizeof(WCHAR));
@ -1363,7 +1363,7 @@ DSA_Destroy (const HDSA hdsa)
/**************************************************************************
* DSA_GetItem [COMCTL32.322]
* DSA_GetItem [COMCTL32.322]
*
* PARAMS
* hdsa [I] pointer to the array control structure
@ -1381,7 +1381,7 @@ DSA_GetItem (const HDSA hdsa, INT nIndex, LPVOID pDest)
LPVOID pSrc;
TRACE("(%p %d %p)\n", hdsa, nIndex, pDest);
if (!hdsa)
return FALSE;
if ((nIndex < 0) || (nIndex >= hdsa->nItemCount))
@ -1395,7 +1395,7 @@ DSA_GetItem (const HDSA hdsa, INT nIndex, LPVOID pDest)
/**************************************************************************
* DSA_GetItemPtr [COMCTL32.323]
* DSA_GetItemPtr [COMCTL32.323]
*
* Retrieves a pointer to the specified item.
*
@ -1421,7 +1421,7 @@ DSA_GetItemPtr (const HDSA hdsa, INT nIndex)
return NULL;
pSrc = (char *) hdsa->pData + (hdsa->nItemSize * nIndex);
TRACE("-- ret=%p\n", pSrc);
return pSrc;
@ -1429,7 +1429,7 @@ DSA_GetItemPtr (const HDSA hdsa, INT nIndex)
/**************************************************************************
* DSA_SetItem [COMCTL32.325]
* DSA_SetItem [COMCTL32.325]
*
* Sets the contents of an item in the array.
*
@ -1448,12 +1448,12 @@ DSA_SetItem (const HDSA hdsa, INT nIndex, LPVOID pSrc)
{
INT nSize, nNewItems;
LPVOID pDest, lpTemp;
TRACE("(%p %d %p)\n", hdsa, nIndex, pSrc);
if ((!hdsa) || nIndex < 0)
return FALSE;
if (hdsa->nItemCount <= nIndex) {
/* within the old array */
if (hdsa->nMaxCount > nIndex) {
@ -1473,7 +1473,7 @@ DSA_SetItem (const HDSA hdsa, INT nIndex, LPVOID pSrc)
hdsa->nMaxCount = nNewItems;
hdsa->nItemCount = nIndex + 1;
hdsa->pData = lpTemp;
}
}
}
/* put the new entry in */
@ -1487,7 +1487,7 @@ DSA_SetItem (const HDSA hdsa, INT nIndex, LPVOID pSrc)
/**************************************************************************
* DSA_InsertItem [COMCTL32.324]
* DSA_InsertItem [COMCTL32.324]
*
* PARAMS
* hdsa [I] pointer to the array control structure
@ -1504,7 +1504,7 @@ DSA_InsertItem (const HDSA hdsa, INT nIndex, LPVOID pSrc)
{
INT nNewItems, nSize;
LPVOID lpTemp, lpDest;
TRACE("(%p %d %p)\n", hdsa, nIndex, pSrc);
if ((!hdsa) || nIndex < 0)
@ -1524,7 +1524,7 @@ DSA_InsertItem (const HDSA hdsa, INT nIndex, LPVOID pSrc)
return -1;
hdsa->nMaxCount = nNewItems;
hdsa->pData = lpTemp;
hdsa->pData = lpTemp;
}
/* do we need to move elements ? */
@ -1549,7 +1549,7 @@ DSA_InsertItem (const HDSA hdsa, INT nIndex, LPVOID pSrc)
/**************************************************************************
* DSA_DeleteItem [COMCTL32.326]
* DSA_DeleteItem [COMCTL32.326]
*
* PARAMS
* hdsa [I] pointer to the array control structure
@ -1565,7 +1565,7 @@ DSA_DeleteItem (const HDSA hdsa, INT nIndex)
{
LPVOID lpDest,lpSrc;
INT nSize;
TRACE("(%p %d)\n", hdsa, nIndex);
if (!hdsa)
@ -1582,9 +1582,9 @@ DSA_DeleteItem (const HDSA hdsa, INT nIndex)
lpDest, lpSrc, nSize);
memmove (lpDest, lpSrc, nSize);
}
hdsa->nItemCount--;
/* free memory ? */
if ((hdsa->nMaxCount - hdsa->nItemCount) >= hdsa->nGrow) {
nSize = hdsa->nItemSize * hdsa->nItemCount;
@ -1619,7 +1619,7 @@ DSA_DeleteAllItems (const HDSA hdsa)
{
TRACE("(%p)\n", hdsa);
if (!hdsa)
if (!hdsa)
return FALSE;
if (hdsa->pData && (!COMCTL32_Free (hdsa->pData)))
return FALSE;
@ -1949,12 +1949,12 @@ BOOL WINAPI
DPA_SetPtr (const HDPA hdpa, INT i, LPVOID p)
{
LPVOID *lpTemp;
TRACE("(%p %d %p)\n", hdpa, i, p);
if ((!hdpa) || i < 0)
return FALSE;
if (hdpa->nItemCount <= i) {
/* within the old array */
if (hdpa->nMaxCount > i) {
@ -1973,8 +1973,8 @@ DPA_SetPtr (const HDPA hdpa, INT i, LPVOID p)
return FALSE;
hdpa->nItemCount = nNewItems;
hdpa->ptrs = lpTemp;
}
hdpa->ptrs = lpTemp;
}
}
/* put the new entry in */
@ -2003,7 +2003,7 @@ DPA_DeletePtr (const HDPA hdpa, INT i)
{
LPVOID *lpDest, *lpSrc, lpTemp = NULL;
INT nSize;
TRACE("(%p %d)\n", hdpa, i);
if ((!hdpa) || i < 0 || i >= hdpa->nItemCount)
@ -2020,9 +2020,9 @@ DPA_DeletePtr (const HDPA hdpa, INT i)
lpDest, lpSrc, nSize);
memmove (lpDest, lpSrc, nSize);
}
hdpa->nItemCount --;
/* free memory ?*/
if ((hdpa->nMaxCount - hdpa->nItemCount) >= hdpa->nGrow) {
INT nNewItems = max(hdpa->nGrow * 2, hdpa->nItemCount);
@ -2033,7 +2033,7 @@ DPA_DeletePtr (const HDPA hdpa, INT i)
return NULL;
hdpa->nMaxCount = nNewItems;
hdpa->ptrs = (LPVOID*)lpDest;
hdpa->ptrs = (LPVOID*)lpDest;
}
return lpTemp;
@ -2058,7 +2058,7 @@ DPA_DeleteAllPtrs (const HDPA hdpa)
{
TRACE("(%p)\n", hdpa);
if (!hdpa)
if (!hdpa)
return FALSE;
if (hdpa->ptrs && (!HeapFree (hdpa->hHeap, 0, hdpa->ptrs)))
@ -2097,7 +2097,7 @@ DPA_QuickSort (LPVOID *lpPtrs, INT l, INT r,
LPVOID t;
TRACE("l=%i r=%i\n", l, r);
if (l==r) /* one element is always sorted */
return;
if (r<l) /* oops, got it in the wrong order */
@ -2110,7 +2110,7 @@ DPA_QuickSort (LPVOID *lpPtrs, INT l, INT r,
DPA_QuickSort(lpPtrs, m+1, r, pfnCompare, lParam);
/* join the two sides */
while( (l<=m) && (m<r) )
while( (l<=m) && (m<r) )
{
if(pfnCompare(lpPtrs[l],lpPtrs[m+1],lParam)>0)
{
@ -2228,7 +2228,7 @@ DPA_Search (const HDPA hdpa, LPVOID pFind, INT nStart,
INT nIndex;
TRACE("linear search\n");
nIndex = (nStart == -1)? 0 : nStart;
lpPtr = hdpa->ptrs;
for (; nIndex < hdpa->nItemCount; nIndex++) {
@ -2493,7 +2493,7 @@ COMCTL32_StrToIntW (LPWSTR lpString)
* PARAMS
* hdpa [I] handle to the dynamic pointer array
* enumProc [I]
* lParam [I]
* lParam [I]
*
* RETURNS
* none
@ -2674,7 +2674,7 @@ LPSTR WINAPI COMCTL32_StrRChrA( LPCSTR lpStart, LPCSTR lpEnd, WORD wMatch )
if (*lpStart != LOBYTE(wMatch)) continue;
if (dbcs && lpStart[1] != HIBYTE(wMatch)) continue;
lpGotIt = lpStart;
}
}
return (LPSTR)lpGotIt;
}
@ -2728,7 +2728,7 @@ INT WINAPI COMCTL32_StrSpnW( LPWSTR lpStr, LPWSTR lpSet) {
for(; (*lpLoop != 0); lpLoop++)
if( strchrW(lpSet, *(WORD*)lpLoop))
return (INT)(lpLoop-lpStr);
return (INT)(lpLoop-lpStr);
}

View File

@ -1,4 +1,4 @@
/*
/*
* Common controls functions
*
* Copyright 1997 Dimitrie O. Paun
@ -274,7 +274,7 @@ MenuHelp (UINT uMsg, WPARAM wParam, LPARAM lParam, HMENU hMainMenu,
/***********************************************************************
* ShowHideMenuCtl [COMCTL32.3]
* ShowHideMenuCtl [COMCTL32.3]
*
* Shows or hides controls and updates the corresponding menu item.
*
@ -497,9 +497,9 @@ void WINAPI DrawStatusTextA (HDC hdc, LPRECT lprc, LPCSTR text, UINT style)
HWND WINAPI
CreateStatusWindowA (INT style, LPCSTR text, HWND parent, UINT wid)
{
return CreateWindowA(STATUSCLASSNAMEA, text, style,
return CreateWindowA(STATUSCLASSNAMEA, text, style,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
parent, wid, 0, 0);
}
@ -561,7 +561,7 @@ CreateUpDownControl (DWORD style, INT x, INT y, INT cx, INT cy,
if (hUD) {
SendMessageA (hUD, UDM_SETBUDDY, buddy, 0);
SendMessageA (hUD, UDM_SETRANGE, 0, MAKELONG(maxVal, minVal));
SendMessageA (hUD, UDM_SETPOS, 0, MAKELONG(curVal, 0));
SendMessageA (hUD, UDM_SETPOS, 0, MAKELONG(curVal, 0));
}
return hUD;
@ -936,7 +936,7 @@ COMCTL32_DllGetVersion (DLLVERSIONINFO *pdvi)
*/
HRESULT WINAPI COMCTL32_DllInstall(BOOL bInstall, LPCWSTR cmdline)
{
FIXME("(%s, %s): stub\n", bInstall?"TRUE":"FALSE",
FIXME("(%s, %s): stub\n", bInstall?"TRUE":"FALSE",
debugstr_w(cmdline));
return S_OK;

View File

@ -55,7 +55,7 @@ typedef struct
int haveFocus;
int *fieldspec;
RECT *fieldRect;
int *buflen;
int *buflen;
char textbuf[256];
POINT monthcal_pos;
} DATETIME_INFO, *LPDATETIME_INFO;
@ -65,12 +65,12 @@ extern int MONTHCAL_MonthLength(int month, int year);
/* this list of defines is closely related to `allowedformatchars' defined
* in datetime.c; the high nibble indicates the `base type' of the format
* specifier.
* specifier.
* Do not change without first reading DATETIME_UseFormat.
*
*
*/
#define DT_END_FORMAT 0
#define DT_END_FORMAT 0
#define ONEDIGITDAY 0x01
#define TWODIGITDAY 0x02
#define THREECHARDAY 0x03
@ -122,7 +122,7 @@ DATETIME_GetSystemTime (HWND hwnd, WPARAM wParam, LPARAM lParam )
TRACE("%04x %08lx\n",wParam,lParam);
if (!lParam) return GDT_NONE;
if ((dwStyle & DTS_SHOWNONE) &&
if ((dwStyle & DTS_SHOWNONE) &&
(SendMessageA (infoPtr->hwndCheckbut, BM_GETCHECK, 0, 0)))
return GDT_NONE;
@ -141,7 +141,7 @@ DATETIME_SetSystemTime (HWND hwnd, WPARAM wParam, LPARAM lParam )
TRACE("%04x %08lx\n",wParam,lParam);
if (!lParam) return 0;
if (lParam==GDT_VALID)
if (lParam==GDT_VALID)
MONTHCAL_CopyTime (lprgSysTimeArray, &infoPtr->date);
if (lParam==GDT_NONE) {
infoPtr->dateValid=FALSE;
@ -225,20 +225,20 @@ DATETIME_SetMonthCalFont (HWND hwnd, WPARAM wParam, LPARAM lParam)
}
/*
Split up a formattxt in actions.
/*
Split up a formattxt in actions.
See ms documentation for the meaning of the letter codes/'specifiers'.
Notes:
Notes:
*'dddddd' is handled as 'dddd' plus 'dd'.
*unrecognized formats are strings (here given the type DT_STRING;
*unrecognized formats are strings (here given the type DT_STRING;
start of the string is encoded in lower bits of DT_STRING.
Therefore, 'string' ends finally up as '<show seconds>tring'.
*/
static void
static void
DATETIME_UseFormat (DATETIME_INFO *infoPtr, const char *formattxt)
{
int i,j,k,len;
@ -255,20 +255,20 @@ DATETIME_UseFormat (DATETIME_INFO *infoPtr, const char *formattxt)
for (i=0; i<strlen (formattxt); i++) {
TRACE ("\n%d %c:",i, formattxt[i]);
for (j=0; j<len; j++) {
if (allowedformatchars[j]==formattxt[i]) {
if (allowedformatchars[j]==formattxt[i]) {
TRACE ("%c[%d,%x]",allowedformatchars[j], *nrFields,
infoPtr->fieldspec[*nrFields]);
if ((*nrFields==0) && (infoPtr->fieldspec[*nrFields]==0)) {
infoPtr->fieldspec[*nrFields]=(j<<4) +1;
break;
}
if (infoPtr->fieldspec[*nrFields]>>4!=j) {
(*nrFields)++;
if (infoPtr->fieldspec[*nrFields]>>4!=j) {
(*nrFields)++;
infoPtr->fieldspec[*nrFields]=(j<<4) +1;
break;
}
if ((infoPtr->fieldspec[*nrFields] & 0x0f)==maxrepetition[j]) {
(*nrFields)++;
(*nrFields)++;
infoPtr->fieldspec[*nrFields]=(j<<4) +1;
break;
}
@ -283,12 +283,12 @@ DATETIME_UseFormat (DATETIME_INFO *infoPtr, const char *formattxt)
if ((*nrFields==0) && (infoPtr->fieldspec[*nrFields]==0)) {
infoPtr->fieldspec[*nrFields]=DT_STRING+k;
infoPtr->buflen[*nrFields]=0;
} else
} else
if ((infoPtr->fieldspec[*nrFields] & DT_STRING)!=DT_STRING) {
(*nrFields)++;
infoPtr->fieldspec[*nrFields]=DT_STRING+k;
infoPtr->buflen[*nrFields]=0;
}
}
infoPtr->textbuf[k]=formattxt[i];
k++;
infoPtr->buflen[*nrFields]++;
@ -306,7 +306,7 @@ DATETIME_UseFormat (DATETIME_INFO *infoPtr, const char *formattxt)
}
static LRESULT
static LRESULT
DATETIME_SetFormat (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
DATETIME_INFO *infoPtr= DATETIME_GetInfoPtr (hwnd);
@ -317,15 +317,15 @@ DATETIME_SetFormat (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (!lParam) {
DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
if (dwStyle & DTS_LONGDATEFORMAT)
if (dwStyle & DTS_LONGDATEFORMAT)
format_item=LOCALE_SLONGDATE;
else if (dwStyle & DTS_TIMEFORMAT)
else if (dwStyle & DTS_TIMEFORMAT)
format_item=LOCALE_STIMEFORMAT;
else /* DTS_SHORTDATEFORMAT */
format_item=LOCALE_SSHORTDATE;
GetLocaleInfoA( GetSystemDefaultLCID(), format_item,format_buf,sizeof(format_buf));
DATETIME_UseFormat (infoPtr, format_buf);
}
}
else
DATETIME_UseFormat (infoPtr, (char *) lParam);
@ -333,7 +333,7 @@ DATETIME_SetFormat (HWND hwnd, WPARAM wParam, LPARAM lParam)
}
static LRESULT
static LRESULT
DATETIME_SetFormatW (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
@ -348,14 +348,14 @@ DATETIME_SetFormatW (HWND hwnd, WPARAM wParam, LPARAM lParam)
retval=DATETIME_SetFormat (hwnd, 0, (LPARAM) buf);
COMCTL32_Free (buf);
return retval;
}
}
else
return DATETIME_SetFormat (hwnd, 0, 0);
}
static void
static void
DATETIME_ReturnTxt (DATETIME_INFO *infoPtr, int count, char *result)
{
SYSTEMTIME date = infoPtr->date;
@ -370,7 +370,7 @@ DATETIME_ReturnTxt (DATETIME_INFO *infoPtr, int count, char *result)
}
if (!infoPtr->fieldspec) return;
spec=infoPtr->fieldspec[count];
if (spec & DT_STRING) {
int txtlen=infoPtr->buflen[count];
@ -381,18 +381,18 @@ DATETIME_ReturnTxt (DATETIME_INFO *infoPtr, int count, char *result)
return;
}
switch (spec) {
case DT_END_FORMAT:
case DT_END_FORMAT:
*result=0;
break;
case ONEDIGITDAY:
case ONEDIGITDAY:
sprintf (result,"%d",date.wDay);
break;
case TWODIGITDAY:
case TWODIGITDAY:
sprintf (result,"%.2d",date.wDay);
break;
case THREECHARDAY:
case THREECHARDAY:
GetLocaleInfoA( LOCALE_USER_DEFAULT, LOCALE_SABBREVDAYNAME1+(date.wDayOfWeek+6)%7,
result,4);
/*sprintf (result,"%.3s",days[date.wDayOfWeek]);*/
@ -402,83 +402,83 @@ DATETIME_ReturnTxt (DATETIME_INFO *infoPtr, int count, char *result)
buffer,sizeof(buffer));
strcpy (result,buffer);
break;
case ONEDIGIT12HOUR:
if (date.wHour>12)
case ONEDIGIT12HOUR:
if (date.wHour>12)
sprintf (result,"%d",date.wHour-12);
else
else
sprintf (result,"%d",date.wHour);
break;
case TWODIGIT12HOUR:
if (date.wHour>12)
case TWODIGIT12HOUR:
if (date.wHour>12)
sprintf (result,"%.2d",date.wHour-12);
else
else
sprintf (result,"%.2d",date.wHour);
break;
case ONEDIGIT24HOUR:
case ONEDIGIT24HOUR:
sprintf (result,"%d",date.wHour);
break;
case TWODIGIT24HOUR:
case TWODIGIT24HOUR:
sprintf (result,"%.2d",date.wHour);
break;
case ONEDIGITSECOND:
case ONEDIGITSECOND:
sprintf (result,"%d",date.wSecond);
break;
case TWODIGITSECOND:
case TWODIGITSECOND:
sprintf (result,"%.2d",date.wSecond);
break;
case ONEDIGITMINUTE:
case ONEDIGITMINUTE:
sprintf (result,"%d",date.wMinute);
break;
case TWODIGITMINUTE:
case TWODIGITMINUTE:
sprintf (result,"%.2d",date.wMinute);
break;
case ONEDIGITMONTH:
case ONEDIGITMONTH:
sprintf (result,"%d",date.wMonth);
break;
case TWODIGITMONTH:
case TWODIGITMONTH:
sprintf (result,"%.2d",date.wMonth);
break;
case THREECHARMONTH:
case THREECHARMONTH:
GetLocaleInfoA( GetSystemDefaultLCID(),LOCALE_SMONTHNAME1+date.wMonth -1,
buffer,sizeof(buffer));
sprintf (result,"%.3s",buffer);
break;
case FULLMONTH:
case FULLMONTH:
GetLocaleInfoA( GetSystemDefaultLCID(),LOCALE_SMONTHNAME1+date.wMonth -1,
result,sizeof(result));
break;
case ONELETTERAMPM:
if (date.wHour<12)
case ONELETTERAMPM:
if (date.wHour<12)
strcpy (result,"A");
else
else
strcpy (result,"P");
break;
case TWOLETTERAMPM:
if (date.wHour<12)
case TWOLETTERAMPM:
if (date.wHour<12)
strcpy (result,"AM");
else
else
strcpy (result,"PM");
break;
case FORMATCALLBACK:
case FORMATCALLBACK:
FIXME ("Not implemented\n");
strcpy (result,"xxx");
break;
case ONEDIGITYEAR:
case ONEDIGITYEAR:
sprintf (result,"%d",date.wYear-10* (int) floor(date.wYear/10));
break;
case TWODIGITYEAR:
case TWODIGITYEAR:
sprintf (result,"%.2d",date.wYear-100* (int) floor(date.wYear/100));
break;
case FULLYEAR:
case FULLYEAR:
sprintf (result,"%d",date.wYear);
break;
}
TRACE ("arg%d=%x->[%s]\n",count,infoPtr->fieldspec[count],result);
}
static void
static void
DATETIME_IncreaseField (DATETIME_INFO *infoPtr, int number)
{
SYSTEMTIME *date = &infoPtr->date;
@ -489,53 +489,53 @@ DATETIME_IncreaseField (DATETIME_INFO *infoPtr, int number)
spec=infoPtr->fieldspec[number];
if ((spec & DTHT_DATEFIELD)==0) return;
switch (spec) {
case ONEDIGITDAY:
case TWODIGITDAY:
case THREECHARDAY:
case ONEDIGITDAY:
case TWODIGITDAY:
case THREECHARDAY:
case FULLDAY:
date->wDay++;
if (date->wDay>MONTHCAL_MonthLength(date->wMonth,date->wYear))
date->wDay=1;
date->wDay=1;
break;
case ONEDIGIT12HOUR:
case TWODIGIT12HOUR:
case ONEDIGIT24HOUR:
case TWODIGIT24HOUR:
case ONEDIGIT12HOUR:
case TWODIGIT12HOUR:
case ONEDIGIT24HOUR:
case TWODIGIT24HOUR:
date->wHour++;
if (date->wHour>23) date->wHour=0;
break;
case ONEDIGITSECOND:
case TWODIGITSECOND:
case ONEDIGITSECOND:
case TWODIGITSECOND:
date->wSecond++;
if (date->wSecond>59) date->wSecond=0;
break;
case ONEDIGITMINUTE:
case TWODIGITMINUTE:
case ONEDIGITMINUTE:
case TWODIGITMINUTE:
date->wMinute++;
if (date->wMinute>59) date->wMinute=0;
break;
case ONEDIGITMONTH:
case TWODIGITMONTH:
case THREECHARMONTH:
case FULLMONTH:
case ONEDIGITMONTH:
case TWODIGITMONTH:
case THREECHARMONTH:
case FULLMONTH:
date->wMonth++;
if (date->wMonth>12) date->wMonth=1;
if (date->wDay>MONTHCAL_MonthLength(date->wMonth,date->wYear))
if (date->wDay>MONTHCAL_MonthLength(date->wMonth,date->wYear))
date->wDay=MONTHCAL_MonthLength(date->wMonth,date->wYear);
break;
case ONELETTERAMPM:
case TWOLETTERAMPM:
case ONELETTERAMPM:
case TWOLETTERAMPM:
date->wHour+=12;
if (date->wHour>23) date->wHour-=24;
break;
case FORMATCALLBACK:
case FORMATCALLBACK:
FIXME ("Not implemented\n");
break;
case ONEDIGITYEAR:
case TWODIGITYEAR:
case FULLYEAR:
case ONEDIGITYEAR:
case TWODIGITYEAR:
case FULLYEAR:
date->wYear++;
break;
}
@ -543,7 +543,7 @@ DATETIME_IncreaseField (DATETIME_INFO *infoPtr, int number)
}
static void
static void
DATETIME_DecreaseField (DATETIME_INFO *infoPtr, int number)
{
SYSTEMTIME *date = & infoPtr->date;
@ -554,65 +554,65 @@ DATETIME_DecreaseField (DATETIME_INFO *infoPtr, int number)
spec = infoPtr->fieldspec[number];
if ((spec & DTHT_DATEFIELD)==0) return;
TRACE ("%x\n",spec);
switch (spec) {
case ONEDIGITDAY:
case TWODIGITDAY:
case THREECHARDAY:
case ONEDIGITDAY:
case TWODIGITDAY:
case THREECHARDAY:
case FULLDAY:
date->wDay--;
if (date->wDay<1)
if (date->wDay<1)
date->wDay=MONTHCAL_MonthLength(date->wMonth,date->wYear);
break;
case ONEDIGIT12HOUR:
case TWODIGIT12HOUR:
case ONEDIGIT24HOUR:
case TWODIGIT24HOUR:
if (date->wHour)
case ONEDIGIT12HOUR:
case TWODIGIT12HOUR:
case ONEDIGIT24HOUR:
case TWODIGIT24HOUR:
if (date->wHour)
date->wHour--;
else
date->wHour=23;
break;
case ONEDIGITSECOND:
case TWODIGITSECOND:
if (date->wHour)
case ONEDIGITSECOND:
case TWODIGITSECOND:
if (date->wHour)
date->wSecond--;
else
date->wHour=59;
break;
case ONEDIGITMINUTE:
case TWODIGITMINUTE:
if (date->wMinute)
case ONEDIGITMINUTE:
case TWODIGITMINUTE:
if (date->wMinute)
date->wMinute--;
else
date->wMinute=59;
break;
case ONEDIGITMONTH:
case TWODIGITMONTH:
case THREECHARMONTH:
case FULLMONTH:
if (date->wMonth>1)
case ONEDIGITMONTH:
case TWODIGITMONTH:
case THREECHARMONTH:
case FULLMONTH:
if (date->wMonth>1)
date->wMonth--;
else
date->wMonth=12;
if (date->wDay>MONTHCAL_MonthLength(date->wMonth,date->wYear))
if (date->wDay>MONTHCAL_MonthLength(date->wMonth,date->wYear))
date->wDay=MONTHCAL_MonthLength(date->wMonth,date->wYear);
break;
case ONELETTERAMPM:
case TWOLETTERAMPM:
if (date->wHour<12)
case ONELETTERAMPM:
case TWOLETTERAMPM:
if (date->wHour<12)
date->wHour+=12;
else
date->wHour-=12;
break;
case FORMATCALLBACK:
case FORMATCALLBACK:
FIXME ("Not implemented\n");
break;
case ONEDIGITYEAR:
case TWODIGITYEAR:
case FULLYEAR:
case ONEDIGITYEAR:
case TWODIGITYEAR:
case FULLYEAR:
date->wYear--;
break;
}
@ -620,7 +620,7 @@ DATETIME_DecreaseField (DATETIME_INFO *infoPtr, int number)
}
static void
static void
DATETIME_ResetFieldDown (DATETIME_INFO *infoPtr, int number)
{
SYSTEMTIME *date = &infoPtr->date;
@ -631,47 +631,47 @@ DATETIME_ResetFieldDown (DATETIME_INFO *infoPtr, int number)
spec = infoPtr->fieldspec[number];
if ((spec & DTHT_DATEFIELD)==0) return;
switch (spec) {
case ONEDIGITDAY:
case TWODIGITDAY:
case THREECHARDAY:
case ONEDIGITDAY:
case TWODIGITDAY:
case THREECHARDAY:
case FULLDAY:
date->wDay = 1;
break;
case ONEDIGIT12HOUR:
case TWODIGIT12HOUR:
case ONEDIGIT24HOUR:
case TWODIGIT24HOUR:
case ONELETTERAMPM:
case TWOLETTERAMPM:
case ONEDIGIT12HOUR:
case TWODIGIT12HOUR:
case ONEDIGIT24HOUR:
case TWODIGIT24HOUR:
case ONELETTERAMPM:
case TWOLETTERAMPM:
date->wHour = 0;
break;
case ONEDIGITSECOND:
case TWODIGITSECOND:
case ONEDIGITSECOND:
case TWODIGITSECOND:
date->wSecond = 0;
break;
case ONEDIGITMINUTE:
case TWODIGITMINUTE:
case ONEDIGITMINUTE:
case TWODIGITMINUTE:
date->wMinute = 0;
break;
case ONEDIGITMONTH:
case TWODIGITMONTH:
case THREECHARMONTH:
case FULLMONTH:
case ONEDIGITMONTH:
case TWODIGITMONTH:
case THREECHARMONTH:
case FULLMONTH:
date->wMonth = 1;
case FORMATCALLBACK:
case FORMATCALLBACK:
FIXME ("Not implemented\n");
break;
case ONEDIGITYEAR:
case TWODIGITYEAR:
/* FYI: On 1752/9/14 the calendar changed and England and the
* American colonies changed to the Gregorian calendar. This change
* involved having September 14th follow September 2nd. So no date
case ONEDIGITYEAR:
case TWODIGITYEAR:
/* FYI: On 1752/9/14 the calendar changed and England and the
* American colonies changed to the Gregorian calendar. This change
* involved having September 14th follow September 2nd. So no date
* algorithm works before that date.
*/
case FULLYEAR:
case FULLYEAR:
date->wSecond = 0;
date->wMinute = 0;
date->wHour = 0;
@ -684,7 +684,7 @@ DATETIME_ResetFieldDown (DATETIME_INFO *infoPtr, int number)
}
static void
static void
DATETIME_ResetFieldUp (DATETIME_INFO *infoPtr, int number)
{
SYSTEMTIME *date = & infoPtr->date;
@ -695,41 +695,41 @@ DATETIME_ResetFieldUp (DATETIME_INFO *infoPtr, int number)
spec=infoPtr->fieldspec[number];
if ((spec & DTHT_DATEFIELD)==0) return;
switch (spec) {
case ONEDIGITDAY:
case TWODIGITDAY:
case THREECHARDAY:
case ONEDIGITDAY:
case TWODIGITDAY:
case THREECHARDAY:
case FULLDAY:
date->wDay=MONTHCAL_MonthLength(date->wMonth,date->wYear);
break;
case ONEDIGIT12HOUR:
case TWODIGIT12HOUR:
case ONEDIGIT24HOUR:
case TWODIGIT24HOUR:
case ONELETTERAMPM:
case TWOLETTERAMPM:
case ONEDIGIT12HOUR:
case TWODIGIT12HOUR:
case ONEDIGIT24HOUR:
case TWODIGIT24HOUR:
case ONELETTERAMPM:
case TWOLETTERAMPM:
date->wHour=23;
break;
case ONEDIGITSECOND:
case TWODIGITSECOND:
case ONEDIGITSECOND:
case TWODIGITSECOND:
date->wSecond=59;
break;
case ONEDIGITMINUTE:
case TWODIGITMINUTE:
case ONEDIGITMINUTE:
case TWODIGITMINUTE:
date->wMinute=59;
break;
case ONEDIGITMONTH:
case TWODIGITMONTH:
case THREECHARMONTH:
case FULLMONTH:
case ONEDIGITMONTH:
case TWODIGITMONTH:
case THREECHARMONTH:
case FULLMONTH:
date->wMonth=12;
case FORMATCALLBACK:
case FORMATCALLBACK:
FIXME ("Not implemented\n");
break;
case ONEDIGITYEAR:
case TWODIGITYEAR:
case FULLYEAR:
case ONEDIGITYEAR:
case TWODIGITYEAR:
case FULLYEAR:
date->wYear=9999; /* Y10K problem? naaah. */
break;
}
@ -751,14 +751,14 @@ static void DATETIME_Refresh (HWND hwnd, HDC hdc)
HBRUSH hbr;
SIZE size;
COLORREF oldBk, oldTextColor;
/* draw control edge */
TRACE("\n");
hbr = CreateSolidBrush(RGB(255, 255, 255));
FillRect(hdc, rcClient, hbr);
DrawEdge(hdc, rcClient, EDGE_SUNKEN, BF_RECT);
DeleteObject(hbr);
DeleteObject(hbr);
if (infoPtr->dateValid) {
char txt[80];
HFONT oldFont;
@ -825,7 +825,7 @@ DATETIME_HitTest (HWND hwnd, DATETIME_INFO *infoPtr, POINT pt)
for (i=0; i<infoPtr->nrFields; i++) {
if (PtInRect (&infoPtr->fieldRect[i], pt)) {
retval = i;
TRACE("Hit in date text in field %d\n", i);
TRACE("Hit in date text in field %d\n", i);
break;
}
}
@ -838,7 +838,7 @@ done:
static LRESULT
DATETIME_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd);
DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd);
DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
int old, new;
POINT pt;
@ -867,7 +867,7 @@ DATETIME_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
if(dwStyle & DTS_RIGHTALIGN)
infoPtr->monthcal_pos.x = infoPtr->rcClient.right - ((infoPtr->calbutton.right -
infoPtr->calbutton.left) + 145);
else
else
infoPtr->monthcal_pos.x = 8;
infoPtr->monthcal_pos.y = infoPtr->rcClient.bottom;
@ -881,7 +881,7 @@ DATETIME_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
ShowWindow(infoPtr->hMonthCal, SW_SHOW);
TRACE ("dt:%x mc:%x mc parent:%x, desktop:%x, mcpp:%x\n",
hwnd,infoPtr->hMonthCal,
hwnd,infoPtr->hMonthCal,
GetParent (infoPtr->hMonthCal),
GetDesktopWindow (),
GetParent (GetParent (infoPtr->hMonthCal)));
@ -897,10 +897,10 @@ DATETIME_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
static LRESULT
DATETIME_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd);
DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd);
TRACE("\n");
if(infoPtr->bCalDepressed == TRUE) {
infoPtr->bCalDepressed = FALSE;
InvalidateRect(hwnd, &(infoPtr->calbutton), TRUE);
@ -927,7 +927,7 @@ DATETIME_Paint (HWND hwnd, WPARAM wParam)
static LRESULT
DATETIME_ParentNotify (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd);
DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd);
LPNMHDR lpnmh = (LPNMHDR) lParam;
TRACE ("%x,%lx\n",wParam, lParam);
@ -941,7 +941,7 @@ static LRESULT
DATETIME_Notify (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd);
DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd);
LPNMHDR lpnmh = (LPNMHDR) lParam;
TRACE ("%x,%lx\n",wParam, lParam);
@ -951,7 +951,7 @@ DATETIME_Notify (HWND hwnd, WPARAM wParam, LPARAM lParam)
}
static LRESULT
static LRESULT
DATETIME_KeyDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd);
@ -970,7 +970,7 @@ DATETIME_KeyDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
switch (wParam) {
case VK_ADD:
case VK_UP:
case VK_UP:
DATETIME_IncreaseField (infoPtr,FieldNum);
DATETIME_SendDateTimeChangeNotify (hwnd);
break;
@ -987,17 +987,17 @@ DATETIME_KeyDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
DATETIME_ResetFieldUp(infoPtr,FieldNum);
DATETIME_SendDateTimeChangeNotify (hwnd);
break;
case VK_LEFT:
case VK_LEFT:
do {
if (infoPtr->select==0) {
infoPtr->select = infoPtr->nrFields - 1;
wrap++;
} else
} else
infoPtr->select--;
}
while ((infoPtr->fieldspec[infoPtr->select] & DT_STRING) && (wrap<2));
break;
case VK_RIGHT:
case VK_RIGHT:
do {
infoPtr->select++;
if (infoPtr->select==infoPtr->nrFields) {
@ -1018,7 +1018,7 @@ DATETIME_KeyDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
static LRESULT
DATETIME_KillFocus (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd);
DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd);
TRACE ("\n");
@ -1036,12 +1036,12 @@ DATETIME_KillFocus (HWND hwnd, WPARAM wParam, LPARAM lParam)
static LRESULT
DATETIME_SetFocus (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd);
DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd);
TRACE ("\n");
if (infoPtr->haveFocus==0) {
DATETIME_SendSimpleNotify (hwnd, NM_SETFOCUS);
DATETIME_SendSimpleNotify (hwnd, NM_SETFOCUS);
infoPtr->haveFocus = DTHT_GOTFOCUS;
}
@ -1055,7 +1055,7 @@ static BOOL
DATETIME_SendDateTimeChangeNotify (HWND hwnd)
{
DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd);
DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd);
NMDATETIMECHANGE dtdtc;
TRACE ("\n");
@ -1123,7 +1123,7 @@ DATETIME_Size (HWND hwnd, WPARAM wParam, LPARAM lParam)
if(dwStyle & DTS_RIGHTALIGN)
infoPtr->monthcal_pos.x = infoPtr->rcClient.right - ((infoPtr->calbutton.right -
infoPtr->calbutton.left) + 145);
else
else
infoPtr->monthcal_pos.x = 8;
infoPtr->monthcal_pos.y = infoPtr->rcClient.bottom;
@ -1155,10 +1155,10 @@ DATETIME_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
SetWindowLongA (hwnd, 0, (DWORD)infoPtr);
if (dwStyle & DTS_SHOWNONE) {
infoPtr->hwndCheckbut=CreateWindowExA (0,"button", 0,
WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX,
infoPtr->hwndCheckbut=CreateWindowExA (0,"button", 0,
WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX,
2,2,13,13,
hwnd,
hwnd,
0, GetWindowLongA (hwnd, GWL_HINSTANCE), 0);
SendMessageA (infoPtr->hwndCheckbut, BM_SETCHECK, 1, 0);
}
@ -1179,10 +1179,10 @@ DATETIME_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
DATETIME_SetFormat (hwnd, 0, 0);
/* create the monthcal control */
infoPtr->hMonthCal = CreateWindowExA (0,"SysMonthCal32", 0,
infoPtr->hMonthCal = CreateWindowExA (0,"SysMonthCal32", 0,
WS_BORDER | WS_POPUP | WS_CLIPSIBLINGS,
0, 0, 0, 0,
GetParent(hwnd),
GetParent(hwnd),
0, 0, 0);
/* initialize info structure */
@ -1197,7 +1197,7 @@ static LRESULT
DATETIME_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd);
TRACE("\n");
COMCTL32_Free (infoPtr);
SetWindowLongA( hwnd, 0, 0 );
@ -1210,7 +1210,7 @@ DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if (!DATETIME_GetInfoPtr(hwnd) && (uMsg != WM_CREATE))
return DefWindowProcA( hwnd, uMsg, wParam, lParam );
switch (uMsg)
{
@ -1307,7 +1307,7 @@ DATETIME_Register (void)
wndClass.hCursor = LoadCursorA (0, IDC_ARROWA);
wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
wndClass.lpszClassName = DATETIMEPICK_CLASSA;
RegisterClassA (&wndClass);
}

View File

@ -79,10 +79,10 @@ HRESULT WINAPI UninitializeFlatSB(HWND hwnd)
*
* Returns nonzero if successful, or zero otherwise. If index is WSB_PROP_HSTYLE,
* the return is nonzero if InitializeFlatSB has been called for this window, or
* zero otherwise.
* zero otherwise.
*
*/
BOOL WINAPI
BOOL WINAPI
FlatSB_GetScrollProp(HWND hwnd, INT propIndex, LPINT prop)
{
TRACE("[%04x] propIndex=%d\n", hwnd, propIndex);
@ -93,7 +93,7 @@ FlatSB_GetScrollProp(HWND hwnd, INT propIndex, LPINT prop)
/***********************************************************************
* FlatSB_SetScrollProp (COMCTL32.36)
*/
BOOL WINAPI
BOOL WINAPI
FlatSB_SetScrollProp(HWND hwnd, UINT index, INT newValue, BOOL flag)
{
TRACE("[%04x] index=%u newValue=%d flag=%d\n", hwnd, index, newValue, flag);
@ -109,7 +109,7 @@ FlatSB_SetScrollProp(HWND hwnd, UINT index, INT newValue, BOOL flag)
* bars on and off without having to write conditional code."
*
* So, if we just call the standard functions until we implement
* the flat scroll bar functions, flat scroll bars will show up and
* the flat scroll bar functions, flat scroll bars will show up and
* behave properly, as though they had simply not been setup to
* have flat properties.
*
@ -120,7 +120,7 @@ FlatSB_SetScrollProp(HWND hwnd, UINT index, INT newValue, BOOL flag)
/***********************************************************************
* FlatSB_EnableScrollBar (COMCTL32.29)
*/
BOOL WINAPI
BOOL WINAPI
FlatSB_EnableScrollBar(HWND hwnd, int nBar, UINT flags)
{
return EnableScrollBar(hwnd, nBar, flags);
@ -129,7 +129,7 @@ FlatSB_EnableScrollBar(HWND hwnd, int nBar, UINT flags)
/***********************************************************************
* FlatSB_ShowScrollBar (COMCTL32.38)
*/
BOOL WINAPI
BOOL WINAPI
FlatSB_ShowScrollBar(HWND hwnd, int nBar, BOOL fShow)
{
return ShowScrollBar(hwnd, nBar, fShow);
@ -138,7 +138,7 @@ FlatSB_ShowScrollBar(HWND hwnd, int nBar, BOOL fShow)
/***********************************************************************
* FlatSB_GetScrollRange (COMCTL32.33)
*/
BOOL WINAPI
BOOL WINAPI
FlatSB_GetScrollRange(HWND hwnd, int nBar, LPINT min, LPINT max)
{
return GetScrollRange(hwnd, nBar, min, max);
@ -147,7 +147,7 @@ FlatSB_GetScrollRange(HWND hwnd, int nBar, LPINT min, LPINT max)
/***********************************************************************
* FlatSB_GetScrollInfo (COMCTL32.30)
*/
BOOL WINAPI
BOOL WINAPI
FlatSB_GetScrollInfo(HWND hwnd, int nBar, LPSCROLLINFO info)
{
return GetScrollInfo(hwnd, nBar, info);
@ -156,7 +156,7 @@ FlatSB_GetScrollInfo(HWND hwnd, int nBar, LPSCROLLINFO info)
/***********************************************************************
* FlatSB_GetScrollPos (COMCTL32.31)
*/
INT WINAPI
INT WINAPI
FlatSB_GetScrollPos(HWND hwnd, int nBar)
{
return GetScrollPos(hwnd, nBar);
@ -165,7 +165,7 @@ FlatSB_GetScrollPos(HWND hwnd, int nBar)
/***********************************************************************
* FlatSB_SetScrollPos (COMCTL32.35)
*/
INT WINAPI
INT WINAPI
FlatSB_SetScrollPos(HWND hwnd, int nBar, INT pos, BOOL bRedraw)
{
return SetScrollPos(hwnd, nBar, pos, bRedraw);
@ -174,7 +174,7 @@ FlatSB_SetScrollPos(HWND hwnd, int nBar, INT pos, BOOL bRedraw)
/***********************************************************************
* FlatSB_SetScrollInfo (COMCTL32.34)
*/
INT WINAPI
INT WINAPI
FlatSB_SetScrollInfo(HWND hwnd, int nBar, LPSCROLLINFO info, BOOL bRedraw)
{
return SetScrollInfo(hwnd, nBar, info, bRedraw);
@ -183,7 +183,7 @@ FlatSB_SetScrollInfo(HWND hwnd, int nBar, LPSCROLLINFO info, BOOL bRedraw)
/***********************************************************************
* FlatSB_SetScrollRange (COMCTL32.37)
*/
INT WINAPI
INT WINAPI
FlatSB_SetScrollRange(HWND hwnd, int nBar, INT min, INT max, BOOL bRedraw)
{
return SetScrollRange(hwnd, nBar, min, max, bRedraw);
@ -211,7 +211,7 @@ FlatSB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if (!FlatSB_GetInfoPtr(hwnd) && (uMsg != WM_CREATE))
return DefWindowProcA( hwnd, uMsg, wParam, lParam );
switch (uMsg)
{
case WM_CREATE:
@ -243,7 +243,7 @@ FLATSB_Register (void)
wndClass.hCursor = LoadCursorA (0, IDC_ARROWA);
wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
wndClass.lpszClassName = FLATSB_CLASSA;
RegisterClassA (&wndClass);
}

View File

@ -42,7 +42,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(header);
typedef struct
typedef struct
{
INT cxy;
HBITMAP hbm;
@ -98,13 +98,13 @@ HEADER_IndexToOrder (HWND hwnd, INT iItem)
}
static INT
static INT
HEADER_OrderToIndex(HWND hwnd, WPARAM wParam)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
INT i,iorder = (INT)wParam;
if ((iorder <0) || iorder >infoPtr->uNumItem)
return iorder;
for (i=0; i<infoPtr->uNumItem; i++)
@ -162,7 +162,7 @@ HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack)
if (!infoPtr->bRectsValid)
HEADER_SetItemBounds(hwnd);
r = phdi->rect;
if (r.right - r.left == 0)
return phdi->rect.right;
@ -329,7 +329,7 @@ HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack)
}
static void
static void
HEADER_Refresh (HWND hwnd, HDC hdc)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
@ -594,7 +594,7 @@ HEADER_DeleteItem (HWND hwnd, WPARAM wParam)
INT iItem = (INT)wParam;
TRACE("[iItem=%d]\n", iItem);
if ((iItem < 0) || (iItem >= (INT)infoPtr->uNumItem))
return FALSE;
@ -633,7 +633,7 @@ HEADER_DeleteItem (HWND hwnd, WPARAM wParam)
HEADER_SetItemBounds (hwnd);
InvalidateRect(hwnd, NULL, FALSE);
return TRUE;
}
@ -685,7 +685,7 @@ HEADER_GetItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
phdi->pszText, phdi->cchTextMax, NULL, NULL);
else
*phdi->pszText = 0;
}
}
else
phdi->pszText = LPSTR_TEXTCALLBACKA;
}
@ -779,7 +779,7 @@ HEADER_GetItemRect (HWND hwnd, WPARAM wParam, LPARAM lParam)
}
static LRESULT
static LRESULT
HEADER_GetOrderArray(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
int i;
@ -793,7 +793,7 @@ HEADER_GetOrderArray(HWND hwnd, WPARAM wParam, LPARAM lParam)
return TRUE;
}
static LRESULT
static LRESULT
HEADER_SetOrderArray(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
int i;
@ -877,7 +877,7 @@ HEADER_InsertItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
(infoPtr->uNumItem - nItem - 1) * sizeof(HEADER_ITEM));
}
}
COMCTL32_Free (oldItems);
}
@ -924,7 +924,7 @@ HEADER_InsertItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
}
else
lpItem->iOrder=nItem;
HEADER_SetItemBounds (hwnd);
@ -976,7 +976,7 @@ HEADER_InsertItemW (HWND hwnd, WPARAM wParam, LPARAM lParam)
(infoPtr->uNumItem - nItem - 1) * sizeof(HEADER_ITEM));
}
}
COMCTL32_Free (oldItems);
}
@ -989,7 +989,7 @@ HEADER_InsertItemW (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (phdi->mask & HDI_TEXT) {
WCHAR wide_null_char = 0;
if (!phdi->pszText) /* null pointer check */
phdi->pszText = &wide_null_char;
phdi->pszText = &wide_null_char;
if (phdi->pszText != LPSTR_TEXTCALLBACKW) {
len = strlenW (phdi->pszText);
lpItem->pszText = COMCTL32_Alloc ((len+1)*sizeof(WCHAR));
@ -1304,7 +1304,7 @@ HEADER_LButtonDblClk (HWND hwnd, WPARAM wParam, LPARAM lParam)
UINT flags;
INT nItem;
pt.x = (INT)LOWORD(lParam);
pt.x = (INT)LOWORD(lParam);
pt.y = (INT)HIWORD(lParam);
HEADER_InternalHitTest (hwnd, &pt, &flags, &nItem);
@ -1327,13 +1327,13 @@ HEADER_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
INT nItem;
HDC hdc;
pt.x = (INT)LOWORD(lParam);
pt.x = (INT)LOWORD(lParam);
pt.y = (INT)HIWORD(lParam);
HEADER_InternalHitTest (hwnd, &pt, &flags, &nItem);
if ((dwStyle & HDS_BUTTONS) && (flags == HHT_ONHEADER)) {
SetCapture (hwnd);
infoPtr->bCaptured = TRUE;
infoPtr->bCaptured = TRUE;
infoPtr->bPressed = TRUE;
infoPtr->iMoveItem = nItem;
@ -1345,11 +1345,11 @@ HEADER_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
ReleaseDC (hwnd, hdc);
TRACE("Pressed item %d!\n", nItem);
}
}
else if ((flags == HHT_ONDIVIDER) || (flags == HHT_ONDIVOPEN)) {
if (!(HEADER_SendHeaderNotify (hwnd, HDN_BEGINTRACKA, nItem,0))) {
SetCapture (hwnd);
infoPtr->bCaptured = TRUE;
infoPtr->bCaptured = TRUE;
infoPtr->bTracking = TRUE;
infoPtr->iMoveItem = nItem;
infoPtr->nOldWidth = infoPtr->items[nItem].cxy;
@ -1412,7 +1412,7 @@ HEADER_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
infoPtr->bRectsValid = FALSE;
InvalidateRect(hwnd, NULL, FALSE);
/* FIXME: Should some WM_NOTIFY be sent */
}
}
TRACE("Released item %d!\n", infoPtr->iMoveItem);
infoPtr->bPressed = FALSE;
@ -1447,7 +1447,7 @@ HEADER_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
HEADER_SendHeaderNotify(hwnd, HDN_ITEMCHANGINGA, infoPtr->iMoveItem, HDI_WIDTH);
HEADER_SetItemBounds (hwnd);
InvalidateRect(hwnd, NULL, FALSE);
/*
/*
* }
*/
}
@ -1536,7 +1536,7 @@ HEADER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
infoPtr->xOldTrack = pt.x + infoPtr->xTrackOffset;
if (infoPtr->xOldTrack < infoPtr->items[infoPtr->iMoveItem].rect.left)
infoPtr->xOldTrack = infoPtr->items[infoPtr->iMoveItem].rect.left;
infoPtr->items[infoPtr->iMoveItem].cxy =
infoPtr->items[infoPtr->iMoveItem].cxy =
infoPtr->xOldTrack - infoPtr->items[infoPtr->iMoveItem].rect.left;
HEADER_DrawTrackLine (hwnd, hdc, infoPtr->xOldTrack);
ReleaseDC (hwnd, hdc);
@ -1586,7 +1586,7 @@ HEADER_RButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
/* Send a WM_CONTEXTMENU message in response to the RBUTTONUP */
SendMessageA( hwnd, WM_CONTEXTMENU, (WPARAM) hwnd, MAKELPARAM(pt.x, pt.y));
return bRet;
}
@ -1637,7 +1637,7 @@ HEADER_SetFont (HWND hwnd, WPARAM wParam, LPARAM lParam)
ReleaseDC (0, hdc);
infoPtr->bRectsValid = FALSE;
if (lParam) {
InvalidateRect(hwnd, NULL, FALSE);
}
@ -1680,7 +1680,7 @@ HEADER_WindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
case HDM_GETITEMRECT:
return HEADER_GetItemRect (hwnd, wParam, lParam);
case HDM_GETORDERARRAY:
case HDM_GETORDERARRAY:
return HEADER_GetOrderArray(hwnd, wParam, lParam);
case HDM_GETUNICODEFORMAT:
@ -1754,7 +1754,7 @@ HEADER_WindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
case WM_SIZE:
return HEADER_Size (hwnd, wParam);
case WM_PAINT:
return HEADER_Paint (hwnd, wParam);
@ -1768,7 +1768,7 @@ HEADER_WindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return HEADER_SetFont (hwnd, wParam, lParam);
default:
if (msg >= WM_USER)
if (msg >= WM_USER)
ERR("unknown msg %04x wp=%04x lp=%08lx\n",
msg, wParam, lParam );
return DefWindowProcA (hwnd, msg, wParam, lParam);
@ -1789,7 +1789,7 @@ HEADER_Register (void)
wndClass.cbWndExtra = sizeof(HEADER_INFO *);
wndClass.hCursor = LoadCursorA (0, IDC_ARROWA);
wndClass.lpszClassName = WC_HEADERA;
RegisterClassA (&wndClass);
}

View File

@ -365,7 +365,7 @@ HOTKEY_Register (void)
wndClass.hCursor = 0;
wndClass.hbrBackground = 0;
wndClass.lpszClassName = HOTKEY_CLASSA;
RegisterClassA (&wndClass);
}

View File

@ -33,7 +33,7 @@
* Comments:
* - ImageList_Draw, ImageList_DrawEx and ImageList_GetIcon use
* ImageList_DrawIndirect. Since ImageList_DrawIndirect is still
* partially implemented, the functions mentioned above will be
* partially implemented, the functions mentioned above will be
* limited in functionality too.
*
* - Hotspot handling still not correct. The Hotspot passed to BeginDrag
@ -80,7 +80,7 @@ static INTERNALDRAG InternalDrag = { 0, 0, 0, 0, 0, 0, FALSE, 0, FALSE };
/*************************************************************************
* IMAGELIST_InternalExpandBitmaps [Internal]
* IMAGELIST_InternalExpandBitmaps [Internal]
*
* Expands the bitmaps of an image list by the given number of images.
*
@ -127,7 +127,7 @@ IMAGELIST_InternalExpandBitmaps (HIMAGELIST himl, INT nImageCount, INT cx, INT c
himl->hbmImage = hbmNewBitmap;
if (himl->hbmMask) {
hbmNewBitmap =
hbmNewBitmap =
CreateBitmap (nNewWidth, cy, 1, 1, NULL);
if (hbmNewBitmap == 0)
@ -149,7 +149,7 @@ IMAGELIST_InternalExpandBitmaps (HIMAGELIST himl, INT nImageCount, INT cx, INT c
/*************************************************************************
* IMAGELIST_InternalDraw [Internal]
* IMAGELIST_InternalDraw [Internal]
*
* Draws the image in the ImageList (without the mask)
*
@ -162,7 +162,7 @@ IMAGELIST_InternalExpandBitmaps (HIMAGELIST himl, INT nImageCount, INT cx, INT c
* nothing
*
* NOTES
* This function is used by ImageList_DrawIndirect, when it is
* This function is used by ImageList_DrawIndirect, when it is
* required to draw only the Image (without the mask) to the screen.
*
* Blending and Overlays styles are accomplished by another function
@ -175,10 +175,10 @@ IMAGELIST_InternalDraw(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy)
hImageDC = CreateCompatibleDC(0);
hOldBitmap = SelectObject(hImageDC, pimldp->himl->hbmImage);
BitBlt(pimldp->hdcDst,
BitBlt(pimldp->hdcDst,
pimldp->x, pimldp->y, cx, cy,
hImageDC,
pimldp->himl->cx * pimldp->i, 0,
hImageDC,
pimldp->himl->cx * pimldp->i, 0,
SRCCOPY);
SelectObject(hImageDC, hOldBitmap);
@ -187,7 +187,7 @@ IMAGELIST_InternalDraw(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy)
/*************************************************************************
* IMAGELIST_InternalDrawMask [Internal]
* IMAGELIST_InternalDrawMask [Internal]
*
* Draws the image in the ImageList with the mask
*
@ -200,7 +200,7 @@ IMAGELIST_InternalDraw(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy)
* nothing
*
* NOTES
* This function is used by ImageList_DrawIndirect, when it is
* This function is used by ImageList_DrawIndirect, when it is
* required to draw the Image with the mask to the screen.
*
* Blending and Overlays styles are accomplished by another function.
@ -216,8 +216,8 @@ IMAGELIST_InternalDrawMask(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy)
COLORREF oldBkColor, oldFgColor;
UINT fStyle = pimldp->fStyle & (~ILD_OVERLAYMASK);
/*
* We need a dc and bitmap to draw on that is
/*
* We need a dc and bitmap to draw on that is
* not on the screen.
*/
HDC hOffScreenDC = 0;
@ -232,11 +232,11 @@ IMAGELIST_InternalDrawMask(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy)
/* Create a compatible DC. */
hOffScreenDC = CreateCompatibleDC( pimldp->hdcDst );
if ( hOffScreenDC )
if ( hOffScreenDC )
{
hOffScreenBmp = CreateCompatibleBitmap( pimldp->hdcDst, cx, cy );
if ( hOffScreenBmp )
if ( hOffScreenBmp )
SelectObject( hOffScreenDC, hOffScreenBmp );
else
goto cleanup;
@ -246,43 +246,43 @@ IMAGELIST_InternalDrawMask(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy)
hOldBitmapImage = SelectObject(hImageDC, himlLocal->hbmImage);
hOldBitmapMask = SelectObject(hMaskDC, himlLocal->hbmMask);
/*
* Get a copy of the image for the masking operations.
/*
* Get a copy of the image for the masking operations.
* We will use the copy, and this dc for all the various
* blitting, and then do one final blit to the screen dc.
* This should clean up most of the flickering.
*/
BitBlt( hOffScreenDC, 0, 0, cx, cy, pimldp->hdcDst, pimldp->x,
BitBlt( hOffScreenDC, 0, 0, cx, cy, pimldp->hdcDst, pimldp->x,
pimldp->y, SRCCOPY);
/*
/*
* Draw the Background for the appropriate Styles
*/
if( bUseCustomBackground && (fStyle == ILD_NORMAL || fStyle & ILD_IMAGE
if( bUseCustomBackground && (fStyle == ILD_NORMAL || fStyle & ILD_IMAGE
|| bBlendFlag) )
{
hBrush = CreateSolidBrush (himlLocal->clrBk);
hOldBrush = SelectObject (pimldp->hdcDst, hBrush);
PatBlt( hOffScreenDC, pimldp->x, pimldp->y, cx, cy, PATCOPY );
DeleteObject (SelectObject (pimldp->hdcDst, hOldBrush));
}
/*
/*
* Draw Image Transparently over the current background
*/
if(fStyle == ILD_NORMAL || (fStyle & ILD_TRANSPARENT) ||
((fStyle & ILD_IMAGE) && bUseCustomBackground) || bBlendFlag)
{ /*
if(fStyle == ILD_NORMAL || (fStyle & ILD_TRANSPARENT) ||
((fStyle & ILD_IMAGE) && bUseCustomBackground) || bBlendFlag)
{ /*
* To obtain a transparent look, background color should be set
* to white and foreground color to black when blting the
* monochrome mask.
* to white and foreground color to black when blting the
* monochrome mask.
*/
oldBkColor = SetBkColor( hOffScreenDC, RGB( 0xff, 0xff, 0xff ) );
oldBkColor = SetBkColor( hOffScreenDC, RGB( 0xff, 0xff, 0xff ) );
oldFgColor = SetTextColor( hOffScreenDC, RGB( 0, 0, 0 ) );
BitBlt( hOffScreenDC, 0, 0, cx, cy,hMaskDC, himlLocal->cx * pimldp->i,
@ -290,18 +290,18 @@ IMAGELIST_InternalDrawMask(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy)
BitBlt( hOffScreenDC, 0, 0, cx, cy, hImageDC,himlLocal->cx * pimldp->i,
0, SRCPAINT );
}
/*
* Draw the image when no Background is specified
*/
else if((fStyle & ILD_IMAGE) && !bUseCustomBackground)
{
BitBlt( hOffScreenDC, 0, 0, cx, cy, hImageDC,
BitBlt( hOffScreenDC, 0, 0, cx, cy, hImageDC,
himlLocal->cx * pimldp->i, 0, SRCCOPY);
}
/*
/*
* Draw the mask with or without a background
*/
else if(fStyle & ILD_MASK)
@ -309,32 +309,32 @@ IMAGELIST_InternalDrawMask(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy)
BitBlt( hOffScreenDC, 0, 0, cx, cy, hMaskDC, himlLocal->cx * pimldp->i,
0, bUseCustomBackground ? SRCCOPY : SRCAND);
}
/*
* Blit the bitmap to the screen now.
*/
BitBlt( pimldp->hdcDst, pimldp->x, pimldp->y, cx, cy,
hOffScreenDC, 0, 0, SRCCOPY);
SelectObject(hImageDC, hOldBitmapImage);
SelectObject(hMaskDC, hOldBitmapMask);
cleanup:
DeleteDC(hImageDC);
DeleteDC(hMaskDC);
DeleteDC( hOffScreenDC );
DeleteObject( hOffScreenBmp );
return;
}
/*************************************************************************
* IMAGELIST_InternalDrawBlend [Internal]
* IMAGELIST_InternalDrawBlend [Internal]
*
* Draws the Blend over the current image
* Draws the Blend over the current image
*
* PARAMS
* pimldp [I] pointer to IMAGELISTDRAWPARAMS structure.
@ -345,9 +345,9 @@ cleanup:
* nothing
*
* NOTES
* This functions is used by ImageList_DrawIndirect, when it is
* required to add the blend to the current image.
*
* This functions is used by ImageList_DrawIndirect, when it is
* required to add the blend to the current image.
*
*/
static VOID
IMAGELIST_InternalDrawBlend(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy)
@ -386,15 +386,15 @@ IMAGELIST_InternalDrawBlend(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy)
hOldMaskBitmap = (HBITMAP) SelectObject(hMaskDC, himlLocal->hbmMask);
BitBlt(hBlendMaskDC,
0,0, cx, cy,
0,0, cx, cy,
hMaskDC,
himlLocal->cx * pimldp->i,0,
0x220326); /* NOTSRCAND */
BitBlt(hBlendMaskDC,
0,0, cx, cy,
0,0, cx, cy,
hBlendMaskDC,
0,0,
0,0,
NOTSRCCOPY);
SelectObject(hMaskDC, hOldMaskBitmap);
@ -408,10 +408,10 @@ IMAGELIST_InternalDrawBlend(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy)
hBlendColorBrush = CreateSolidBrush(clrBlend);
hOldBrush = (HBRUSH) SelectObject (pimldp->hdcDst, hBlendColorBrush);
BitBlt (pimldp->hdcDst,
pimldp->x, pimldp->y, cx, cy,
hBlendMaskDC,
0, 0,
BitBlt (pimldp->hdcDst,
pimldp->x, pimldp->y, cx, cy,
hBlendMaskDC,
0, 0,
0xB8074A); /* PSDPxax */
SelectObject(pimldp->hdcDst, hOldBrush);
@ -424,9 +424,9 @@ IMAGELIST_InternalDrawBlend(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy)
}
/*************************************************************************
* IMAGELIST_InternalDrawOverlay [Internal]
* IMAGELIST_InternalDrawOverlay [Internal]
*
* Draws the overlay image
* Draws the overlay image
*
* PARAMS
* pimldp [I] pointer to IMAGELISTDRAWPARAMS structure.
@ -437,12 +437,12 @@ IMAGELIST_InternalDrawBlend(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy)
* nothing
*
* NOTES
* This functions is used by ImageList_DrawIndirect, when it is
* This functions is used by ImageList_DrawIndirect, when it is
* required to draw the overlay
*
*
*
*/
static VOID
static VOID
IMAGELIST_InternalDrawOverlay(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy)
{
INT nOvlIdx;
@ -458,21 +458,21 @@ IMAGELIST_InternalDrawOverlay(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy)
hImageDC = CreateCompatibleDC(0);
if (pimldp->himl->hbmMask)
{
hOldBitmap = (HBITMAP) SelectObject (hImageDC,
hOldBitmap = (HBITMAP) SelectObject (hImageDC,
pimldp->himl->hbmMask);
BitBlt (pimldp->hdcDst,
BitBlt (pimldp->hdcDst,
pimldp->x, pimldp->y, cx, cy,
hImageDC, pimldp->himl->cx * nOvlIdx, 0,
SRCAND);
SelectObject(hImageDC, hOldBitmap);
}
hOldBitmap = (HBITMAP) SelectObject (hImageDC,
hOldBitmap = (HBITMAP) SelectObject (hImageDC,
pimldp->himl->hbmImage);
BitBlt (pimldp->hdcDst,
pimldp->x, pimldp->y, cx, cy,
BitBlt (pimldp->hdcDst,
pimldp->x, pimldp->y, cx, cy,
hImageDC,
pimldp->himl->cx * nOvlIdx, 0,
SRCPAINT);
@ -539,10 +539,10 @@ ImageList_Add (HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask)
hOldBitmapMask = (HBITMAP) SelectObject(hdcMask, himl->hbmMask);
hOldBitmapTemp = (HBITMAP) SelectObject(hdcTemp, hbmMask);
BitBlt (hdcMask,
BitBlt (hdcMask,
nStartX, 0, bmp.bmWidth, bmp.bmHeight,
hdcTemp,
0, 0,
hdcTemp,
0, 0,
SRCCOPY);
SelectObject(hdcTemp, hOldBitmapTemp);
@ -550,10 +550,10 @@ ImageList_Add (HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask)
/* Remove the background from the image
*/
BitBlt (hdcImage,
BitBlt (hdcImage,
nStartX, 0, bmp.bmWidth, bmp.bmHeight,
hdcMask,
nStartX, 0,
hdcMask,
nStartX, 0,
0x220326); /* NOTSRCAND */
SelectObject(hdcMask, hOldBitmapMask);
@ -594,7 +594,7 @@ ImageList_AddIcon (HIMAGELIST himl, HICON hIcon)
/*************************************************************************
* ImageList_AddMasked [COMCTL32.42]
* ImageList_AddMasked [COMCTL32.42]
*
* Adds an image or images to an image list and creates a mask from the
* specified bitmap using the mask color.
@ -659,9 +659,9 @@ ImageList_AddMasked (HIMAGELIST himl, HBITMAP hBitmap, COLORREF clrMask)
bkColor = (clrMask != CLR_DEFAULT) ? clrMask :
GetPixel (hdcBitmap, 0, 0);
SetBkColor (hdcBitmap, bkColor);
BitBlt (hdcMask,
BitBlt (hdcMask,
nMaskXOffset, 0, bmp.bmWidth, bmp.bmHeight,
hdcBitmap, 0, 0,
hdcBitmap, 0, 0,
SRCCOPY);
SetBkColor(hdcBitmap, RGB(255,255,255));
@ -676,17 +676,17 @@ ImageList_AddMasked (HIMAGELIST himl, HBITMAP hBitmap, COLORREF clrMask)
on windows where it failed (BUT ImageList_Add is OK)
This is here in case some apps rely on this bug
*/
BitBlt(hdcBitmap,
BitBlt(hdcBitmap,
0, 0, bmp.bmWidth, bmp.bmHeight,
hdcMask,
nMaskXOffset, 0,
hdcMask,
nMaskXOffset, 0,
0x220326); /* NOTSRCAND */
/* Copy result to the imagelist
*/
BitBlt (hdcImage,
BitBlt (hdcImage,
nIndex * himl->cx, 0, bmp.bmWidth, bmp.bmHeight,
hdcBitmap,
0, 0,
hdcBitmap,
0, 0,
SRCCOPY);
/* Clean up
*/
@ -706,7 +706,7 @@ ImageList_AddMasked (HIMAGELIST himl, HBITMAP hBitmap, COLORREF clrMask)
/*************************************************************************
* ImageList_BeginDrag [COMCTL32.43]
* ImageList_BeginDrag [COMCTL32.43]
*
* Creates a temporary image list that contains one image. It will be used
* as a drag image.
@ -774,9 +774,9 @@ ImageList_BeginDrag (HIMAGELIST himlTrack, INT iTrack,
/*************************************************************************
* ImageList_Copy [COMCTL32.44]
* ImageList_Copy [COMCTL32.44]
*
* Copies an image of the source image list to an image of the
* Copies an image of the source image list to an image of the
* destination image list. Images can be copied or swapped.
*
* PARAMS
@ -800,7 +800,7 @@ BOOL WINAPI
ImageList_Copy (HIMAGELIST himlDst, INT iDst, HIMAGELIST himlSrc,
INT iSrc, INT uFlags)
{
HDC hdcSrc, hdcDst;
HDC hdcSrc, hdcDst;
TRACE("iDst=%d iSrc=%d\n", iDst, iSrc);
@ -924,7 +924,7 @@ ImageList_Create (INT cx, INT cy, UINT flags,
HDC hdc;
INT nCount;
HBITMAP hbmTemp;
static WORD aBitBlend25[] =
static WORD aBitBlend25[] =
{0xAA, 0x00, 0x55, 0x00, 0xAA, 0x00, 0x55, 0x00};
static WORD aBitBlend50[] =
@ -967,7 +967,7 @@ ImageList_Create (INT cx, INT cy, UINT flags,
}
else
himl->hbmImage = 0;
if ( (himl->cMaxImage > 0) && (himl->flags & ILC_MASK)) {
himl->hbmMask = CreateBitmap (himl->cx * himl->cMaxImage, himl->cy,
1, 1, NULL);
@ -996,7 +996,7 @@ ImageList_Create (INT cx, INT cy, UINT flags,
/*************************************************************************
* ImageList_Destroy [COMCTL32.46]
* ImageList_Destroy [COMCTL32.46]
*
* Destroys an image list.
*
@ -1010,7 +1010,7 @@ ImageList_Create (INT cx, INT cy, UINT flags,
BOOL WINAPI
ImageList_Destroy (HIMAGELIST himl)
{
{
if (!himl)
return FALSE;
@ -1025,7 +1025,7 @@ ImageList_Destroy (HIMAGELIST himl)
DeleteObject (himl->hbrBlend25);
if (himl->hbrBlend50)
DeleteObject (himl->hbrBlend50);
COMCTL32_Free (himl);
return TRUE;
@ -1033,7 +1033,7 @@ ImageList_Destroy (HIMAGELIST himl)
/*************************************************************************
* ImageList_DragEnter [COMCTL32.47]
* ImageList_DragEnter [COMCTL32.47]
*
* Locks window update and displays the drag image at the given position.
*
@ -1077,7 +1077,7 @@ ImageList_DragEnter (HWND hwndLock, INT x, INT y)
/*************************************************************************
* ImageList_DragLeave [COMCTL32.48]
* ImageList_DragLeave [COMCTL32.48]
*
* Unlocks window update and hides the drag image.
*
@ -1110,7 +1110,7 @@ ImageList_DragLeave (HWND hwndLock)
/*************************************************************************
* ImageList_DragMove [COMCTL32.49]
* ImageList_DragMove [COMCTL32.49]
*
* Moves the drag image.
*
@ -1149,7 +1149,7 @@ ImageList_DragMove (INT x, INT y)
INT origOldX, origOldY;
INT origRegX, origRegY;
INT sizeRegX, sizeRegY;
/* calculate the update region */
origNewX = x - InternalDrag.dxHotspot;
@ -1203,7 +1203,7 @@ ImageList_DragMove (INT x, INT y)
/*************************************************************************
* ImageList_DragShowNolock [COMCTL32.50]
* ImageList_DragShowNolock [COMCTL32.50]
*
* Shows or hides the drag image.
*
@ -1248,7 +1248,7 @@ ImageList_DragShowNolock (BOOL bShow)
InternalDrag.himl->cx, InternalDrag.himl->cy);
}
SelectObject(hdcBg, InternalDrag.hbmBg);
if (bShow) {
/* save the background */
BitBlt(hdcBg, 0, 0, InternalDrag.himl->cx, InternalDrag.himl->cy,
@ -1256,7 +1256,7 @@ ImageList_DragShowNolock (BOOL bShow)
/* show the image */
/* FIXME: this should be drawn semitransparent */
ImageList_Draw(InternalDrag.himl, 0, hdcDrag, x, y, ILD_NORMAL);
} else {
} else {
/* hide the image */
BitBlt(hdcDrag, x, y, InternalDrag.himl->cx, InternalDrag.himl->cy,
hdcBg, 0, 0, SRCCOPY);
@ -1372,7 +1372,7 @@ ImageList_DrawEx (HIMAGELIST himl, INT i, HDC hdc, INT x, INT y,
/*************************************************************************
* ImageList_DrawIndirect [COMCTL32.53]
* ImageList_DrawIndirect [COMCTL32.53]
*
* Draws an image using ...
*
@ -1387,8 +1387,8 @@ ImageList_DrawEx (HIMAGELIST himl, INT i, HDC hdc, INT x, INT y,
BOOL WINAPI
ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp)
{
INT cx, cy;
/*
INT cx, cy;
/*
Do some Error Checking
*/
if (pimldp == NULL)
@ -1417,7 +1417,7 @@ ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp)
{
IMAGELIST_InternalDraw(pimldp, cx, cy);
}
/*
/*
Apply the blend if needed to the Image
*/
if((pimldp->fStyle & ILD_BLEND50)
@ -1594,7 +1594,7 @@ ImageList_GetFlags(HIMAGELIST himl)
/*************************************************************************
* ImageList_GetIcon [COMCTL32.59]
* ImageList_GetIcon [COMCTL32.59]
*
* Creates an icon from a masked image of an image list.
*
@ -1646,12 +1646,12 @@ ImageList_GetIcon (HIMAGELIST himl, INT i, UINT fStyle)
/*
* CreateIconIndirect requires us to deselect the bitmaps from
* the DCs before calling
* the DCs before calling
*/
SelectObject(hdcSrc, hOldSrcBitmap);
SelectObject(hdcDst, hOldDstBitmap);
hIcon = CreateIconIndirect (&ii);
hIcon = CreateIconIndirect (&ii);
DeleteDC (hdcSrc);
DeleteDC (hdcDst);
@ -1745,18 +1745,18 @@ ImageList_GetImageInfo (HIMAGELIST himl, INT i, IMAGEINFO *pImageInfo)
pImageInfo->hbmImage = himl->hbmImage;
pImageInfo->hbmMask = himl->hbmMask;
pImageInfo->rcImage.top = 0;
pImageInfo->rcImage.bottom = himl->cy;
pImageInfo->rcImage.left = i * himl->cx;
pImageInfo->rcImage.right = (i+1) * himl->cx;
return TRUE;
}
/*************************************************************************
* ImageList_GetImageRect [COMCTL32.63]
* ImageList_GetImageRect [COMCTL32.63]
*
* Retrieves the rectangle of the specified image in an image list.
*
@ -1855,7 +1855,7 @@ ImageList_LoadImageA (HINSTANCE hi, LPCSTR lpbmp, INT cx, INT cGrow,
GetIconInfo (handle, &ii);
GetObjectA (ii.hbmColor, sizeof(BITMAP), (LPVOID)&bmp);
himl = ImageList_Create (bmp.bmWidth, bmp.bmHeight,
himl = ImageList_Create (bmp.bmWidth, bmp.bmHeight,
ILC_MASK | ILC_COLOR, 1, cGrow);
ImageList_Add (himl, ii.hbmColor, ii.hbmMask);
DeleteObject (ii.hbmColor);
@ -1863,7 +1863,7 @@ ImageList_LoadImageA (HINSTANCE hi, LPCSTR lpbmp, INT cx, INT cGrow,
}
DeleteObject (handle);
return himl;
}
@ -1932,7 +1932,7 @@ ImageList_LoadImageW (HINSTANCE hi, LPCWSTR lpbmp, INT cx, INT cGrow,
GetIconInfo (handle, &ii);
GetObjectA (ii.hbmMask, sizeof(BITMAP), (LPVOID)&bmp);
himl = ImageList_Create (bmp.bmWidth, bmp.bmHeight,
himl = ImageList_Create (bmp.bmWidth, bmp.bmHeight,
ILC_MASK | ILC_COLOR, 1, cGrow);
ImageList_Add (himl, ii.hbmColor, ii.hbmMask);
DeleteObject (ii.hbmColor);
@ -1940,13 +1940,13 @@ ImageList_LoadImageW (HINSTANCE hi, LPCWSTR lpbmp, INT cx, INT cGrow,
}
DeleteObject (handle);
return himl;
}
/*************************************************************************
* ImageList_Merge [COMCTL32.67]
* ImageList_Merge [COMCTL32.67]
*
* Creates a new image list that contains a merged image from the specified
* images of both source image lists.
@ -2030,40 +2030,40 @@ ImageList_Merge (HIMAGELIST himl1, INT i1, HIMAGELIST himl2, INT i2,
hdcDstImage = CreateCompatibleDC (0);
nX1 = i1 * himl1->cx;
nX2 = i2 * himl2->cx;
/* copy image */
SelectObject (hdcSrcImage, himl1->hbmImage);
SelectObject (hdcDstImage, himlDst->hbmImage);
BitBlt (hdcDstImage, 0, 0, cxDst, cyDst,
BitBlt (hdcDstImage, 0, 0, cxDst, cyDst,
hdcSrcImage, 0, 0, BLACKNESS);
BitBlt (hdcDstImage, xOff1, yOff1, himl1->cx, himl1->cy,
BitBlt (hdcDstImage, xOff1, yOff1, himl1->cx, himl1->cy,
hdcSrcImage, nX1, 0, SRCCOPY);
SelectObject (hdcSrcImage, himl2->hbmMask);
BitBlt (hdcDstImage, xOff2, yOff2, himl2->cx, himl2->cy,
BitBlt (hdcDstImage, xOff2, yOff2, himl2->cx, himl2->cy,
hdcSrcImage, nX2, 0, SRCAND);
SelectObject (hdcSrcImage, himl2->hbmImage);
BitBlt (hdcDstImage, xOff2, yOff2, himl2->cx, himl2->cy,
BitBlt (hdcDstImage, xOff2, yOff2, himl2->cx, himl2->cy,
hdcSrcImage, nX2, 0, SRCPAINT);
/* copy mask */
SelectObject (hdcSrcImage, himl1->hbmMask);
SelectObject (hdcDstImage, himlDst->hbmMask);
BitBlt (hdcDstImage, 0, 0, cxDst, cyDst,
BitBlt (hdcDstImage, 0, 0, cxDst, cyDst,
hdcSrcImage, 0, 0, WHITENESS);
BitBlt (hdcDstImage, xOff1, yOff1, himl1->cx, himl1->cy,
BitBlt (hdcDstImage, xOff1, yOff1, himl1->cx, himl1->cy,
hdcSrcImage, nX1, 0, SRCCOPY);
SelectObject (hdcSrcImage, himl2->hbmMask);
BitBlt (hdcDstImage, xOff2, yOff2, himl2->cx, himl2->cy,
BitBlt (hdcDstImage, xOff2, yOff2, himl2->cx, himl2->cy,
hdcSrcImage, nX2, 0, SRCAND);
DeleteDC (hdcSrcImage);
DeleteDC (hdcDstImage);
himlDst->cCurImage = 1;
}
return himlDst;
}
@ -2193,10 +2193,10 @@ ret1:
* ILHEAD ilheadstruct;
*
* for the color image part:
* BITMAPFILEHEADER bmfh;
* BITMAPFILEHEADER bmfh;
* BITMAPINFOHEADER bmih;
* only if it has a palette:
* RGBQUAD rgbs[nr_of_paletted_colors];
* RGBQUAD rgbs[nr_of_paletted_colors];
*
* BYTE colorbits[imagesize];
*
@ -2204,7 +2204,7 @@ ret1:
* BITMAPFILEHEADER bmfh_mask;
* BITMAPINFOHEADER bmih_mask;
* only if it has a palette (it usually does not):
* RGBQUAD rgbs[nr_of_paletted_colors];
* RGBQUAD rgbs[nr_of_paletted_colors];
*
* BYTE maskbits[imagesize];
*
@ -2296,7 +2296,7 @@ ImageList_Remove (HIMAGELIST himl, INT i)
ERR("Invalid image list handle!\n");
return FALSE;
}
if ((i < -1) || (i >= himl->cCurImage)) {
ERR("index out of range! %d\n", i);
return FALSE;
@ -2339,7 +2339,7 @@ ImageList_Remove (HIMAGELIST himl, INT i)
himl->cCurImage, himl->cCurImage - 1);
TRACE(" - Max. number of images: %d / %d (Old/New)\n",
himl->cMaxImage, himl->cCurImage + himl->cGrow - 1);
hbmNewImage =
CreateBitmap (cxNew, himl->cy, 1, himl->uBitsPixel, NULL);
@ -2354,7 +2354,7 @@ ImageList_Remove (HIMAGELIST himl, INT i)
/* copy all images and masks prior to the "removed" image */
if (i > 0) {
TRACE("Pre image copy: Copy %d images\n", i);
SelectObject (hdcSrc, himl->hbmImage);
SelectObject (hdcDst, hbmNewImage);
BitBlt (hdcDst, 0, 0, i * himl->cx, himl->cy,
@ -2405,7 +2405,7 @@ ImageList_Remove (HIMAGELIST himl, INT i)
/*************************************************************************
* ImageList_Replace [COMCTL32.70]
* ImageList_Replace [COMCTL32.70]
*
* Replaces an image in an image list with a new image.
*
@ -2431,7 +2431,7 @@ ImageList_Replace (HIMAGELIST himl, INT i, HBITMAP hbmImage,
ERR("Invalid image list handle!\n");
return FALSE;
}
if ((i >= himl->cMaxImage) || (i < 0)) {
ERR("Invalid image index!\n");
return FALSE;
@ -2461,10 +2461,10 @@ ImageList_Replace (HIMAGELIST himl, INT i, HBITMAP hbmImage,
/* Remove the background from the image
*/
SelectObject (hdcImageList, himl->hbmImage);
StretchBlt (hdcImageList,
StretchBlt (hdcImageList,
i*himl->cx, 0, himl->cx, himl->cy,
hdcImage,
0, 0, bmp.bmWidth, bmp.bmHeight,
hdcImage,
0, 0, bmp.bmWidth, bmp.bmHeight,
0x220326); /* NOTSRCAND */
}
@ -2508,8 +2508,8 @@ ImageList_ReplaceIcon (HIMAGELIST himl, INT i, HICON hIcon)
return -1;
hBestFitIcon = CopyImage(
hIcon, IMAGE_ICON,
himl->cx, himl->cy,
hIcon, IMAGE_ICON,
himl->cx, himl->cy,
LR_COPYFROMRESOURCE);
GetIconInfo (hBestFitIcon, &ii);
@ -2572,7 +2572,7 @@ ImageList_ReplaceIcon (HIMAGELIST himl, INT i, HICON hIcon)
/*************************************************************************
* ImageList_SetBkColor [COMCTL32.76]
* ImageList_SetBkColor [COMCTL32.76]
*
* Sets the background color of an image list.
*
@ -2682,7 +2682,7 @@ ImageList_SetDragCursorImage (HIMAGELIST himlDrag, INT iDrag,
/*************************************************************************
* ImageList_SetFilter [COMCTL32.78]
* ImageList_SetFilter [COMCTL32.78]
*
* Sets a filter (or does something completely different)!!???
*
@ -2822,7 +2822,7 @@ ImageList_SetImageCount (HIMAGELIST himl, INT iImageCount)
/* delete 'empty' image space */
SetBkColor (hdcBitmap, RGB(255, 255, 255));
SetTextColor (hdcBitmap, RGB(0, 0, 0));
PatBlt (hdcBitmap, nCopyCount * himl->cx, 0,
PatBlt (hdcBitmap, nCopyCount * himl->cx, 0,
(nNewCount - nCopyCount) * himl->cx, himl->cy, BLACKNESS);
#endif
DeleteObject (himl->hbmImage);
@ -2847,7 +2847,7 @@ ImageList_SetImageCount (HIMAGELIST himl, INT iImageCount)
/* delete 'empty' image space */
SetBkColor (hdcBitmap, RGB(255, 255, 255));
SetTextColor (hdcBitmap, RGB(0, 0, 0));
PatBlt (hdcBitmap, nCopyCount * himl->cx, 0,
PatBlt (hdcBitmap, nCopyCount * himl->cx, 0,
(nNewCount - nCopyCount) * himl->cx, himl->cy, BLACKNESS);
#endif
DeleteObject (himl->hbmMask);
@ -2899,10 +2899,10 @@ ImageList_SetOverlayImage (HIMAGELIST himl, INT iImage, INT iOverlay)
/* helper for ImageList_Write - write bitmap to pstm
/* helper for ImageList_Write - write bitmap to pstm
* currently everything is written as 24 bit RGB, except masks
*/
static BOOL
static BOOL
_write_bitmap(HBITMAP hBitmap, LPSTREAM pstm, int cx, int cy)
{
LPBITMAPFILEHEADER bmfh;
@ -2917,7 +2917,7 @@ _write_bitmap(HBITMAP hBitmap, LPSTREAM pstm, int cx, int cy)
xdc = GetDC(0);
GetObjectA(hBitmap, sizeof(BITMAP), (LPVOID)&bm);
/* XXX is this always correct? */
icount = bm.bmWidth / cx;
nwidth = cx << 2;
@ -2959,21 +2959,21 @@ _write_bitmap(HBITMAP hBitmap, LPSTREAM pstm, int cx, int cy)
bmih->biClrImportant = 0;
lpBitsOrg = (LPBYTE)LocalAlloc(LMEM_ZEROINIT, nsizeImage);
if(!GetDIBits(xdc, hBitmap, 0, bm.bmHeight, lpBitsOrg,
if(!GetDIBits(xdc, hBitmap, 0, bm.bmHeight, lpBitsOrg,
(BITMAPINFO *)bmih, DIB_RGB_COLORS))
goto failed;
else {
int i;
int obpl = (((bm.bmWidth*bitCount+31) & ~31)>>3);
int nbpl = (((nwidth*bitCount+31) & ~31)>>3);
for(i = 0; i < nheight; i++) {
int ooff = ((nheight-1-i)%cy) * obpl + ((i/cy) * nbpl);
int noff = (nbpl * (nheight-1-i));
memcpy(lpBits + noff, lpBitsOrg + ooff, nbpl);
}
}
bmih->biWidth = nwidth;
bmih->biHeight = nheight;

View File

@ -17,7 +17,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WINE_IMAGELIST_H
#define __WINE_IMAGELIST_H

View File

@ -64,9 +64,9 @@ IPADDRESS_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
static LRESULT IPADDRESS_Notify (IPADDRESS_INFO *infoPtr, UINT command)
{
HWND hwnd = infoPtr->Self;
TRACE("(command=%x)\n", command);
return SendMessageW (GetParent (hwnd), WM_COMMAND,
MAKEWPARAM (GetWindowLongW (hwnd, GWL_ID), command), (LPARAM)hwnd);
}
@ -76,7 +76,7 @@ static INT IPADDRESS_IPNotify (IPADDRESS_INFO *infoPtr, INT field, INT value)
NMIPADDRESS nmip;
TRACE("(field=%x, value=%d)\n", field, value);
nmip.hdr.hwndFrom = infoPtr->Self;
nmip.hdr.idFrom = GetWindowLongW (infoPtr->Self, GWL_ID);
nmip.hdr.code = IPN_FIELDCHANGED;
@ -88,7 +88,7 @@ static INT IPADDRESS_IPNotify (IPADDRESS_INFO *infoPtr, INT field, INT value)
(WPARAM)nmip.hdr.idFrom, (LPARAM)&nmip);
TRACE("<-- %d\n", nmip.iValue);
return nmip.iValue;
}
@ -96,12 +96,12 @@ static INT IPADDRESS_IPNotify (IPADDRESS_INFO *infoPtr, INT field, INT value)
static int IPADDRESS_GetPartIndex(IPADDRESS_INFO *infoPtr, HWND hwnd)
{
int i;
TRACE("(hwnd=%x)\n", hwnd);
for (i = 0; i < 4; i++)
for (i = 0; i < 4; i++)
if (infoPtr->Part[i].EditHwnd == hwnd) return i;
ERR("We subclassed the wrong window! (hwnd=%x)\n", hwnd);
return -1;
}
@ -114,7 +114,7 @@ static LRESULT IPADDRESS_Draw (IPADDRESS_INFO *infoPtr, HDC hdc)
int i;
TRACE("\n");
GetClientRect (infoPtr->Self, &rect);
DrawEdge (hdc, &rect, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
@ -122,7 +122,7 @@ static LRESULT IPADDRESS_Draw (IPADDRESS_INFO *infoPtr, HDC hdc)
GetWindowRect (infoPtr->Part[i].EditHwnd, &rcPart);
pt.x = rcPart.right;
ScreenToClient(infoPtr->Self, &pt);
rect.left = pt.x;
rect.left = pt.x;
GetWindowRect (infoPtr->Part[i+1].EditHwnd, &rcPart);
pt.x = rcPart.left;
ScreenToClient(infoPtr->Self, &pt);
@ -142,10 +142,10 @@ static LRESULT IPADDRESS_Create (HWND hwnd)
WCHAR EDIT[] = { 'E', 'd', 'i', 't', 0 };
TRACE("\n");
SetWindowLongW (hwnd, GWL_STYLE,
GetWindowLongW(hwnd, GWL_STYLE) & ~WS_BORDER);
infoPtr = (IPADDRESS_INFO *)COMCTL32_Alloc (sizeof(IPADDRESS_INFO));
if (!infoPtr) return -1;
SetWindowLongW (hwnd, 0, (DWORD)infoPtr);
@ -158,22 +158,22 @@ static LRESULT IPADDRESS_Create (HWND hwnd)
edit.bottom = rcClient.bottom - 2;
infoPtr->Self = hwnd;
for (i = 0; i < 4; i++) {
IPPART_INFO* part = &infoPtr->Part[i];
part->LowerLimit = 0;
part->UpperLimit = 255;
edit.left = rcClient.left + i*fieldsize + 6;
edit.right = rcClient.left + (i+1)*fieldsize - 2;
part->EditHwnd =
CreateWindowW (EDIT, NULL, WS_CHILD | WS_VISIBLE | ES_CENTER,
edit.left, edit.top, edit.right - edit.left,
edit.bottom - edit.top, hwnd, (HMENU) 1,
edit.left, edit.top, edit.right - edit.left,
edit.bottom - edit.top, hwnd, (HMENU) 1,
GetWindowLongW (hwnd, GWL_HINSTANCE), NULL);
SetPropA(part->EditHwnd, IP_SUBCLASS_PROP, hwnd);
part->OrigProc = (WNDPROC)
SetWindowLongW (part->EditHwnd, GWL_WNDPROC,
SetWindowLongW (part->EditHwnd, GWL_WNDPROC,
(LONG)IPADDRESS_SubclassProc);
}
@ -186,7 +186,7 @@ static LRESULT IPADDRESS_Destroy (IPADDRESS_INFO *infoPtr)
int i;
TRACE("\n");
for (i = 0; i < 4; i++) {
IPPART_INFO* part = &infoPtr->Part[i];
SetWindowLongW (part->EditHwnd, GWL_WNDPROC, (LONG)part->OrigProc);
@ -203,9 +203,9 @@ static LRESULT IPADDRESS_Paint (IPADDRESS_INFO *infoPtr, HDC hdc)
PAINTSTRUCT ps;
TRACE("\n");
if (hdc) return IPADDRESS_Draw (infoPtr, hdc);
hdc = BeginPaint (infoPtr->Self, &ps);
IPADDRESS_Draw (infoPtr, hdc);
EndPaint (infoPtr->Self, &ps);
@ -236,7 +236,7 @@ static int IPADDRESS_GetAddress (IPADDRESS_INFO *infoPtr, LPDWORD ip_address)
for (i = 0; i < 4; i++) {
ip_addr *= 256;
if (GetWindowTextW (infoPtr->Part[i].EditHwnd, field, 4))
if (GetWindowTextW (infoPtr->Part[i].EditHwnd, field, 4))
ip_addr += atolW(field);
else
invalid++;
@ -267,7 +267,7 @@ static void IPADDRESS_ClearAddress (IPADDRESS_INFO *infoPtr)
TRACE("\n");
for (i = 0; i < 4; i++)
for (i = 0; i < 4; i++)
SetWindowTextW (infoPtr->Part[i].EditHwnd, nil);
}
@ -297,13 +297,13 @@ static LRESULT IPADDRESS_SetAddress (IPADDRESS_INFO *infoPtr, DWORD ip_address)
static void IPADDRESS_SetFocusToField (IPADDRESS_INFO *infoPtr, INT index)
{
TRACE("(index=%d)\n", index);
if (index > 3) {
for (index = 0; index < 4; index++)
if (!GetWindowTextLengthW(infoPtr->Part[index].EditHwnd)) break;
}
if (index < 9 || index > 3) index = 0;
SetFocus (infoPtr->Part[index].EditHwnd);
}
@ -317,20 +317,20 @@ static BOOL IPADDRESS_ConstrainField (IPADDRESS_INFO *infoPtr, int currentfield)
TRACE("(currentfield=%d)\n", currentfield);
if (currentfield < 0 || currentfield > 3) return FALSE;
if (!GetWindowTextW (part->EditHwnd, field, 4)) return FALSE;
curValue = atoiW(field);
TRACE(" curValue=%d\n", curValue);
newValue = IPADDRESS_IPNotify(infoPtr, currentfield, curValue);
TRACE(" newValue=%d\n", newValue);
if (newValue < part->LowerLimit) newValue = part->LowerLimit;
if (newValue > part->UpperLimit) newValue = part->UpperLimit;
if (newValue == curValue) return FALSE;
wsprintfW (field, fmt, newValue);
TRACE(" field='%s'\n", debugstr_w(field));
return SetWindowTextW (part->EditHwnd, field);
@ -343,7 +343,7 @@ static BOOL IPADDRESS_GotoNextField (IPADDRESS_INFO *infoPtr, int cur, int sel)
if(cur >= -1 && cur < 4) {
IPADDRESS_ConstrainField(infoPtr, cur);
if(cur < 3) {
IPPART_INFO *next = &infoPtr->Part[cur + 1];
int start = 0, end = 0;
@ -357,7 +357,7 @@ static BOOL IPADDRESS_GotoNextField (IPADDRESS_INFO *infoPtr, int cur, int sel)
}
return TRUE;
}
}
return FALSE;
}
@ -372,30 +372,30 @@ static BOOL IPADDRESS_GotoNextField (IPADDRESS_INFO *infoPtr, int cur, int sel)
*
* alpha characters: completely ignored
*
* digits: accepted when field text length < 2 ignored otherwise.
* when 3 numbers have been entered into the field the value
* of the field is checked, if the field value exceeds the
* maximum value and is changed the field remains the current
* field, otherwise focus moves to the field to the right
* digits: accepted when field text length < 2 ignored otherwise.
* when 3 numbers have been entered into the field the value
* of the field is checked, if the field value exceeds the
* maximum value and is changed the field remains the current
* field, otherwise focus moves to the field to the right
*
* tab: change focus from the current ipaddress control to the next
* control in the tab order
* tab: change focus from the current ipaddress control to the next
* control in the tab order
*
* right arrow: move to the field on the right to the left most
* position in that field if no text is selected,
* we are in the right most position in the field,
* we are not in the right most field
* right arrow: move to the field on the right to the left most
* position in that field if no text is selected,
* we are in the right most position in the field,
* we are not in the right most field
*
* left arrow: move to the field on the left to the right most
* position in that field if no text is selected,
* we are in the left most position in the current field
* and we are not in the left most field
* left arrow: move to the field on the left to the right most
* position in that field if no text is selected,
* we are in the left most position in the current field
* and we are not in the left most field
*
* backspace: delete the character to the left of the cursor position,
* if none are present move to the field on the left if
* we are not in the left most field and delete the right
* most digit in that field while keeping the cursor
* on the right side of the field
* backspace: delete the character to the left of the cursor position,
* if none are present move to the field on the left if
* we are not in the left most field and delete the right
* most digit in that field while keeping the cursor
* on the right side of the field
*/
LRESULT CALLBACK
IPADDRESS_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
@ -414,14 +414,14 @@ IPADDRESS_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
if (uMsg == WM_CHAR || uMsg == WM_KEYDOWN) {
len = GetWindowTextLengthW (hwnd);
SendMessageW(hwnd, EM_GETSEL, (WPARAM)&startsel, (LPARAM)&endsel);
}
}
switch (uMsg) {
case WM_CHAR:
case WM_CHAR:
if(isdigit(c)) {
if(len == 2 && startsel==endsel && endsel==len) {
/* process the digit press before we check the field */
int return_val = CallWindowProcW (part->OrigProc, hwnd, uMsg, wParam, lParam);
/* if the field value was changed stay at the current field */
if(!IPADDRESS_ConstrainField(infoPtr, index))
IPADDRESS_GotoNextField (infoPtr, index, POS_DEFAULT);
@ -429,14 +429,14 @@ IPADDRESS_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return return_val;
} else if (len == 3 && startsel==endsel && endsel==len)
IPADDRESS_GotoNextField (infoPtr, index, POS_SELALL);
else if (len < 3) break;
else if (len < 3) break;
} else if(c == '.' || c == ' ') {
if(len && startsel==endsel && startsel != 0) {
IPADDRESS_GotoNextField(infoPtr, index, POS_SELALL);
IPADDRESS_GotoNextField(infoPtr, index, POS_SELALL);
}
} else if (c == VK_BACK) break;
return 0;
case WM_KEYDOWN:
switch(c) {
case VK_RIGHT:
@ -455,17 +455,17 @@ IPADDRESS_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
if(startsel==endsel && startsel==0 && index > 0) {
IPPART_INFO *prev = &infoPtr->Part[index-1];
WCHAR val[10];
if(GetWindowTextW(prev->EditHwnd, val, 5)) {
val[lstrlenW(val) - 1] = 0;
SetWindowTextW(prev->EditHwnd, val);
}
IPADDRESS_GotoNextField(infoPtr, index - 2, POS_RIGHT);
return 0;
}
break;
}
}
break;
case WM_KILLFOCUS:
if (IPADDRESS_GetPartIndex(infoPtr, (HWND)wParam) < 0)
@ -484,12 +484,12 @@ static LRESULT WINAPI
IPADDRESS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
IPADDRESS_INFO *infoPtr = IPADDRESS_GetInfoPtr (hwnd);
TRACE("(hwnd=0x%x msg=0x%x wparam=0x%x lparam=0x%lx)\n", hwnd, uMsg, wParam, lParam);
if (!infoPtr && (uMsg != WM_CREATE))
return DefWindowProcW (hwnd, uMsg, wParam, lParam);
switch (uMsg)
{
case WM_CREATE:
@ -553,7 +553,7 @@ void IPADDRESS_Register (void)
wndClass.hCursor = LoadCursorW (0, IDC_IBEAMW);
wndClass.hbrBackground = GetStockObject(WHITE_BRUSH);
wndClass.lpszClassName = WC_IPADDRESSW;
RegisterClassW (&wndClass);
}

File diff suppressed because it is too large Load Diff

View File

@ -26,7 +26,7 @@
*
*
* FIXME: handle resources better (doesn't work now); also take care
of internationalization.
of internationalization.
* FIXME: keyboard handling.
*/
@ -54,7 +54,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(monthcal);
/* month', wait 500 ms before going */
/* to the next month */
#define MC_NEXTMONTHTIMER 1 /* Timer ID's */
#define MC_PREVMONTHTIMER 2
#define MC_PREVMONTHTIMER 2
typedef struct
{
@ -91,12 +91,12 @@ typedef struct
DWORD rangeValid;
SYSTEMTIME minDate;
SYSTEMTIME maxDate;
RECT rcClient; /* rect for whole client area */
RECT rcDraw; /* rect for drawable portion of client area */
RECT title; /* rect for the header above the calendar */
RECT titlebtnnext; /* the `next month' button in the header */
RECT titlebtnprev; /* the `prev month' button in the header */
RECT titlebtnprev; /* the `prev month' button in the header */
RECT titlemonth; /* the `month name' txt in the header */
RECT titleyear; /* the `year number' txt in the header */
RECT wdays; /* week days at top */
@ -141,7 +141,7 @@ const int mdays[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 0};
/* make sure that time is valid */
static int MONTHCAL_ValidateTime(SYSTEMTIME time)
static int MONTHCAL_ValidateTime(SYSTEMTIME time)
{
if(time.wMonth > 12) return FALSE;
if(time.wDayOfWeek > 6) return FALSE;
@ -156,7 +156,7 @@ static int MONTHCAL_ValidateTime(SYSTEMTIME time)
}
void MONTHCAL_CopyTime(const SYSTEMTIME *from, SYSTEMTIME *to)
void MONTHCAL_CopyTime(const SYSTEMTIME *from, SYSTEMTIME *to)
{
to->wYear = from->wYear;
to->wMonth = from->wMonth;
@ -169,7 +169,7 @@ void MONTHCAL_CopyTime(const SYSTEMTIME *from, SYSTEMTIME *to)
}
/* Note:Depending on DST, this may be offset by a day.
/* Note:Depending on DST, this may be offset by a day.
Need to find out if we're on a DST place & adjust the clock accordingly.
Above function assumes we have a valid data.
Valid for year>1752; 1 <= d <= 31, 1 <= m <= 12.
@ -182,15 +182,15 @@ static int MONTHCAL_CalculateDayOfWeek(DWORD day, DWORD month, DWORD year)
{
year-=(month < 3);
return((year + year/4 - year/100 + year/400 +
return((year + year/4 - year/100 + year/400 +
DayOfWeekTable[month-1] + day - 1 ) % 7);
}
/* From a given point, calculate the row (weekpos), column(daypos)
and day in the calendar. day== 0 mean the last day of tha last month
*/
static int MONTHCAL_CalcDayFromPos(MONTHCAL_INFO *infoPtr, int x, int y,
int *daypos,int *weekpos)
static int MONTHCAL_CalcDayFromPos(MONTHCAL_INFO *infoPtr, int x, int y,
int *daypos,int *weekpos)
{
int retval, firstDay;
@ -202,7 +202,7 @@ static int MONTHCAL_CalcDayFromPos(MONTHCAL_INFO *infoPtr, int x, int y,
*daypos = (x - infoPtr->days.left ) / infoPtr->width_increment;
*weekpos = (y - infoPtr->days.top ) / infoPtr->height_increment;
firstDay = (MONTHCAL_CalculateDayOfWeek(1, infoPtr->currentMonth, infoPtr->currentYear)+6 - infoPtr->firstDay)%7;
retval = *daypos + (7 * *weekpos) - firstDay;
return retval;
@ -211,7 +211,7 @@ static int MONTHCAL_CalcDayFromPos(MONTHCAL_INFO *infoPtr, int x, int y,
/* day is the day of the month, 1 == 1st day of the month */
/* sets x and y to be the position of the day */
/* x == day, y == week where(0,0) == firstDay, 1st week */
static void MONTHCAL_CalcDayXY(MONTHCAL_INFO *infoPtr, int day, int month,
static void MONTHCAL_CalcDayXY(MONTHCAL_INFO *infoPtr, int day, int month,
int *x, int *y)
{
int firstDay, prevMonth;
@ -227,7 +227,7 @@ static void MONTHCAL_CalcDayXY(MONTHCAL_INFO *infoPtr, int day, int month,
prevMonth = month - 1;
if(prevMonth==0)
prevMonth = 12;
*x = (MONTHCAL_MonthLength(prevMonth, infoPtr->currentYear) - firstDay) % 7;
*y = 0;
return;
@ -240,7 +240,7 @@ static void MONTHCAL_CalcDayXY(MONTHCAL_INFO *infoPtr, int day, int month,
/* x: column(day), y: row(week) */
static void MONTHCAL_CalcDayRect(MONTHCAL_INFO *infoPtr, RECT *r, int x, int y)
static void MONTHCAL_CalcDayRect(MONTHCAL_INFO *infoPtr, RECT *r, int x, int y)
{
r->left = infoPtr->days.left + x * infoPtr->width_increment;
r->right = r->left + infoPtr->width_increment;
@ -252,7 +252,7 @@ static void MONTHCAL_CalcDayRect(MONTHCAL_INFO *infoPtr, RECT *r, int x, int y)
/* sets the RECT struct r to the rectangle around the day and month */
/* day is the day value of the month(1 == 1st), month is the month */
/* value(january == 1, december == 12) */
static inline void MONTHCAL_CalcPosFromDay(MONTHCAL_INFO *infoPtr,
static inline void MONTHCAL_CalcPosFromDay(MONTHCAL_INFO *infoPtr,
int day, int month, RECT *r)
{
int x, y;
@ -278,7 +278,7 @@ int month)
x = day_rect.left;
y = day_rect.top;
points[0].x = x;
points[0].y = y - 1;
points[1].x = x + 0.8 * infoPtr->width_increment;
@ -287,7 +287,7 @@ int month)
points[2].y = y;
points[3].x = x + infoPtr->width_increment;
points[3].y = y + 0.5 * infoPtr->height_increment;
points[4].x = x + infoPtr->width_increment;
points[4].y = y + 0.9 * infoPtr->height_increment;
points[5].x = x + 0.6 * infoPtr->width_increment;
@ -295,7 +295,7 @@ int month)
points[6].x = x + 0.5 * infoPtr->width_increment;
points[6].y = y + 0.9 * infoPtr->height_increment; /* bring the bottom up just
a hair to fit inside the day rectangle */
points[7].x = x + 0.2 * infoPtr->width_increment;
points[7].y = y + 0.8 * infoPtr->height_increment;
points[8].x = x + 0.1 * infoPtr->width_increment;
@ -309,7 +309,7 @@ int month)
points[11].y = y + 0.3 * infoPtr->height_increment;
points[12].x = x + 0.4 * infoPtr->width_increment;
points[12].y = y + 0.2 * infoPtr->height_increment;
PolyBezier(hdc, points, 13);
DeleteObject(hRedPen);
SelectObject(hdc, hOldPen2);
@ -329,7 +329,7 @@ static void MONTHCAL_DrawDay(HDC hdc, MONTHCAL_INFO *infoPtr, int day, int month
sprintf(buf, "%d", day);
/* No need to check styles: when selection is not valid, it is set to zero.
/* No need to check styles: when selection is not valid, it is set to zero.
* 1<day<31, so evertyhing's OK.
*/
@ -390,7 +390,7 @@ static void MONTHCAL_DrawDay(HDC hdc, MONTHCAL_INFO *infoPtr, int day, int month
/* CHECKME: For `todays date', do we need to check the locale?*/
static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps)
static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps)
{
MONTHCAL_INFO *infoPtr=MONTHCAL_GetInfoPtr(hwnd);
RECT *rcClient=&infoPtr->rcClient;
@ -425,7 +425,7 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps)
/* fill background */
hbr = CreateSolidBrush (infoPtr->bk);
FillRect(hdc, rcClient, hbr);
DeleteObject(hbr);
DeleteObject(hbr);
/* draw header */
if(IntersectRect(&rcTemp, &(ps->rcPaint), title))
@ -434,10 +434,10 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps)
FillRect(hdc, title, hbr);
DeleteObject(hbr);
}
/* if the previous button is pressed draw it depressed */
if(IntersectRect(&rcTemp, &(ps->rcPaint), prev))
{
{
if((infoPtr->status & MC_PREVPRESSED))
DrawFrameControl(hdc, prev, DFC_SCROLL,
DFCS_SCROLLLEFT | DFCS_PUSHED |
@ -447,7 +447,7 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps)
DFCS_SCROLLLEFT |(dwStyle & WS_DISABLED ? DFCS_INACTIVE : 0));
}
/* if next button is depressed draw it depressed */
/* if next button is depressed draw it depressed */
if(IntersectRect(&rcTemp, &(ps->rcPaint), next))
{
if((infoPtr->status & MC_NEXTPRESSED))
@ -466,14 +466,14 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps)
/* titlemonth->left and right are set in MONTHCAL_UpdateSize */
titlemonth->left = title->left;
titlemonth->right = title->right;
GetLocaleInfoA( LOCALE_USER_DEFAULT,LOCALE_SMONTHNAME1+infoPtr->currentMonth -1,
buf1,sizeof(buf1));
sprintf(buf, "%s %ld", buf1, infoPtr->currentYear);
if(IntersectRect(&rcTemp, &(ps->rcPaint), titlemonth))
{
DrawTextA(hdc, buf, strlen(buf), titlemonth,
DrawTextA(hdc, buf, strlen(buf), titlemonth,
DT_CENTER | DT_VCENTER | DT_SINGLELINE);
}
@ -481,7 +481,7 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps)
/* titlemonth left/right contained rect for whole titletxt('June 1999')
* MCM_HitTestInfo wants month & year rects, so prepare these now.
*(no, we can't draw them separately; the whole text is centered)
*(no, we can't draw them separately; the whole text is centered)
*/
GetTextExtentPoint32A(hdc, buf, strlen(buf), &size);
titlemonth->left = title->right / 2 - size.cx / 2;
@ -489,7 +489,7 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps)
GetTextExtentPoint32A(hdc, buf1, strlen(buf1), &size);
titlemonth->right = titlemonth->left + size.cx;
titleyear->left = titlemonth->right;
/* draw month area */
rcTemp.top=infoPtr->wdays.top;
rcTemp.left=infoPtr->wdays.left;
@ -501,13 +501,13 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps)
FillRect(hdc, &rcTemp, hbr);
DeleteObject(hbr);
}
/* draw line under day abbreviatons */
MoveToEx(hdc, infoPtr->days.left + 3, title->bottom + textHeight + 1, NULL);
LineTo(hdc, rcDraw->right - 3, title->bottom + textHeight + 1);
prevMonth = infoPtr->currentMonth - 1;
if(prevMonth == 0) /* if currentMonth is january(1) prevMonth is */
prevMonth = 12; /* december(12) of the previous year */
@ -537,10 +537,10 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps)
}
/* draw day numbers; first, the previous month */
firstDay = MONTHCAL_CalculateDayOfWeek(1, infoPtr->currentMonth, infoPtr->currentYear);
day = MONTHCAL_MonthLength(prevMonth, infoPtr->currentYear) +
day = MONTHCAL_MonthLength(prevMonth, infoPtr->currentYear) +
(infoPtr->firstDay + 7 - firstDay)%7 + 1;
if (day > MONTHCAL_MonthLength(prevMonth, infoPtr->currentYear))
day -=7;
@ -553,7 +553,7 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps)
MONTHCAL_CalcDayRect(infoPtr, &rcDay, i, 0);
if(IntersectRect(&rcTemp, &(ps->rcPaint), &rcDay))
{
MONTHCAL_DrawDay(hdc, infoPtr, day, prevMonth, i, 0,
MONTHCAL_DrawDay(hdc, infoPtr, day, prevMonth, i, 0,
infoPtr->monthdayState[m] & mask);
}
@ -577,7 +577,7 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps)
if(IntersectRect(&rcTemp, &(ps->rcPaint), &rcDay))
{
MONTHCAL_DrawDay(hdc, infoPtr, day, infoPtr->currentMonth, i, 0,
MONTHCAL_DrawDay(hdc, infoPtr, day, infoPtr->currentMonth, i, 0,
infoPtr->monthdayState[m] & mask);
if((infoPtr->currentMonth==infoPtr->todaysDate.wMonth) &&
@ -595,7 +595,7 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps)
j = 1; /* move to the 2nd week of the current month */
i = 0; /* move back to sunday */
while(day <= MONTHCAL_MonthLength(infoPtr->currentMonth, infoPtr->currentYear)) {
while(day <= MONTHCAL_MonthLength(infoPtr->currentMonth, infoPtr->currentYear)) {
MONTHCAL_CalcDayRect(infoPtr, &rcDay, i, j);
if(IntersectRect(&rcTemp, &(ps->rcPaint), &rcDay))
{
@ -604,8 +604,8 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps)
if((infoPtr->currentMonth==infoPtr->todaysDate.wMonth) &&
(day==infoPtr->todaysDate.wDay) &&
(infoPtr->currentYear == infoPtr->todaysDate.wYear))
if(!(dwStyle & MCS_NOTODAYCIRCLE))
(infoPtr->currentYear == infoPtr->todaysDate.wYear))
if(!(dwStyle & MCS_NOTODAYCIRCLE))
MONTHCAL_CircleDay(hdc, infoPtr, day, infoPtr->currentMonth);
}
mask<<=1;
@ -627,14 +627,14 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps)
while((i<7) &&(j<6)) {
MONTHCAL_CalcDayRect(infoPtr, &rcDay, i, j);
if(IntersectRect(&rcTemp, &(ps->rcPaint), &rcDay))
{
{
MONTHCAL_DrawDay(hdc, infoPtr, day, infoPtr->currentMonth + 1, i, j,
infoPtr->monthdayState[m] & mask);
}
mask<<=1;
day++;
i++;
i++;
if(i==7) { /* past saturday, go to next week's sunday */
i = 0;
j++;
@ -650,8 +650,8 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps)
int offset = 0;
if(!(dwStyle & MCS_NOTODAYCIRCLE)) {
/*day is the number of days from nextmonth we put on the calendar */
MONTHCAL_CircleDay(hdc, infoPtr,
day+MONTHCAL_MonthLength(infoPtr->currentMonth,infoPtr->currentYear),
MONTHCAL_CircleDay(hdc, infoPtr,
day+MONTHCAL_MonthLength(infoPtr->currentMonth,infoPtr->currentYear),
infoPtr->currentMonth);
offset+=textWidth;
}
@ -674,7 +674,7 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps)
SelectObject(hdc, infoPtr->hFont);
}
/*eventually draw week numbers*/
/*eventually draw week numbers*/
if(dwStyle & MCS_WEEKNUMBERS) {
/* display weeknumbers*/
int mindays;
@ -682,7 +682,7 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps)
/* Rules what week to call the first week of a new year:
LOCALE_IFIRSTWEEKOFYEAR == 0 (e.g US?):
The week containing Jan 1 is the first week of year
LOCALE_IFIRSTWEEKOFYEAR == 2 (e.g. Germany):
LOCALE_IFIRSTWEEKOFYEAR == 2 (e.g. Germany):
First week of year must contain 4 days of the new year
LOCALE_IFIRSTWEEKOFYEAR == 1 (what contries?)
The first week of the year must contain only days of the new year
@ -704,12 +704,12 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps)
{
/* calculate all those exceptions for january */
weeknum1=MONTHCAL_CalculateDayOfWeek(1,1,infoPtr->currentYear);
if ((infoPtr->firstDay +7 - weeknum1)%7 > mindays)
if ((infoPtr->firstDay +7 - weeknum1)%7 > mindays)
weeknum =1;
else
{
weeknum = 0;
for(i=0; i<11; i++)
for(i=0; i<11; i++)
weeknum+=MONTHCAL_MonthLength(i+1, infoPtr->currentYear-1);
weeknum +=startofprescal+ 7;
weeknum /=7;
@ -721,7 +721,7 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps)
else
{
weeknum = 0;
for(i=0; i<prevMonth-1; i++)
for(i=0; i<prevMonth-1; i++)
weeknum+=MONTHCAL_MonthLength(i+1, infoPtr->currentYear);
weeknum +=startofprescal+ 7;
weeknum /=7;
@ -749,26 +749,26 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps)
days->top+=infoPtr->height_increment;
days->bottom+=infoPtr->height_increment;
}
MoveToEx(hdc, infoPtr->weeknums.right, infoPtr->weeknums.top + 3 , NULL);
LineTo(hdc, infoPtr->weeknums.right, infoPtr->weeknums.bottom );
}
/* currentFont was font at entering Refresh */
SetBkColor(hdc, oldBkColor);
SelectObject(hdc, currentFont);
SelectObject(hdc, currentFont);
SetTextColor(hdc, oldTextColor);
}
static LRESULT
static LRESULT
MONTHCAL_GetMinReqRect(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd);
LPRECT lpRect = (LPRECT) lParam;
TRACE("%x %lx\n", wParam, lParam);
/* validate parameters */
if((infoPtr==NULL) ||(lpRect == NULL) ) return FALSE;
@ -781,7 +781,7 @@ MONTHCAL_GetMinReqRect(HWND hwnd, WPARAM wParam, LPARAM lParam)
}
static LRESULT
static LRESULT
MONTHCAL_GetColor(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd);
@ -807,7 +807,7 @@ MONTHCAL_GetColor(HWND hwnd, WPARAM wParam, LPARAM lParam)
}
static LRESULT
static LRESULT
MONTHCAL_SetColor(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd);
@ -847,13 +847,13 @@ MONTHCAL_SetColor(HWND hwnd, WPARAM wParam, LPARAM lParam)
}
static LRESULT
static LRESULT
MONTHCAL_GetMonthDelta(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd);
TRACE("%x %lx\n", wParam, lParam);
if(infoPtr->delta)
return infoPtr->delta;
else
@ -861,24 +861,24 @@ MONTHCAL_GetMonthDelta(HWND hwnd, WPARAM wParam, LPARAM lParam)
}
static LRESULT
static LRESULT
MONTHCAL_SetMonthDelta(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd);
int prev = infoPtr->delta;
TRACE("%x %lx\n", wParam, lParam);
infoPtr->delta = (int)wParam;
return prev;
}
static LRESULT
static LRESULT
MONTHCAL_GetFirstDayOfWeek(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd);
return infoPtr->firstDay;
}
@ -887,7 +887,7 @@ MONTHCAL_GetFirstDayOfWeek(HWND hwnd, WPARAM wParam, LPARAM lParam)
/* 0 == Monday, 6 == Sunday */
/* FIXME: this needs to be implemented properly in MONTHCAL_Refresh() */
/* FIXME: we need more error checking here */
static LRESULT
static LRESULT
MONTHCAL_SetFirstDayOfWeek(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd);
@ -916,7 +916,7 @@ MONTHCAL_SetFirstDayOfWeek(HWND hwnd, WPARAM wParam, LPARAM lParam)
/* FIXME: fill this in */
static LRESULT
MONTHCAL_GetMonthRange(HWND hwnd, WPARAM wParam, LPARAM lParam)
MONTHCAL_GetMonthRange(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd);
@ -937,7 +937,7 @@ MONTHCAL_GetMaxTodayWidth(HWND hwnd)
/* FIXME: are validated times taken from current date/time or simply
* copied?
* copied?
* FIXME: check whether MCM_GETMONTHRANGE shows correct result after
* adjusting range with MCM_SETRANGE
*/
@ -950,7 +950,7 @@ MONTHCAL_SetRange(HWND hwnd, WPARAM wParam, LPARAM lParam)
int prev;
TRACE("%x %lx\n", wParam, lParam);
if(wParam & GDTR_MAX) {
if(MONTHCAL_ValidateTime(lprgSysTimeArray[1])){
MONTHCAL_CopyTime(&lprgSysTimeArray[1], &infoPtr->maxDate);
@ -973,8 +973,8 @@ MONTHCAL_SetRange(HWND hwnd, WPARAM wParam, LPARAM lParam)
prev = infoPtr->monthRange;
infoPtr->monthRange = infoPtr->maxDate.wMonth - infoPtr->minDate.wMonth;
if(infoPtr->monthRange!=prev) {
COMCTL32_ReAlloc(infoPtr->monthdayState,
if(infoPtr->monthRange!=prev) {
COMCTL32_ReAlloc(infoPtr->monthdayState,
infoPtr->monthRange * sizeof(MONTHDAYSTATE));
}
@ -983,7 +983,7 @@ MONTHCAL_SetRange(HWND hwnd, WPARAM wParam, LPARAM lParam)
/* CHECKME: At the moment, we copy ranges anyway,regardless of
* infoPtr->rangeValid; a invalid range is simply filled with zeros in
* infoPtr->rangeValid; a invalid range is simply filled with zeros in
* SetRange. Is this the right behavior?
*/
@ -1015,12 +1015,12 @@ MONTHCAL_SetDayState(HWND hwnd, WPARAM wParam, LPARAM lParam)
TRACE("%x %lx\n", wParam, lParam);
if(iMonths!=infoPtr->monthRange) return 0;
for(i=0; i<iMonths; i++)
for(i=0; i<iMonths; i++)
infoPtr->monthdayState[i] = dayStates[i];
return 1;
}
static LRESULT
static LRESULT
MONTHCAL_GetCurSel(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd);
@ -1036,7 +1036,7 @@ MONTHCAL_GetCurSel(HWND hwnd, WPARAM wParam, LPARAM lParam)
/* FIXME: if the specified date is not visible, make it visible */
/* FIXME: redraw? */
static LRESULT
static LRESULT
MONTHCAL_SetCurSel(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd);
@ -1057,7 +1057,7 @@ MONTHCAL_SetCurSel(HWND hwnd, WPARAM wParam, LPARAM lParam)
}
static LRESULT
static LRESULT
MONTHCAL_GetMaxSelCount(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd);
@ -1067,7 +1067,7 @@ MONTHCAL_GetMaxSelCount(HWND hwnd, WPARAM wParam, LPARAM lParam)
}
static LRESULT
static LRESULT
MONTHCAL_SetMaxSelCount(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd);
@ -1081,7 +1081,7 @@ MONTHCAL_SetMaxSelCount(HWND hwnd, WPARAM wParam, LPARAM lParam)
}
static LRESULT
static LRESULT
MONTHCAL_GetSelRange(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd);
@ -1100,12 +1100,12 @@ MONTHCAL_GetSelRange(HWND hwnd, WPARAM wParam, LPARAM lParam)
TRACE("[min,max]=[%d %d]\n", infoPtr->minSel.wDay, infoPtr->maxSel.wDay);
return TRUE;
}
return FALSE;
}
static LRESULT
static LRESULT
MONTHCAL_SetSelRange(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd);
@ -1124,12 +1124,12 @@ MONTHCAL_SetSelRange(HWND hwnd, WPARAM wParam, LPARAM lParam)
TRACE("[min,max]=[%d %d]\n", infoPtr->minSel.wDay, infoPtr->maxSel.wDay);
return TRUE;
}
return FALSE;
}
static LRESULT
static LRESULT
MONTHCAL_GetToday(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd);
@ -1145,7 +1145,7 @@ MONTHCAL_GetToday(HWND hwnd, WPARAM wParam, LPARAM lParam)
}
static LRESULT
static LRESULT
MONTHCAL_SetToday(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd);
@ -1170,15 +1170,15 @@ MONTHCAL_HitTest(HWND hwnd, LPARAM lParam)
UINT x,y;
DWORD retval;
int day,wday,wnum;
x = lpht->pt.x;
y = lpht->pt.y;
retval = MCHT_NOWHERE;
/* Comment in for debugging...
TRACE("%d %d wd[%d %d %d %d] d[%d %d %d %d] t[%d %d %d %d] wn[%d %d %d %d]\n", x, y,
/* Comment in for debugging...
TRACE("%d %d wd[%d %d %d %d] d[%d %d %d %d] t[%d %d %d %d] wn[%d %d %d %d]\n", x, y,
infoPtr->wdays.left, infoPtr->wdays.right,
infoPtr->wdays.top, infoPtr->wdays.bottom,
infoPtr->days.left, infoPtr->days.right,
@ -1190,7 +1190,7 @@ MONTHCAL_HitTest(HWND hwnd, LPARAM lParam)
*/
/* are we in the header? */
if(PtInRect(&infoPtr->title, lpht->pt)) {
if(PtInRect(&infoPtr->titlebtnprev, lpht->pt)) {
retval = MCHT_TITLEBTNPREV;
@ -1208,36 +1208,36 @@ MONTHCAL_HitTest(HWND hwnd, LPARAM lParam)
retval = MCHT_TITLEYEAR;
goto done;
}
retval = MCHT_TITLE;
goto done;
}
day = MONTHCAL_CalcDayFromPos(infoPtr,x,y,&wday,&wnum);
if(PtInRect(&infoPtr->wdays, lpht->pt)) {
retval = MCHT_CALENDARDAY;
lpht->st.wYear = infoPtr->currentYear;
lpht->st.wMonth = (day < 1)? infoPtr->currentMonth -1 : infoPtr->currentMonth;
lpht->st.wDay = (day < 1)?
lpht->st.wDay = (day < 1)?
MONTHCAL_MonthLength(infoPtr->currentMonth-1,infoPtr->currentYear) -day : day;
goto done;
}
if(PtInRect(&infoPtr->weeknums, lpht->pt)) {
retval = MCHT_CALENDARWEEKNUM;
if(PtInRect(&infoPtr->weeknums, lpht->pt)) {
retval = MCHT_CALENDARWEEKNUM;
lpht->st.wYear = infoPtr->currentYear;
lpht->st.wMonth = (day < 1) ? infoPtr->currentMonth -1 :
(day > MONTHCAL_MonthLength(infoPtr->currentMonth,infoPtr->currentYear)) ?
lpht->st.wMonth = (day < 1) ? infoPtr->currentMonth -1 :
(day > MONTHCAL_MonthLength(infoPtr->currentMonth,infoPtr->currentYear)) ?
infoPtr->currentMonth +1 :infoPtr->currentMonth;
lpht->st.wDay = (day < 1 ) ?
MONTHCAL_MonthLength(infoPtr->currentMonth-1,infoPtr->currentYear) -day :
(day > MONTHCAL_MonthLength(infoPtr->currentMonth,infoPtr->currentYear)) ?
lpht->st.wDay = (day < 1 ) ?
MONTHCAL_MonthLength(infoPtr->currentMonth-1,infoPtr->currentYear) -day :
(day > MONTHCAL_MonthLength(infoPtr->currentMonth,infoPtr->currentYear)) ?
day - MONTHCAL_MonthLength(infoPtr->currentMonth,infoPtr->currentYear) : day;
goto done;
goto done;
}
if(PtInRect(&infoPtr->days, lpht->pt))
if(PtInRect(&infoPtr->days, lpht->pt))
{
lpht->st.wYear = infoPtr->currentYear;
if ( day < 1)
if ( day < 1)
{
retval = MCHT_CALENDARDATEPREV;
lpht->st.wMonth = infoPtr->currentMonth - 1;
@ -1267,15 +1267,15 @@ MONTHCAL_HitTest(HWND hwnd, LPARAM lParam)
goto done;
}
if(PtInRect(&infoPtr->todayrect, lpht->pt)) {
retval = MCHT_TODAYLINK;
retval = MCHT_TODAYLINK;
goto done;
}
/* Hit nothing special? What's left must be background :-) */
retval = MCHT_CALENDARBK;
done:
retval = MCHT_CALENDARBK;
done:
lpht->uHit = retval;
return retval;
}
@ -1331,7 +1331,7 @@ static void MONTHCAL_GoToPrevMonth(HWND hwnd, MONTHCAL_INFO *infoPtr)
nmds.nmhdr.idFrom = GetWindowLongA(hwnd, GWL_ID);
nmds.nmhdr.code = MCN_GETDAYSTATE;
nmds.cDayState = infoPtr->monthRange;
nmds.prgDayState = COMCTL32_Alloc
nmds.prgDayState = COMCTL32_Alloc
(infoPtr->monthRange * sizeof(MONTHDAYSTATE));
SendMessageA(GetParent(hwnd), WM_NOTIFY,
@ -1348,7 +1348,7 @@ MONTHCAL_RButtonDown(HWND hwnd, WPARAM wParam, LPARAM lParam)
HMENU hMenu;
POINT menupoint;
char buf[32];
hMenu = CreatePopupMenu();
if (!LoadStringA(COMCTL32_hModule,IDM_GOTODAY,buf,sizeof(buf)))
{
@ -1365,7 +1365,7 @@ MONTHCAL_RButtonDown(HWND hwnd, WPARAM wParam, LPARAM lParam)
infoPtr->currentMonth=infoPtr->todaysDate.wMonth;
infoPtr->currentYear=infoPtr->todaysDate.wYear;
InvalidateRect(hwnd, NULL, FALSE);
}
}
return 0;
}
@ -1381,7 +1381,7 @@ MONTHCAL_LButtonDown(HWND hwnd, WPARAM wParam, LPARAM lParam)
int i;
POINT menupoint;
TRACE("%x %lx\n", wParam, lParam);
if (infoPtr->hWndYearUpDown)
{
infoPtr->currentYear=SendMessageA( infoPtr->hWndYearUpDown, UDM_SETPOS, (WPARAM) 0,(LPARAM)0);
@ -1399,7 +1399,7 @@ MONTHCAL_LButtonDown(HWND hwnd, WPARAM wParam, LPARAM lParam)
infoPtr->hWndYearEdit=0;
InvalidateRect(hwnd, NULL, FALSE);
}
ht.pt.x = (INT)LOWORD(lParam);
ht.pt.y = (INT)HIWORD(lParam);
hit = MONTHCAL_HitTest(hwnd, (LPARAM)&ht);
@ -1414,7 +1414,7 @@ MONTHCAL_LButtonDown(HWND hwnd, WPARAM wParam, LPARAM lParam)
InvalidateRect(hwnd, NULL, FALSE);
return TRUE;
}
if(hit == MCHT_TITLEBTNPREV){
if(hit == MCHT_TITLEBTNPREV){
MONTHCAL_GoToPrevMonth(hwnd, infoPtr);
infoPtr->status = MC_PREVPRESSED;
SetTimer(hwnd, MC_PREVMONTHTIMER, MC_NEXTMONTHDELAY, 0);
@ -1424,7 +1424,7 @@ MONTHCAL_LButtonDown(HWND hwnd, WPARAM wParam, LPARAM lParam)
if(hit == MCHT_TITLEMONTH) {
hMenu = CreatePopupMenu();
for (i=0; i<12;i++)
{
GetLocaleInfoA( LOCALE_USER_DEFAULT,LOCALE_SMONTHNAME1+i,
@ -1451,8 +1451,8 @@ MONTHCAL_LButtonDown(HWND hwnd, WPARAM wParam, LPARAM lParam)
infoPtr->titleyear.right-infoPtr->titleyear.left,
infoPtr->textHeight,
hwnd,
(HMENU)NULL,
(HINSTANCE)NULL,
(HMENU)NULL,
(HINSTANCE)NULL,
NULL);
infoPtr->hWndYearUpDown=CreateWindowExA(0,
UPDOWN_CLASSA,
@ -1462,14 +1462,14 @@ MONTHCAL_LButtonDown(HWND hwnd, WPARAM wParam, LPARAM lParam)
20,
infoPtr->textHeight,
hwnd,
(HMENU)NULL,
(HINSTANCE)NULL,
(HMENU)NULL,
(HINSTANCE)NULL,
NULL);
SendMessageA( infoPtr->hWndYearUpDown, UDM_SETRANGE, (WPARAM) 0, MAKELONG (9999, 1753));
SendMessageA( infoPtr->hWndYearUpDown, UDM_SETBUDDY, (WPARAM) infoPtr->hWndYearEdit, (LPARAM)0 );
SendMessageA( infoPtr->hWndYearUpDown, UDM_SETPOS, (WPARAM) 0,(LPARAM)infoPtr->currentYear );
return TRUE;
}
if(hit == MCHT_TODAYLINK) {
infoPtr->currentMonth=infoPtr->todaysDate.wMonth;
@ -1487,13 +1487,13 @@ MONTHCAL_LButtonDown(HWND hwnd, WPARAM wParam, LPARAM lParam)
nmsc.nmhdr.code = MCN_SELCHANGE;
MONTHCAL_CopyTime(&nmsc.stSelStart, &infoPtr->minSel);
MONTHCAL_CopyTime(&nmsc.stSelEnd, &infoPtr->maxSel);
SendMessageA(GetParent(hwnd), WM_NOTIFY,
(WPARAM)nmsc.nmhdr.idFrom,(LPARAM)&nmsc);
MONTHCAL_CopyTime(&ht.st, &selArray[0]);
MONTHCAL_CopyTime(&ht.st, &selArray[1]);
MONTHCAL_SetSelRange(hwnd,0,(LPARAM) &selArray);
MONTHCAL_SetSelRange(hwnd,0,(LPARAM) &selArray);
/* redraw both old and new days if the selected day changed */
if(infoPtr->curSelDay != ht.st.wDay) {
@ -1546,7 +1546,7 @@ MONTHCAL_LButtonUp(HWND hwnd, WPARAM wParam, LPARAM lParam)
InvalidateRect(hwnd, NULL, FALSE);
return TRUE;
}
if(hit == MCHT_CALENDARDATEPREV){
if(hit == MCHT_CALENDARDATEPREV){
MONTHCAL_GoToPrevMonth(hwnd, infoPtr);
InvalidateRect(hwnd, NULL, FALSE);
return TRUE;
@ -1564,14 +1564,14 @@ MONTHCAL_LButtonUp(HWND hwnd, WPARAM wParam, LPARAM lParam)
nmsc.nmhdr.code = MCN_SELECT;
MONTHCAL_CopyTime(&nmsc.stSelStart, &infoPtr->minSel);
MONTHCAL_CopyTime(&nmsc.stSelEnd, &infoPtr->maxSel);
SendMessageA(GetParent(hwnd), WM_NOTIFY,
(WPARAM)nmsc.nmhdr.idFrom, (LPARAM)&nmsc);
/* redraw if necessary */
if(redraw)
InvalidateRect(hwnd, NULL, FALSE);
return 0;
}
@ -1586,7 +1586,7 @@ MONTHCAL_Timer(HWND hwnd, WPARAM wParam, LPARAM lParam)
if(!infoPtr) return 0;
switch(wParam) {
case MC_NEXTMONTHTIMER:
case MC_NEXTMONTHTIMER:
redraw = TRUE;
MONTHCAL_GoToNextMonth(hwnd, infoPtr);
break;
@ -1618,9 +1618,9 @@ MONTHCAL_MouseMove(HWND hwnd, WPARAM wParam, LPARAM lParam)
ht.pt.x = LOWORD(lParam);
ht.pt.y = HIWORD(lParam);
hit = MONTHCAL_HitTest(hwnd, (LPARAM)&ht);
/* not on the calendar date numbers? bail out */
TRACE("hit:%x\n",hit);
if((hit & MCHT_CALENDARDATE) != MCHT_CALENDARDATE) return 0;
@ -1638,23 +1638,23 @@ MONTHCAL_MouseMove(HWND hwnd, WPARAM wParam, LPARAM lParam)
i = 0;
if(infoPtr->firstSelDay==selArray[0].wDay) i=1;
TRACE("oldRange:%d %d %d %d\n", infoPtr->firstSelDay, selArray[0].wDay, selArray[1].wDay, i);
if(infoPtr->firstSelDay==selArray[1].wDay) {
if(infoPtr->firstSelDay==selArray[1].wDay) {
/* 1st time we get here: selArray[0]=selArray[1]) */
/* if we're still at the first selected date, return */
if(infoPtr->firstSelDay==selday) goto done;
if(selday<infoPtr->firstSelDay) i = 0;
}
if(abs(infoPtr->firstSelDay - selday) >= infoPtr->maxSelCount) {
if(selday>infoPtr->firstSelDay)
selday = infoPtr->firstSelDay + infoPtr->maxSelCount;
else
selday = infoPtr->firstSelDay - infoPtr->maxSelCount;
}
if(selArray[i].wDay!=selday) {
TRACE("newRange:%d %d %d %d\n", infoPtr->firstSelDay, selArray[0].wDay, selArray[1].wDay, i);
selArray[i].wDay = selday;
if(selArray[0].wDay>selArray[1].wDay) {
@ -1712,7 +1712,7 @@ static LRESULT
MONTHCAL_SetFocus(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACE("\n");
InvalidateRect(hwnd, NULL, FALSE);
return 0;
@ -1769,15 +1769,15 @@ static void MONTHCAL_UpdateSize(HWND hwnd)
rcDraw->bottom = rcClient->bottom;
/* recalculate the height and width increments and offsets */
/* FIXME: We use up all available width. This will inhibit having multiple
calendars in a row, like win doesn
/* FIXME: We use up all available width. This will inhibit having multiple
calendars in a row, like win doesn
*/
if(dwStyle & MCS_WEEKNUMBERS)
xdiv=8.0;
else
xdiv=7.0;
infoPtr->width_increment = (infoPtr->rcDraw.right - infoPtr->rcDraw.left) / xdiv;
infoPtr->height_increment = (infoPtr->rcDraw.bottom - infoPtr->rcDraw.top) / 10.0;
infoPtr->width_increment = (infoPtr->rcDraw.right - infoPtr->rcDraw.left) / xdiv;
infoPtr->height_increment = (infoPtr->rcDraw.bottom - infoPtr->rcDraw.top) / 10.0;
infoPtr->left_offset = (infoPtr->rcDraw.right - infoPtr->rcDraw.left) - (infoPtr->width_increment * xdiv);
infoPtr->top_offset = (infoPtr->rcDraw.bottom - infoPtr->rcDraw.top) - (infoPtr->height_increment * 10.0);
@ -1790,7 +1790,7 @@ static void MONTHCAL_UpdateSize(HWND hwnd)
/*if((rcDraw->top + 9 * infoPtr->textHeight + 5) < rcDraw->bottom) {
rcDraw->bottom = rcDraw->top + 9 * infoPtr->textHeight + 5;
}*/
/* calculate title area */
title->top = rcClient->top;
title->bottom = title->top + 2 * infoPtr->height_increment;
@ -1805,17 +1805,17 @@ static void MONTHCAL_UpdateSize(HWND hwnd)
prev->right = prev->left + (title->bottom - title->top) ;
next->right = title->right - 6;
next->left = next->right - (title->bottom - title->top);
/* titlemonth->left and right change based upon the current month */
/* and are recalculated in refresh as the current month may change */
/* without the control being resized */
titlemonth->top = titleyear->top = title->top + (infoPtr->height_increment)/2;
titlemonth->bottom = titleyear->bottom = title->bottom - (infoPtr->height_increment)/2;
/* setup the dimensions of the rectangle we draw the names of the */
/* days of the week in */
weeknumrect->left =infoPtr->left_offset;
if(dwStyle & MCS_WEEKNUMBERS)
if(dwStyle & MCS_WEEKNUMBERS)
weeknumrect->right=prev->right;
else
weeknumrect->right=weeknumrect->left;
@ -1823,16 +1823,16 @@ static void MONTHCAL_UpdateSize(HWND hwnd)
wdays->right = days->right = wdays->left + 7 * infoPtr->width_increment;
wdays->top = title->bottom ;
wdays->bottom = wdays->top + infoPtr->height_increment;
days->top = weeknumrect->top = wdays->bottom ;
days->bottom = weeknumrect->bottom = days->top + 6 * infoPtr->height_increment;
todayrect->left = rcClient->left;
todayrect->right = rcClient->right;
todayrect->top = days->bottom;
todayrect->bottom = days->bottom + infoPtr->height_increment;
/* uncomment for excessive debugging
/* uncomment for excessive debugging
TRACE("dx=%d dy=%d rcC[%d %d %d %d] t[%d %d %d %d] wd[%d %d %d %d] w[%d %d %d %d] t[%d %d %d %d]\n",
infoPtr->width_increment,infoPtr->height_increment,
rcClient->left, rcClient->right, rcClient->top, rcClient->bottom,
@ -1841,9 +1841,9 @@ static void MONTHCAL_UpdateSize(HWND hwnd)
days->left, days->right, days->top, days->bottom,
todayrect->left,todayrect->right,todayrect->top,todayrect->bottom);
*/
/* restore the originally selected font */
SelectObject(hdc, currentFont);
SelectObject(hdc, currentFont);
ReleaseDC(hwnd, hdc);
}
@ -1896,7 +1896,7 @@ MONTHCAL_Create(HWND hwnd, WPARAM wParam, LPARAM lParam)
MONTHCAL_CopyTime(&infoPtr->todaysDate, &infoPtr->maxDate);
infoPtr->maxSelCount = 7;
infoPtr->monthRange = 3;
infoPtr->monthdayState = COMCTL32_Alloc
infoPtr->monthdayState = COMCTL32_Alloc
(infoPtr->monthRange * sizeof(MONTHDAYSTATE));
infoPtr->titlebk = GetSysColor(COLOR_ACTIVECAPTION);
infoPtr->titletxt = GetSysColor(COLOR_WINDOW);
@ -2054,7 +2054,7 @@ MONTHCAL_Register(void)
wndClass.hCursor = LoadCursorA(0, IDC_ARROWA);
wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
wndClass.lpszClassName = MONTHCAL_CLASSA;
RegisterClassA(&wndClass);
}

View File

@ -123,7 +123,7 @@ NATIVEFONT_Register (void)
wndClass.hCursor = LoadCursorA (0, IDC_ARROWA);
wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
wndClass.lpszClassName = WC_NATIVEFONTCTLA;
RegisterClassA (&wndClass);
}

View File

@ -44,7 +44,7 @@ typedef struct
INT nButtonSize;/* size of the pager btns */
INT nPos; /* scroll position */
INT nWidth; /* from child wnd's response to PGN_CALCSIZE */
INT nHeight; /* from child wnd's response to PGN_CALCSIZE */
INT nHeight; /* from child wnd's response to PGN_CALCSIZE */
BOOL bForward; /* forward WM_MOUSEMOVE msgs to the contained wnd */
BOOL bCapture; /* we have captured the mouse */
INT TLbtnState; /* state of top or left btn */
@ -63,7 +63,7 @@ typedef struct
#define INITIAL_DELAY 500
#define REPEAT_DELAY 50
/* the horizontal arrows are:
/* the horizontal arrows are:
*
* 01234 01234
* 1 * *
@ -72,7 +72,7 @@ typedef struct
* 4*** ***
* 5 ** **
* 6 * *
* 7
* 7
*
*/
static void
@ -115,10 +115,10 @@ PAGER_DrawHorzArrow (HDC hdc, RECT r, INT colorRef, BOOL left)
DeleteObject( hPen );
}
/* the vertical arrows are:
/* the vertical arrows are:
*
* 01234567 01234567
* 1****** **
* 1****** **
* 2 **** ****
* 3 ** ******
* 4
@ -175,14 +175,14 @@ PAGER_DrawButton(HDC hdc, COLORREF clrBk, RECT arrowRect,
return;
if ((rc.right - rc.left <= 0) || (rc.bottom - rc.top <= 0))
return;
return;
hBrush = CreateSolidBrush(clrBk);
hOldBrush = (HBRUSH)SelectObject(hdc, hBrush);
FillRect(hdc, &rc, hBrush);
if (btnState == PGF_HOT)
if (btnState == PGF_HOT)
{
DrawEdge( hdc, &rc, BDR_RAISEDINNER, BF_RECT);
if (horz)
@ -190,7 +190,7 @@ PAGER_DrawButton(HDC hdc, COLORREF clrBk, RECT arrowRect,
else
PAGER_DrawVertArrow(hdc, rc, COLOR_WINDOWFRAME, topLeft);
}
else if (btnState == PGF_NORMAL)
else if (btnState == PGF_NORMAL)
{
DrawEdge (hdc, &rc, BDR_OUTER, BF_FLAT);
if (horz)
@ -198,7 +198,7 @@ PAGER_DrawButton(HDC hdc, COLORREF clrBk, RECT arrowRect,
else
PAGER_DrawVertArrow(hdc, rc, COLOR_WINDOWFRAME, topLeft);
}
else if (btnState == PGF_DEPRESSED)
else if (btnState == PGF_DEPRESSED)
{
DrawEdge( hdc, &rc, BDR_SUNKENOUTER, BF_RECT);
if (horz)
@ -206,7 +206,7 @@ PAGER_DrawButton(HDC hdc, COLORREF clrBk, RECT arrowRect,
else
PAGER_DrawVertArrow(hdc, rc, COLOR_WINDOWFRAME, topLeft);
}
else if (btnState == PGF_GRAYED)
else if (btnState == PGF_GRAYED)
{
DrawEdge (hdc, &rc, BDR_OUTER, BF_FLAT);
if (horz)
@ -246,7 +246,7 @@ static void PAGER_CaptureandTrack(PAGER_INFO *infoPtr, HWND hwnd)
/* Make sure tracking is enabled so we receive a WM_MOUSELEAVE message */
if(!(trackinfo.dwFlags & TME_LEAVE)) {
trackinfo.dwFlags = TME_LEAVE; /* notify upon leaving */
/* call TRACKMOUSEEVENT so we receive a WM_MOUSELEAVE message */
/* and can properly deactivate the hot button */
_TrackMouseEvent(&trackinfo);
@ -270,7 +270,7 @@ PAGER_ForwardMouse (HWND hwnd, WPARAM wParam)
static inline LRESULT
PAGER_GetButtonState (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
LRESULT btnState = PGF_INVISIBLE;
INT btn = (INT)lParam;
TRACE("[%08x]\n", hwnd);
@ -287,7 +287,7 @@ PAGER_GetButtonState (HWND hwnd, WPARAM wParam, LPARAM lParam)
static inline LRESULT
PAGER_GetPos(HWND hwnd)
{
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
TRACE("[%08x] returns %d\n", hwnd, infoPtr->nPos);
return (LRESULT)infoPtr->nPos;
}
@ -295,7 +295,7 @@ PAGER_GetPos(HWND hwnd)
static inline LRESULT
PAGER_GetButtonSize(HWND hwnd)
{
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
TRACE("[%08x] returns %d\n", hwnd, infoPtr->nButtonSize);
return (LRESULT)infoPtr->nButtonSize;
}
@ -303,7 +303,7 @@ PAGER_GetButtonSize(HWND hwnd)
static inline LRESULT
PAGER_GetBorder(HWND hwnd)
{
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
TRACE("[%08x] returns %d\n", hwnd, infoPtr->nBorder);
return (LRESULT)infoPtr->nBorder;
}
@ -311,13 +311,13 @@ PAGER_GetBorder(HWND hwnd)
static inline LRESULT
PAGER_GetBkColor(HWND hwnd)
{
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
TRACE("[%08x] returns %06lx\n", hwnd, infoPtr->clrBk);
return (LRESULT)infoPtr->clrBk;
}
static void
PAGER_CalcSize (HWND hwnd, INT* size, BOOL getWidth)
static void
PAGER_CalcSize (HWND hwnd, INT* size, BOOL getWidth)
{
NMPGCALCSIZE nmpgcs;
ZeroMemory (&nmpgcs, sizeof (NMPGCALCSIZE));
@ -370,7 +370,7 @@ PAGER_PositionChildWnd(HWND hwnd, PAGER_INFO* infoPtr)
if (infoPtr->nHeight < wndSize)
infoPtr->nHeight = wndSize;
TRACE("[%08x] SWP %dx%d at (%d,%d)\n", hwnd,
TRACE("[%08x] SWP %dx%d at (%d,%d)\n", hwnd,
infoPtr->nWidth, infoPtr->nHeight,
0, -nPos);
SetWindowPos(infoPtr->hwndChild, 0,
@ -416,7 +416,7 @@ PAGER_GetScrollRange(HWND hwnd, PAGER_INFO* infoPtr)
return scrollRange;
}
static void
static void
PAGER_GrayAndRestoreBtns(PAGER_INFO* infoPtr, INT scrollRange,
BOOL* needsResize, BOOL* needsRepaint)
{
@ -453,7 +453,7 @@ PAGER_GrayAndRestoreBtns(PAGER_INFO* infoPtr, INT scrollRange,
}
static void
static void
PAGER_NormalizeBtns(PAGER_INFO* infoPtr, BOOL* needsRepaint)
{
if (infoPtr->TLbtnState & (PGF_HOT | PGF_DEPRESSED))
@ -469,7 +469,7 @@ PAGER_NormalizeBtns(PAGER_INFO* infoPtr, BOOL* needsRepaint)
}
}
static void
static void
PAGER_HideGrayBtns(PAGER_INFO* infoPtr, BOOL* needsResize)
{
if (infoPtr->TLbtnState == PGF_GRAYED)
@ -501,16 +501,16 @@ PAGER_UpdateBtns(HWND hwnd, PAGER_INFO *infoPtr,
PAGER_HideGrayBtns(infoPtr, &resizeClient);
if (resizeClient) /* initiate NCCalcSize to resize client wnd */ {
SetWindowPos(hwnd, 0,0,0,0,0,
SetWindowPos(hwnd, 0,0,0,0,0,
SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE |
SWP_NOZORDER | SWP_NOACTIVATE);
}
if (repaintBtns)
SendMessageA(hwnd, WM_NCPAINT, 0, 0);
SendMessageA(hwnd, WM_NCPAINT, 0, 0);
}
static LRESULT
static LRESULT
PAGER_SetPos(HWND hwnd, INT newPos, BOOL fromBtnPress)
{
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
@ -568,7 +568,7 @@ PAGER_HandleWindowPosChanging(HWND hwnd, WPARAM wParam, WINDOWPOS *winpos)
return 1;
}
static INT
static INT
PAGER_SetFixedWidth(HWND hwnd, PAGER_INFO* infoPtr)
{
/* Must set the non-scrollable dimension to be less than the full height/width
@ -599,7 +599,7 @@ PAGER_SetFixedWidth(HWND hwnd, PAGER_INFO* infoPtr)
return h;
}
static INT
static INT
PAGER_SetFixedHeight(HWND hwnd, PAGER_INFO* infoPtr)
{
/* Must set the non-scrollable dimension to be less than the full height/width
@ -658,7 +658,7 @@ PAGER_RecalcSize(HWND hwnd)
infoPtr->nPos = -1;
PAGER_SetPos(hwnd, 0, FALSE);
}
else
else
{
PAGER_UpdateBtns(hwnd, infoPtr, scrollRange, TRUE);
PAGER_PositionChildWnd(hwnd, infoPtr);
@ -679,7 +679,7 @@ PAGER_SetBkColor (HWND hwnd, WPARAM wParam, LPARAM lParam)
TRACE("[%08x] %06lx\n", hwnd, infoPtr->clrBk);
/* the native control seems to do things this way */
SetWindowPos(hwnd, 0,0,0,0,0,
SetWindowPos(hwnd, 0,0,0,0,0,
SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE |
SWP_NOZORDER | SWP_NOACTIVATE);
@ -734,14 +734,14 @@ PAGER_SetChild (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (PAGER_IsHorizontal(hwnd)) {
hw = PAGER_SetFixedHeight(hwnd, infoPtr);
/* adjust non-scrollable dimension to fit the child */
SetWindowPos(hwnd, 0, 0,0, hw, infoPtr->nHeight,
SetWindowPos(hwnd, 0, 0,0, hw, infoPtr->nHeight,
SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOZORDER |
SWP_NOSIZE | SWP_NOACTIVATE);
}
else {
hw = PAGER_SetFixedWidth(hwnd, infoPtr);
/* adjust non-scrollable dimension to fit the child */
SetWindowPos(hwnd, 0, 0,0, infoPtr->nWidth, hw,
SetWindowPos(hwnd, 0, 0,0, infoPtr->nWidth, hw,
SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOZORDER |
SWP_NOSIZE | SWP_NOACTIVATE);
}
@ -772,8 +772,8 @@ PAGER_Scroll(HWND hwnd, INT dir)
nmpgScroll.hdr.idFrom = GetWindowLongA (hwnd, GWL_ID);
nmpgScroll.hdr.code = PGN_SCROLL;
GetWindowRect(hwnd, &rcWnd);
GetClientRect(hwnd, &nmpgScroll.rcParent);
GetWindowRect(hwnd, &rcWnd);
GetClientRect(hwnd, &nmpgScroll.rcParent);
nmpgScroll.iXpos = nmpgScroll.iYpos = 0;
nmpgScroll.iDir = dir;
@ -788,10 +788,10 @@ PAGER_Scroll(HWND hwnd, INT dir)
nmpgScroll.iYpos = infoPtr->nPos;
}
nmpgScroll.iScroll -= 2*infoPtr->nButtonSize;
SendMessageA (GetParent(hwnd), WM_NOTIFY,
(WPARAM)nmpgScroll.hdr.idFrom, (LPARAM)&nmpgScroll);
TRACE("[%08x] PGN_SCROLL returns iScroll=%d\n", hwnd, nmpgScroll.iScroll);
if (nmpgScroll.iScroll > 0)
@ -814,12 +814,12 @@ PAGER_FmtLines(HWND hwnd)
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
/* initiate NCCalcSize to resize client wnd and get size */
SetWindowPos(hwnd, 0, 0,0,0,0,
SetWindowPos(hwnd, 0, 0,0,0,0,
SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE |
SWP_NOZORDER | SWP_NOACTIVATE);
SetWindowPos(infoPtr->hwndChild, 0,
0,0,infoPtr->nWidth,infoPtr->nHeight,
SetWindowPos(infoPtr->hwndChild, 0,
0,0,infoPtr->nWidth,infoPtr->nHeight,
0);
return DefWindowProcA (hwnd, EM_FMTLINES, 0, 0);
@ -890,11 +890,11 @@ PAGER_NCCalcSize(HWND hwnd, WPARAM wParam, LPARAM lParam)
/*
* lParam points to a RECT struct. On entry, the struct
* contains the proposed wnd rectangle for the window.
* contains the proposed wnd rectangle for the window.
* On exit, the struct should contain the screen
* coordinates of the corresponding window's client area.
*/
DefWindowProcA (hwnd, WM_NCCALCSIZE, wParam, lParam);
TRACE("orig rect=(%d,%d)-(%d,%d)\n",
@ -941,7 +941,7 @@ PAGER_NCCalcSize(HWND hwnd, WPARAM wParam, LPARAM lParam)
}
else
{
/* native does: (from trace of IE4 opening "Favorites" frame)
/* native does: (from trace of IE4 opening "Favorites" frame)
* DefWindowProc
* WM_NOITFY PGN_CALCSIZE w/ dwFlag=2
* GetWindowRect (child, &rc)
@ -1003,7 +1003,7 @@ PAGER_NCCalcSize(HWND hwnd, WPARAM wParam, LPARAM lParam)
lpRect->bottom = infoPtr->nHeight;
}
TRACE("[%08x] client rect set to %dx%d at (%d,%d) BtnState[%d,%d]\n",
TRACE("[%08x] client rect set to %dx%d at (%d,%d) BtnState[%d,%d]\n",
hwnd, lpRect->right-lpRect->left, lpRect->bottom-lpRect->top,
lpRect->left, lpRect->top,
infoPtr->TLbtnState, infoPtr->BRbtnState);
@ -1046,13 +1046,13 @@ PAGER_NCPaint (HWND hwnd, WPARAM wParam, LPARAM lParam)
PAGER_DrawButton(hdc, infoPtr->clrBk, rcTopLeft,
bHorizontal, TRUE, infoPtr->TLbtnState);
PAGER_DrawButton(hdc, infoPtr->clrBk, rcBottomRight,
bHorizontal, FALSE, infoPtr->BRbtnState);
bHorizontal, FALSE, infoPtr->BRbtnState);
ReleaseDC( hwnd, hdc );
return 0;
}
static INT
static INT
PAGER_HitTest (HWND hwnd, LPPOINT pt)
{
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
@ -1145,7 +1145,7 @@ PAGER_SetCursor( HWND hwnd, WPARAM wParam, LPARAM lParam )
{
PAGER_CaptureandTrack(infoPtr, hwnd);
SendMessageA(hwnd, WM_NCPAINT, 0, 0);
SendMessageA(hwnd, WM_NCPAINT, 0, 0);
}
return TRUE;
@ -1226,7 +1226,7 @@ PAGER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
/* If in one of the buttons the capture and draw buttons */
if (btnrect) {
TRACE("[%08x] draw btn (%d,%d)-(%d,%d), Capture %s, style %08lx\n",
hwnd, btnrect->left, btnrect->top,
hwnd, btnrect->left, btnrect->top,
btnrect->right, btnrect->bottom,
(infoPtr->bCapture) ? "TRUE" : "FALSE",
dwStyle);
@ -1276,7 +1276,7 @@ PAGER_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
INT hit;
TRACE("[%08x] at (%d,%d)\n", hwnd, SLOWORD(lParam), SHIWORD(lParam));
hit = PAGER_HitTest(hwnd, &pt);
/* put btn in DEPRESSED state */
@ -1284,17 +1284,17 @@ PAGER_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
repaintBtns = infoPtr->TLbtnState != PGF_DEPRESSED;
infoPtr->TLbtnState = PGF_DEPRESSED;
SetTimer(hwnd, TIMERID1, INITIAL_DELAY, 0);
SetTimer(hwnd, TIMERID1, INITIAL_DELAY, 0);
}
else if (hit == HTRIGHT || hit == HTBOTTOM)
{
repaintBtns = infoPtr->BRbtnState != PGF_DEPRESSED;
infoPtr->BRbtnState = PGF_DEPRESSED;
SetTimer(hwnd, TIMERID1, INITIAL_DELAY, 0);
SetTimer(hwnd, TIMERID1, INITIAL_DELAY, 0);
}
if (repaintBtns)
SendMessageA(hwnd, WM_NCPAINT, 0, 0);
SendMessageA(hwnd, WM_NCPAINT, 0, 0);
switch(hit)
{
@ -1357,11 +1357,11 @@ PAGER_Timer (HWND hwnd, WPARAM wParam)
/* if initial timer, kill it and start the repeat timer */
if (wParam == TIMERID1) {
if (PAGER_IsHorizontal(hwnd)) {
dir = (infoPtr->TLbtnState & PGF_DEPRESSED) ?
dir = (infoPtr->TLbtnState & PGF_DEPRESSED) ?
PGF_SCROLLLEFT : PGF_SCROLLRIGHT;
}
else {
dir = (infoPtr->TLbtnState & PGF_DEPRESSED) ?
dir = (infoPtr->TLbtnState & PGF_DEPRESSED) ?
PGF_SCROLLUP : PGF_SCROLLDOWN;
}
TRACE("[%08x] TIMERID1: style=%08lx, dir=%d\n", hwnd, dwStyle, dir);
@ -1369,7 +1369,7 @@ PAGER_Timer (HWND hwnd, WPARAM wParam)
SetTimer(hwnd, TIMERID1, REPEAT_DELAY, 0);
if (dwStyle & PGS_AUTOSCROLL) {
PAGER_Scroll(hwnd, dir);
SetWindowPos(hwnd, 0,0,0,0,0,
SetWindowPos(hwnd, 0,0,0,0,0,
SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE |
SWP_NOZORDER | SWP_NOACTIVATE);
}
@ -1381,7 +1381,7 @@ PAGER_Timer (HWND hwnd, WPARAM wParam)
KillTimer(hwnd, TIMERID2);
if (infoPtr->direction > 0) {
PAGER_Scroll(hwnd, infoPtr->direction);
SetTimer(hwnd, TIMERID2, REPEAT_DELAY, 0);
SetTimer(hwnd, TIMERID2, REPEAT_DELAY, 0);
}
return 0;
}
@ -1485,7 +1485,7 @@ PAGER_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case PGM_RECALCSIZE:
return PAGER_RecalcSize(hwnd);
case PGM_SETBKCOLOR:
return PAGER_SetBkColor (hwnd, wParam, lParam);
@ -1536,7 +1536,7 @@ PAGER_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return PAGER_MouseMove (hwnd, wParam, lParam);
case WM_MOUSELEAVE:
return PAGER_MouseLeave (hwnd, wParam, lParam);
return PAGER_MouseLeave (hwnd, wParam, lParam);
case WM_NCLBUTTONDOWN:
return PAGER_NCLButtonDown (hwnd, wParam, lParam);
@ -1552,7 +1552,7 @@ PAGER_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return PAGER_EraseBackground (hwnd, wParam, lParam);
/*
case WM_PAINT:
return PAGER_Paint (hwnd, wParam);
return PAGER_Paint (hwnd, wParam);
*/
case WM_TIMER:
return PAGER_Timer (hwnd, wParam);
@ -1582,7 +1582,7 @@ PAGER_Register (void)
wndClass.hCursor = LoadCursorA (0, IDC_ARROWA);
wndClass.hbrBackground = 0;
wndClass.lpszClassName = WC_PAGESCROLLERA;
RegisterClassA (&wndClass);
}

View File

@ -1,4 +1,4 @@
/*
/*
* Progress control
*
* Copyright 1997, 2002 Dimitrie O. Paun
@ -44,7 +44,7 @@ typedef struct
#define UNKNOWN_PARAM(msg, wParam, lParam) WARN( \
"Unknown parameter(s) for message " #msg \
"(%04x): wp=%04x lp=%08lx\n", msg, wParam, lParam);
"(%04x): wp=%04x lp=%08lx\n", msg, wParam, lParam);
/***********************************************************************
* PROGRESS_EraseBackground
@ -103,14 +103,14 @@ static LRESULT PROGRESS_Draw (PROGRESS_INFO *infoPtr, HDC hdc)
/* compute extent of progress bar */
if (dwStyle & PBS_VERTICAL) {
rightBar = rect.bottom -
rightBar = rect.bottom -
MulDiv (infoPtr->CurVal - infoPtr->MinVal,
rect.bottom - rect.top,
infoPtr->MaxVal - infoPtr->MinVal);
ledWidth = MulDiv (rect.right - rect.left, 2, 3);
rightMost = rect.top;
} else {
rightBar = rect.left +
rightBar = rect.left +
MulDiv (infoPtr->CurVal - infoPtr->MinVal,
rect.right - rect.left,
infoPtr->MaxVal - infoPtr->MinVal);
@ -120,14 +120,14 @@ static LRESULT PROGRESS_Draw (PROGRESS_INFO *infoPtr, HDC hdc)
/* now draw the bar */
if (dwStyle & PBS_SMOOTH) {
if (dwStyle & PBS_VERTICAL)
if (dwStyle & PBS_VERTICAL)
rect.top = rightBar;
else
else
rect.right = rightBar;
FillRect(hdc, &rect, hbrBar);
} else {
if (dwStyle & PBS_VERTICAL) {
while(rect.bottom > rightBar) {
while(rect.bottom > rightBar) {
rect.top = rect.bottom - ledWidth;
if (rect.top < rightMost)
rect.top = rightMost;
@ -135,7 +135,7 @@ static LRESULT PROGRESS_Draw (PROGRESS_INFO *infoPtr, HDC hdc)
rect.bottom = rect.top - LED_GAP;
}
} else {
while(rect.left < rightBar) {
while(rect.left < rightBar) {
rect.right = rect.left + ledWidth;
if (rect.right > rightMost)
rect.right = rightMost;
@ -200,7 +200,7 @@ static DWORD PROGRESS_SetRange (PROGRESS_INFO *infoPtr, int low, int high)
/* if nothing changes, simply return */
if(infoPtr->MinVal == low && infoPtr->MaxVal == high) return res;
infoPtr->MinVal = low;
infoPtr->MaxVal = high;
PROGRESS_CoercePos(infoPtr);
@ -210,7 +210,7 @@ static DWORD PROGRESS_SetRange (PROGRESS_INFO *infoPtr, int low, int high)
/***********************************************************************
* ProgressWindowProc
*/
static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam)
{
PROGRESS_INFO *infoPtr;
@ -220,7 +220,7 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
infoPtr = (PROGRESS_INFO *)GetWindowLongW(hwnd, 0);
if (!infoPtr && message != WM_CREATE)
return DefWindowProcW( hwnd, message, wParam, lParam );
return DefWindowProcW( hwnd, message, wParam, lParam );
switch(message) {
case WM_CREATE:
@ -240,9 +240,9 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
/* initialize the info struct */
infoPtr->Self = hwnd;
infoPtr->MinVal = 0;
infoPtr->MinVal = 0;
infoPtr->MaxVal = 100;
infoPtr->CurVal = 0;
infoPtr->CurVal = 0;
infoPtr->Step = 10;
infoPtr->ColorBar = CLR_DEFAULT;
infoPtr->ColorBk = CLR_DEFAULT;
@ -250,7 +250,7 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
TRACE("Progress Ctrl creation, hwnd=%04x\n", hwnd);
return 0;
}
case WM_DESTROY:
TRACE("Progress Ctrl destruction, hwnd=%04x\n", hwnd);
COMCTL32_Free (infoPtr);
@ -260,7 +260,7 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
case WM_ERASEBKGND:
PROGRESS_EraseBackground(infoPtr, wParam);
return TRUE;
case WM_GETFONT:
return (LRESULT)infoPtr->Font;
@ -269,7 +269,7 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
case WM_PAINT:
return PROGRESS_Paint (infoPtr, (HDC)wParam);
case PBM_DELTAPOS:
{
INT oldVal;
@ -301,7 +301,7 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
}
return oldVal;
}
case PBM_SETRANGE:
if (wParam) UNKNOWN_PARAM(PBM_SETRANGE, wParam, lParam);
return PROGRESS_SetRange (infoPtr, (int)LOWORD(lParam), (int)HIWORD(lParam));
@ -319,7 +319,7 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
{
INT oldVal;
if (wParam || lParam) UNKNOWN_PARAM(PBM_STEPIT, wParam, lParam);
oldVal = infoPtr->CurVal;
oldVal = infoPtr->CurVal;
infoPtr->CurVal += infoPtr->Step;
if(infoPtr->CurVal > infoPtr->MaxVal)
infoPtr->CurVal = infoPtr->MinVal;
@ -335,7 +335,7 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
case PBM_SETRANGE32:
return PROGRESS_SetRange (infoPtr, (int)wParam, (int)lParam);
case PBM_GETRANGE:
if (lParam) {
((PPBRANGE)lParam)->iLow = infoPtr->MinVal;
@ -359,11 +359,11 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
InvalidateRect(hwnd, NULL, TRUE);
return 0;
default:
if (message >= WM_USER)
default:
if (message >= WM_USER)
ERR("unknown msg %04x wp=%04x lp=%08lx\n", message, wParam, lParam );
return DefWindowProcW( hwnd, message, wParam, lParam );
}
return DefWindowProcW( hwnd, message, wParam, lParam );
}
}

View File

@ -88,7 +88,7 @@ typedef struct
* Defines and global variables
*/
const WCHAR PropSheetInfoStr[] =
const WCHAR PropSheetInfoStr[] =
{'P','r','o','p','e','r','t','y','S','h','e','e','t','I','n','f','o',0 };
#define MAX_CAPTION_LENGTH 255
@ -442,7 +442,7 @@ BOOL PROPSHEET_CollectPageInfo(LPCPROPSHEETPAGEW lppsp,
default:
p += lstrlenW( (LPCWSTR)p ) + 1;
break;
}
}
/* class */
switch ((WORD)*p)
@ -491,14 +491,14 @@ BOOL PROPSHEET_CollectPageInfo(LPCPROPSHEETPAGEW lppsp,
/*
* Build the image list for icons
*/
if ((dwFlags & PSP_USEHICON) || (dwFlags & PSP_USEICONID))
if ((dwFlags & PSP_USEHICON) || (dwFlags & PSP_USEICONID))
{
HICON hIcon;
int icon_cx = GetSystemMetrics(SM_CXSMICON);
int icon_cy = GetSystemMetrics(SM_CYSMICON);
if (dwFlags & PSP_USEICONID)
hIcon = LoadImageW(lppsp->hInstance, lppsp->u2.pszIcon, IMAGE_ICON,
hIcon = LoadImageW(lppsp->hInstance, lppsp->u2.pszIcon, IMAGE_ICON,
icon_cx, icon_cy, LR_DEFAULTCOLOR);
else
hIcon = lppsp->u2.hIcon;
@ -577,7 +577,7 @@ BOOL PROPSHEET_CreateDialog(PropSheetInfo* psInfo)
/******************************************************************************
* PROPSHEET_SizeMismatch
*
*
* Verify that the tab control and the "largest" property sheet page dlg. template
* match in size.
*/
@ -701,7 +701,7 @@ static BOOL PROPSHEET_AdjustSize(HWND hwndDlg, PropSheetInfo* psInfo)
rc.bottom = rc.top + tabRect.bottom - tabRect.top;
psInfo->height = MulDiv((rc.bottom - rc.top),8,units.top);
}
if ((rc.right - rc.left) < (tabRect.right - tabRect.left))
{
rc.right = rc.left + tabRect.right - tabRect.left;
@ -778,7 +778,7 @@ static BOOL PROPSHEET_AdjustSizeWizard(HWND hwndDlg, PropSheetInfo* psInfo)
rc.bottom = rc.top + tabRect.bottom - tabRect.top;
psInfo->height = MulDiv((rc.bottom - rc.top), 8, units.top);
}
if ((rc.right - rc.left) < (tabRect.right - tabRect.left))
{
rc.right = rc.left + tabRect.right - tabRect.left;
@ -828,10 +828,10 @@ static BOOL PROPSHEET_AdjustButtons(HWND hwndParent, PropSheetInfo* psInfo)
/*
* Get the size of the property sheet.
*/
*/
GetClientRect(hwndParent, &rcSheet);
/*
/*
* All buttons will be at this y coordinate.
*/
y = rcSheet.bottom - (padding.y + buttonHeight);
@ -867,7 +867,7 @@ static BOOL PROPSHEET_AdjustButtons(HWND hwndParent, PropSheetInfo* psInfo)
x = rcSheet.right - ((padding.x + buttonWidth) * 2);
else
x = rcSheet.right - (padding.x + buttonWidth);
SetWindowPos(hwndButton, 0, x, y, 0, 0,
SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
@ -884,7 +884,7 @@ static BOOL PROPSHEET_AdjustButtons(HWND hwndParent, PropSheetInfo* psInfo)
if (psInfo->hasHelp)
{
x = rcSheet.right - (padding.x + buttonWidth);
SetWindowPos(hwndButton, 0, x, y, 0, 0,
SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
}
@ -1063,7 +1063,7 @@ static PADDING_INFO PROPSHEET_GetPaddingInfoWizard(HWND hwndDlg, const PropSheet
idButton = IDCANCEL;
}
}
hwndControl = GetDlgItem(hwndDlg, idButton);
GetWindowRect(hwndControl, &rc);
@ -1325,7 +1325,7 @@ static BOOL PROPSHEET_Back(HWND hwndDlg)
psn.hdr.hwndFrom = hwndDlg;
psn.hdr.idFrom = 0;
psn.lParam = 0;
hwndPage = psInfo->proppage[psInfo->active_page].hwndPage;
result = SendMessageW(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn);
@ -1364,7 +1364,7 @@ static BOOL PROPSHEET_Next(HWND hwndDlg)
psn.hdr.hwndFrom = hwndDlg;
psn.hdr.idFrom = 0;
psn.lParam = 0;
hwndPage = psInfo->proppage[psInfo->active_page].hwndPage;
msgResult = SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn);
@ -1403,7 +1403,7 @@ static BOOL PROPSHEET_Finish(HWND hwndDlg)
psn.hdr.hwndFrom = hwndDlg;
psn.hdr.idFrom = 0;
psn.lParam = 0;
hwndPage = psInfo->proppage[psInfo->active_page].hwndPage;
msgResult = SendMessageW(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn);
@ -1440,7 +1440,7 @@ static BOOL PROPSHEET_Apply(HWND hwndDlg, LPARAM lParam)
psn.hdr.hwndFrom = hwndDlg;
psn.hdr.idFrom = 0;
psn.lParam = 0;
/*
* Send PSN_KILLACTIVE to the current page.
@ -1457,7 +1457,7 @@ static BOOL PROPSHEET_Apply(HWND hwndDlg, LPARAM lParam)
*/
psn.hdr.code = PSN_APPLY;
psn.lParam = lParam;
for (i = 0; i < psInfo->nPages; i++)
{
hwndPage = psInfo->proppage[i].hwndPage;
@ -1504,13 +1504,13 @@ static void PROPSHEET_Cancel(HWND hwndDlg, LPARAM lParam)
psn.hdr.hwndFrom = hwndDlg;
psn.hdr.idFrom = 0;
psn.lParam = 0;
if (SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn))
return;
psn.hdr.code = PSN_RESET;
psn.lParam = lParam;
for (i = 0; i < psInfo->nPages; i++)
{
hwndPage = psInfo->proppage[i].hwndPage;
@ -1547,7 +1547,7 @@ static void PROPSHEET_Help(HWND hwndDlg)
psn.hdr.hwndFrom = hwndDlg;
psn.hdr.idFrom = 0;
psn.lParam = 0;
SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn);
}
@ -1649,7 +1649,7 @@ static void PROPSHEET_PressButton(HWND hwndDlg, int buttonID)
/*************************************************************************
* BOOL PROPSHEET_CanSetCurSel [Internal]
* BOOL PROPSHEET_CanSetCurSel [Internal]
*
* Test whether the current page can be changed by sending a PSN_KILLACTIVE
*
@ -1778,7 +1778,7 @@ static void PROPSHEET_SetTitleA(HWND hwndDlg, DWORD dwStyle, LPCSTR lpszText)
if(HIWORD(lpszText))
{
WCHAR szTitle[256];
MultiByteToWideChar(CP_ACP, 0, lpszText, -1,
MultiByteToWideChar(CP_ACP, 0, lpszText, -1,
szTitle, sizeof szTitle);
PROPSHEET_SetTitleW(hwndDlg, dwStyle, szTitle);
}
@ -1798,7 +1798,7 @@ static void PROPSHEET_SetTitleW(HWND hwndDlg, DWORD dwStyle, LPCWSTR lpszText)
TRACE("'%s' (style %08lx)\n", debugstr_w(lpszText), dwStyle);
if (HIWORD(lpszText) == 0) {
if (!LoadStringW(psInfo->ppshheader.hInstance,
if (!LoadStringW(psInfo->ppshheader.hInstance,
LOWORD(lpszText), szTitle, sizeof(szTitle)-sizeof(WCHAR)))
return;
lpszText = szTitle;
@ -2020,14 +2020,14 @@ static BOOL PROPSHEET_RemovePage(HWND hwndDlg,
DestroyPropertySheetPage(psInfo->proppage[index].hpage);
}
/* Remove the tab */
SendMessageW(hwndTabControl, TCM_DELETEITEM, index, 0);
psInfo->nPages--;
psInfo->proppage = COMCTL32_Alloc(sizeof(PropPageInfo) * psInfo->nPages);
if (index > 0)
if (index > 0)
memcpy(&psInfo->proppage[0], &oldPages[0], index * sizeof(PropPageInfo));
if (index < psInfo->nPages)
@ -2256,16 +2256,16 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(
if ( !(ppsp->dwFlags & PSP_DLGINDIRECT) && HIWORD( ppsp->u.pszTemplate ) )
{
PROPSHEET_AtoW(&ppsp->u.pszTemplate, lpPropSheetPage->u.pszTemplate);
PROPSHEET_AtoW(&ppsp->u.pszTemplate, lpPropSheetPage->u.pszTemplate);
}
if ( (ppsp->dwFlags & PSP_USEICONID) && HIWORD( ppsp->u2.pszIcon ) )
{
PROPSHEET_AtoW(&ppsp->u2.pszIcon, lpPropSheetPage->u2.pszIcon);
PROPSHEET_AtoW(&ppsp->u2.pszIcon, lpPropSheetPage->u2.pszIcon);
}
if ((ppsp->dwFlags & PSP_USETITLE) && HIWORD( ppsp->pszTitle ))
{
PROPSHEET_AtoW(&ppsp->pszTitle, lpPropSheetPage->pszTitle);
PROPSHEET_AtoW(&ppsp->pszTitle, lpPropSheetPage->pszTitle);
}
else if ( !(ppsp->dwFlags & PSP_USETITLE) )
ppsp->pszTitle = NULL;
@ -2455,7 +2455,7 @@ static BOOL PROPSHEET_DoCommand(HWND hwnd, WORD wID)
BOOL WINAPI
PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
TRACE("hwnd=%x msg=%x wparam=%x lparam=%lx\n",
TRACE("hwnd=%x msg=%x wparam=%x lparam=%lx\n",
hwnd, uMsg, wParam, lParam);
switch (uMsg)
@ -2471,8 +2471,8 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
SetPropW(hwnd, PropSheetInfoStr, (HANDLE)psInfo);
/*
* psInfo->hwnd is not being used by WINE code - it exists
* for compatibility with "real" Windoze. The same about
* psInfo->hwnd is not being used by WINE code - it exists
* for compatibility with "real" Windoze. The same about
* SetWindowLong - WINE is only using the PropSheetInfoStr
* property.
*/
@ -2500,7 +2500,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
SendMessageW(hwnd, WM_SETICON, 0, hIcon);
}
if (psInfo->ppshheader.dwFlags & PSH_USEHICON)
SendMessageW(hwnd, WM_SETICON, 0, psInfo->ppshheader.u.hIcon);
@ -2527,14 +2527,14 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
}
}
if (psInfo->useCallback)
(*(psInfo->ppshheader.pfnCallback))(hwnd,
PSCB_INITIALIZED, (LPARAM)0);
if (psInfo->useCallback)
(*(psInfo->ppshheader.pfnCallback))(hwnd,
PSCB_INITIALIZED, (LPARAM)0);
idx = psInfo->active_page;
ppshpage = (LPCPROPSHEETPAGEW)psInfo->proppage[idx].hpage;
psInfo->active_page = -1;
PROPSHEET_SetCurSel(hwnd, idx, 1, psInfo->proppage[idx].hpage);
/* doing TCM_SETCURSEL seems to be needed even in case of PSH_WIZARD,
@ -2547,7 +2547,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
WCHAR szText[256];
if (LoadStringW(psInfo->ppshheader.hInstance,
if (LoadStringW(psInfo->ppshheader.hInstance,
(UINT)psInfo->ppshheader.pszCaption, szText, 255))
PROPSHEET_SetTitleW(hwnd, psInfo->ppshheader.dwFlags, szText);
}
@ -2649,7 +2649,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
EnableWindow(hwndCancel, FALSE);
if (LoadStringW(COMCTL32_hModule, IDS_CLOSE, buf, sizeof(buf)))
SetWindowTextW(hwndOK, buf);
return FALSE;
}
@ -2664,7 +2664,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case PSM_REBOOTSYSTEM:
{
PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwnd,
PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwnd,
PropSheetInfoStr);
psInfo->rebootSystem = TRUE;
@ -2674,7 +2674,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case PSM_SETTITLEA:
PROPSHEET_SetTitleA(hwnd, (DWORD) wParam, (LPCSTR) lParam);
return TRUE;
case PSM_SETTITLEW:
PROPSHEET_SetTitleW(hwnd, (DWORD) wParam, (LPCWSTR) lParam);
return TRUE;
@ -2730,7 +2730,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return TRUE;
case PSM_SETFINISHTEXTA:
PROPSHEET_SetFinishTextA(hwnd, (LPCSTR) lParam);
PROPSHEET_SetFinishTextA(hwnd, (LPCSTR) lParam);
return TRUE;
case PSM_SETWIZBUTTONS:
@ -2742,13 +2742,13 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return FALSE;
case PSM_SETFINISHTEXTW:
PROPSHEET_SetFinishTextW(hwnd, (LPCWSTR) lParam);
PROPSHEET_SetFinishTextW(hwnd, (LPCWSTR) lParam);
return FALSE;
default:
return FALSE;
}
return FALSE;
}

View File

@ -46,7 +46,7 @@
* TODO:
* - vertical placement
* - ComboBox and ComboBoxEx placement
* - center image
* - center image
* - Layout code.
* - Display code.
* - Some messages.
@ -55,11 +55,11 @@
* Changes Guy Albertelli <galberte@neo.lrun.com>
* rev 2,3,4
* - Implement initial version of row grouping, row separators,
* text and background colors. Support additional messages.
* text and background colors. Support additional messages.
* Support RBBS_BREAK. Implement ERASEBKGND and improve painting.
* rev 5
* - implement support for dragging Gripper left or right in a row. Supports
* WM_LBUTTONDOWN, WM_LBUTTONUP, and WM_MOUSEMOVE. Also support
* WM_LBUTTONDOWN, WM_LBUTTONUP, and WM_MOUSEMOVE. Also support
* RBS_BANDBORDERS.
* rev 6
* - Fix or implement notifications for RBN_HEIGHTCHANGE, RBN_CHILDSIZE.
@ -68,7 +68,7 @@
*
* rev 7
* - Fix algorithm for _Layout and _AdjustBand.
* - Fix or implement RBN_ENDDRAG, RB_MOVEBAND, WM_SETREDRAW,
* - Fix or implement RBN_ENDDRAG, RB_MOVEBAND, WM_SETREDRAW,
* WM_STYLECHANGED, RB_MINIMIZEBAND, RBBS_VARIABLEHEIGHT, RBS_VARHEIGHT,
* RBBS_HIDDEN, WM_NOTIFYFORMAT, NM_NCHITTEST, WM_SETREDRAW, RBS_AUTOSIZE,
* WM_SETFONT, RBS_BORDERS
@ -87,7 +87,7 @@
* 7. Invalidate window rectangles after SetBandInfo, InsertBand, ShowBand
* so that repainting is correct.
* 8. Implement RB_MAXIMIZEBAND for the "ideal=TRUE" case.
* 9. Implement item custom draw notifications partially. Only done for
* 9. Implement item custom draw notifications partially. Only done for
* ITEMPREPAINT and ITEMPOSTPAINT. (Used by IE4 for "Favorites" frame
* to draw the word "Favorites").
* rev 8a
@ -96,7 +96,7 @@
* number (0) to indicate *no* band.
* 12. Fix CCS_VERT errors in _ForceResize, _NCCalcSize, and _NCPaint.
* 13. Support some special cases of CCS_TOP (and therefore CCS_LEFT),
* CCS_BOTTOM (and therefore CCS_RIGHT) and CCS_NOPARENTALIGN. Not
* CCS_BOTTOM (and therefore CCS_RIGHT) and CCS_NOPARENTALIGN. Not
* at all sure whether this is all cases.
* 14. Handle returned value for the RBN_CHILDSIZE notify.
* 15. Implement RBBS_CHILDEDGE, and set each bands "offChild" at _Layout
@ -121,10 +121,10 @@
* 2. Following still not handled: RBBS_FIXEDBMP,
* RBBS_USECHEVRON, CCS_NORESIZE,
* CCS_NOMOVEX, CCS_NOMOVEY
* 3. Following are only partially handled:
* 3. Following are only partially handled:
* RBS_AUTOSIZE, RBBS_VARIABLEHEIGHT
* 5. Native uses (on each draw!!) SM_CYBORDER (or SM_CXBORDER for CCS_VERT)
* to set the size of the separator width (the value SEP_WIDTH_SIZE
* to set the size of the separator width (the value SEP_WIDTH_SIZE
* in here). Should be fixed!!
* 6. The following messages are not implemented:
* RB_BEGINDRAG, RB_DRAGMOVE, RB_ENDDRAG, RB_GETCOLORSCHEME,
@ -236,7 +236,7 @@ typedef struct
BOOL bUnicode; /* TRUE if this window is W type */
BOOL NtfUnicode; /* TRUE if parent wants notify in W format */
BOOL DoRedraw; /* TRUE to acutally draw bands */
UINT fStatus; /* Status flags (see below) */
UINT fStatus; /* Status flags (see below) */
HCURSOR hcurArrow; /* handle to the arrow cursor */
HCURSOR hcurHorz; /* handle to the EW cursor */
HCURSOR hcurVert; /* handle to the NS cursor */
@ -400,7 +400,7 @@ REBAR_DumpBandInfo( LPREBARBANDINFOA pB)
{
if( !TRACE_ON(rebar) ) return;
TRACE("band info: ID=%u, size=%u, child=%04x, clrF=0x%06lx, clrB=0x%06lx\n",
pB->wID, pB->cbSize, pB->hwndChild, pB->clrFore, pB->clrBack);
pB->wID, pB->cbSize, pB->hwndChild, pB->clrFore, pB->clrBack);
TRACE("band info: mask=0x%08x (%s)\n", pB->fMask, REBAR_FmtMask(pB->fMask));
if (pB->fMask & RBBIM_STYLE)
TRACE("band info: style=0x%08x (%s)\n", pB->fStyle, REBAR_FmtStyle(pB->fStyle));
@ -418,7 +418,7 @@ REBAR_DumpBandInfo( LPREBARBANDINFOA pB)
}
if (pB->fMask & RBBIM_CHILDSIZE)
TRACE("band info: xMin=%u, yMin=%u, yChild=%u, yMax=%u, yIntgl=%u\n",
pB->cxMinChild,
pB->cxMinChild,
pB->cyMinChild, pB->cyChild, pB->cyMaxChild, pB->cyIntegral);
}
@ -430,7 +430,7 @@ REBAR_DumpBand (REBAR_INFO *iP)
if(! TRACE_ON(rebar) ) return;
TRACE("hwnd=%04x: color=%08lx/%08lx, bands=%u, rows=%u, cSize=%ld,%ld\n",
TRACE("hwnd=%04x: color=%08lx/%08lx, bands=%u, rows=%u, cSize=%ld,%ld\n",
iP->hwndSelf, iP->clrText, iP->clrBk, iP->uNumBands, iP->uNumRows,
iP->calcSize.cx, iP->calcSize.cy);
TRACE("hwnd=%04x: flags=%08x, dragStart=%d,%d, dragNow=%d,%d, ihitBand=%d\n",
@ -446,9 +446,9 @@ REBAR_DumpBand (REBAR_INFO *iP)
i, pB->wID, pB->hwndChild, pB->iRow, pB->clrFore, pB->clrBack);
TRACE("band # %u: mask=0x%08x (%s)\n", i, pB->fMask, REBAR_FmtMask(pB->fMask));
if (pB->fMask & RBBIM_STYLE)
TRACE("band # %u: style=0x%08x (%s)\n",
TRACE("band # %u: style=0x%08x (%s)\n",
i, pB->fStyle, REBAR_FmtStyle(pB->fStyle));
TRACE("band # %u: uMinH=%u xHeader=%u",
TRACE("band # %u: uMinH=%u xHeader=%u",
i, pB->uMinHeight, pB->cxHeader);
if (pB->fMask & (RBBIM_SIZE | RBBIM_IDEALSIZE | RBBIM_LPARAM )) {
if (pB->fMask & RBBIM_SIZE)
@ -604,7 +604,7 @@ REBAR_DrawBand (HDC hdc, REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
DT_CENTER | DT_VCENTER | DT_SINGLELINE);
if (oldBkMode != TRANSPARENT)
SetBkMode (hdc, oldBkMode);
if (lpBand->clrFore != CLR_NONE)
if (lpBand->clrFore != CLR_NONE)
SetTextColor (hdc, oldcolor);
SelectObject (hdc, hOldFont);
}
@ -635,10 +635,10 @@ REBAR_Refresh (REBAR_INFO *infoPtr, HDC hdc)
for (i = 0; i < infoPtr->uNumBands; i++) {
lpBand = &infoPtr->bands[i];
if (HIDDENBAND(lpBand)) continue;
if (HIDDENBAND(lpBand)) continue;
/* now draw the band */
TRACE("[%04x] drawing band %i, flags=%08x\n",
TRACE("[%04x] drawing band %i, flags=%08x\n",
infoPtr->hwndSelf, i, lpBand->fDraw);
REBAR_DrawBand (hdc, infoPtr, lpBand);
@ -649,7 +649,7 @@ REBAR_Refresh (REBAR_INFO *infoPtr, HDC hdc)
static void
REBAR_FixVert (REBAR_INFO *infoPtr, UINT rowstart, UINT rowend,
INT mcy)
/* Function: */
/* Function: */
/* Cycle through bands in row and fix height of each band. */
/* Also determine whether each band has changed. */
/* On entry: */
@ -718,7 +718,7 @@ REBAR_AdjustBands (REBAR_INFO *infoPtr, UINT rowstart, UINT rowend,
/* a. inflate band till either all extra space used */
/* or band's ->ccx reached. */
/* If any band modified, add any space left to last band */
/* adjusted. */
/* adjusted. */
/* */
/* ****************************************************** */
lpBand = &infoPtr->bands[rowend];
@ -771,7 +771,7 @@ REBAR_AdjustBands (REBAR_INFO *infoPtr, UINT rowstart, UINT rowend,
}
if ((x >= maxx) || (last_adjusted != -1)) {
if (x > maxx) {
ERR("Phase 1 failed, x=%d, maxx=%d, start=%u, end=%u\n",
ERR("Phase 1 failed, x=%d, maxx=%d, start=%u, end=%u\n",
x, maxx, rowstart, rowend);
}
/* done, so spread extra space */
@ -841,7 +841,7 @@ REBAR_AdjustBands (REBAR_INFO *infoPtr, UINT rowstart, UINT rowend,
}
if (x >= maxx) {
if (x > maxx) {
ERR("Phase 2 failed, x=%d, maxx=%d, start=%u, end=%u\n",
ERR("Phase 2 failed, x=%d, maxx=%d, start=%u, end=%u\n",
x, maxx, rowstart, rowend);
}
/* done, so spread extra space */
@ -909,7 +909,7 @@ REBAR_CalcHorzBand (REBAR_INFO *infoPtr, UINT rstart, UINT rend, BOOL notify)
if (lpBand->fStatus & (HAS_IMAGE | HAS_TEXT))
/* if no gripper but either image or text, then leave space */
xoff = REBAR_ALWAYS_SPACE;
SetRect (&lpBand->rcCapImage,
SetRect (&lpBand->rcCapImage,
lpBand->rcBand.left+xoff, lpBand->rcBand.top,
lpBand->rcBand.left+xoff, lpBand->rcBand.bottom);
}
@ -924,7 +924,7 @@ REBAR_CalcHorzBand (REBAR_INFO *infoPtr, UINT rstart, UINT rend, BOOL notify)
SetRect (&lpBand->rcCapText,
lpBand->rcCapImage.right+REBAR_POST_IMAGE, lpBand->rcBand.top+1,
lpBand->rcBand.left+lpBand->cxHeader, lpBand->rcBand.bottom-1);
/* update band height
/* update band height
if (lpBand->uMinHeight < infoPtr->imageSize.cy + 2) {
lpBand->uMinHeight = infoPtr->imageSize.cy + 2;
lpBand->rcBand.bottom = lpBand->rcBand.top + lpBand->uMinHeight;
@ -939,7 +939,7 @@ REBAR_CalcHorzBand (REBAR_INFO *infoPtr, UINT rstart, UINT rend, BOOL notify)
/* text is visible */
if (lpBand->fStatus & HAS_TEXT) {
lpBand->fDraw |= DRAW_TEXT;
lpBand->rcCapText.right = max(lpBand->rcCapText.left,
lpBand->rcCapText.right = max(lpBand->rcCapText.left,
lpBand->rcCapText.right-REBAR_POST_TEXT);
}
@ -958,7 +958,7 @@ REBAR_CalcHorzBand (REBAR_INFO *infoPtr, UINT rstart, UINT rend, BOOL notify)
}
/* flag if notify required and invalidate rectangle */
if (notify &&
if (notify &&
((oldChild.right-oldChild.left != lpBand->rcChild.right-lpBand->rcChild.left) ||
(oldChild.bottom-oldChild.top != lpBand->rcChild.bottom-lpBand->rcChild.top))) {
TRACE("Child rectangle changed for band %u\n", i);
@ -970,9 +970,9 @@ REBAR_CalcHorzBand (REBAR_INFO *infoPtr, UINT rstart, UINT rend, BOOL notify)
}
if (lpBand->fDraw & NTF_INVALIDATE) {
TRACE("invalidating (%d,%d)-(%d,%d)\n",
lpBand->rcBand.left,
lpBand->rcBand.left,
lpBand->rcBand.top,
lpBand->rcBand.right + ((lpBand->fDraw & DRAW_RIGHTSEP) ? SEP_WIDTH_SIZE : 0),
lpBand->rcBand.right + ((lpBand->fDraw & DRAW_RIGHTSEP) ? SEP_WIDTH_SIZE : 0),
lpBand->rcBand.bottom + ((lpBand->fDraw & DRAW_BOTTOMSEP) ? SEP_WIDTH_SIZE : 0));
lpBand->fDraw &= ~NTF_INVALIDATE;
work = lpBand->rcBand;
@ -1046,7 +1046,7 @@ REBAR_CalcVertBand (REBAR_INFO *infoPtr, UINT rstart, UINT rend, BOOL notify)
/* if no gripper but either image or text, then leave space */
xoff = REBAR_ALWAYS_SPACE;
/* initialize Caption image rectangle */
SetRect (&lpBand->rcCapImage,
SetRect (&lpBand->rcCapImage,
lpBand->rcBand.left, lpBand->rcBand.top+xoff,
lpBand->rcBand.right, lpBand->rcBand.top+xoff);
}
@ -1059,7 +1059,7 @@ REBAR_CalcVertBand (REBAR_INFO *infoPtr, UINT rstart, UINT rend, BOOL notify)
lpBand->rcCapImage.bottom += infoPtr->imageSize.cy;
/* set initial caption text rectangle */
SetRect (&lpBand->rcCapText,
SetRect (&lpBand->rcCapText,
lpBand->rcBand.left, lpBand->rcCapImage.bottom+REBAR_POST_IMAGE,
lpBand->rcBand.right, lpBand->rcBand.top+lpBand->cxHeader);
/* update band height *
@ -1070,7 +1070,7 @@ REBAR_CalcVertBand (REBAR_INFO *infoPtr, UINT rstart, UINT rend, BOOL notify)
}
else {
/* set initial caption text rectangle */
SetRect (&lpBand->rcCapText,
SetRect (&lpBand->rcCapText,
lpBand->rcBand.left, lpBand->rcCapImage.bottom,
lpBand->rcBand.right, lpBand->rcBand.top+lpBand->cxHeader);
}
@ -1097,7 +1097,7 @@ REBAR_CalcVertBand (REBAR_INFO *infoPtr, UINT rstart, UINT rend, BOOL notify)
}
/* flag if notify required and invalidate rectangle */
if (notify &&
if (notify &&
((oldChild.right-oldChild.left != lpBand->rcChild.right-lpBand->rcChild.left) ||
(oldChild.bottom-oldChild.top != lpBand->rcChild.bottom-lpBand->rcChild.top))) {
TRACE("Child rectangle changed for band %u\n", i);
@ -1109,9 +1109,9 @@ REBAR_CalcVertBand (REBAR_INFO *infoPtr, UINT rstart, UINT rend, BOOL notify)
}
if (lpBand->fDraw & NTF_INVALIDATE) {
TRACE("invalidating (%d,%d)-(%d,%d)\n",
lpBand->rcBand.left,
lpBand->rcBand.left,
lpBand->rcBand.top,
lpBand->rcBand.right + ((lpBand->fDraw & DRAW_BOTTOMSEP) ? SEP_WIDTH_SIZE : 0),
lpBand->rcBand.right + ((lpBand->fDraw & DRAW_BOTTOMSEP) ? SEP_WIDTH_SIZE : 0),
lpBand->rcBand.bottom + ((lpBand->fDraw & DRAW_RIGHTSEP) ? SEP_WIDTH_SIZE : 0));
lpBand->fDraw &= ~NTF_INVALIDATE;
work = lpBand->rcBand;
@ -1258,7 +1258,7 @@ REBAR_MoveChildWindows (REBAR_INFO *infoPtr, UINT start, UINT endplus)
rbcz.wID = lpBand->wID;
rbcz.rcChild = lpBand->rcChild;
rbcz.rcBand = lpBand->rcBand;
if (infoPtr->dwStyle & CCS_VERT)
if (infoPtr->dwStyle & CCS_VERT)
rbcz.rcBand.top += lpBand->cxHeader;
else
rbcz.rcBand.left += lpBand->cxHeader;
@ -1400,7 +1400,7 @@ REBAR_Layout (REBAR_INFO *infoPtr, LPRECT lpRect, BOOL notify, BOOL resetclient)
}
/* save height of original control */
if (infoPtr->dwStyle & CCS_VERT)
if (infoPtr->dwStyle & CCS_VERT)
origheight = infoPtr->calcSize.cx;
else
origheight = infoPtr->calcSize.cy;
@ -1439,10 +1439,10 @@ REBAR_Layout (REBAR_INFO *infoPtr, LPRECT lpRect, BOOL notify, BOOL resetclient)
lpBand->offChild.cy = ((lpBand->fStyle & RBBS_CHILDEDGE) ? 2 : 0);
/* separator from previous band */
cxsep = (cntonrow == 0) ? 0 : SEP_WIDTH;
cxsep = (cntonrow == 0) ? 0 : SEP_WIDTH;
/* Header: includes gripper, text, image */
cx = lpBand->cxHeader;
cx = lpBand->cxHeader;
if (lpBand->fStyle & RBBS_FIXEDSIZE) cx = lpBand->lcx;
if (infoPtr->dwStyle & CCS_VERT)
@ -1484,7 +1484,7 @@ REBAR_Layout (REBAR_INFO *infoPtr, LPRECT lpRect, BOOL notify, BOOL resetclient)
cntonrow = 0;
}
if (mcy < lpBand->lcy + REBARSPACE(lpBand))
if (mcy < lpBand->lcy + REBARSPACE(lpBand))
mcy = lpBand->lcy + REBARSPACE(lpBand);
/* if boundary rect specified then limit mcy */
@ -1513,7 +1513,7 @@ REBAR_Layout (REBAR_INFO *infoPtr, LPRECT lpRect, BOOL notify, BOOL resetclient)
rightx = clientcx;
bottomy = (lpRect) ? min(clientcy, y+cxsep+cx) : y+cxsep+cx;
lpBand->rcBand.left = x;
lpBand->rcBand.right = x + min(mcy,
lpBand->rcBand.right = x + min(mcy,
lpBand->lcy+REBARSPACE(lpBand));
lpBand->rcBand.top = min(bottomy, y + cxsep);
lpBand->rcBand.bottom = bottomy;
@ -1527,7 +1527,7 @@ REBAR_Layout (REBAR_INFO *infoPtr, LPRECT lpRect, BOOL notify, BOOL resetclient)
lpBand->rcBand.left = min(rightx, x + cxsep);
lpBand->rcBand.right = rightx;
lpBand->rcBand.top = y;
lpBand->rcBand.bottom = y + min(mcy,
lpBand->rcBand.bottom = y + min(mcy,
lpBand->lcy+REBARSPACE(lpBand));
lpBand->uMinHeight = lpBand->lcy;
x = rightx;
@ -1615,7 +1615,7 @@ REBAR_Layout (REBAR_INFO *infoPtr, LPRECT lpRect, BOOL notify, BOOL resetclient)
REBAR_BAND *prev, *current, *walk;
/* FIXME: problem # 2 */
if (((infoPtr->dwStyle & CCS_VERT) ?
if (((infoPtr->dwStyle & CCS_VERT) ?
#if PROBLEM2
(x < adjcx) : (y < adjcy)
#else
@ -1697,7 +1697,7 @@ REBAR_Layout (REBAR_INFO *infoPtr, LPRECT lpRect, BOOL notify, BOOL resetclient)
walk->rcBand.bottom += adj_rh;
}
}
if ((infoPtr->dwStyle & CCS_VERT) ? (x >= adjcx) : (y >= adjcy))
if ((infoPtr->dwStyle & CCS_VERT) ? (x >= adjcx) : (y >= adjcy))
break; /* all done */
}
}
@ -1761,7 +1761,7 @@ REBAR_Layout (REBAR_INFO *infoPtr, LPRECT lpRect, BOOL notify, BOOL resetclient)
lpBand = &infoPtr->bands[iband];
if(HIDDENBAND(lpBand)) continue;
if (lpBand->fMask & RBBS_VARIABLEHEIGHT) continue;
if (((INT)lpBand->cyMaxChild < 1) ||
if (((INT)lpBand->cyMaxChild < 1) ||
((INT)lpBand->cyIntegral < 1)) {
if (lpBand->cyMaxChild + lpBand->cyIntegral == 0) continue;
ERR("P2b band %u RBBS_VARIABLEHEIGHT set but cyMax=%d, cyInt=%d\n",
@ -1769,9 +1769,9 @@ REBAR_Layout (REBAR_INFO *infoPtr, LPRECT lpRect, BOOL notify, BOOL resetclient)
continue;
}
/* j is now the maximum height/width in the client area */
j = ((diff / lpBand->cyIntegral) * lpBand->cyIntegral) +
j = ((diff / lpBand->cyIntegral) * lpBand->cyIntegral) +
ircBw(lpBand);
if (j > lpBand->cyMaxChild + REBARSPACE(lpBand))
if (j > lpBand->cyMaxChild + REBARSPACE(lpBand))
j = lpBand->cyMaxChild + REBARSPACE(lpBand);
diff -= (j - ircBw(lpBand));
if (infoPtr->dwStyle & CCS_VERT)
@ -1827,7 +1827,7 @@ REBAR_Layout (REBAR_INFO *infoPtr, LPRECT lpRect, BOOL notify, BOOL resetclient)
p = &infoPtr->rows[i-1];
mcy = 0;
TRACE("P3 processing row %d, starting band %d, ending band %d\n",
TRACE("P3 processing row %d, starting band %d, ending band %d\n",
i, p->istartband, p->iendband);
/* Find the largest height of the bands in the row */
@ -1839,7 +1839,7 @@ REBAR_Layout (REBAR_INFO *infoPtr, LPRECT lpRect, BOOL notify, BOOL resetclient)
}
REBAR_AdjustBands (infoPtr, p->istartband, p->iendband,
(infoPtr->dwStyle & CCS_VERT) ?
(infoPtr->dwStyle & CCS_VERT) ?
clientcy : clientcx, mcy);
}
@ -1849,7 +1849,7 @@ REBAR_Layout (REBAR_INFO *infoPtr, LPRECT lpRect, BOOL notify, BOOL resetclient)
notify);
}
else {
REBAR_CalcHorzBand (infoPtr, 0, infoPtr->uNumBands,
REBAR_CalcHorzBand (infoPtr, 0, infoPtr->uNumBands,
notify);
}
}
@ -1875,7 +1875,7 @@ REBAR_Layout (REBAR_INFO *infoPtr, LPRECT lpRect, BOOL notify, BOOL resetclient)
infoPtr->calcSize.cy = y;
TRACE("horz, notify=%d, y=%d, origheight=%d\n",
notify, y, origheight);
if (notify && (y != origheight)) infoPtr->fStatus |= NTF_HGHTCHG;
if (notify && (y != origheight)) infoPtr->fStatus |= NTF_HGHTCHG;
}
REBAR_DumpBand (infoPtr);
@ -1942,7 +1942,7 @@ REBAR_ValidateBand (REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
/* calculate gripper rectangle */
if ( (!(lpBand->fStyle & RBBS_NOGRIPPER)) &&
( (lpBand->fStyle & RBBS_GRIPPERALWAYS) ||
( (lpBand->fStyle & RBBS_GRIPPERALWAYS) ||
( !(lpBand->fStyle & RBBS_FIXEDSIZE) && (nonfixed > 1)))
) {
lpBand->fStatus |= HAS_GRIPPER;
@ -2185,7 +2185,7 @@ REBAR_InternalEraseBkGnd (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam, REC
rect = lpBand->rcBand;
TRACE("%s background color=0x%06lx, band (%d,%d)-(%d,%d), clip (%d,%d)-(%d,%d)\n",
(lpBand->clrBack == CLR_NONE) ? "none" :
(lpBand->clrBack == CLR_NONE) ? "none" :
((lpBand->clrBack == CLR_DEFAULT) ? "dft" : ""),
GetBkColor(hdc),
lpBand->rcBand.left,lpBand->rcBand.top,
@ -2392,7 +2392,7 @@ REBAR_HandleLRDrag (REBAR_INFO *infoPtr, POINTS *ptsmove)
/* a one to separate each band. */
if (i < ihitBand)
LHeaderSum += (band->lcx + SEP_WIDTH);
else
else
RHeaderSum += (band->lcx + SEP_WIDTH);
}
@ -2425,7 +2425,7 @@ REBAR_HandleLRDrag (REBAR_INFO *infoPtr, POINTS *ptsmove)
imaxdBand, LHeaderSum, RHeaderSum);
REBAR_DumpBand (infoPtr);
if (movement < 0) {
if (movement < 0) {
/* *** Drag left/up *** */
compress = rcBlt(hitBand) - rcBlt(mindBand) -
@ -2442,7 +2442,7 @@ REBAR_HandleLRDrag (REBAR_INFO *infoPtr, POINTS *ptsmove)
if (i == ihitBand) {
LEADJ(band, movement)
}
else
else
movement = REBAR_Shrink (infoPtr, band, movement, i);
band->ccx = rcBw(band);
}
@ -2465,7 +2465,7 @@ REBAR_HandleLRDrag (REBAR_INFO *infoPtr, POINTS *ptsmove)
first = FALSE;
READJ(band, movement)
}
else
else
movement = REBAR_Shrink (infoPtr, band, movement, i);
band->ccx = rcBw(band);
}
@ -2477,7 +2477,7 @@ REBAR_HandleLRDrag (REBAR_INFO *infoPtr, POINTS *ptsmove)
FALSE);
}
else {
REBAR_CalcHorzBand (infoPtr, imindBand, imaxdBand+1,
REBAR_CalcHorzBand (infoPtr, imindBand, imaxdBand+1,
FALSE);
}
@ -2485,7 +2485,7 @@ REBAR_HandleLRDrag (REBAR_INFO *infoPtr, POINTS *ptsmove)
imindBand, imaxdBand);
REBAR_DumpBand (infoPtr);
SetRect (&newrect,
SetRect (&newrect,
mindBand->rcBand.left,
mindBand->rcBand.top,
maxdBand->rcBand.right,
@ -2652,7 +2652,7 @@ REBAR_GetBandInfoA (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
lprbbi->lpText, lprbbi->cch, NULL, NULL ))
lprbbi->lpText[lprbbi->cch-1] = 0;
}
else
else
*lprbbi->lpText = 0;
}
@ -2734,7 +2734,7 @@ REBAR_GetBandInfoW (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
if ((lprbbi->fMask & RBBIM_TEXT) && (lprbbi->lpText)) {
if (lpBand->lpText && (lpBand->fMask & RBBIM_TEXT))
lstrcpynW (lprbbi->lpText, lpBand->lpText, lprbbi->cch);
else
else
*lprbbi->lpText = 0;
}
@ -2922,7 +2922,7 @@ REBAR_GetToolTips (REBAR_INFO *infoPtr)
inline static LRESULT
REBAR_GetUnicodeFormat (REBAR_INFO *infoPtr)
{
TRACE("%s hwnd=0x%x\n",
TRACE("%s hwnd=0x%x\n",
infoPtr->bUnicode ? "TRUE" : "FALSE", infoPtr->hwndSelf);
return infoPtr->bUnicode;
@ -2940,7 +2940,7 @@ REBAR_GetVersion (REBAR_INFO *infoPtr)
static LRESULT
REBAR_HitTest (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
LPRBHITTESTINFO lprbht = (LPRBHITTESTINFO)lParam;
LPRBHITTESTINFO lprbht = (LPRBHITTESTINFO)lParam;
if (!lprbht)
return -1;
@ -3249,7 +3249,7 @@ REBAR_MinimizeBand (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
}
startBand = uBand;
endBand = iprevBand;
SetRect (&newrect,
SetRect (&newrect,
lpBand->rcBand.left,
lpBand->rcBand.top,
band->rcBand.right,
@ -3275,7 +3275,7 @@ REBAR_MinimizeBand (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
}
startBand = iprevBand;
endBand = uBand;
SetRect (&newrect,
SetRect (&newrect,
band->rcBand.left,
band->rcBand.top,
lpBand->rcBand.right,
@ -3290,7 +3290,7 @@ REBAR_MinimizeBand (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
FALSE);
}
else {
REBAR_CalcHorzBand (infoPtr, startBand, endBand+1,
REBAR_CalcHorzBand (infoPtr, startBand, endBand+1,
FALSE);
}
@ -3553,12 +3553,12 @@ REBAR_SetUnicodeFormat (REBAR_INFO *infoPtr, WPARAM wParam)
{
BOOL bTemp = infoPtr->bUnicode;
TRACE("to %s hwnd=0x%04x, was %s\n",
TRACE("to %s hwnd=0x%04x, was %s\n",
((BOOL)wParam) ? "TRUE" : "FALSE", infoPtr->hwndSelf,
(bTemp) ? "TRUE" : "FALSE");
infoPtr->bUnicode = (BOOL)wParam;
return bTemp;
}
@ -3892,7 +3892,7 @@ REBAR_NCCreate (HWND hwnd, WPARAM wParam, LPARAM lParam)
/* get font handle for Caption Font */
ncm.cbSize = sizeof(NONCLIENTMETRICSA);
SystemParametersInfoA (SPI_GETNONCLIENTMETRICS,
SystemParametersInfoA (SPI_GETNONCLIENTMETRICS,
ncm.cbSize, &ncm, 0);
/* if the font is bold, set to normal */
if (ncm.lfCaptionFont.lfWeight > FW_NORMAL) {
@ -3952,14 +3952,14 @@ REBAR_NCHitTest (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
POINTSTOPOINT(pt, shortpt);
clpt = pt;
ScreenToClient (infoPtr->hwndSelf, &clpt);
REBAR_InternalHitTest (infoPtr, &clpt, &scrap,
REBAR_InternalHitTest (infoPtr, &clpt, &scrap,
(INT *)&nmmouse.dwItemSpec);
nmmouse.dwItemData = 0;
nmmouse.pt = clpt;
nmmouse.dwHitInfo = 0;
if ((i = REBAR_Notify((NMHDR *) &nmmouse, infoPtr, NM_NCHITTEST))) {
TRACE("notify changed return value from %ld to %d\n",
ret, i);
ret, i);
ret = (LRESULT) i;
}
TRACE("returning %ld, client point (%ld,%ld)\n", ret, clpt.x, clpt.y);
@ -4101,7 +4101,7 @@ REBAR_SetRedraw (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
* Handles the WM_SETREDRAW message.
*
* Documentation:
* According to testing V4.71 of COMCTL32 returns the
* According to testing V4.71 of COMCTL32 returns the
* *previous* status of the redraw flag (either 0 or -1)
* instead of the MSDN documented value of 0 if handled
*
@ -4109,7 +4109,7 @@ REBAR_SetRedraw (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
BOOL oldredraw = infoPtr->DoRedraw;
TRACE("set to %s, fStatus=%08x\n",
TRACE("set to %s, fStatus=%08x\n",
(wParam) ? "TRUE" : "FALSE", infoPtr->fStatus);
infoPtr->DoRedraw = (BOOL) wParam;
if (wParam) {
@ -4152,11 +4152,11 @@ REBAR_Size (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
TRACE("win rect (%d,%d)-(%d,%d)\n",
rcWin.left, rcWin.top, rcWin.right, rcWin.bottom);
if ((lParam == 0) && (rcWin.right-rcWin.left == 0) &&
if ((lParam == 0) && (rcWin.right-rcWin.left == 0) &&
(rcWin.bottom-rcWin.top == 0)) {
/* native control seems to do this */
GetClientRect (GetParent(infoPtr->hwndSelf), &rcClient);
TRACE("sizing rebar, message and client zero, parent client (%d,%d)\n",
TRACE("sizing rebar, message and client zero, parent client (%d,%d)\n",
rcClient.right, rcClient.bottom);
}
else {
@ -4170,7 +4170,7 @@ REBAR_Size (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
/* do the actual WM_SIZE request */
GetClientRect (infoPtr->hwndSelf, &rcClient);
TRACE("sizing rebar from (%ld,%ld) to (%d,%d), client (%d,%d)\n",
TRACE("sizing rebar from (%ld,%ld) to (%d,%d), client (%d,%d)\n",
infoPtr->calcSize.cx, infoPtr->calcSize.cy,
LOWORD(lParam), HIWORD(lParam),
rcClient.right, rcClient.bottom);
@ -4190,11 +4190,11 @@ REBAR_Size (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
/* on a WM_SIZE to zero and current client not zero and AUTOSIZE */
/* native seems to use the current client rect for the size */
infoPtr->fStatus |= BAND_NEEDS_LAYOUT;
TRACE("sizing rebar to client (%d,%d) size is zero but AUTOSIZE set\n",
TRACE("sizing rebar to client (%d,%d) size is zero but AUTOSIZE set\n",
rcClient.right, rcClient.bottom);
}
else {
TRACE("sizing rebar from (%ld,%ld) to (%d,%d), client (%d,%d)\n",
TRACE("sizing rebar from (%ld,%ld) to (%d,%d), client (%d,%d)\n",
infoPtr->calcSize.cx, infoPtr->calcSize.cy,
LOWORD(lParam), HIWORD(lParam),
rcClient.right, rcClient.bottom);
@ -4208,7 +4208,7 @@ REBAR_Size (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
autosize.fChanged = 0; /* ??? */
autosize.rcActual = autosize.rcTarget; /* ??? */
REBAR_Notify((NMHDR *) &autosize, infoPtr, RBN_AUTOSIZE);
TRACE("RBN_AUTOSIZE client=(%d,%d), lp=%08lx\n",
TRACE("RBN_AUTOSIZE client=(%d,%d), lp=%08lx\n",
autosize.rcTarget.right, autosize.rcTarget.bottom, lParam);
}
@ -4246,7 +4246,7 @@ REBAR_WindowPosChanged (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
/* Save the new origin of this window - used by _ForceResize */
infoPtr->origin.x = lpwp->x;
infoPtr->origin.y = lpwp->y;
ret = DefWindowProcA(infoPtr->hwndSelf, WM_WINDOWPOSCHANGED,
ret = DefWindowProcA(infoPtr->hwndSelf, WM_WINDOWPOSCHANGED,
wParam, lParam);
GetWindowRect(infoPtr->hwndSelf, &rc);
TRACE("hwnd %08x new pos (%d,%d)-(%d,%d)\n",
@ -4260,7 +4260,7 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
TRACE("hwnd=%x msg=%x wparam=%x lparam=%lx\n",
TRACE("hwnd=%x msg=%x wparam=%x lparam=%lx\n",
hwnd, uMsg, /* SPY_GetMsgName(uMsg), */ wParam, lParam);
if (!infoPtr && (uMsg != WM_NCCREATE))
return DefWindowProcA (hwnd, uMsg, wParam, lParam);
@ -4462,7 +4462,7 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
/* case WM_SYSCOLORCHANGE: supported according to ControlSpy */
/* "Applications that have brushes using the existing system colors
should delete those brushes and recreate them using the new
should delete those brushes and recreate them using the new
system colors." per MSDN */
/* case WM_VKEYTOITEM: supported according to ControlSpy */
@ -4497,7 +4497,7 @@ REBAR_Register (void)
wndClass.hbrBackground = CreateSolidBrush(RGB(0,128,0));
#endif
wndClass.lpszClassName = REBARCLASSNAMEA;
RegisterClassA (&wndClass);
mindragx = GetSystemMetrics (SM_CXDRAG);

View File

@ -124,7 +124,7 @@ STATUSBAR_DrawSizeGrip (HDC hdc, LPRECT lpRect)
}
static void
static void
STATUSBAR_DrawPart (HDC hdc, const STATUSWINDOWPART *part, const STATUSWINDOWINFO *infoPtr, int itemID)
{
RECT r = part->bound;
@ -137,7 +137,7 @@ STATUSBAR_DrawPart (HDC hdc, const STATUSWINDOWPART *part, const STATUSWINDOWINF
border = 0;
DrawEdge(hdc, &r, border, BF_RECT|BF_ADJUST);
if (part->style & SBT_OWNERDRAW)
{
DRAWITEMSTRUCT dis;
@ -150,14 +150,14 @@ STATUSBAR_DrawPart (HDC hdc, const STATUSWINDOWPART *part, const STATUSWINDOWINF
dis.itemData = (INT)part->text;
SendMessageW (GetParent (infoPtr->Self), WM_DRAWITEM,
(WPARAM)dis.CtlID, (LPARAM)&dis);
}
}
else
{
if (part->hIcon)
{
INT cy = r.bottom - r.top;
r.left += 2;
r.left += 2;
DrawIconEx (hdc, r.left, r.top, part->hIcon, cy, cy, 0, 0, DI_NORMAL);
r.left += cy;
}
@ -586,7 +586,7 @@ STATUSBAR_SetParts (STATUSWINDOWINFO *infoPtr, INT count, LPINT parts)
if (i==oldNumParts) /* Unchanged? no need to redraw! */
return TRUE;
}
for (i = 0; i < infoPtr->numParts; i++)
infoPtr->parts[i].x = parts[i];
@ -625,13 +625,13 @@ STATUSBAR_SetParts (STATUSWINDOWINFO *infoPtr, INT count, LPINT parts)
static BOOL
STATUSBAR_SetTextT (STATUSWINDOWINFO *infoPtr, INT nPart, WORD style,
STATUSBAR_SetTextT (STATUSWINDOWINFO *infoPtr, INT nPart, WORD style,
LPCWSTR text, BOOL isW)
{
STATUSWINDOWPART *part=NULL;
BOOL changed = FALSE;
if (style & SBT_OWNERDRAW) {
if (style & SBT_OWNERDRAW) {
TRACE("part %d, text %x\n",nPart,text);
}
else TRACE("part %d, text %s\n", nPart, debugstr_t(text, isW));
@ -678,7 +678,7 @@ STATUSBAR_SetTextT (STATUSWINDOWINFO *infoPtr, INT nPart, WORD style,
return TRUE;
}
} else {
if (!changed && !part->text)
if (!changed && !part->text)
return TRUE;
}
@ -898,7 +898,7 @@ STATUSBAR_WMCreate (HWND hwnd, LPCREATESTRUCTA lpCreate)
SendMessageW (lpCreate->hwndParent, WM_NOTIFY,
(WPARAM)nmttc.hdr.idFrom, (LPARAM)&nmttc);
}
}
}
if (!(dwStyle & CCS_NORESIZE)) { /* don't resize wnd if it doesn't want it ! */
@ -911,7 +911,7 @@ STATUSBAR_WMCreate (HWND hwnd, LPCREATESTRUCTA lpCreate)
}
return 0;
create_fail:
TRACE(" failed!\n");
if (infoPtr) STATUSBAR_WMDestroy(infoPtr);
@ -1049,13 +1049,13 @@ STATUSBAR_WMSize (STATUSWINDOWINFO *infoPtr, WORD flags)
return FALSE;
}
if (GetWindowLongW(infoPtr->Self, GWL_STYLE) & CCS_NORESIZE) return FALSE;
/* width and height don't apply */
GetClientRect (GetParent(infoPtr->Self), &parent_rect);
width = parent_rect.right - parent_rect.left;
x = parent_rect.left;
y = parent_rect.bottom - infoPtr->height;
MoveWindow (infoPtr->Self, parent_rect.left,
MoveWindow (infoPtr->Self, parent_rect.left,
parent_rect.bottom - infoPtr->height,
width, infoPtr->height, TRUE);
STATUSBAR_SetPartBounds (infoPtr);
@ -1063,7 +1063,7 @@ STATUSBAR_WMSize (STATUSWINDOWINFO *infoPtr, WORD flags)
}
static LRESULT
static LRESULT
STATUSBAR_NotifyFormat (STATUSWINDOWINFO *infoPtr, HWND from, INT cmd)
{
if (cmd == NF_REQUERY) {
@ -1144,7 +1144,7 @@ StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
case SB_SETMINHEIGHT:
return STATUSBAR_SetMinHeight (infoPtr, (INT)wParam);
case SB_SETPARTS:
case SB_SETPARTS:
return STATUSBAR_SetParts (infoPtr, (INT)wParam, (LPINT)lParam);
case SB_SETTEXTA:
@ -1202,7 +1202,7 @@ StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
case WM_NOTIFYFORMAT:
return STATUSBAR_NotifyFormat(infoPtr, (HWND)wParam, (INT)lParam);
case WM_PAINT:
return STATUSBAR_WMPaint (infoPtr, (HDC)wParam);
@ -1251,7 +1251,7 @@ STATUS_Register (void)
wndClass.hCursor = LoadCursorW (0, IDC_ARROWW);
wndClass.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
wndClass.lpszClassName = STATUSCLASSNAMEW;
RegisterClassW (&wndClass);
}

File diff suppressed because it is too large Load Diff

View File

@ -85,7 +85,7 @@ typedef struct
BOOL bHot;
INT nRow;
RECT rect;
} TBUTTON_INFO;
} TBUTTON_INFO;
typedef struct
{
@ -170,7 +170,7 @@ typedef struct
#define SEPARATOR_WIDTH 8
#define TOP_BORDER 2
#define BOTTOM_BORDER 2
#define DDARROW_WIDTH 11
#define DDARROW_WIDTH 11
#define TOOLBAR_GetInfoPtr(hwnd) ((TOOLBAR_INFO *)GetWindowLongA(hwnd,0))
#define TOOLBAR_HasText(x, y) (TOOLBAR_GetText(x, y) ? TRUE : FALSE)
@ -196,7 +196,7 @@ TOOLBAR_GetText(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr)
lpText = (LPWSTR)btnPtr->iString;
else if ((btnPtr->iString >= 0) && (btnPtr->iString < infoPtr->nNumStrings))
lpText = infoPtr->strings[btnPtr->iString];
return lpText;
}
@ -212,7 +212,7 @@ TOOLBAR_DumpButton(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *bP, INT btn_num, BOOL in
TRACE("button %d id %d, hot=%s, row=%d, rect=(%d,%d)-(%d,%d)\n",
btn_num, bP->idCommand,
(bP->bHot) ? "TRUE":"FALSE", bP->nRow,
bP->rect.left, bP->rect.top,
bP->rect.left, bP->rect.top,
bP->rect.right, bP->rect.bottom);
}
}
@ -263,7 +263,7 @@ TOOLBAR_SendNotify (NMHDR *nmhdr, TOOLBAR_INFO *infoPtr, UINT code)
{
if(!IsWindow(infoPtr->hwndSelf))
return 0; /* we have just been destroyed */
nmhdr->idFrom = GetDlgCtrlID (infoPtr->hwndSelf);
nmhdr->hwndFrom = infoPtr->hwndSelf;
nmhdr->code = code;
@ -272,10 +272,10 @@ TOOLBAR_SendNotify (NMHDR *nmhdr, TOOLBAR_INFO *infoPtr, UINT code)
(infoPtr->bNtfUnicode) ? "via Unicode" : "via ANSI");
if (infoPtr->bNtfUnicode)
return SendMessageW (infoPtr->hwndNotify, WM_NOTIFY,
return SendMessageW (infoPtr->hwndNotify, WM_NOTIFY,
(WPARAM) nmhdr->idFrom, (LPARAM)nmhdr);
else
return SendMessageA (infoPtr->hwndNotify, WM_NOTIFY,
return SendMessageA (infoPtr->hwndNotify, WM_NOTIFY,
(WPARAM) nmhdr->idFrom, (LPARAM)nmhdr);
}
@ -286,7 +286,7 @@ TOOLBAR_SendNotify (NMHDR *nmhdr, TOOLBAR_INFO *infoPtr, UINT code)
* If the button specifies I_IMAGECALLBACK, then the TBN_GETDISPINFO
* is issued to retrieve the index.
*/
static INT
static INT
TOOLBAR_GetBitmapIndex(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr)
{
INT ret = btnPtr->iBitmap;
@ -305,14 +305,14 @@ TOOLBAR_GetBitmapIndex(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr)
btnPtr->iBitmap = nmgd.iImage;
}
ret = nmgd.iImage;
TRACE("TBN_GETDISPINFOA returned bitmap id %d, mask=%08lx, nNumBitmaps=%d\n",
TRACE("TBN_GETDISPINFOA returned bitmap id %d, mask=%08lx, nNumBitmaps=%d\n",
ret, nmgd.dwMask, infoPtr->nNumBitmaps);
}
return ret;
}
static BOOL
static BOOL
TOOLBAR_IsValidBitmapIndex(TOOLBAR_INFO *infoPtr, INT index)
{
if (((index>=0) && (index <= infoPtr->nNumBitmaps)) ||
@ -328,7 +328,7 @@ TOOLBAR_IsValidBitmapIndex(TOOLBAR_INFO *infoPtr, INT index)
*
* This function validates the bitmap index (including I_IMAGECALLBACK
* functionality). It then draws the image via the ImageList_Draw
* function. It returns TRUE if the image was drawn, FALSE otherwise.
* function. It returns TRUE if the image was drawn, FALSE otherwise.
*/
static BOOL
TOOLBAR_DrawImageList (TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, HIMAGELIST himl,
@ -340,7 +340,7 @@ TOOLBAR_DrawImageList (TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, HIMAGELIST h
if (!TOOLBAR_IsValidBitmapIndex(infoPtr,btnPtr->iBitmap)) {
if (btnPtr->iBitmap == I_IMAGENONE) return FALSE;
ERR("index %d is not valid, max %d\n",
ERR("index %d is not valid, max %d\n",
btnPtr->iBitmap, infoPtr->nNumBitmaps);
return FALSE;
}
@ -375,7 +375,7 @@ TOOLBAR_TestImageExist (TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, HIMAGELIST
if (!TOOLBAR_IsValidBitmapIndex(infoPtr,btnPtr->iBitmap)) {
if (btnPtr->iBitmap == I_IMAGENONE) return FALSE;
ERR("index %d is not valid, max %d\n",
ERR("index %d is not valid, max %d\n",
btnPtr->iBitmap, infoPtr->nNumBitmaps);
return FALSE;
}
@ -402,7 +402,7 @@ TOOLBAR_DrawFlatSeparator (LPRECT lpRect, HDC hdc, TOOLBAR_INFO *infoPtr)
myrect.top = lpRect->top + 2;
myrect.bottom = lpRect->bottom - 2;
newcolor = (infoPtr->clrBtnShadow == CLR_DEFAULT) ?
newcolor = (infoPtr->clrBtnShadow == CLR_DEFAULT) ?
comctl32_color.clrBtnShadow : infoPtr->clrBtnShadow;
oldcolor = SetBkColor (hdc, newcolor);
ExtTextOutA (hdc, 0, 0, ETO_OPAQUE, &myrect, 0, 0, 0);
@ -410,7 +410,7 @@ TOOLBAR_DrawFlatSeparator (LPRECT lpRect, HDC hdc, TOOLBAR_INFO *infoPtr)
myrect.left = myrect.right;
myrect.right = myrect.left + 1;
newcolor = (infoPtr->clrBtnHighlight == CLR_DEFAULT) ?
newcolor = (infoPtr->clrBtnHighlight == CLR_DEFAULT) ?
comctl32_color.clrBtnHighlight : infoPtr->clrBtnHighlight;
SetBkColor (hdc, newcolor);
ExtTextOutA (hdc, 0, 0, ETO_OPAQUE, &myrect, 0, 0, 0);
@ -446,7 +446,7 @@ TOOLBAR_DrawDDFlatSeparator (LPRECT lpRect, HDC hdc, TBUTTON_INFO *btnPtr, TOOLB
TRACE("rect=(%d,%d)-(%d,%d)\n",
myrect.left, myrect.top, myrect.right, myrect.bottom);
newcolor = (infoPtr->clrBtnShadow == CLR_DEFAULT) ?
newcolor = (infoPtr->clrBtnShadow == CLR_DEFAULT) ?
comctl32_color.clrBtnShadow : infoPtr->clrBtnShadow;
oldcolor = SetBkColor (hdc, newcolor);
ExtTextOutA (hdc, 0, 0, ETO_OPAQUE, &myrect, 0, 0, 0);
@ -454,7 +454,7 @@ TOOLBAR_DrawDDFlatSeparator (LPRECT lpRect, HDC hdc, TBUTTON_INFO *btnPtr, TOOLB
myrect.top = myrect.bottom;
myrect.bottom = myrect.top + 1;
newcolor = (infoPtr->clrBtnHighlight == CLR_DEFAULT) ?
newcolor = (infoPtr->clrBtnHighlight == CLR_DEFAULT) ?
comctl32_color.clrBtnHighlight : infoPtr->clrBtnHighlight;
SetBkColor (hdc, newcolor);
ExtTextOutA (hdc, 0, 0, ETO_OPAQUE, &myrect, 0, 0, 0);
@ -631,7 +631,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
rc.right = max(rc.left, rc.right - DDARROW_WIDTH);
else
rc.right = max(rc.left, rc.right - DDARROW_WIDTH - 2);
rcArrow.left = rc.right;
rcArrow.left = rc.right;
}
/* Center the bitmap horizontally and vertically */
@ -645,7 +645,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
else
rcBitmap.top+=(infoPtr->nButtonHeight - infoPtr->nBitmapHeight) / 2;
TRACE("iBitmap: %d, start=(%d,%d) w=%d, h=%d\n",
TRACE("iBitmap: %d, start=(%d,%d) w=%d, h=%d\n",
btnPtr->iBitmap, rcBitmap.left, rcBitmap.top,
infoPtr->nBitmapWidth, infoPtr->nBitmapHeight);
TRACE ("iString: %x\n", btnPtr->iString);
@ -656,7 +656,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
InflateRect (&rcText, -3, -3);
if (infoPtr->himlDef &&
if (infoPtr->himlDef &&
TOOLBAR_IsValidBitmapIndex(infoPtr,btnPtr->iBitmap)) {
/* The following test looked like this before
* I changed it. IE4 "Links" toolbar would not
@ -664,7 +664,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
* ((dwStyle & TBSTYLE_LIST) &&
* ((btnPtr->fsStyle & TBSTYLE_AUTOSIZE) == 0) &&
* (btnPtr->iBitmap != I_IMAGENONE))
*/
*/
if (dwStyle & TBSTYLE_LIST) {
/* LIST style w/ ICON offset is by matching native. */
/* Matches IE4 "Links" bar. - GA 8/01 */
@ -711,7 +711,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
tbcd.hbrLines = 0;
tbcd.hpenLines = 0;
/* Issue Item Prepaint notify */
/* Issue Item Prepaint notify */
infoPtr->dwItemCustDraw = 0;
infoPtr->dwItemCDFlag = 0;
if (infoPtr->dwBaseCustDraw & CDRF_NOTIFYITEMDRAW)
@ -725,7 +725,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
ntfret = TOOLBAR_SendNotify ((NMHDR *)&tbcd, infoPtr, NM_CUSTOMDRAW);
infoPtr->dwItemCustDraw = ntfret & 0xffff;
infoPtr->dwItemCDFlag = ntfret & 0xffff0000;
if (infoPtr->dwItemCustDraw & CDRF_SKIPDEFAULT)
if (infoPtr->dwItemCustDraw & CDRF_SKIPDEFAULT)
return;
/* save the only part of the rect that the user can change */
rcText.right = tbcd.rcText.right + rc.left;
@ -765,7 +765,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
DrawEdge (hdc, &rcArrow, EDGE_RAISED,
BF_SOFT | BF_RECT | BF_MIDDLE | BF_ADJUST);
}
if (hasDropDownArrow)
{
TOOLBAR_DrawArrow(hdc, rcArrow.left+1, rcArrow.top+1, COLOR_3DHIGHLIGHT);
@ -773,7 +773,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
}
if (!TOOLBAR_DrawImageList (infoPtr, btnPtr, infoPtr->himlDis,
hdc, rcBitmap.left, rcBitmap.top,
hdc, rcBitmap.left, rcBitmap.top,
ILD_NORMAL))
TOOLBAR_DrawMasked (infoPtr, btnPtr, hdc, rcBitmap.left, rcBitmap.top);
@ -804,7 +804,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
TOOLBAR_DrawArrow(hdc, rcArrow.left, rcArrow.top, COLOR_WINDOWFRAME);
TOOLBAR_DrawImageList (infoPtr, btnPtr, infoPtr->himlDef,
hdc, rcBitmap.left+offset, rcBitmap.top+offset,
hdc, rcBitmap.left+offset, rcBitmap.top+offset,
ILD_NORMAL);
TOOLBAR_DrawString (infoPtr, btnPtr, hdc, btnPtr->fsState, dwStyle, &rcText, lpText, &tbcd);
@ -825,16 +825,16 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
}
TOOLBAR_DrawPattern (hdc, &rc);
TOOLBAR_DrawImageList (infoPtr, btnPtr, infoPtr->himlDef,
hdc, rcBitmap.left+1, rcBitmap.top+1,
hdc, rcBitmap.left+1, rcBitmap.top+1,
ILD_NORMAL);
TOOLBAR_DrawString (infoPtr, btnPtr, hdc, btnPtr->fsState, dwStyle, &rcText, lpText, &tbcd);
goto FINALNOTIFY;
}
/* indeterminate */
/* indeterminate */
if (btnPtr->fsState & TBSTATE_INDETERMINATE) {
if (!(infoPtr->dwItemCDFlag & TBCDRF_NOEDGES))
DrawEdge (hdc, &rc, EDGE_RAISED,
@ -888,9 +888,9 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
if (btnPtr->bHot) {
/* if hot, attempt to draw with himlHot, if fails, use himlDef */
if (!TOOLBAR_DrawImageList (infoPtr, btnPtr,
if (!TOOLBAR_DrawImageList (infoPtr, btnPtr,
infoPtr->himlHot,
hdc, rcBitmap.left,
hdc, rcBitmap.left,
rcBitmap.top, ILD_NORMAL))
TOOLBAR_DrawImageList (infoPtr, btnPtr, infoPtr->himlDef,
hdc, rcBitmap.left, rcBitmap.top,
@ -918,7 +918,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
TOOLBAR_DrawImageList (infoPtr, btnPtr, infoPtr->himlDef,
hdc, rcBitmap.left, rcBitmap.top,
ILD_NORMAL);}
TOOLBAR_DrawString (infoPtr, btnPtr, hdc, btnPtr->fsState, dwStyle, &rcText, lpText, &tbcd);
@ -1002,7 +1002,7 @@ TOOLBAR_Refresh (HWND hwnd, HDC hdc, PAINTSTRUCT* ps)
* only DrawText does. Note that the TBSTYLE_NOPREFIX is handled here.
*/
static void
TOOLBAR_MeasureString(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr,
TOOLBAR_MeasureString(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr,
HDC hdc, LPSIZE lpSize)
{
RECT myrect;
@ -1010,7 +1010,7 @@ TOOLBAR_MeasureString(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr,
lpSize->cx = 0;
lpSize->cy = 0;
if (!(btnPtr->fsState & TBSTATE_HIDDEN) )
if (!(btnPtr->fsState & TBSTATE_HIDDEN) )
{
LPWSTR lpText = TOOLBAR_GetText(infoPtr, btnPtr);
@ -1080,17 +1080,17 @@ TOOLBAR_CalcStrings (HWND hwnd, LPSIZE lpSize)
/***********************************************************************
* TOOLBAR_WrapToolbar
*
* This function walks through the buttons and seperators in the
* toolbar, and sets the TBSTATE_WRAP flag only on those items where
* wrapping should occur based on the width of the toolbar window.
* It does *not* calculate button placement itself. That task
* takes place in TOOLBAR_CalcToolbar. If the program wants to manage
* the toolbar wrapping on its own, it can use the TBSTYLE_WRAPABLE
* This function walks through the buttons and seperators in the
* toolbar, and sets the TBSTATE_WRAP flag only on those items where
* wrapping should occur based on the width of the toolbar window.
* It does *not* calculate button placement itself. That task
* takes place in TOOLBAR_CalcToolbar. If the program wants to manage
* the toolbar wrapping on its own, it can use the TBSTYLE_WRAPABLE
* flag, and set the TBSTATE_WRAP flags manually on the appropriate items.
*
* Note: TBSTYLE_WRAPABLE or TBSTYLE_EX_UNDOC1 can be used also to allow
* vertical toolbar lists.
*/
* Note: TBSTYLE_WRAPABLE or TBSTYLE_EX_UNDOC1 can be used also to allow
* vertical toolbar lists.
*/
static void
TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle )
@ -1101,10 +1101,10 @@ TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle )
RECT rc;
BOOL bWrap, bButtonWrap;
/* When the toolbar window style is not TBSTYLE_WRAPABLE, */
/* When the toolbar window style is not TBSTYLE_WRAPABLE, */
/* no layout is necessary. Applications may use this style */
/* to perform their own layout on the toolbar. */
if( !(dwStyle & TBSTYLE_WRAPABLE) &&
if( !(dwStyle & TBSTYLE_WRAPABLE) &&
!(infoPtr->dwExStyle & TBSTYLE_EX_UNDOC1) ) return;
btnPtr = infoPtr->buttons;
@ -1126,7 +1126,7 @@ TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle )
{
bWrap = FALSE;
btnPtr[i].fsState &= ~TBSTATE_WRAP;
if (btnPtr[i].fsState & TBSTATE_HIDDEN)
continue;
@ -1138,18 +1138,18 @@ TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle )
/* width. - GA 8/01 */
if ((btnPtr[i].fsStyle & TBSTYLE_SEP) &&
!(btnPtr[i].fsStyle & TBSTYLE_DROPDOWN))
cx = (btnPtr[i].iBitmap > 0) ?
cx = (btnPtr[i].iBitmap > 0) ?
btnPtr[i].iBitmap : SEPARATOR_WIDTH;
else
cx = infoPtr->nButtonWidth;
/* Two or more adjacent separators form a separator group. */
/* Two or more adjacent separators form a separator group. */
/* The first separator in a group should be wrapped to the */
/* next row if the previous wrapping is on a button. */
if( bButtonWrap &&
(btnPtr[i].fsStyle & TBSTYLE_SEP) &&
(btnPtr[i].fsStyle & TBSTYLE_SEP) &&
(i + 1 < infoPtr->nNumButtons ) &&
(btnPtr[i + 1].fsStyle & TBSTYLE_SEP) )
(btnPtr[i + 1].fsStyle & TBSTYLE_SEP) )
{
TRACE("wrap point 1 btn %d style %02x\n", i, btnPtr[i].fsStyle);
btnPtr[i].fsState |= TBSTATE_WRAP;
@ -1162,28 +1162,28 @@ TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle )
/* The layout makes sure the bitmap is visible, but not the button. */
/* Test added to also wrap after a button that starts a row but */
/* is bigger than the area. - GA 8/01 */
if (( x + cx - (infoPtr->nButtonWidth - infoPtr->nBitmapWidth) / 2
if (( x + cx - (infoPtr->nButtonWidth - infoPtr->nBitmapWidth) / 2
> infoPtr->nWidth ) ||
((x == infoPtr->nIndent) && (cx > infoPtr->nWidth)))
{
BOOL bFound = FALSE;
/* If the current button is a separator and not hidden, */
/* If the current button is a separator and not hidden, */
/* go to the next until it reaches a non separator. */
/* Wrap the last separator if it is before a button. */
while( ( ((btnPtr[i].fsStyle & TBSTYLE_SEP) &&
!(btnPtr[i].fsStyle & TBSTYLE_DROPDOWN)) ||
!(btnPtr[i].fsStyle & TBSTYLE_DROPDOWN)) ||
(btnPtr[i].fsState & TBSTATE_HIDDEN) ) &&
i < infoPtr->nNumButtons )
{
i++;
bFound = TRUE;
}
if( bFound && i < infoPtr->nNumButtons )
{
i--;
TRACE("wrap point 2 btn %d style %02x, x=%d, cx=%d\n",
TRACE("wrap point 2 btn %d style %02x, x=%d, cx=%d\n",
i, btnPtr[i].fsStyle, x, cx);
btnPtr[i].fsState |= TBSTATE_WRAP;
x = infoPtr->nIndent;
@ -1193,20 +1193,20 @@ TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle )
else if ( i >= infoPtr->nNumButtons)
break;
/* If the current button is not a separator, find the last */
/* If the current button is not a separator, find the last */
/* separator and wrap it. */
for ( j = i - 1; j >= 0 && !(btnPtr[j].fsState & TBSTATE_WRAP); j--)
{
if ((btnPtr[j].fsStyle & TBSTYLE_SEP) &&
!(btnPtr[j].fsState & TBSTATE_HIDDEN))
{
bFound = TRUE;
i = j;
TRACE("wrap point 3 btn %d style %02x, x=%d, cx=%d\n",
bFound = TRUE;
i = j;
TRACE("wrap point 3 btn %d style %02x, x=%d, cx=%d\n",
i, btnPtr[i].fsStyle, x, cx);
x = infoPtr->nIndent;
btnPtr[j].fsState |= TBSTATE_WRAP;
bButtonWrap = FALSE;
bButtonWrap = FALSE;
break;
}
}
@ -1215,15 +1215,15 @@ TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle )
/* non-hidden previous button. */
if (!bFound)
{
for ( j = i - 1;
for ( j = i - 1;
j >= 0 && !(btnPtr[j].fsState & TBSTATE_WRAP); j--)
{
if (btnPtr[j].fsState & TBSTATE_HIDDEN)
if (btnPtr[j].fsState & TBSTATE_HIDDEN)
continue;
bFound = TRUE;
i = j;
TRACE("wrap point 4 btn %d style %02x, x=%d, cx=%d\n",
bFound = TRUE;
i = j;
TRACE("wrap point 4 btn %d style %02x, x=%d, cx=%d\n",
i, btnPtr[i].fsStyle, x, cx);
x = infoPtr->nIndent;
btnPtr[j].fsState |= TBSTATE_WRAP;
@ -1233,7 +1233,7 @@ TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle )
}
/* If all above failed, wrap the current button. */
if (!bFound)
if (!bFound)
{
TRACE("wrap point 5 btn %d style %02x, x=%d, cx=%d\n",
i, btnPtr[i].fsStyle, x, cx);
@ -1244,10 +1244,10 @@ TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle )
bButtonWrap = FALSE;
else
bButtonWrap = TRUE;
}
}
}
else {
TRACE("wrap point 6 btn %d style %02x, x=%d, cx=%d\n",
TRACE("wrap point 6 btn %d style %02x, x=%d, cx=%d\n",
i, btnPtr[i].fsStyle, x, cx);
x += cx;
}
@ -1258,13 +1258,13 @@ TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle )
/***********************************************************************
* TOOLBAR_CalcToolbar
*
* This function calculates button and separator placement. It first
* calculates the button sizes, gets the toolbar window width and then
* calls TOOLBAR_WrapToolbar to determine which buttons we need to wrap
* This function calculates button and separator placement. It first
* calculates the button sizes, gets the toolbar window width and then
* calls TOOLBAR_WrapToolbar to determine which buttons we need to wrap
* on. It assigns a new location to each item and sends this location to
* the tooltip window if appropriate. Finally, it updates the rcBound
* rect and calculates the new required toolbar window height.
*/
* the tooltip window if appropriate. Finally, it updates the rcBound
* rect and calculates the new required toolbar window height.
*/
static void
TOOLBAR_CalcToolbar (HWND hwnd)
@ -1301,10 +1301,10 @@ TOOLBAR_CalcToolbar (HWND hwnd)
if (sizeString.cy > 0)
{
if (usesBitmaps)
infoPtr->nButtonHeight = sizeString.cy +
infoPtr->nButtonHeight = sizeString.cy +
2 + /* this is the space to separate text from bitmap */
infoPtr->nBitmapHeight + 6;
else
else
infoPtr->nButtonHeight = sizeString.cy + 6;
}
else if (infoPtr->nButtonHeight < infoPtr->nBitmapHeight + 6)
@ -1327,8 +1327,8 @@ TOOLBAR_CalcToolbar (HWND hwnd)
y = 0;
/*
* We will set the height below, and we set the width on entry
* so we do not reset them here..
* We will set the height below, and we set the width on entry
* so we do not reset them here..
*/
#if 0
GetClientRect( hwnd, &rc );
@ -1389,7 +1389,7 @@ TOOLBAR_CalcToolbar (HWND hwnd)
}
else
{
if (btnPtr->fsStyle & TBSTYLE_AUTOSIZE)
if (btnPtr->fsStyle & TBSTYLE_AUTOSIZE)
{
SIZE sz;
HDC hdc;
@ -1406,7 +1406,7 @@ TOOLBAR_CalcToolbar (HWND hwnd)
/* Fudge amount measured against IE4 "menu" and "Links" */
/* toolbars with native control (v4.71). - GA 8/01 */
cx = sz.cx + 6 + 5 + 5;
if ((dwStyle & TBSTYLE_LIST) &&
if ((dwStyle & TBSTYLE_LIST) &&
(TOOLBAR_TestImageExist (infoPtr, btnPtr, infoPtr->himlDef)))
cx += infoPtr->nBitmapWidth;
}
@ -1414,7 +1414,7 @@ TOOLBAR_CalcToolbar (HWND hwnd)
cx = infoPtr->nButtonWidth;
if (hasDropDownArrows && (btnPtr->fsStyle & TBSTYLE_DROPDOWN))
cx += DDARROW_WIDTH;
cx += DDARROW_WIDTH;
}
if (btnPtr->fsState & TBSTATE_WRAP )
bWrap = TRUE;
@ -1429,7 +1429,7 @@ TOOLBAR_CalcToolbar (HWND hwnd)
infoPtr->rcBound.bottom = y + cy;
/* Set the toolTip only for non-hidden, non-separator button */
if (infoPtr->hwndToolTip && !(btnPtr->fsStyle & TBSTYLE_SEP ))
if (infoPtr->hwndToolTip && !(btnPtr->fsStyle & TBSTYLE_SEP ))
{
TTTOOLINFOA ti;
@ -1454,17 +1454,17 @@ TOOLBAR_CalcToolbar (HWND hwnd)
{
if ( !(btnPtr->fsStyle & TBSTYLE_SEP) )
y += cy;
else
{
else
{
/* UNDOCUMENTED: If a separator has a non zero bitmap index, */
/* it is the actual width of the separator. This is used for */
/* custom controls in toolbars. */
if ( !(btnPtr->fsStyle & TBSTYLE_DROPDOWN))
y += cy + ( (btnPtr->iBitmap > 0 ) ?
btnPtr->iBitmap : SEPARATOR_WIDTH) * 2 /3;
btnPtr->iBitmap : SEPARATOR_WIDTH) * 2 /3;
else
y += cy;
/* nSepRows is used to calculate the extra height follwoing */
/* the last row. */
nSepRows++;
@ -1495,10 +1495,10 @@ TOOLBAR_CalcToolbar (HWND hwnd)
/* nSepRows * (infoPtr->nBitmapHeight + 1) is the space following */
/* the last row. */
infoPtr->nHeight = TOP_BORDER + (nRows + 1) * infoPtr->nButtonHeight +
infoPtr->nHeight = TOP_BORDER + (nRows + 1) * infoPtr->nButtonHeight +
nSepRows * (SEPARATOR_WIDTH * 2 / 3) +
nSepRows * (infoPtr->nBitmapHeight + 1) +
BOTTOM_BORDER;
nSepRows * (infoPtr->nBitmapHeight + 1) +
BOTTOM_BORDER;
#endif
infoPtr->nHeight = infoPtr->rcBound.bottom - infoPtr->rcBound.top;
@ -1513,7 +1513,7 @@ TOOLBAR_InternalHitTest (HWND hwnd, LPPOINT lpPt)
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
TBUTTON_INFO *btnPtr;
INT i;
btnPtr = infoPtr->buttons;
for (i = 0; i < infoPtr->nNumButtons; i++, btnPtr++) {
if (btnPtr->fsState & TBSTATE_HIDDEN)
@ -1593,7 +1593,7 @@ TOOLBAR_GetCheckedGroupButtonIndex (TOOLBAR_INFO *infoPtr, INT nIndex)
/* check next buttons */
nRunIndex = nIndex + 1;
while (nRunIndex < infoPtr->nNumButtons) {
btnPtr = &infoPtr->buttons[nRunIndex];
btnPtr = &infoPtr->buttons[nRunIndex];
if ((btnPtr->fsStyle & TBSTYLE_CHECKGROUP) == TBSTYLE_CHECKGROUP) {
if (btnPtr->fsState & TBSTATE_CHECKED)
return nRunIndex;
@ -1648,7 +1648,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
char Buffer[256];
int i = 0;
int index;
infoPtr = custInfo->tbInfo;
/* send TBN_QUERYINSERT notification */
@ -1668,8 +1668,8 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
/* send TBN_QUERYDELETE notification */
nmtb.iItem = i;
btnInfo->bRemovable = TOOLBAR_SendNotify ((NMHDR *) &nmtb,
infoPtr,
btnInfo->bRemovable = TOOLBAR_SendNotify ((NMHDR *) &nmtb,
infoPtr,
TBN_QUERYDELETE);
index = (int)SendDlgItemMessageA (hwnd, IDC_TOOLBARBTN_LBOX, LB_ADDSTRING, 0, 0);
@ -1697,7 +1697,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
if (!TOOLBAR_SendNotify ((NMHDR *) &nmtb, infoPtr, TBN_GETBUTTONINFOA))
break;
TRACE("style: %x\n", nmtb.tbButton.fsStyle);
TRACE("style: %x\n", nmtb.tbButton.fsStyle);
/* insert button into the apropriate list */
index = TOOLBAR_GetButtonIndex (custInfo->tbInfo, nmtb.tbButton.idCommand, FALSE);
@ -1773,7 +1773,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
/* send TBN_QUERYINSERT notification */
nmtb.iItem = index;
TOOLBAR_SendNotify ((NMHDR *) &nmtb, infoPtr,
TOOLBAR_SendNotify ((NMHDR *) &nmtb, infoPtr,
TBN_QUERYINSERT);
/* get list box item */
@ -2100,18 +2100,18 @@ TOOLBAR_AddBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam)
TRACE ("adding %d internal bitmaps!\n", nButtons);
/* Windows resize all the buttons to the size of a newly added standard image */
if (lpAddBmp->nID & 1)
if (lpAddBmp->nID & 1)
{
/* large icons */
/* FIXME: on windows the size of the images is 25x24 but the size of the bitmap
* in rsrc is only 24x24. Fix the bitmap (how?) and then fix this
/* FIXME: on windows the size of the images is 25x24 but the size of the bitmap
* in rsrc is only 24x24. Fix the bitmap (how?) and then fix this
*/
SendMessageA (hwnd, TB_SETBITMAPSIZE, 0,
MAKELPARAM((WORD)24, (WORD)24));
SendMessageA (hwnd, TB_SETBUTTONSIZE, 0,
MAKELPARAM((WORD)31, (WORD)30));
}
else
}
else
{
/* small icons */
SendMessageA (hwnd, TB_SETBITMAPSIZE, 0,
@ -2119,7 +2119,7 @@ TOOLBAR_AddBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam)
SendMessageA (hwnd, TB_SETBUTTONSIZE, 0,
MAKELPARAM((WORD)22, (WORD)22));
}
TOOLBAR_CalcToolbar (hwnd);
}
else
@ -2127,10 +2127,10 @@ TOOLBAR_AddBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam)
nButtons = (INT)wParam;
if (nButtons <= 0)
return -1;
TRACE ("adding %d bitmaps!\n", nButtons);
}
if (!(infoPtr->himlDef)) {
/* create new default image list */
TRACE ("creating default image list!\n");
@ -2146,7 +2146,7 @@ TOOLBAR_AddBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam)
/* Add bitmaps to the default image list */
if (lpAddBmp->hInst == (HINSTANCE)0)
{
nIndex =
nIndex =
ImageList_AddMasked (infoPtr->himlDef, (HBITMAP)lpAddBmp->nID,
CLR_DEFAULT);
}
@ -2476,7 +2476,7 @@ TOOLBAR_AddStringW (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (szString[0] == L'|')
{
PWSTR p = szString + 1;
nIndex = infoPtr->nNumStrings;
while (*p != L'|') {
@ -2698,7 +2698,7 @@ TOOLBAR_CheckButton (HWND hwnd, WPARAM wParam, LPARAM lParam)
btnPtr->fsState &= ~TBSTATE_CHECKED;
else {
if (btnPtr->fsStyle & TBSTYLE_GROUP) {
nOldIndex =
nOldIndex =
TOOLBAR_GetCheckedGroupButtonIndex (infoPtr, nIndex);
if (nOldIndex == nIndex)
return 0;
@ -2781,7 +2781,7 @@ TOOLBAR_DeleteButton (HWND hwnd, WPARAM wParam, LPARAM lParam)
if ((nIndex < 0) || (nIndex >= infoPtr->nNumButtons))
return FALSE;
if ((infoPtr->hwndToolTip) &&
if ((infoPtr->hwndToolTip) &&
!(infoPtr->buttons[nIndex].fsStyle & TBSTYLE_SEP)) {
TTTOOLINFOA ti;
@ -2976,7 +2976,7 @@ TOOLBAR_GetButtonInfoW (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (lpTbInfo->cbSize < sizeof(TBBUTTONINFOW))
return -1;
nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam,
nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam,
lpTbInfo->dwMask & 0x80000000);
if (nIndex == -1)
return -1;
@ -3134,7 +3134,7 @@ TOOLBAR_GetItemRect (HWND hwnd, WPARAM wParam, LPARAM lParam)
return FALSE;
if (btnPtr->fsState & TBSTATE_HIDDEN)
return FALSE;
lpRect->left = btnPtr->rect.left;
lpRect->right = btnPtr->rect.right;
lpRect->bottom = btnPtr->rect.bottom;
@ -3195,7 +3195,7 @@ TOOLBAR_GetRect (HWND hwnd, WPARAM wParam, LPARAM lParam)
lpRect = (LPRECT)lParam;
if (lpRect == NULL)
return FALSE;
lpRect->left = btnPtr->rect.left;
lpRect->right = btnPtr->rect.right;
lpRect->bottom = btnPtr->rect.bottom;
@ -3273,7 +3273,7 @@ TOOLBAR_GetUnicodeFormat (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
TRACE("%s hwnd=0x%x stub!\n",
TRACE("%s hwnd=0x%x stub!\n",
infoPtr->bUnicode ? "TRUE" : "FALSE", hwnd);
return infoPtr->bUnicode;
@ -3471,7 +3471,7 @@ TOOLBAR_InsertButtonW (HWND hwnd, WPARAM wParam, LPARAM lParam)
} else if (nIndex < 0)
return FALSE;
/* If the string passed is not an index, assume address of string
/* If the string passed is not an index, assume address of string
and do our own AddString */
if ((HIWORD(lpTbb->iString) != 0) && (lpTbb->iString != -1)) {
LPWSTR ptr;
@ -3839,7 +3839,7 @@ TOOLBAR_SetButtonInfoA (HWND hwnd, WPARAM wParam, LPARAM lParam)
return FALSE;
if (lptbbi->cbSize < sizeof(TBBUTTONINFOA))
return FALSE;
nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam,
lptbbi->dwMask & 0x80000000);
if (nIndex == -1)
@ -3863,7 +3863,7 @@ TOOLBAR_SetButtonInfoA (HWND hwnd, WPARAM wParam, LPARAM lParam)
if ((HIWORD(btnPtr->iString) == 0) || (btnPtr->iString == -1))
/* iString is index, zero it to make Str_SetPtr succeed */
btnPtr->iString=0;
Str_SetPtrAtoW ((LPWSTR *)&btnPtr->iString, lptbbi->pszText);
}
return TRUE;
@ -3925,15 +3925,15 @@ TOOLBAR_SetButtonSize (HWND hwnd, WPARAM wParam, LPARAM lParam)
}
/* The documentation claims you can only change the button size before
* any button has been added. But this is wrong.
* WINZIP32.EXE (ver 8) calls this on one of its buttons after adding
* any button has been added. But this is wrong.
* WINZIP32.EXE (ver 8) calls this on one of its buttons after adding
* it to the toolbar, and it checks that the return value is nonzero - mjm
* Further testing shows that we must actually perform the change too.
*/
/*
* The documentation also does not mention that if 0 is supplied for
* either size, the system changes it to the default of 24 wide and
* 22 high. Demonstarted in ControlSpy Toolbar. GLA 3/02
* 22 high. Demonstarted in ControlSpy Toolbar. GLA 3/02
*/
infoPtr->nButtonWidth = (cx) ? cx : 24;
infoPtr->nButtonHeight = (cy) ? cy : 22;
@ -3956,7 +3956,7 @@ TOOLBAR_SetButtonWidth (HWND hwnd, WPARAM wParam, LPARAM lParam)
(infoPtr->cxMax == (INT)HIWORD(lParam))) {
TRACE("matches current width, min=%d, max=%d, no recalc\n",
infoPtr->cxMin, infoPtr->cxMax);
return TRUE;
return TRUE;
}
/* save new values */
@ -3965,14 +3965,14 @@ TOOLBAR_SetButtonWidth (HWND hwnd, WPARAM wParam, LPARAM lParam)
/* if both values are 0 then we are done */
if (lParam == 0) {
TRACE("setting both min and max to 0, norecalc\n");
TRACE("setting both min and max to 0, norecalc\n");
return TRUE;
}
/* otherwise we need to recalc the toolbar and in some cases
recalc the bounding rectangle (does DrawText w/ DT_CALCRECT
which doesn't actually draw - GA). */
TRACE("number of buttons %d, cx=%d, cy=%d, recalcing\n",
TRACE("number of buttons %d, cx=%d, cy=%d, recalcing\n",
infoPtr->nNumButtons, infoPtr->cxMin, infoPtr->cxMax);
TOOLBAR_CalcToolbar (hwnd);
@ -4021,7 +4021,7 @@ TOOLBAR_SetDisabledImageList (HWND hwnd, WPARAM wParam, LPARAM lParam)
/* FIXME: redraw ? */
return (LRESULT)himlTemp;
return (LRESULT)himlTemp;
}
@ -4060,7 +4060,7 @@ TOOLBAR_SetExtendedStyle (HWND hwnd, WPARAM wParam, LPARAM lParam)
FIXME("Unknown Toolbar Extended Style 0x%08lx. Please report.\n",
(infoPtr->dwExStyle & ~TBSTYLE_EX_ALL));
return (LRESULT)dwTemp;
return (LRESULT)dwTemp;
}
@ -4080,7 +4080,7 @@ TOOLBAR_SetHotImageList (HWND hwnd, WPARAM wParam, LPARAM lParam)
/* FIXME: redraw ? */
return (LRESULT)himlTemp;
return (LRESULT)himlTemp;
}
@ -4146,7 +4146,7 @@ TOOLBAR_SetImageList (HWND hwnd, WPARAM wParam, LPARAM lParam)
/* FIXME: redraw ? */
InvalidateRect(hwnd, NULL, TRUE);
return (LRESULT)himlTemp;
return (LRESULT)himlTemp;
}
@ -4348,7 +4348,7 @@ TOOLBAR_SetUnicodeFormat (HWND hwnd, WPARAM wParam, LPARAM lParam)
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
BOOL bTemp;
TRACE("%s hwnd=0x%04x stub!\n",
TRACE("%s hwnd=0x%04x stub!\n",
((BOOL)wParam) ? "TRUE" : "FALSE", hwnd);
bTemp = infoPtr->bUnicode;
@ -4363,10 +4363,10 @@ TOOLBAR_GetColorScheme (HWND hwnd, LPCOLORSCHEME lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
lParam->clrBtnHighlight = (infoPtr->clrBtnHighlight == CLR_DEFAULT) ?
comctl32_color.clrBtnHighlight :
lParam->clrBtnHighlight = (infoPtr->clrBtnHighlight == CLR_DEFAULT) ?
comctl32_color.clrBtnHighlight :
infoPtr->clrBtnHighlight;
lParam->clrBtnShadow = (infoPtr->clrBtnShadow == CLR_DEFAULT) ?
lParam->clrBtnShadow = (infoPtr->clrBtnShadow == CLR_DEFAULT) ?
comctl32_color.clrBtnShadow : infoPtr->clrBtnShadow;
return 1;
}
@ -4426,7 +4426,7 @@ TOOLBAR_Unkwn45E (HWND hwnd, WPARAM wParam, LPARAM lParam)
nmhotitem.idOld = (nOldHotItem >= 0) ?
infoPtr->buttons[nOldHotItem].idCommand : 0;
if ( !(nmhotitem.dwFlags & HICF_LEAVING) )
nmhotitem.idNew = (infoPtr->nHotItem >= 0) ?
nmhotitem.idNew = (infoPtr->nHotItem >= 0) ?
infoPtr->buttons[infoPtr->nHotItem].idCommand : 0;
no_hi = TOOLBAR_SendNotify((NMHDR*)&nmhotitem, infoPtr, TBN_HOTITEMCHANGE);
}
@ -4635,7 +4635,7 @@ TOOLBAR_EraseBackground (HWND hwnd, WPARAM wParam, LPARAM lParam)
infoPtr->dwBaseCustDraw = ntfret & 0xffff;
/* FIXME: in general the return flags *can* be or'ed together */
switch (infoPtr->dwBaseCustDraw)
switch (infoPtr->dwBaseCustDraw)
{
case CDRF_DODEFAULT:
break;
@ -4647,7 +4647,7 @@ TOOLBAR_EraseBackground (HWND hwnd, WPARAM wParam, LPARAM lParam)
}
}
/* If the toolbar is "transparent" then pass the WM_ERASEBKGND up
/* If the toolbar is "transparent" then pass the WM_ERASEBKGND up
* to my parent for processing.
*/
if (infoPtr->bTransparent) {
@ -4666,14 +4666,14 @@ TOOLBAR_EraseBackground (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (!ret)
ret = DefWindowProcA (hwnd, WM_ERASEBKGND, wParam, lParam);
if ((dwStyle & TBSTYLE_CUSTOMERASE) &&
(infoPtr->dwBaseCustDraw & CDRF_NOTIFYPOSTERASE)) {
if ((dwStyle & TBSTYLE_CUSTOMERASE) &&
(infoPtr->dwBaseCustDraw & CDRF_NOTIFYPOSTERASE)) {
ZeroMemory (&tbcd, sizeof(NMTBCUSTOMDRAW));
tbcd.nmcd.dwDrawStage = CDDS_POSTERASE;
tbcd.nmcd.hdc = (HDC)wParam;
ntfret = TOOLBAR_SendNotify ((NMHDR *)&tbcd, infoPtr, NM_CUSTOMDRAW);
infoPtr->dwBaseCustDraw = ntfret & 0xffff;
switch (infoPtr->dwBaseCustDraw)
switch (infoPtr->dwBaseCustDraw)
{
case CDRF_DODEFAULT:
break;
@ -4846,7 +4846,7 @@ TOOLBAR_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
nHit);
if (nOldIndex == nHit)
bSendMessage = FALSE;
if ((nOldIndex != nHit) &&
if ((nOldIndex != nHit) &&
(nOldIndex != -1))
infoPtr->buttons[nOldIndex].fsState &= ~TBSTATE_CHECKED;
btnPtr->fsState |= TBSTATE_CHECKED;
@ -4868,7 +4868,7 @@ TOOLBAR_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
/*
* now we can ReleaseCapture, which triggers CAPTURECHANGED msg,
* that resets bCaptured and btn TBSTATE_PRESSED flags,
* and obliterates nButtonDown and nOldHit (see TOOLBAR_CaptureChanged)
* and obliterates nButtonDown and nOldHit (see TOOLBAR_CaptureChanged)
*/
if ((infoPtr->bCaptured) && (infoPtr->nButtonDown >= 0))
ReleaseCapture ();
@ -4877,7 +4877,7 @@ TOOLBAR_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
TOOLBAR_SendNotify ((NMHDR *) &hdr, infoPtr,
NM_RELEASEDCAPTURE);
/* native issues TBN_ENDDRAG here, if _LBUTTONDOWN issued the
/* native issues TBN_ENDDRAG here, if _LBUTTONDOWN issued the
* TBN_BEGINDRAG
*/
nmtb.iItem = btnPtr->idCommand;
@ -4992,7 +4992,7 @@ TOOLBAR_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
/* Make sure tracking is enabled so we receive a WM_MOUSELEAVE message */
if(!(trackinfo.dwFlags & TME_LEAVE)) {
trackinfo.dwFlags = TME_LEAVE; /* notify upon leaving */
/* call TRACKMOUSEEVENT so we receive a WM_MOUSELEAVE message */
/* and can properly deactivate the hot toolbar button */
_TrackMouseEvent(&trackinfo);
@ -5011,7 +5011,7 @@ TOOLBAR_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
/* Remove the effect of an old hot button if the button was enabled and was
drawn with the hot button effect */
if(infoPtr->nOldHit >= 0 && infoPtr->nOldHit == infoPtr->nHotItem &&
if(infoPtr->nOldHit >= 0 && infoPtr->nOldHit == infoPtr->nHotItem &&
(infoPtr->buttons[infoPtr->nOldHit].fsState & TBSTATE_ENABLED))
{
oldBtnPtr = &infoPtr->buttons[infoPtr->nOldHit];
@ -5025,7 +5025,7 @@ TOOLBAR_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
infoPtr->nHotItem = nHit;
/* only enabled buttons show hot effect */
/* only enabled buttons show hot effect */
if(infoPtr->buttons[nHit].fsState & TBSTATE_ENABLED)
{
btnPtr->bHot = TRUE;
@ -5116,7 +5116,7 @@ TOOLBAR_NCCreate (HWND hwnd, WPARAM wParam, LPARAM lParam)
* CreateBitmap(0x27, 0x24, 1, 1, 0)
* hdc = GetDC(toolbar)
* GetSystemMetrics(0x48)
* fnt2=CreateFontA(0xe, 0, 0, 0, 0x190, 0, 0, 0, 0, 2,
* fnt2=CreateFontA(0xe, 0, 0, 0, 0x190, 0, 0, 0, 0, 2,
* 0, 0, 0, 0, "MARLETT")
* oldfnt = SelectObject(hdc, fnt2)
* GetCharWidthA(hdc, 0x36, 0x36, adr2)
@ -5205,12 +5205,12 @@ TOOLBAR_Notify (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (lppgc->dwFlag == PGF_CALCWIDTH) {
lppgc->iWidth = infoPtr->rcBound.right - infoPtr->rcBound.left;
TRACE("processed PGN_CALCSIZE, returning horz size = %d\n",
TRACE("processed PGN_CALCSIZE, returning horz size = %d\n",
lppgc->iWidth);
}
else {
lppgc->iHeight = infoPtr->rcBound.bottom - infoPtr->rcBound.top;
TRACE("processed PGN_CALCSIZE, returning vert size = %d\n",
TRACE("processed PGN_CALCSIZE, returning vert size = %d\n",
lppgc->iHeight);
}
return 0;
@ -5231,10 +5231,10 @@ TOOLBAR_Notify (HWND hwnd, WPARAM wParam, LPARAM lParam)
if ((infoPtr->hwndToolTip) && (lpnmh->hwndFrom == infoPtr->hwndToolTip)) {
if (infoPtr->bNtfUnicode)
return SendMessageW (infoPtr->hwndNotify, WM_NOTIFY,
return SendMessageW (infoPtr->hwndNotify, WM_NOTIFY,
wParam, lParam);
else
return SendMessageA (infoPtr->hwndNotify, WM_NOTIFY,
return SendMessageA (infoPtr->hwndNotify, WM_NOTIFY,
wParam, lParam);
#if 0
@ -5296,7 +5296,7 @@ TOOLBAR_Paint (HWND hwnd, WPARAM wParam)
PAINTSTRUCT ps;
/* fill ps.rcPaint with a default rect */
memcpy(&(ps.rcPaint), &(infoPtr->rcBound), sizeof(infoPtr->rcBound));
memcpy(&(ps.rcPaint), &(infoPtr->rcBound), sizeof(infoPtr->rcBound));
hdc = wParam==0 ? BeginPaint(hwnd, &ps) : (HDC)wParam;
@ -5319,7 +5319,7 @@ TOOLBAR_SetRedraw (HWND hwnd, WPARAM wParam, LPARAM lParam)
* Handles the WM_SETREDRAW message.
*
* Documentation:
* According to testing V4.71 of COMCTL32 returns the
* According to testing V4.71 of COMCTL32 returns the
* *previous* status of the redraw flag (either 0 or 1)
* instead of the MSDN documented value of 0 if handled.
* (For laughs see the "consistancy" with same function
@ -5330,7 +5330,7 @@ TOOLBAR_SetRedraw (HWND hwnd, WPARAM wParam, LPARAM lParam)
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
BOOL oldredraw = infoPtr->bDoRedraw;
TRACE("set to %s\n",
TRACE("set to %s\n",
(wParam) ? "TRUE" : "FALSE");
infoPtr->bDoRedraw = (BOOL) wParam;
if (wParam) {
@ -5384,7 +5384,7 @@ TOOLBAR_Size (HWND hwnd, WPARAM wParam, LPARAM lParam)
* this sets the working width of the toolbar, and
* Calc Toolbar will not adjust it, only the height
*/
infoPtr->nWidth = parent_rect.right - parent_rect.left;
infoPtr->nWidth = parent_rect.right - parent_rect.left;
cy = infoPtr->nHeight;
cx = infoPtr->nWidth;
TOOLBAR_CalcToolbar (hwnd);
@ -5440,7 +5440,7 @@ TOOLBAR_StyleChanged (HWND hwnd, INT nType, LPSTYLESTRUCT lpStyle)
infoPtr->dwDTFlags = DT_CENTER;
}
infoPtr->bTransparent = (lpStyle->styleNew & TBSTYLE_TRANSPARENT);
infoPtr->bBtnTranspnt = (lpStyle->styleNew &
infoPtr->bBtnTranspnt = (lpStyle->styleNew &
(TBSTYLE_FLAT | TBSTYLE_LIST));
TOOLBAR_CheckStyle (hwnd, lpStyle->styleNew);
}
@ -5466,7 +5466,7 @@ TOOLBAR_SysColorChange (HWND hwnd)
static LRESULT WINAPI
ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
TRACE("hwnd=%x msg=%x wparam=%x lparam=%lx\n",
TRACE("hwnd=%x msg=%x wparam=%x lparam=%lx\n",
hwnd, uMsg, /* SPY_GetMsgName(uMsg), */ wParam, lParam);
if (!TOOLBAR_GetInfoPtr(hwnd) && (uMsg != WM_NCCREATE))
@ -5774,10 +5774,10 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return TOOLBAR_MouseMove (hwnd, wParam, lParam);
case WM_MOUSELEAVE:
return TOOLBAR_MouseLeave (hwnd, wParam, lParam);
return TOOLBAR_MouseLeave (hwnd, wParam, lParam);
case WM_CAPTURECHANGED:
return TOOLBAR_CaptureChanged(hwnd);
return TOOLBAR_CaptureChanged(hwnd);
case WM_NCACTIVATE:
return TOOLBAR_NCActivate (hwnd, wParam, lParam);
@ -5854,7 +5854,7 @@ TOOLBAR_Register (void)
wndClass.hCursor = LoadCursorA (0, IDC_ARROWA);
wndClass.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
wndClass.lpszClassName = TOOLBARCLASSNAMEA;
RegisterClassA (&wndClass);
}

View File

@ -61,7 +61,7 @@
*
* infoPtr->nTool is the tool the mouse was on on the last relayed MM
* or timer expiry or -1 if the mouse was not on a tool.
*
*
* infoPtr->nCurrentTool is the tool for which the tip is currently
* displaying text for or -1 if the tip is not shown. Actually this
* will only ever be infoPtr-nTool or -1, so it could be changed to a
@ -97,7 +97,7 @@ typedef struct
HINSTANCE hinst;
LPWSTR lpszText;
LPARAM lParam;
} TTTOOL_INFO;
} TTTOOL_INFO;
typedef struct
@ -285,7 +285,7 @@ TOOLTIPS_CalcTipSize (HWND hwnd, TOOLTIPS_INFO *infoPtr, LPSIZE lpSize)
SelectObject (hdc, hOldFont);
ReleaseDC (hwnd, hdc);
lpSize->cx = rc.right - rc.left + 4 +
lpSize->cx = rc.right - rc.left + 4 +
infoPtr->rcMargin.left + infoPtr->rcMargin.right;
lpSize->cy = rc.bottom - rc.top + 4 +
infoPtr->rcMargin.bottom + infoPtr->rcMargin.top;
@ -367,7 +367,7 @@ TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr)
else {
rc = toolPtr->rect;
MapWindowPoints (toolPtr->hwnd, (HWND)0, (LPPOINT)&rc, 2);
}
}
rect.bottom = rc.top - 2;
rect.top = rect.bottom - size.cy;
}
@ -535,7 +535,7 @@ TOOLTIPS_GetToolFromInfoA (TOOLTIPS_INFO *infoPtr, LPTTTOOLINFOA lpToolInfo)
for (nTool = 0; nTool < infoPtr->uNumTools; nTool++) {
toolPtr = &infoPtr->tools[nTool];
if (!(toolPtr->uFlags & TTF_IDISHWND) &&
if (!(toolPtr->uFlags & TTF_IDISHWND) &&
(lpToolInfo->hwnd == toolPtr->hwnd) &&
(lpToolInfo->uId == toolPtr->uId))
return nTool;
@ -562,7 +562,7 @@ TOOLTIPS_GetToolFromInfoW (TOOLTIPS_INFO *infoPtr, LPTTTOOLINFOW lpToolInfo)
for (nTool = 0; nTool < infoPtr->uNumTools; nTool++) {
toolPtr = &infoPtr->tools[nTool];
if (!(toolPtr->uFlags & TTF_IDISHWND) &&
if (!(toolPtr->uFlags & TTF_IDISHWND) &&
(lpToolInfo->hwnd == toolPtr->hwnd) &&
(lpToolInfo->uId == toolPtr->uId))
return nTool;
@ -738,7 +738,7 @@ TOOLTIPS_AddToolA (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (lpttsi == NULL) {
lpttsi =
(LPTT_SUBCLASS_INFO)COMCTL32_Alloc (sizeof(TT_SUBCLASS_INFO));
lpttsi->wpOrigProc =
lpttsi->wpOrigProc =
(WNDPROC)SetWindowLongA ((HWND)toolPtr->uId,
GWL_WNDPROC,(LONG)TOOLTIPS_SubclassProc);
lpttsi->hwndToolTip = hwnd;
@ -755,7 +755,7 @@ TOOLTIPS_AddToolA (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (lpttsi == NULL) {
lpttsi =
(LPTT_SUBCLASS_INFO)COMCTL32_Alloc (sizeof(TT_SUBCLASS_INFO));
lpttsi->wpOrigProc =
lpttsi->wpOrigProc =
(WNDPROC)SetWindowLongA (toolPtr->hwnd,
GWL_WNDPROC,(LONG)TOOLTIPS_SubclassProc);
lpttsi->hwndToolTip = hwnd;
@ -840,7 +840,7 @@ TOOLTIPS_AddToolW (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (lpttsi == NULL) {
lpttsi =
(LPTT_SUBCLASS_INFO)COMCTL32_Alloc (sizeof(TT_SUBCLASS_INFO));
lpttsi->wpOrigProc =
lpttsi->wpOrigProc =
(WNDPROC)SetWindowLongA ((HWND)toolPtr->uId,
GWL_WNDPROC,(LONG)TOOLTIPS_SubclassProc);
lpttsi->hwndToolTip = hwnd;
@ -857,7 +857,7 @@ TOOLTIPS_AddToolW (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (lpttsi == NULL) {
lpttsi =
(LPTT_SUBCLASS_INFO)COMCTL32_Alloc (sizeof(TT_SUBCLASS_INFO));
lpttsi->wpOrigProc =
lpttsi->wpOrigProc =
(WNDPROC)SetWindowLongA (toolPtr->hwnd,
GWL_WNDPROC,(LONG)TOOLTIPS_SubclassProc);
lpttsi->hwndToolTip = hwnd;
@ -896,9 +896,9 @@ TOOLTIPS_DelToolA (HWND hwnd, WPARAM wParam, LPARAM lParam)
/* make sure the tooltip has disappeared before deleting it */
TOOLTIPS_Hide(hwnd, infoPtr);
/* delete text string */
toolPtr = &infoPtr->tools[nTool];
toolPtr = &infoPtr->tools[nTool];
if ((toolPtr->hinst) && (toolPtr->lpszText)) {
if ( (toolPtr->lpszText != LPSTR_TEXTCALLBACKW) &&
(HIWORD((INT)toolPtr->lpszText) != 0) )
@ -962,11 +962,11 @@ TOOLTIPS_DelToolA (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (infoPtr->nTool == nTool)
{
/* no current tool (0 means first tool) */
infoPtr->nTool = -1;
infoPtr->nTool = -1;
}
infoPtr->uNumTools--;
return 0;
}
@ -992,10 +992,10 @@ TOOLTIPS_DelToolW (HWND hwnd, WPARAM wParam, LPARAM lParam)
TRACE("tool %d\n", nTool);
/* make sure the tooltip has disappeared before deleting it */
TOOLTIPS_Hide(hwnd, infoPtr);
TOOLTIPS_Hide(hwnd, infoPtr);
/* delete text string */
toolPtr = &infoPtr->tools[nTool];
toolPtr = &infoPtr->tools[nTool];
if ((toolPtr->hinst) && (toolPtr->lpszText)) {
if ( (toolPtr->lpszText != LPSTR_TEXTCALLBACKW) &&
(HIWORD((INT)toolPtr->lpszText) != 0) )
@ -1059,11 +1059,11 @@ TOOLTIPS_DelToolW (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (infoPtr->nTool == nTool)
{
/* no current tool (0 means first tool) */
infoPtr->nTool = -1;
infoPtr->nTool = -1;
}
infoPtr->uNumTools--;
return 0;
}
@ -2044,7 +2044,7 @@ TOOLTIPS_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
toolPtr = &infoPtr->tools[i];
if ((toolPtr->hinst) && (toolPtr->lpszText)) {
if ( (toolPtr->lpszText != LPSTR_TEXTCALLBACKW) &&
(HIWORD((INT)toolPtr->lpszText) != 0) )
(HIWORD((INT)toolPtr->lpszText) != 0) )
{
COMCTL32_Free (toolPtr->lpszText);
toolPtr->lpszText = NULL;
@ -2054,7 +2054,7 @@ TOOLTIPS_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
/* remove subclassing */
if (toolPtr->uFlags & TTF_SUBCLASS) {
LPTT_SUBCLASS_INFO lpttsi;
if (toolPtr->uFlags & TTF_IDISHWND) {
lpttsi = (LPTT_SUBCLASS_INFO)GetPropA ((HWND)toolPtr->uId, COMCTL32_aSubclass);
if (lpttsi) {
@ -2470,10 +2470,10 @@ TOOLTIPS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_GETTEXT:
return TOOLTIPS_OnWMGetText (hwnd, wParam, lParam);
case WM_GETTEXTLENGTH:
return TOOLTIPS_OnWMGetTextLength (hwnd, wParam, lParam);
case WM_LBUTTONDOWN:
case WM_LBUTTONUP:
@ -2528,7 +2528,7 @@ TOOLTIPS_Register (void)
wndClass.hCursor = LoadCursorA (0, IDC_ARROWA);
wndClass.hbrBackground = 0;
wndClass.lpszClassName = TOOLTIPS_CLASSA;
RegisterClassA (&wndClass);
}

View File

@ -23,7 +23,7 @@
* - handle dragging slider better
* - better tic handling.
* - more notifications.
*
*
*/
/* known bugs:
@ -76,10 +76,10 @@ typedef struct
#define TRACKBAR_GetInfoPtr(wndPtr) ((TRACKBAR_INFO *)GetWindowLongA (hwnd,0))
/* Used by TRACKBAR_Refresh to find out which parts of the control
/* Used by TRACKBAR_Refresh to find out which parts of the control
need to be recalculated */
#define TB_THUMBPOSCHANGED 1
#define TB_THUMBPOSCHANGED 1
#define TB_THUMBSIZECHANGED 2
#define TB_THUMBCHANGED (TB_THUMBPOSCHANGED | TB_THUMBPOSCHANGED)
#define TB_SELECTIONCHANGED 4
@ -101,7 +101,7 @@ static void TRACKBAR_RecalculateTics (TRACKBAR_INFO *infoPtr)
{
int i,tic,nrTics;
if (infoPtr->uTicFreq && infoPtr->nRangeMax >= infoPtr->nRangeMin)
if (infoPtr->uTicFreq && infoPtr->nRangeMax >= infoPtr->nRangeMin)
nrTics=(infoPtr->nRangeMax - infoPtr->nRangeMin)/infoPtr->uTicFreq;
else {
nrTics=0;
@ -112,7 +112,7 @@ static void TRACKBAR_RecalculateTics (TRACKBAR_INFO *infoPtr)
}
if (nrTics!=infoPtr->uNumTics) {
infoPtr->tics=COMCTL32_ReAlloc (infoPtr->tics,
infoPtr->tics=COMCTL32_ReAlloc (infoPtr->tics,
(nrTics+1)*sizeof (DWORD));
infoPtr->uNumTics=nrTics;
}
@ -123,12 +123,12 @@ static void TRACKBAR_RecalculateTics (TRACKBAR_INFO *infoPtr)
}
/* converts from physical (mouse) position to logical position
/* converts from physical (mouse) position to logical position
(in range of trackbar) */
static inline DOUBLE
TRACKBAR_ConvertPlaceToPosition (TRACKBAR_INFO *infoPtr, int place,
int vertical)
TRACKBAR_ConvertPlaceToPosition (TRACKBAR_INFO *infoPtr, int place,
int vertical)
{
double range,width,pos;
@ -165,7 +165,7 @@ TRACKBAR_CalcChannel (HWND hwnd, TRACKBAR_INFO *infoPtr)
else
cyChannel = 4;
offsettop = (int)(infoPtr->uThumbLen/4.5);
offsettop = (int)(infoPtr->uThumbLen/4.5);
offsetedge = (int)(infoPtr->uThumbLen/4.5) + 3;
if (dwStyle & TBS_VERT) {
@ -202,33 +202,33 @@ TRACKBAR_CalcThumb (HWND hwnd, TRACKBAR_INFO *infoPtr)
RECT *thumb;
int range, width, thumbdepth;
DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);
thumb=&infoPtr->rcThumb;
range=infoPtr->nRangeMax - infoPtr->nRangeMin;
thumbdepth = ((INT)((FLOAT)infoPtr->uThumbLen / 4.5) * 2) + 2;
if (!range) return; /* FIXME: may this happen? */
if (dwStyle & TBS_VERT)
if (dwStyle & TBS_VERT)
{
width=infoPtr->rcChannel.bottom - infoPtr->rcChannel.top;
if (dwStyle & (TBS_BOTH | TBS_LEFT))
thumb->left = 10;
else
thumb-> left =2;
thumb-> left =2;
thumb->right = thumb -> left + infoPtr->uThumbLen;
thumb->top = infoPtr->rcChannel.top +
(width*(infoPtr->nPos - infoPtr->nRangeMin))/range -
(width*(infoPtr->nPos - infoPtr->nRangeMin))/range -
thumbdepth/2;
thumb->bottom = thumb->top + thumbdepth;
}
else
}
else
{
width=infoPtr->rcChannel.right - infoPtr->rcChannel.left;
thumb->left = infoPtr->rcChannel.left +
(width*(infoPtr->nPos - infoPtr->nRangeMin))/range -
(width*(infoPtr->nPos - infoPtr->nRangeMin))/range -
thumbdepth/2;
thumb->right = thumb->left + thumbdepth;
if (dwStyle & (TBS_BOTH | TBS_TOP))
@ -249,9 +249,9 @@ TRACKBAR_CalcSelection (HWND hwnd, TRACKBAR_INFO *infoPtr)
range=infoPtr->nRangeMax - infoPtr->nRangeMin;
width=infoPtr->rcChannel.right - infoPtr->rcChannel.left;
if (range <= 0)
if (range <= 0)
SetRectEmpty (selection);
else
else
if (GetWindowLongA (hwnd, GWL_STYLE) & TBS_VERT) {
selection->left = infoPtr->rcChannel.left +
(width*infoPtr->nSelMin)/range;
@ -274,7 +274,7 @@ TRACKBAR_CalcSelection (HWND hwnd, TRACKBAR_INFO *infoPtr)
/* ticPos is in tic-units, not in pixels */
static VOID
TRACKBAR_DrawHorizTic (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos,
TRACKBAR_DrawHorizTic (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos,
int flags, COLORREF clrTic)
{
RECT rcChannel=infoPtr->rcChannel;
@ -292,9 +292,9 @@ TRACKBAR_DrawHorizTic (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos,
}
if (flags & TIC_SELECTIONMARK) {
if (flags & TIC_SELECTIONMARKMIN)
if (flags & TIC_SELECTIONMARKMIN)
x=rcChannel.left + (width*(ticPos - infoPtr->nRangeMin))/range - 1;
else
else
x=rcChannel.left + (width*(ticPos - infoPtr->nRangeMin))/range + 1;
SetPixel (hdc, x,y+6*side, clrTic);
@ -312,7 +312,7 @@ TRACKBAR_DrawHorizTic (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos,
if (flags & TIC_EDGE) {
if (flags & TIC_LEFTEDGE)
x=rcChannel.left;
else
else
x=rcChannel.right;
SetPixel (hdc, x,y+5*side, clrTic);
@ -324,7 +324,7 @@ TRACKBAR_DrawHorizTic (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos,
}
static VOID
TRACKBAR_DrawVertTic (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos,
TRACKBAR_DrawVertTic (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos,
int flags, COLORREF clrTic)
{
RECT rcChannel=infoPtr->rcChannel;
@ -343,9 +343,9 @@ TRACKBAR_DrawVertTic (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos,
if (flags & TIC_SELECTIONMARK) {
if (flags & TIC_SELECTIONMARKMIN)
if (flags & TIC_SELECTIONMARKMIN)
y=rcChannel.top + (width*(ticPos - infoPtr->nRangeMin))/range - 1;
else
else
y=rcChannel.top + (width*(ticPos - infoPtr->nRangeMin))/range + 1;
SetPixel (hdc, x+6*side, y, clrTic);
@ -363,7 +363,7 @@ TRACKBAR_DrawVertTic (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos,
if (flags & TIC_EDGE) {
if (flags & TIC_LEFTEDGE)
y=rcChannel.top;
else
else
y=rcChannel.bottom;
SetPixel (hdc, x+5*side, y, clrTic);
@ -376,23 +376,23 @@ TRACKBAR_DrawVertTic (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos,
static VOID
TRACKBAR_DrawTics (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos,
TRACKBAR_DrawTics (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos,
int flags, COLORREF clrTic)
{
if (flags & TBS_VERT) {
if ((flags & TBS_TOP) || (flags & TBS_BOTH))
TRACKBAR_DrawVertTic (infoPtr, hdc, ticPos,
if ((flags & TBS_TOP) || (flags & TBS_BOTH))
TRACKBAR_DrawVertTic (infoPtr, hdc, ticPos,
flags | TBS_TOP , clrTic);
if (!(flags & TBS_TOP) || (flags & TBS_BOTH))
if (!(flags & TBS_TOP) || (flags & TBS_BOTH))
TRACKBAR_DrawVertTic (infoPtr, hdc, ticPos, flags, clrTic);
return;
}
if ((flags & TBS_TOP) || (flags & TBS_BOTH))
if ((flags & TBS_TOP) || (flags & TBS_BOTH))
TRACKBAR_DrawHorizTic (infoPtr, hdc, ticPos, flags | TBS_TOP , clrTic);
if (!(flags & TBS_TOP) || (flags & TBS_BOTH))
if (!(flags & TBS_TOP) || (flags & TBS_BOTH))
TRACKBAR_DrawHorizTic (infoPtr, hdc, ticPos, flags, clrTic);
}
@ -411,8 +411,8 @@ TRACKBAR_DrawThumb(TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle)
oldbr = SelectObject (hdc, hbr);
SetPolyFillMode (hdc,WINDING);
if (dwStyle & TBS_BOTH)
if (dwStyle & TBS_BOTH)
{
points[0].x=thumb.right;
points[0].y=thumb.top;
@ -426,8 +426,8 @@ TRACKBAR_DrawThumb(TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle)
points[4].y=points[0].y;
PointCount = 5;
BlackUntil = 3;
}
else
}
else
{
if (dwStyle & TBS_VERT)
{
@ -472,7 +472,7 @@ TRACKBAR_DrawThumb(TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle)
points[1].x=thumb.right;
points[1].y=thumb.top + PointDepth;
points[2].x=thumb.right;
points[2].y=thumb.bottom;
points[2].y=thumb.bottom;
points[3].x=thumb.left;
points[3].y=thumb.bottom;
points[4].x=thumb.left;
@ -497,7 +497,7 @@ TRACKBAR_DrawThumb(TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle)
points[5].y=points[0].y;
}
}
}
/*
@ -513,13 +513,13 @@ TRACKBAR_DrawThumb(TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle)
/*
* Black part
*/
*/
Polyline(hdc,points,BlackUntil);
SelectObject(hdc,oldpen);
hpn = GetStockObject(WHITE_PEN);
SelectObject(hdc,hpn);
/*
* White Part
*/
@ -551,15 +551,15 @@ TRACKBAR_Refresh (HWND hwnd, HDC hdc)
infoPtr->nPos=infoPtr->dragPos;
infoPtr->flags |= TB_THUMBPOSCHANGED;
}
if (infoPtr->flags & TB_THUMBCHANGED) {
TRACKBAR_CalcThumb (hwnd, infoPtr);
if (infoPtr->flags & TB_THUMBSIZECHANGED)
if (infoPtr->flags & TB_THUMBSIZECHANGED)
TRACKBAR_CalcChannel (hwnd, infoPtr);
}
if (infoPtr->flags & TB_SELECTIONCHANGED)
TRACKBAR_CalcSelection (hwnd, infoPtr);
infoPtr->flags &= ~ (TB_THUMBCHANGED | TB_SELECTIONCHANGED |
infoPtr->flags &= ~ (TB_THUMBCHANGED | TB_SELECTIONCHANGED |
TB_DRAGPOSVALID);
/* draw channel */
@ -571,11 +571,11 @@ TRACKBAR_Refresh (HWND hwnd, HDC hdc)
if (dwStyle & TBS_ENABLESELRANGE) { /* fill the channel */
HBRUSH hbr = CreateSolidBrush (RGB(255,255,255));
FillRect (hdc, &rcChannel, hbr);
if (((dwStyle & TBS_VERT) &&
(rcSelection.left!=rcSelection.right)) ||
((!(dwStyle & TBS_VERT)) &&
if (((dwStyle & TBS_VERT) &&
(rcSelection.left!=rcSelection.right)) ||
((!(dwStyle & TBS_VERT)) &&
(rcSelection.left!=rcSelection.right))) {
hbr=CreateSolidBrush (COLOR_HIGHLIGHT);
hbr=CreateSolidBrush (COLOR_HIGHLIGHT);
FillRect (hdc, &rcSelection, hbr);
}
DeleteObject (hbr);
@ -588,27 +588,27 @@ TRACKBAR_Refresh (HWND hwnd, HDC hdc)
int ticFlags = dwStyle & 0x0f;
COLORREF clrTic=GetSysColor (COLOR_3DDKSHADOW);
for (i=0; i<infoPtr->uNumTics; i++)
TRACKBAR_DrawTics (infoPtr, hdc, infoPtr->tics[i],
for (i=0; i<infoPtr->uNumTics; i++)
TRACKBAR_DrawTics (infoPtr, hdc, infoPtr->tics[i],
ticFlags, clrTic);
TRACKBAR_DrawTics (infoPtr, hdc, 0, ticFlags | TIC_LEFTEDGE, clrTic);
TRACKBAR_DrawTics (infoPtr, hdc, 0, ticFlags | TIC_RIGHTEDGE, clrTic);
if ((dwStyle & TBS_ENABLESELRANGE) &&
if ((dwStyle & TBS_ENABLESELRANGE) &&
(rcSelection.left!=rcSelection.right)) {
TRACKBAR_DrawTics (infoPtr, hdc, infoPtr->nSelMin,
TRACKBAR_DrawTics (infoPtr, hdc, infoPtr->nSelMin,
ticFlags | TIC_SELECTIONMARKMIN, clrTic);
TRACKBAR_DrawTics (infoPtr, hdc, infoPtr->nSelMax,
TRACKBAR_DrawTics (infoPtr, hdc, infoPtr->nSelMax,
ticFlags | TIC_SELECTIONMARKMAX, clrTic);
}
}
/* draw thumb */
if (!(dwStyle & TBS_NOTHUMB))
if (!(dwStyle & TBS_NOTHUMB))
{
TRACKBAR_DrawThumb(infoPtr,hdc,dwStyle);
TRACKBAR_DrawThumb(infoPtr,hdc,dwStyle);
}
if (infoPtr->bFocus)
@ -678,7 +678,7 @@ TRACKBAR_ClearSel (HWND hwnd, WPARAM wParam, LPARAM lParam)
infoPtr->nSelMax = 0;
infoPtr->flags |= TB_SELECTIONCHANGED;
if ((BOOL)wParam)
if ((BOOL)wParam)
InvalidateRect (hwnd, NULL, FALSE);
return 0;
@ -696,7 +696,7 @@ TRACKBAR_ClearTics (HWND hwnd, WPARAM wParam, LPARAM lParam)
infoPtr->uNumTics = 0;
}
if (wParam)
if (wParam)
InvalidateRect (hwnd, NULL, FALSE);
return 0;
@ -821,7 +821,7 @@ static LRESULT
TRACKBAR_GetPTics (HWND hwnd)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
return (LRESULT) infoPtr->tics;
}
@ -830,17 +830,17 @@ TRACKBAR_GetThumbRect (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
LPRECT lprc = (LPRECT)lParam;
if (lprc == NULL)
return 0;
return 0;
lprc->left = infoPtr->rcThumb.left;
lprc->right = infoPtr->rcThumb.right;
lprc->bottom = infoPtr->rcThumb.bottom;
lprc->top = infoPtr->rcThumb.top;
return 0;
}
}
static LRESULT
@ -850,7 +850,7 @@ TRACKBAR_GetTic (HWND hwnd, WPARAM wParam, LPARAM lParam)
INT iTic;
iTic=(INT) wParam;
if ((iTic<0) || (iTic>infoPtr->uNumTics))
if ((iTic<0) || (iTic>infoPtr->uNumTics))
return -1;
return (LRESULT) infoPtr->tics[iTic];
@ -863,10 +863,10 @@ TRACKBAR_GetTicPos (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
INT iTic, range, width, pos;
iTic=(INT ) wParam;
if ((iTic<0) || (iTic>infoPtr->uNumTics))
if ((iTic<0) || (iTic>infoPtr->uNumTics))
return -1;
range=infoPtr->nRangeMax - infoPtr->nRangeMin;
@ -957,7 +957,7 @@ TRACKBAR_SetPos (HWND hwnd, WPARAM wParam, LPARAM lParam)
infoPtr->nPos = infoPtr->nRangeMax;
infoPtr->flags |= TB_THUMBPOSCHANGED;
if (wParam)
if (wParam)
InvalidateRect (hwnd, NULL, FALSE);
return 0;
@ -1009,7 +1009,7 @@ TRACKBAR_SetRangeMax (HWND hwnd, WPARAM wParam, LPARAM lParam)
infoPtr->nPageSize = 1;
TRACKBAR_RecalculateTics (infoPtr);
if (wParam)
if (wParam)
InvalidateRect (hwnd, NULL, FALSE);
return 0;
@ -1043,16 +1043,16 @@ static LRESULT
TRACKBAR_SetTicFreq (HWND hwnd, WPARAM wParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
if (GetWindowLongA (hwnd, GWL_STYLE) & TBS_AUTOTICKS)
infoPtr->uTicFreq=(UINT) wParam;
infoPtr->uTicFreq=(UINT) wParam;
TRACKBAR_RecalculateTics (infoPtr);
InvalidateRect (hwnd, NULL, FALSE);
return 0;
}
}
static LRESULT
@ -1072,7 +1072,7 @@ TRACKBAR_SetSel (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (infoPtr->nSelMax > infoPtr->nRangeMax)
infoPtr->nSelMax = infoPtr->nRangeMax;
if (wParam)
if (wParam)
InvalidateRect (hwnd, NULL, FALSE);
@ -1090,11 +1090,11 @@ TRACKBAR_SetSelEnd (HWND hwnd, WPARAM wParam, LPARAM lParam)
infoPtr->nSelMax = (INT)lParam;
infoPtr->flags |= TB_SELECTIONCHANGED;
if (infoPtr->nSelMax > infoPtr->nRangeMax)
infoPtr->nSelMax = infoPtr->nRangeMax;
if (wParam)
if (wParam)
InvalidateRect (hwnd, NULL, FALSE);
return 0;
@ -1115,7 +1115,7 @@ TRACKBAR_SetSelStart (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (infoPtr->nSelMin < infoPtr->nRangeMin)
infoPtr->nSelMin = infoPtr->nRangeMin;
if (wParam)
if (wParam)
InvalidateRect (hwnd, NULL, FALSE);
return 0;
@ -1165,7 +1165,7 @@ TRACKBAR_SetTipSide (HWND hwnd, WPARAM wParam, LPARAM lParam)
INT fTemp = infoPtr->fLocation;
infoPtr->fLocation = (INT)wParam;
return fTemp;
}
@ -1322,7 +1322,7 @@ TRACKBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
infoPtr->flags |= TB_SHOW_TOOLTIP;
SetCapture (hwnd);
SendMessageA (infoPtr->hwndToolTip, TTM_TRACKACTIVATE,
SendMessageA (infoPtr->hwndToolTip, TTM_TRACKACTIVATE,
(WPARAM)TRUE, (LPARAM)&ti);
}
return 0;
@ -1338,7 +1338,7 @@ TRACKBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
else
clickPlace=(INT)LOWORD(lParam);
clickPos = TRACKBAR_ConvertPlaceToPosition(infoPtr, clickPlace,
clickPos = TRACKBAR_ConvertPlaceToPosition(infoPtr, clickPlace,
vertical);
prevPos = infoPtr->nPos;
if (clickPos > (int)prevPos)
@ -1346,22 +1346,22 @@ TRACKBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
infoPtr->nPos += infoPtr->nPageSize;
if (infoPtr->nPos > infoPtr->nRangeMax)
infoPtr->nPos = infoPtr->nRangeMax;
TRACKBAR_SendNotify (hwnd, TB_PAGEUP);
}
else
TRACKBAR_SendNotify (hwnd, TB_PAGEUP);
}
else
{
infoPtr->nPos -= infoPtr->nPageSize; /* similar to VK_PRIOR */
if (infoPtr->nPos < infoPtr->nRangeMin)
infoPtr->nPos = infoPtr->nRangeMin;
TRACKBAR_SendNotify (hwnd, TB_PAGEDOWN);
}
if (prevPos!=infoPtr->nPos) {
infoPtr->flags |= TB_THUMBPOSCHANGED;
InvalidateRect (hwnd, NULL, FALSE);
}
}
return 0;
}
@ -1390,7 +1390,7 @@ TRACKBAR_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
SendMessageA (infoPtr->hwndToolTip, TTM_TRACKACTIVATE,
(WPARAM)FALSE, (LPARAM)&ti);
}
InvalidateRect (hwnd, NULL, FALSE);
return 0;
@ -1401,12 +1401,12 @@ static LRESULT
TRACKBAR_CaptureChanged (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
if (infoPtr->flags & TB_DRAGPOSVALID) {
infoPtr->nPos=infoPtr->dragPos;
InvalidateRect (hwnd, NULL, FALSE);
}
infoPtr->flags &= ~ TB_DRAGPOSVALID;
TRACKBAR_SendNotify (hwnd, TB_ENDTRACK);
@ -1459,11 +1459,11 @@ TRACKBAR_SendNotify (HWND hwnd, UINT code)
{
TRACE("%x\n",code);
if (GetWindowLongA (hwnd, GWL_STYLE) & TBS_VERT)
return (BOOL) SendMessageA (GetParent (hwnd),
if (GetWindowLongA (hwnd, GWL_STYLE) & TBS_VERT)
return (BOOL) SendMessageA (GetParent (hwnd),
WM_VSCROLL, (WPARAM)code, (LPARAM)hwnd);
return (BOOL) SendMessageA (GetParent (hwnd),
return (BOOL) SendMessageA (GetParent (hwnd),
WM_HSCROLL, (WPARAM)code, (LPARAM)hwnd);
}
@ -1476,7 +1476,7 @@ TRACKBAR_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
SHORT clickPlace;
DOUBLE dragPos;
char buf[80];
TRACE("%x\n",wParam);
if (dwStyle & TBS_VERT)
@ -1488,7 +1488,7 @@ TRACKBAR_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
return TRUE;
SetCapture (hwnd);
dragPos = TRACKBAR_ConvertPlaceToPosition (infoPtr, clickPlace,
dragPos = TRACKBAR_ConvertPlaceToPosition (infoPtr, clickPlace,
dwStyle & TBS_VERT);
if (dragPos > ((INT)dragPos) + 0.5)
infoPtr->dragPos = dragPos + 1;
@ -1501,7 +1501,7 @@ TRACKBAR_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (infoPtr->flags & TB_SHOW_TOOLTIP) {
POINT pt;
TTTOOLINFOA ti;
ti.cbSize = sizeof(TTTOOLINFOA);
ti.hwnd = hwnd;
ti.uId = 0;
@ -1509,12 +1509,12 @@ TRACKBAR_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
sprintf (buf,"%d",infoPtr->nPos);
ti.lpszText = (LPSTR) buf;
GetCursorPos (&pt);
if (dwStyle & TBS_VERT) {
SendMessageA (infoPtr->hwndToolTip, TTM_TRACKPOSITION,
SendMessageA (infoPtr->hwndToolTip, TTM_TRACKPOSITION,
0, (LPARAM)MAKELPARAM(pt.x+5, pt.y+15));
} else {
SendMessageA (infoPtr->hwndToolTip, TTM_TRACKPOSITION,
SendMessageA (infoPtr->hwndToolTip, TTM_TRACKPOSITION,
0, (LPARAM)MAKELPARAM(pt.x+15, pt.y+5));
}
SendMessageA (infoPtr->hwndToolTip, TTM_UPDATETIPTEXTA,
@ -1539,48 +1539,48 @@ TRACKBAR_KeyDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
pos=infoPtr->nPos;
switch (wParam) {
case VK_LEFT:
case VK_UP:
case VK_UP:
if (infoPtr->nPos == infoPtr->nRangeMin) return FALSE;
infoPtr->nPos -= infoPtr->nLineSize;
if (infoPtr->nPos < infoPtr->nRangeMin)
if (infoPtr->nPos < infoPtr->nRangeMin)
infoPtr->nPos = infoPtr->nRangeMin;
TRACKBAR_SendNotify (hwnd, TB_LINEUP);
break;
case VK_RIGHT:
case VK_DOWN:
case VK_DOWN:
if (infoPtr->nPos == infoPtr->nRangeMax) return FALSE;
infoPtr->nPos += infoPtr->nLineSize;
if (infoPtr->nPos > infoPtr->nRangeMax)
if (infoPtr->nPos > infoPtr->nRangeMax)
infoPtr->nPos = infoPtr->nRangeMax;
TRACKBAR_SendNotify (hwnd, TB_LINEDOWN);
break;
case VK_NEXT:
if (infoPtr->nPos == infoPtr->nRangeMax) return FALSE;
infoPtr->nPos += infoPtr->nPageSize;
if (infoPtr->nPos > infoPtr->nRangeMax)
if (infoPtr->nPos > infoPtr->nRangeMax)
infoPtr->nPos = infoPtr->nRangeMax;
TRACKBAR_SendNotify (hwnd, TB_PAGEUP);
break;
case VK_PRIOR:
if (infoPtr->nPos == infoPtr->nRangeMin) return FALSE;
infoPtr->nPos -= infoPtr->nPageSize;
if (infoPtr->nPos < infoPtr->nRangeMin)
if (infoPtr->nPos < infoPtr->nRangeMin)
infoPtr->nPos = infoPtr->nRangeMin;
TRACKBAR_SendNotify (hwnd, TB_PAGEDOWN);
break;
case VK_HOME:
case VK_HOME:
if (infoPtr->nPos == infoPtr->nRangeMin) return FALSE;
infoPtr->nPos = infoPtr->nRangeMin;
TRACKBAR_SendNotify (hwnd, TB_TOP);
break;
case VK_END:
case VK_END:
if (infoPtr->nPos == infoPtr->nRangeMax) return FALSE;
infoPtr->nPos = infoPtr->nRangeMax;
TRACKBAR_SendNotify (hwnd, TB_BOTTOM);
break;
}
if (pos!=infoPtr->nPos) {
if (pos!=infoPtr->nPos) {
infoPtr->flags |=TB_THUMBPOSCHANGED;
InvalidateRect (hwnd, NULL, FALSE);
}
@ -1594,12 +1594,12 @@ TRACKBAR_KeyUp (HWND hwnd, WPARAM wParam)
{
switch (wParam) {
case VK_LEFT:
case VK_UP:
case VK_UP:
case VK_RIGHT:
case VK_DOWN:
case VK_DOWN:
case VK_NEXT:
case VK_PRIOR:
case VK_HOME:
case VK_HOME:
case VK_END:
TRACKBAR_SendNotify (hwnd, TB_ENDTRACK);
}
@ -1662,10 +1662,10 @@ TRACKBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case TBM_GETTIC:
return TRACKBAR_GetTic (hwnd, wParam, lParam);
case TBM_GETTICPOS:
return TRACKBAR_GetTicPos (hwnd, wParam, lParam);
case TBM_GETTOOLTIPS:
return TRACKBAR_GetToolTips (hwnd, wParam, lParam);
@ -1738,7 +1738,7 @@ TRACKBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_KEYDOWN:
return TRACKBAR_KeyDown (hwnd, wParam, lParam);
case WM_KEYUP:
return TRACKBAR_KeyUp (hwnd, wParam);
@ -1789,7 +1789,7 @@ TRACKBAR_Register (void)
wndClass.hCursor = LoadCursorA (0, IDC_ARROWA);
wndClass.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
wndClass.lpszClassName = TRACKBAR_CLASSA;
RegisterClassA (&wndClass);
}

View File

@ -154,7 +154,7 @@ typedef struct tagTREEVIEW_INFO
#define TV_LDRAG 0x04 /* Lbutton pushed to start drag */
#define TV_LDRAGGING 0x08 /* Lbutton pushed, mouse moved. */
#define TV_RDRAG 0x10 /* dito Rbutton */
#define TV_RDRAGGING 0x20
#define TV_RDRAGGING 0x20
/* bitflags for infoPtr->timer */
@ -309,7 +309,7 @@ TREEVIEW_GetLastListItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem)
}
/***************************************************************************
* This method returns the previous non-hidden item in the list not
* This method returns the previous non-hidden item in the list not
* considering the tree hierarchy.
*/
static TREEVIEW_ITEM *
@ -334,7 +334,7 @@ TREEVIEW_GetPrevListItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *tvItem)
/***************************************************************************
* This method returns the next physical item in the treeview not
* This method returns the next physical item in the treeview not
* considering the tree hierarchy.
*/
static TREEVIEW_ITEM *
@ -342,7 +342,7 @@ TREEVIEW_GetNextListItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *tvItem)
{
assert(tvItem != NULL);
/*
/*
* If this item has children and is expanded, return the first child
*/
if ((tvItem->state & TVIS_EXPANDED) && tvItem->firstChild != NULL)
@ -372,7 +372,7 @@ TREEVIEW_GetNextListItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *tvItem)
}
/***************************************************************************
* This method returns the nth item starting at the given item. It returns
* This method returns the nth item starting at the given item. It returns
* the last item (or first) we we run out of items.
*
* Will scroll backward if count is <0.
@ -687,7 +687,7 @@ TREEVIEW_UpdateDispInfo(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
TREEVIEW_SendRealNotify(infoPtr,
(WPARAM)callback.hdr.idFrom, (LPARAM)&callback);
/* It may have changed due to a call to SetItem. */
/* It may have changed due to a call to SetItem. */
mask &= wineItem->callbackMask;
if ((mask & TVIF_TEXT) && callback.item.pszText != wineItem->pszText)
@ -696,7 +696,7 @@ TREEVIEW_UpdateDispInfo(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
if (infoPtr->bNtfUnicode) {
LPWSTR newText;
int buflen;
int len = WideCharToMultiByte( CP_ACP, 0,
int len = WideCharToMultiByte( CP_ACP, 0,
(LPWSTR)callback.item.pszText, -1,
NULL, 0, NULL, NULL );
buflen = max((len+1)*sizeof(WCHAR), TEXT_CALLBACK_SIZE);
@ -708,16 +708,16 @@ TREEVIEW_UpdateDispInfo(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
if (newText)
{
wineItem->pszText = (LPSTR)newText;
WideCharToMultiByte( CP_ACP, 0,
WideCharToMultiByte( CP_ACP, 0,
(LPWSTR)callback.item.pszText, -1,
wineItem->pszText, buflen,
wineItem->pszText, buflen,
NULL, NULL );
wineItem->cchTextMax = buflen;
}
/* If ReAlloc fails we have nothing to do, but keep original text */
}
else {
int len = max(lstrlenA(callback.item.pszText) + 1,
int len = max(lstrlenA(callback.item.pszText) + 1,
TEXT_CALLBACK_SIZE);
LPSTR newText = COMCTL32_ReAlloc(wineItem->pszText, len);
@ -739,7 +739,7 @@ TREEVIEW_UpdateDispInfo(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
LPWSTR newText;
LPSTR oldText = NULL;
int buflen;
int len = WideCharToMultiByte( CP_ACP, 0,
int len = WideCharToMultiByte( CP_ACP, 0,
(LPWSTR)callback.item.pszText, -1,
NULL, 0, NULL, NULL );
buflen = max((len+1)*sizeof(WCHAR), TEXT_CALLBACK_SIZE);
@ -752,7 +752,7 @@ TREEVIEW_UpdateDispInfo(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
{
oldText = wineItem->pszText;
wineItem->pszText = (LPSTR)newText;
WideCharToMultiByte( CP_ACP, 0,
WideCharToMultiByte( CP_ACP, 0,
(LPWSTR)callback.item.pszText, -1,
wineItem->pszText, buflen, NULL, NULL );
wineItem->cchTextMax = buflen;
@ -761,7 +761,7 @@ TREEVIEW_UpdateDispInfo(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
}
}
}
if (mask & TVIF_IMAGE)
wineItem->iImage = callback.item.iImage;
@ -1240,7 +1240,7 @@ TREEVIEW_InsertItemA(TREEVIEW_INFO *infoPtr, LPARAM lParam)
/* This will help us to exit if there is no more sibling */
aChild = (aChild->nextSibling == 0)
? NULL
? NULL
: aChild->nextSibling;
/* Look at the next item */
@ -1248,9 +1248,9 @@ TREEVIEW_InsertItemA(TREEVIEW_INFO *infoPtr, LPARAM lParam)
}
else if (comp == 0)
{
/*
* An item with this name is already existing, therefore,
* we add after the one we found
/*
* An item with this name is already existing, therefore,
* we add after the one we found
*/
TREEVIEW_InsertAfter(newItem, aChild, parentItem);
bItemInserted = TRUE;
@ -1258,7 +1258,7 @@ TREEVIEW_InsertItemA(TREEVIEW_INFO *infoPtr, LPARAM lParam)
}
}
/*
/*
* we reach the end of the child list and the item has not
* yet been inserted, therefore, insert it after the last child.
*/
@ -1304,7 +1304,7 @@ TREEVIEW_InsertItemA(TREEVIEW_INFO *infoPtr, LPARAM lParam)
TREEVIEW_ComputeTextWidth(infoPtr, newItem, 0);
TREEVIEW_UpdateScrollBars(infoPtr);
/*
* if the item was inserted in a visible part of the tree,
* if the item was inserted in a visible part of the tree,
* invalidate it, as well as those after it
*/
for (item = newItem;
@ -1435,8 +1435,8 @@ TREEVIEW_RemoveItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem)
{
TRACE("%p, (%s)\n", wineItem, TREEVIEW_ItemName(wineItem));
TREEVIEW_SendTreeviewNotify(infoPtr,
(infoPtr->bNtfUnicode) ? TVN_DELETEITEMW :
TREEVIEW_SendTreeviewNotify(infoPtr,
(infoPtr->bNtfUnicode) ? TVN_DELETEITEMW :
TVN_DELETEITEMA,
TVIF_HANDLE | TVIF_PARAM, 0, wineItem, 0);
@ -1933,9 +1933,9 @@ TREEVIEW_GetItemRect(TREEVIEW_INFO *infoPtr, BOOL fTextRect, LPRECT lpRect)
if (!TREEVIEW_ValidItem(infoPtr, wineItem) || !ISVISIBLE(wineItem))
return FALSE;
/*
* If wParam is TRUE return the text size otherwise return
* the whole item size
/*
* If wParam is TRUE return the text size otherwise return
* the whole item size
*/
if (fTextRect)
{
@ -2141,7 +2141,7 @@ TREEVIEW_SetItemW(TREEVIEW_INFO *infoPtr, LPTVITEMEXW tvItem)
len ++;
tvItemA.pszText = HeapAlloc(GetProcessHeap(),0,len*sizeof(WCHAR));
len = WideCharToMultiByte(CP_ACP, 0, tvItem->pszText, -1,
tvItemA.pszText ,len*sizeof(WCHAR),
tvItemA.pszText ,len*sizeof(WCHAR),
NULL,NULL);
}
else
@ -2300,7 +2300,7 @@ TREEVIEW_DrawItemLines(TREEVIEW_INFO *infoPtr, HDC hdc, TREEVIEW_ITEM *item)
HPEN hOldPen, hNewPen;
HTREEITEM parent;
/*
/*
* Get a dotted grey pen
*/
hNewPen = CreatePen(PS_ALTERNATE, 0, infoPtr->clrLine);
@ -2342,7 +2342,7 @@ TREEVIEW_DrawItemLines(TREEVIEW_INFO *infoPtr, HDC hdc, TREEVIEW_ITEM *item)
DeleteObject(hNewPen);
}
/*
/*
* Display the (+/-) signs
*/
@ -2419,7 +2419,7 @@ TREEVIEW_DrawItem(TREEVIEW_INFO *infoPtr, HDC hdc, TREEVIEW_ITEM *wineItem)
centery = (wineItem->rect.top + wineItem->rect.bottom) / 2;
/*
/*
* Display the images associated with this item
*/
{
@ -2439,7 +2439,7 @@ TREEVIEW_DrawItem(TREEVIEW_INFO *infoPtr, HDC hdc, TREEVIEW_ITEM *wineItem)
}
/* Now, draw the normal image; can be either selected or
* non-selected image.
* non-selected image.
*/
if ((wineItem->state & TVIS_SELECTED) && (wineItem->iSelectedImage))
@ -2465,7 +2465,7 @@ TREEVIEW_DrawItem(TREEVIEW_INFO *infoPtr, HDC hdc, TREEVIEW_ITEM *wineItem)
}
/*
/*
* Display the text associated with this item
*/
@ -2813,7 +2813,7 @@ TREEVIEW_Paint(TREEVIEW_INFO *infoPtr, WPARAM wParam)
GetObjectA(hbitmap, sizeof(BITMAP), &bitmap);
rc.left = 0; rc.top = 0;
rc.right = bitmap.bmWidth;
rc.bottom = bitmap.bmHeight;
rc.bottom = bitmap.bmHeight;
TREEVIEW_EraseBackground(infoPtr, wParam);
}
}
@ -3050,7 +3050,7 @@ TREEVIEW_SendExpanding(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
UINT action)
{
return !TREEVIEW_SendTreeviewNotify(infoPtr,
(infoPtr->bNtfUnicode) ? TVN_ITEMEXPANDINGW :
(infoPtr->bNtfUnicode) ? TVN_ITEMEXPANDINGW :
TVN_ITEMEXPANDINGA,
action,
TVIF_HANDLE | TVIF_STATE | TVIF_PARAM
@ -3062,8 +3062,8 @@ static VOID
TREEVIEW_SendExpanded(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
UINT action)
{
TREEVIEW_SendTreeviewNotify(infoPtr,
(infoPtr->bNtfUnicode) ? TVN_ITEMEXPANDEDW :
TREEVIEW_SendTreeviewNotify(infoPtr,
(infoPtr->bNtfUnicode) ? TVN_ITEMEXPANDEDW :
TVN_ITEMEXPANDEDA,
action,
TVIF_HANDLE | TVIF_STATE | TVIF_PARAM
@ -3240,8 +3240,8 @@ TREEVIEW_ExpandAll(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item)
}
/* Note:If the specified item is the child of a collapsed parent item,
the parent's list of child items is (recursively) expanded to reveal the
specified item. This is mentioned for TREEVIEW_SelectItem; don't
the parent's list of child items is (recursively) expanded to reveal the
specified item. This is mentioned for TREEVIEW_SelectItem; don't
know if it also applies here.
*/
@ -3461,8 +3461,8 @@ TREEVIEW_Command(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
case EN_UPDATE:
{
/*
* Adjust the edit window size
/*
* Adjust the edit window size
*/
char buffer[1024];
TREEVIEW_ITEM *editItem = infoPtr->selectedItem;
@ -3897,8 +3897,8 @@ TREEVIEW_LButtonDown(TREEVIEW_INFO *infoPtr, LPARAM lParam)
if (TREEVIEW_SendSimpleNotify(infoPtr, NM_CLICK))
goto setfocus;
/*
* If the style allows editing and the node is already selected
/*
* If the style allows editing and the node is already selected
* and the click occurred on the item label...
*/
if ((infoPtr->dwStyle & TVS_EDITLABELS) &&
@ -4188,20 +4188,20 @@ TREEVIEW_SelectItem(TREEVIEW_INFO *infoPtr, INT wParam, HTREEITEM item)
/*************************************************************************
* TREEVIEW_ProcessLetterKeys
*
* Processes keyboard messages generated by pressing the letter keys
* Processes keyboard messages generated by pressing the letter keys
* on the keyboard.
* What this does is perform a case insensitive search from the
* What this does is perform a case insensitive search from the
* current position with the following quirks:
* - If two chars or more are pressed in quick succession we search
* - If two chars or more are pressed in quick succession we search
* for the corresponding string (e.g. 'abc').
* - If there is a delay we wipe away the current search string and
* - If there is a delay we wipe away the current search string and
* restart with just that char.
* - If the user keeps pressing the same character, whether slowly or
* fast, so that the search string is entirely composed of this
* character ('aaaaa' for instance), then we search for first item
* - If the user keeps pressing the same character, whether slowly or
* fast, so that the search string is entirely composed of this
* character ('aaaaa' for instance), then we search for first item
* that starting with that character.
* - If the user types the above character in quick succession, then
* we must also search for the corresponding string ('aaaaa'), and
* - If the user types the above character in quick succession, then
* we must also search for the corresponding string ('aaaaa'), and
* go to that string if there is a match.
*
* RETURNS
@ -4210,13 +4210,13 @@ TREEVIEW_SelectItem(TREEVIEW_INFO *infoPtr, INT wParam, HTREEITEM item)
*
* BUGS
*
* - The current implementation has a list of characters it will
* accept and it ignores averything else. In particular it will
* ignore accentuated characters which seems to match what
* Windows does. But I'm not sure it makes sense to follow
* - The current implementation has a list of characters it will
* accept and it ignores averything else. In particular it will
* ignore accentuated characters which seems to match what
* Windows does. But I'm not sure it makes sense to follow
* Windows there.
* - We don't sound a beep when the search fails.
* - The search should start from the focused item, not from the selected
* - The search should start from the focused item, not from the selected
* item. One reason for this is to allow for multiple selections in trees.
* But currently infoPtr->focusedItem does not seem very usable.
*
@ -4624,7 +4624,7 @@ scroll:
{
TREEVIEW_ITEM *item;
LONG scroll_pixels = infoPtr->scrollX - scrollX;
for (item = infoPtr->root->firstChild; item != NULL;
item = TREEVIEW_GetNextListItem(infoPtr, item))
{
@ -4679,14 +4679,14 @@ TREEVIEW_MouseWheel(TREEVIEW_INFO *infoPtr, WPARAM wParam)
static LRESULT
TREEVIEW_Create(HWND hwnd)
{
{
RECT rcClient;
TREEVIEW_INFO *infoPtr;
TRACE("wnd %x, style %lx\n", hwnd, GetWindowLongA(hwnd, GWL_STYLE));
infoPtr = (TREEVIEW_INFO *)COMCTL32_Alloc(sizeof(TREEVIEW_INFO));
if (infoPtr == NULL)
{
ERR("could not allocate info memory!\n");
@ -4768,7 +4768,7 @@ TREEVIEW_Create(HWND hwnd)
/* Determine what type of notify should be issued */
/* sets infoPtr->bNtfUnicode */
TREEVIEW_NotifyFormat(infoPtr, 0, NF_REQUERY);
TREEVIEW_NotifyFormat(infoPtr, 0, NF_REQUERY);
if (!(infoPtr->dwStyle & TVS_NOTOOLTIPS))
infoPtr->hwndToolTip = COMCTL32_CreateToolTip(hwnd);
@ -5009,12 +5009,12 @@ TREEVIEW_Notify(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
if (lppgc->dwFlag == PGF_CALCWIDTH) {
lppgc->iWidth = infoPtr->treeWidth;
TRACE("got PGN_CALCSIZE, returning horz size = %ld, client=%ld\n",
TRACE("got PGN_CALCSIZE, returning horz size = %ld, client=%ld\n",
infoPtr->treeWidth, infoPtr->clientWidth);
}
else {
lppgc->iHeight = infoPtr->treeHeight;
TRACE("got PGN_CALCSIZE, returning vert size = %ld, client=%ld\n",
TRACE("got PGN_CALCSIZE, returning vert size = %ld, client=%ld\n",
infoPtr->treeHeight, infoPtr->clientHeight);
}
return 0;

View File

@ -1,4 +1,4 @@
/*
/*
* Updown control
*
* Copyright 1997, 2002 Dimitrie O. Paun
@ -151,7 +151,7 @@ static BOOL UPDOWN_OffsetVal(UPDOWN_INFO *infoPtr, int delta)
* want to draw a sunken edge to make like we are part of that control.
*/
static BOOL UPDOWN_HasBuddyBorder(UPDOWN_INFO* infoPtr)
{
{
DWORD dwStyle = GetWindowLongW (infoPtr->Self, GWL_STYLE);
return ( ((dwStyle & (UDS_ALIGNLEFT | UDS_ALIGNRIGHT)) != 0) &&
@ -181,7 +181,7 @@ static void UPDOWN_GetArrowRect (UPDOWN_INFO* infoPtr, RECT *rect, int arrow)
rect->left += DEFAULT_BUDDYBORDER;
else
rect->right -= DEFAULT_BUDDYBORDER;
InflateRect(rect, 0, -DEFAULT_BUDDYBORDER);
}
@ -190,7 +190,7 @@ static void UPDOWN_GetArrowRect (UPDOWN_INFO* infoPtr, RECT *rect, int arrow)
if (dwStyle & UDS_ALIGNLEFT) rect->right -= DEFAULT_BUDDYSPACER;
else rect->left += DEFAULT_BUDDYSPACER;
}
/*
* We're calculating the midpoint to figure-out where the
* separation between the buttons will lay. We make sure that we
@ -199,7 +199,7 @@ static void UPDOWN_GetArrowRect (UPDOWN_INFO* infoPtr, RECT *rect, int arrow)
if (dwStyle & UDS_HORZ) {
int len = rect->right - rect->left + 1; /* compute the width */
if (arrow & FLAG_INCR)
rect->left = rect->left + len/2;
rect->left = rect->left + len/2;
if (arrow & FLAG_DECR)
rect->right = rect->left + len/2 - 1;
} else {
@ -267,7 +267,7 @@ static BOOL UPDOWN_GetBuddyInt (UPDOWN_INFO *infoPtr)
/* we have a regular window, so will get the text */
if (!GetWindowTextW(infoPtr->Buddy, txt, COUNT_OF(txt))) return FALSE;
sep = UPDOWN_GetThousandSep();
sep = UPDOWN_GetThousandSep();
/* now get rid of the separators */
for(src = dst = txt; *src; src++)
@ -278,7 +278,7 @@ static BOOL UPDOWN_GetBuddyInt (UPDOWN_INFO *infoPtr)
newVal = strtolW(txt, &src, infoPtr->Base);
if(*src || !UPDOWN_InBounds (infoPtr, newVal)) return FALSE;
}
TRACE("new value(%d) from buddy (old=%d)\n", newVal, infoPtr->CurVal);
infoPtr->CurVal = newVal;
return TRUE;
@ -306,7 +306,7 @@ static BOOL UPDOWN_SetBuddyInt (UPDOWN_INFO *infoPtr)
if (UPDOWN_IsBuddyListbox(infoPtr)) {
return SendMessageW(infoPtr->Buddy, LB_SETCURSEL, infoPtr->CurVal, 0) != LB_ERR;
}
/* Regular window, so set caption to the number */
if (infoPtr->Base == 16) fmt[1] = 'X';
len = wsprintfW(txt, fmt, infoPtr->CurVal);
@ -317,7 +317,7 @@ static BOOL UPDOWN_SetBuddyInt (UPDOWN_INFO *infoPtr)
WCHAR tmp[COUNT_OF(txt)], *src = tmp, *dst = txt;
WCHAR sep = UPDOWN_GetThousandSep();
int start = len % 3;
memcpy(tmp, txt, sizeof(txt));
if (start == 0) start = 3;
dst += start;
@ -328,9 +328,9 @@ static BOOL UPDOWN_SetBuddyInt (UPDOWN_INFO *infoPtr)
}
*dst = 0;
}
return SetWindowTextW(infoPtr->Buddy, txt);
}
}
/***********************************************************************
* UPDOWN_Draw
@ -346,16 +346,16 @@ static LRESULT UPDOWN_Draw (UPDOWN_INFO *infoPtr, HDC hdc)
/* Draw the common border between ourselves and our buddy */
if (UPDOWN_HasBuddyBorder(infoPtr)) {
GetClientRect(infoPtr->Self, &rect);
DrawEdge(hdc, &rect, EDGE_SUNKEN,
BF_BOTTOM | BF_TOP |
DrawEdge(hdc, &rect, EDGE_SUNKEN,
BF_BOTTOM | BF_TOP |
(dwStyle & UDS_ALIGNLEFT ? BF_LEFT : BF_RIGHT));
}
/* Draw the incr button */
UPDOWN_GetArrowRect (infoPtr, &rect, FLAG_INCR);
pressed = (infoPtr->Flags & FLAG_PRESSED) && (infoPtr->Flags & FLAG_INCR);
hot = (infoPtr->Flags & FLAG_INCR) && (infoPtr->Flags & FLAG_MOUSEIN);
DrawFrameControl(hdc, &rect, DFC_SCROLL,
DrawFrameControl(hdc, &rect, DFC_SCROLL,
(dwStyle & UDS_HORZ ? DFCS_SCROLLRIGHT : DFCS_SCROLLUP) |
((dwStyle & UDS_HOTTRACK) && hot ? DFCS_HOT : 0) |
(pressed ? DFCS_PUSHED : 0) |
@ -365,7 +365,7 @@ static LRESULT UPDOWN_Draw (UPDOWN_INFO *infoPtr, HDC hdc)
UPDOWN_GetArrowRect(infoPtr, &rect, FLAG_DECR);
pressed = (infoPtr->Flags & FLAG_PRESSED) && (infoPtr->Flags & FLAG_DECR);
hot = (infoPtr->Flags & FLAG_DECR) && (infoPtr->Flags & FLAG_MOUSEIN);
DrawFrameControl(hdc, &rect, DFC_SCROLL,
DrawFrameControl(hdc, &rect, DFC_SCROLL,
(dwStyle & UDS_HORZ ? DFCS_SCROLLLEFT : DFCS_SCROLLDOWN) |
((dwStyle & UDS_HOTTRACK) && hot ? DFCS_HOT : 0) |
(pressed ? DFCS_PUSHED : 0) |
@ -398,11 +398,11 @@ static LRESULT UPDOWN_Paint (UPDOWN_INFO *infoPtr, HDC hdc)
static LRESULT UPDOWN_KeyPressed(UPDOWN_INFO *infoPtr, int key)
{
int arrow;
if (key == VK_UP) arrow = FLAG_INCR;
else if (key == VK_DOWN) arrow = FLAG_DECR;
else return 1;
UPDOWN_GetBuddyInt (infoPtr);
infoPtr->Flags &= ~FLAG_ARROW;
infoPtr->Flags |= FLAG_PRESSED | arrow;
@ -413,19 +413,19 @@ static LRESULT UPDOWN_KeyPressed(UPDOWN_INFO *infoPtr, int key)
}
/***********************************************************************
* UPDOWN_Buddy_SubclassProc used to handle messages sent to the buddy
* UPDOWN_Buddy_SubclassProc used to handle messages sent to the buddy
* control.
*/
static LRESULT CALLBACK
static LRESULT CALLBACK
UPDOWN_Buddy_SubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
WNDPROC superClassWndProc = (WNDPROC)GetPropA(hwnd, BUDDY_SUPERCLASS_WNDPROC);
TRACE("hwnd=%04x, wndProc=%d, uMsg=%04x, wParam=%d, lParam=%d\n",
TRACE("hwnd=%04x, wndProc=%d, uMsg=%04x, wParam=%d, lParam=%d\n",
hwnd, (INT)superClassWndProc, uMsg, wParam, (UINT)lParam);
if (uMsg == WM_KEYDOWN) {
HWND upDownHwnd = GetPropA(hwnd, BUDDY_UPDOWN_HWND);
UPDOWN_KeyPressed(UPDOWN_GetInfoPtr(upDownHwnd), (int)wParam);
}
@ -436,7 +436,7 @@ UPDOWN_Buddy_SubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
* UPDOWN_SetBuddy
* Tests if 'bud' is a valid window handle. If not, returns FALSE.
* Else, sets it as a new Buddy.
* Then, it should subclass the buddy
* Then, it should subclass the buddy
* If window has the UDS_ARROWKEYS, it subcalsses the buddy window to
* process the UP/DOWN arrow keys.
* If window has the UDS_ALIGNLEFT or UDS_ALIGNRIGHT style
@ -449,20 +449,20 @@ static BOOL UPDOWN_SetBuddy (UPDOWN_INFO* infoPtr, HWND bud)
int x, width; /* new x position and width for the up-down */
WNDPROC baseWndProc, currWndProc;
CHAR buddyClass[40];
/* Is it a valid bud? */
if(!IsWindow(bud)) return FALSE;
TRACE("(hwnd=%04x, bud=%04x)\n", infoPtr->Self, bud);
/* there is already a body assigned */
if (infoPtr->Buddy) RemovePropA(infoPtr->Buddy, BUDDY_UPDOWN_HWND);
/* Store buddy window handle */
infoPtr->Buddy = bud;
infoPtr->Buddy = bud;
/* keep upDown ctrl hwnd in a buddy property */
SetPropA( bud, BUDDY_UPDOWN_HWND, infoPtr->Self);
/* keep upDown ctrl hwnd in a buddy property */
SetPropA( bud, BUDDY_UPDOWN_HWND, infoPtr->Self);
/* Store buddy window class type */
infoPtr->BuddyType = BUDDY_TYPE_UNKNOWN;
@ -474,12 +474,12 @@ static BOOL UPDOWN_SetBuddy (UPDOWN_INFO* infoPtr, HWND bud)
}
if(dwStyle & UDS_ARROWKEYS){
/* Note that I don't clear the BUDDY_SUPERCLASS_WNDPROC property
when we reset the upDown ctrl buddy to another buddy because it is not
/* Note that I don't clear the BUDDY_SUPERCLASS_WNDPROC property
when we reset the upDown ctrl buddy to another buddy because it is not
good to break the window proc chain. */
currWndProc = (WNDPROC) GetWindowLongW(bud, GWL_WNDPROC);
if (currWndProc != UPDOWN_Buddy_SubclassProc) {
baseWndProc = (WNDPROC)SetWindowLongW(bud, GWL_WNDPROC, (LPARAM)UPDOWN_Buddy_SubclassProc);
baseWndProc = (WNDPROC)SetWindowLongW(bud, GWL_WNDPROC, (LPARAM)UPDOWN_Buddy_SubclassProc);
SetPropA(bud, BUDDY_SUPERCLASS_WNDPROC, (HANDLE)baseWndProc);
}
}
@ -501,7 +501,7 @@ static BOOL UPDOWN_SetBuddy (UPDOWN_INFO* infoPtr, HWND bud)
/* first adjust the buddy to accomodate the up/down */
SetWindowPos(infoPtr->Buddy, 0, budRect.left, budRect.top,
budRect.right - budRect.left, budRect.bottom - budRect.top,
budRect.right - budRect.left, budRect.bottom - budRect.top,
SWP_NOACTIVATE|SWP_NOZORDER);
/* now position the up/down */
@ -511,7 +511,7 @@ static BOOL UPDOWN_SetBuddy (UPDOWN_INFO* infoPtr, HWND bud)
/*
* If the updown has a buddy border, it has to overlap with the buddy
* to look as if it is integrated with the buddy control.
* to look as if it is integrated with the buddy control.
* We nudge the control or change it size to overlap.
*/
if (UPDOWN_HasBuddyBorder(infoPtr)) {
@ -521,18 +521,18 @@ static BOOL UPDOWN_SetBuddy (UPDOWN_INFO* infoPtr, HWND bud)
x -= DEFAULT_BUDDYBORDER;
}
SetWindowPos(infoPtr->Self, infoPtr->Buddy, x,
budRect.top - DEFAULT_ADDTOP, width,
SetWindowPos(infoPtr->Self, infoPtr->Buddy, x,
budRect.top - DEFAULT_ADDTOP, width,
budRect.bottom - budRect.top + DEFAULT_ADDTOP + DEFAULT_ADDBOT,
SWP_NOACTIVATE);
return TRUE;
}
}
/***********************************************************************
* UPDOWN_DoAction
*
* This function increments/decrements the CurVal by the
* This function increments/decrements the CurVal by the
* 'delta' amount according to the 'action' flag which can be a
* combination of FLAG_INCR and FLAG_DECR
* It notifies the parent as required.
@ -555,7 +555,7 @@ static void UPDOWN_DoAction (UPDOWN_INFO *infoPtr, int delta, int action)
ni.iDelta = delta;
ni.hdr.hwndFrom = infoPtr->Self;
ni.hdr.idFrom = GetWindowLongW (infoPtr->Self, GWL_ID);
ni.hdr.code = UDN_DELTAPOS;
ni.hdr.code = UDN_DELTAPOS;
if (!SendMessageW(GetParent (infoPtr->Self), WM_NOTIFY,
(WPARAM)ni.hdr.idFrom, (LPARAM)&ni)) {
/* Parent said: OK to adjust */
@ -566,10 +566,10 @@ static void UPDOWN_DoAction (UPDOWN_INFO *infoPtr, int delta, int action)
if (dwStyle & UDS_SETBUDDYINT) UPDOWN_SetBuddyInt (infoPtr);
}
}
/* Also, notify it. This message is sent in any case. */
SendMessageW( GetParent(infoPtr->Self),
dwStyle & UDS_HORZ ? WM_HSCROLL : WM_VSCROLL,
SendMessageW( GetParent(infoPtr->Self),
dwStyle & UDS_HORZ ? WM_HSCROLL : WM_VSCROLL,
MAKELONG(SB_THUMBPOSITION, infoPtr->CurVal), infoPtr->Self);
}
@ -593,17 +593,17 @@ static BOOL UPDOWN_IsEnabled (UPDOWN_INFO *infoPtr)
*
* Deletes any timers, releases the mouse and does redraw if necessary.
* If the control is not in "capture" mode, it does nothing.
* If the control was not in cancel mode, it returns FALSE.
* If the control was not in cancel mode, it returns FALSE.
* If the control was in cancel mode, it returns TRUE.
*/
static BOOL UPDOWN_CancelMode (UPDOWN_INFO *infoPtr)
{
if (!(infoPtr->Flags & FLAG_PRESSED)) return FALSE;
KillTimer (infoPtr->Self, TIMER_AUTOREPEAT);
KillTimer (infoPtr->Self, TIMER_ACCEL);
KillTimer (infoPtr->Self, TIMER_AUTOPRESS);
if (GetCapture() == infoPtr->Self) {
NMHDR hdr;
hdr.hwndFrom = infoPtr->Self;
@ -612,10 +612,10 @@ static BOOL UPDOWN_CancelMode (UPDOWN_INFO *infoPtr)
SendMessageW(GetParent (infoPtr->Self), WM_NOTIFY, hdr.idFrom, (LPARAM)&hdr);
ReleaseCapture();
}
infoPtr->Flags &= ~FLAG_PRESSED;
InvalidateRect (infoPtr->Self, NULL, FALSE);
return TRUE;
}
@ -624,7 +624,7 @@ static BOOL UPDOWN_CancelMode (UPDOWN_INFO *infoPtr)
*
* Handle a mouse event for the updown.
* 'pt' is the location of the mouse event in client or
* windows coordinates.
* windows coordinates.
*/
static void UPDOWN_HandleMouseEvent (UPDOWN_INFO *infoPtr, UINT msg, POINT pt)
{
@ -646,10 +646,10 @@ static void UPDOWN_HandleMouseEvent (UPDOWN_INFO *infoPtr, UINT msg, POINT pt)
/* Update the CurVal if necessary */
if (dwStyle & UDS_SETBUDDYINT) UPDOWN_GetBuddyInt (infoPtr);
/* Set up the correct flags */
infoPtr->Flags |= FLAG_PRESSED;
infoPtr->Flags |= FLAG_PRESSED;
/* repaint the control */
InvalidateRect (infoPtr->Self, NULL, FALSE);
@ -678,7 +678,7 @@ static void UPDOWN_HandleMouseEvent (UPDOWN_INFO *infoPtr, UINT msg, POINT pt)
} else {
if(infoPtr->AccelIndex != -1) infoPtr->AccelIndex = 0;
}
/* If state changed, redraw the control */
if(temp != infoPtr->Flags)
InvalidateRect (infoPtr->Self, &rect, FALSE);
@ -699,9 +699,9 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam,
UPDOWN_INFO *infoPtr = UPDOWN_GetInfoPtr (hwnd);
DWORD dwStyle = GetWindowLongW (hwnd, GWL_STYLE);
int temp;
if (!infoPtr && (message != WM_CREATE))
return DefWindowProcW (hwnd, message, wParam, lParam);
return DefWindowProcW (hwnd, message, wParam, lParam);
switch(message)
{
@ -715,8 +715,8 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam,
infoPtr->AccelCount = 0;
infoPtr->AccelVect = 0;
infoPtr->AccelIndex = -1;
infoPtr->CurVal = 0;
infoPtr->MinVal = 0;
infoPtr->CurVal = 0;
infoPtr->MinVal = 0;
infoPtr->MaxVal = 9999;
infoPtr->Base = 10; /* Default to base 10 */
infoPtr->Buddy = 0; /* No buddy window yet */
@ -725,10 +725,10 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam,
/* Do we pick the buddy win ourselves? */
if (dwStyle & UDS_AUTOBUDDY)
UPDOWN_SetBuddy (infoPtr, GetWindow (hwnd, GW_HWNDPREV));
TRACE("UpDown Ctrl creation, hwnd=%04x\n", hwnd);
break;
case WM_DESTROY:
if(infoPtr->AccelVect) COMCTL32_Free (infoPtr->AccelVect);
@ -738,7 +738,7 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam,
SetWindowLongW (hwnd, 0, 0);
TRACE("UpDown Ctrl destruction, hwnd=%04x\n", hwnd);
break;
case WM_ENABLE:
if (dwStyle & WS_DISABLED) UPDOWN_CancelMode (infoPtr);
InvalidateRect (infoPtr->Self, NULL, FALSE);
@ -770,13 +770,13 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam,
if(infoPtr->Flags & FLAG_MOUSEIN) {
temp = infoPtr->AccelIndex == -1 ? 1 : infoPtr->AccelVect[infoPtr->AccelIndex].nInc;
UPDOWN_DoAction(infoPtr, temp, infoPtr->Flags & FLAG_ARROW);
if(infoPtr->AccelIndex != -1 && infoPtr->AccelIndex < infoPtr->AccelCount-1) {
KillTimer(hwnd, TIMER_ACCEL);
infoPtr->AccelIndex++; /* move to the next accel info */
temp = infoPtr->AccelVect[infoPtr->AccelIndex].nSec * 1000 + 1;
/* make sure we have at least 1ms intervals */
SetTimer(hwnd, TIMER_ACCEL, temp, 0);
SetTimer(hwnd, TIMER_ACCEL, temp, 0);
}
}
break;
@ -786,11 +786,11 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam,
case WM_LBUTTONUP:
if (GetCapture() != infoPtr->Self) break;
if ( (infoPtr->Flags & FLAG_MOUSEIN) &&
(infoPtr->Flags & FLAG_ARROW) ) {
SendMessageW( GetParent(hwnd),
SendMessageW( GetParent(hwnd),
dwStyle & UDS_HORZ ? WM_HSCROLL : WM_VSCROLL,
MAKELONG(SB_ENDSCROLL, infoPtr->CurVal), hwnd);
if (UPDOWN_IsBuddyEdit(infoPtr))
@ -798,7 +798,7 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam,
}
UPDOWN_CancelMode(infoPtr);
break;
case WM_LBUTTONDOWN:
case WM_MOUSEMOVE:
if(UPDOWN_IsEnabled(infoPtr)){
@ -814,10 +814,10 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam,
return UPDOWN_KeyPressed(infoPtr, (int)wParam);
}
break;
case WM_PAINT:
return UPDOWN_Paint (infoPtr, (HDC)wParam);
case UDM_GETACCEL:
if (wParam==0 && lParam==0) return infoPtr->AccelCount;
if (wParam && lParam) {
@ -883,20 +883,20 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam,
infoPtr->CurVal = temp;
if(dwStyle & UDS_SETBUDDYINT) UPDOWN_SetBuddyInt (infoPtr);
return wParam; /* return prev value */
case UDM_GETRANGE:
if (wParam || lParam) UNKNOWN_PARAM(UDM_GETRANGE, wParam, lParam);
return MAKELONG(infoPtr->MaxVal, infoPtr->MinVal);
case UDM_SETRANGE:
if (wParam) UNKNOWN_PARAM(UDM_SETRANGE, wParam, lParam);
if (wParam) UNKNOWN_PARAM(UDM_SETRANGE, wParam, lParam);
/* we must have: */
infoPtr->MaxVal = SLOWORD(lParam); /* UD_MINVAL <= Max <= UD_MAXVAL */
infoPtr->MinVal = SHIWORD(lParam); /* UD_MINVAL <= Min <= UD_MAXVAL */
/* |Max-Min| <= UD_MAXVAL */
TRACE("UpDown Ctrl new range(%d to %d), hwnd=%04x\n",
TRACE("UpDown Ctrl new range(%d to %d), hwnd=%04x\n",
infoPtr->MinVal, infoPtr->MaxVal, hwnd);
break;
break;
case UDM_GETRANGE32:
if (wParam) *(LPINT)wParam = infoPtr->MinVal;
@ -908,7 +908,7 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam,
infoPtr->MaxVal = (INT)lParam;
if (infoPtr->MaxVal <= infoPtr->MinVal)
infoPtr->MaxVal = infoPtr->MinVal + 1;
TRACE("UpDown Ctrl new range(%d to %d), hwnd=%04x\n",
TRACE("UpDown Ctrl new range(%d to %d), hwnd=%04x\n",
infoPtr->MinVal, infoPtr->MaxVal, hwnd);
break;
@ -937,12 +937,12 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam,
temp = infoPtr->UnicodeFormat;
infoPtr->UnicodeFormat = (BOOL)wParam;
return temp;
default:
if (message >= WM_USER)
default:
if (message >= WM_USER)
ERR("unknown msg %04x wp=%04x lp=%08lx\n", message, wParam, lParam);
return DefWindowProcW (hwnd, message, wParam, lParam);
}
return DefWindowProcW (hwnd, message, wParam, lParam);
}
return 0;
}
@ -966,7 +966,7 @@ UPDOWN_Register(void)
wndClass.hCursor = LoadCursorW( 0, IDC_ARROWW );
wndClass.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
wndClass.lpszClassName = UPDOWN_CLASSW;
RegisterClassW( &wndClass );
}

View File

@ -70,7 +70,7 @@ typedef struct {
#define PD32_PRINTER_STATUS_READY 1536
#define PD32_PRINTER_STATUS_PAUSED 1537
#define PD32_PRINTER_STATUS_ERROR 1538
#define PD32_PRINTER_STATUS_ERROR 1538
#define PD32_PRINTER_STATUS_PENDING_DELETION 1539
#define PD32_PRINTER_STATUS_PAPER_JAM 1540
#define PD32_PRINTER_STATUS_PAPER_OUT 1541
@ -183,7 +183,7 @@ typedef struct {
} FINDREPLACE16, *LPFINDREPLACE16;
typedef UINT16 (CALLBACK *LPCFHOOKPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
typedef struct
typedef struct
{
DWORD lStructSize;
HWND16 hwndOwner; /* caller's window handle */

View File

@ -89,7 +89,7 @@ BOOL WINAPI COMDLG32_DllEntryPoint(HINSTANCE hInstance, DWORD Reason, LPVOID Res
COMDLG32_TlsIndex = 0xffffffff;
SHELL32_hInstance = GetModuleHandleA("SHELL32.DLL");
if (!SHELL32_hInstance)
{
ERR("loading of shell32 failed\n");
@ -102,9 +102,9 @@ BOOL WINAPI COMDLG32_DllEntryPoint(HINSTANCE hInstance, DWORD Reason, LPVOID Res
GPA(COMDLG32_PIDL_ILGetNext, SHELL32_hInstance, (LPCSTR)153L);
GPA(COMDLG32_PIDL_ILClone, SHELL32_hInstance, (LPCSTR)18L);
GPA(COMDLG32_PIDL_ILRemoveLastID, SHELL32_hInstance, (LPCSTR)17L);
/* SHELL */
GPA(COMDLG32_SHAlloc, SHELL32_hInstance, (LPCSTR)196L);
GPA(COMDLG32_SHFree, SHELL32_hInstance, (LPCSTR)195L);
/* for the first versions of shell32 SHGetFolderPathA is in SHFOLDER.DLL */
@ -177,7 +177,7 @@ void COMDLG32_SetCommDlgExtendedError(DWORD err)
*/
DWORD WINAPI CommDlgExtendedError(void)
{
if (COMDLG32_TlsIndex != 0xffffffff)
if (COMDLG32_TlsIndex != 0xffffffff)
return (DWORD)TlsGetValue(COMDLG32_TlsIndex);
else
return 0; /* we never set an error, so there isn't one */

View File

@ -69,7 +69,7 @@ struct CCPRIVATE
LPCHOOSECOLOR16 lpcc16; /* save the 16 bits pointer */
int nextuserdef; /* next free place in user defined color array */
HDC hdcMem; /* color graph used for BitBlt() */
HBITMAP hbmMem; /* color graph bitmap */
HBITMAP hbmMem; /* color graph bitmap */
RECT fullsize; /* original dialog window size */
UINT msetrgb; /* # of SETRGBSTRING message (today not used) */
RECT old3angle; /* last position of l-marker */
@ -459,7 +459,7 @@ static void CC_PaintTriangle( HWND hDlg, int y)
int oben;
RECT rect;
HWND hwnd = GetDlgItem(hDlg, 0x2be);
LCCPRIV lpp = (LCCPRIV)GetWindowLongA( hDlg, DWL_USER);
LCCPRIV lpp = (LCCPRIV)GetWindowLongA( hDlg, DWL_USER);
if (IsWindowVisible( GetDlgItem(hDlg, 0x2c6))) /* if full size */
{
@ -497,7 +497,7 @@ static void CC_PaintCross( HWND hDlg, int x, int y)
HDC hDC;
int w = GetDialogBaseUnits();
HWND hwnd = GetDlgItem(hDlg, 0x2c6);
LCCPRIV lpp = (LCCPRIV)GetWindowLongA( hDlg, DWL_USER );
LCCPRIV lpp = (LCCPRIV)GetWindowLongA( hDlg, DWL_USER );
RECT rect;
POINT point, p;
HPEN hPen;
@ -519,11 +519,11 @@ static void CC_PaintCross( HWND hDlg, int x, int y)
lpp->oldcross.left = point.x - w - 1;
lpp->oldcross.right = point.x + w + 1;
lpp->oldcross.top = point.y - w - 1;
lpp->oldcross.bottom = point.y + w + 1;
lpp->oldcross.bottom = point.y + w + 1;
MoveToEx(hDC, point.x - w, point.y, &p);
MoveToEx(hDC, point.x - w, point.y, &p);
LineTo(hDC, point.x + w, point.y);
MoveToEx(hDC, point.x, point.y - w, &p);
MoveToEx(hDC, point.x, point.y - w, &p);
LineTo(hDC, point.x, point.y + w);
DeleteObject( SelectObject(hDC, hPen)) ;
ReleaseDC(hwnd, hDC);
@ -538,11 +538,11 @@ static void CC_PaintCross( HWND hDlg, int x, int y)
/***********************************************************************
* CC_PrepareColorGraph [internal]
*/
static void CC_PrepareColorGraph( HWND hDlg )
static void CC_PrepareColorGraph( HWND hDlg )
{
int sdif, hdif, xdif, ydif, r, g, b, hue, sat;
HWND hwnd = GetDlgItem(hDlg, 0x2c6);
LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER);
LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER);
HBRUSH hbrush;
HDC hdc ;
RECT rect, client;
@ -585,7 +585,7 @@ static void CC_PrepareColorGraph( HWND hDlg )
static void CC_PaintColorGraph( HWND hDlg )
{
HWND hwnd = GetDlgItem( hDlg, 0x2c6 );
LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER);
LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER);
HDC hDC;
RECT rect;
if (IsWindowVisible(hwnd)) /* if full size */
@ -645,7 +645,7 @@ static void CC_PaintLumBar( HWND hDlg, int hue, int sat )
static void CC_EditSetRGB( HWND hDlg, COLORREF cr )
{
char buffer[10];
LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER);
LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER);
int r = GetRValue(cr);
int g = GetGValue(cr);
int b = GetBValue(cr);
@ -690,8 +690,8 @@ static void CC_EditSetHSL( HWND hDlg, int h, int s, int l )
static void CC_SwitchToFullSize( HWND hDlg, COLORREF result, LPRECT lprect )
{
int i;
LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER);
LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER);
EnableWindow( GetDlgItem(hDlg, 0x2cf), FALSE);
CC_PrepareColorGraph(hDlg);
for (i = 0x2bf; i < 0x2c5; i++)
@ -738,7 +738,7 @@ static void CC_PaintPredefColorArray( HWND hDlg, int rows, int cols)
FillRect(hdc, &rect, GetClassLongA(hwnd, GCL_HBRBACKGROUND));
for ( j = 0; j < rows; j++ )
{
for ( i = 0; i < cols; i++ )
for ( i = 0; i < cols; i++ )
{
hBrush = CreateSolidBrush(predefcolors[j][i]);
if (hBrush)
@ -759,7 +759,7 @@ static void CC_PaintPredefColorArray( HWND hDlg, int rows, int cols)
}
/***********************************************************************
* CC_PaintUserColorArray [internal]
* Paint the 16 user-selected colors
* Paint the 16 user-selected colors
*/
static void CC_PaintUserColorArray( HWND hDlg, int rows, int cols, COLORREF* lpcr )
{
@ -777,7 +777,7 @@ static void CC_PaintUserColorArray( HWND hDlg, int rows, int cols, COLORREF* lpc
k = rect.left;
hdc = GetDC(hwnd);
if (hdc)
if (hdc)
{
FillRect(hdc, &rect, GetClassLongA(hwnd, GCL_HBRBACKGROUND) );
for (j = 0; j < rows; j++)
@ -786,7 +786,7 @@ static void CC_PaintUserColorArray( HWND hDlg, int rows, int cols, COLORREF* lpc
{
hBrush = CreateSolidBrush(lpcr[i+j*cols]);
if (hBrush)
{
{
hBrush = SelectObject(hdc, hBrush) ;
Rectangle(hdc, rect.left, rect.top,
rect.left + dx - DISTANCE, rect.top + dy - DISTANCE);
@ -821,15 +821,15 @@ static BOOL CC_HookCallChk( LPCHOOSECOLORW lpcc )
/***********************************************************************
* CC_WMInitDialog [internal]
*/
static LONG CC_WMInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam, BOOL b16 )
static LONG CC_WMInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam, BOOL b16 )
{
int i, res;
int r, g, b;
HWND hwnd;
RECT rect;
POINT point;
LCCPRIV lpp;
LCCPRIV lpp;
TRACE("WM_INITDIALOG lParam=%08lX\n", lParam);
lpp = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct CCPRIVATE) );
if (b16)
@ -845,7 +845,7 @@ static LONG CC_WMInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam, BOOL b16 )
return FALSE;
}
ch32->lStructSize = sizeof(CHOOSECOLORW);
ch32->hwndOwner = ch16->hwndOwner;
ch32->hwndOwner = ch16->hwndOwner;
ch32->hInstance = ch16->hInstance;
ch32->lpCustColors = MapSL(ch16->lpCustColors);
ch32->lpfnHook = (LPCCHOOKPROC) ch16->lpfnHook; /* only used as flag */
@ -859,7 +859,7 @@ static LONG CC_WMInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam, BOOL b16 )
EndDialog (hDlg, 0) ;
return FALSE;
}
SetWindowLongA(hDlg, DWL_USER, (LONG)lpp);
SetWindowLongA(hDlg, DWL_USER, (LONG)lpp);
if (!(lpp->lpcc->Flags & CC_SHOWHELP))
ShowWindow( GetDlgItem(hDlg,0x40e), SW_HIDE);
@ -869,7 +869,7 @@ static LONG CC_WMInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam, BOOL b16 )
cpos = MAKELONG(5,7); /* init */
if (lpp->lpcc->Flags & CC_RGBINIT)
{
for (i = 0; i < 6; i++)
for (i = 0; i < 6; i++)
for (j = 0; j < 8; j++)
if (predefcolors[i][j] == lpp->lpcc->rgbResult)
{
@ -921,7 +921,7 @@ static LONG CC_WMInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam, BOOL b16 )
else
res = CallWindowProcA( (WNDPROC)lpp->lpcc->lpfnHook, hDlg, WM_INITDIALOG, wParam, lParam);
}
/* Set the initial values of the color chooser dialog */
r = GetRValue(lpp->lpcc->rgbResult);
g = GetGValue(lpp->lpcc->rgbResult);
@ -950,13 +950,13 @@ static LONG CC_WMInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam, BOOL b16 )
/***********************************************************************
* CC_WMCommand [internal]
*/
static LRESULT CC_WMCommand( HWND hDlg, WPARAM wParam, LPARAM lParam, WORD notifyCode, HWND hwndCtl )
static LRESULT CC_WMCommand( HWND hDlg, WPARAM wParam, LPARAM lParam, WORD notifyCode, HWND hwndCtl )
{
int r, g, b, i, xx;
UINT cokmsg;
HDC hdc;
COLORREF *cr;
LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER);
LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER);
TRACE("CC_WMCommand wParam=%x lParam=%lx\n", wParam, lParam);
switch (wParam)
{
@ -989,7 +989,7 @@ static LRESULT CC_WMCommand( HWND hDlg, WPARAM wParam, LPARAM lParam, WORD notif
}
}
break;
case 0x2bf: /* edit notify HSL */
case 0x2c0:
case 0x2c1:
@ -1016,7 +1016,7 @@ static LRESULT CC_WMCommand( HWND hDlg, WPARAM wParam, LPARAM lParam, WORD notif
}
}
break;
case 0x2cf:
CC_SwitchToFullSize(hDlg, lpp->lpcc->rgbResult, &lpp->fullsize);
SetFocus( GetDlgItem(hDlg, 0x2bf));
@ -1089,7 +1089,7 @@ static LRESULT CC_WMCommand( HWND hDlg, WPARAM wParam, LPARAM lParam, WORD notif
}
EndDialog(hDlg, 1) ;
return TRUE ;
case IDCANCEL :
EndDialog(hDlg, 0) ;
return TRUE ;
@ -1101,11 +1101,11 @@ static LRESULT CC_WMCommand( HWND hDlg, WPARAM wParam, LPARAM lParam, WORD notif
/***********************************************************************
* CC_WMPaint [internal]
*/
static LRESULT CC_WMPaint( HWND hDlg, WPARAM wParam, LPARAM lParam )
static LRESULT CC_WMPaint( HWND hDlg, WPARAM wParam, LPARAM lParam )
{
HDC hdc;
PAINTSTRUCT ps;
LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER);
LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER);
hdc = BeginPaint(hDlg, &ps);
/* we have to paint dialog children except text and buttons */
@ -1134,7 +1134,7 @@ static LRESULT CC_WMLButtonUp( HWND hDlg, WPARAM wParam, LPARAM lParam )
ReleaseCapture();
CC_PaintCross(hDlg, lpp->h, lpp->s);
return 1;
}
}
return 0;
}
@ -1142,15 +1142,15 @@ static LRESULT CC_WMLButtonUp( HWND hDlg, WPARAM wParam, LPARAM lParam )
/***********************************************************************
* CC_WMMouseMove [internal]
*/
static LRESULT CC_WMMouseMove( HWND hDlg, LPARAM lParam )
static LRESULT CC_WMMouseMove( HWND hDlg, LPARAM lParam )
{
LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER);
LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER);
int r, g, b;
if (lpp->capturedGraph)
{
int *ptrh = NULL, *ptrs = &lpp->l;
if (lpp->capturedGraph == 0x2c6)
if (lpp->capturedGraph == 0x2c6)
{
ptrh = &lpp->h;
ptrs = &lpp->s;
@ -1179,9 +1179,9 @@ static LRESULT CC_WMMouseMove( HWND hDlg, LPARAM lParam )
/***********************************************************************
* CC_WMLButtonDown [internal]
*/
static LRESULT CC_WMLButtonDown( HWND hDlg, WPARAM wParam, LPARAM lParam )
static LRESULT CC_WMLButtonDown( HWND hDlg, WPARAM wParam, LPARAM lParam )
{
LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER);
LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER);
int r, g, b, i;
i = 0;
@ -1263,15 +1263,15 @@ static LRESULT WINAPI ColorDlgProc( HWND hDlg, UINT message,
case WM_INITDIALOG:
return CC_WMInitDialog(hDlg, wParam, lParam, FALSE);
case WM_NCDESTROY:
DeleteDC(lpp->hdcMem);
DeleteObject(lpp->hbmMem);
DeleteDC(lpp->hdcMem);
DeleteObject(lpp->hbmMem);
HeapFree(GetProcessHeap(), 0, lpp);
SetWindowLongA(hDlg, DWL_USER, 0L); /* we don't need it anymore */
break;
case WM_COMMAND:
if (CC_WMCommand( hDlg, wParam, lParam, HIWORD(wParam), (HWND) lParam))
return TRUE;
break;
break;
case WM_PAINT:
if ( CC_WMPaint(hDlg, wParam, lParam))
return TRUE;
@ -1291,7 +1291,7 @@ static LRESULT WINAPI ColorDlgProc( HWND hDlg, UINT message,
case WM_LBUTTONDOWN:/* FIXME: ClipCursor on (if in color graph)*/
if (CC_WMLButtonDown(hDlg, wParam, lParam))
return TRUE;
break;
break;
}
return FALSE ;
}
@ -1303,7 +1303,7 @@ LRESULT WINAPI ColorDlgProc16( HWND16 hDlg, UINT16 message,
WPARAM16 wParam, LONG lParam )
{
int res;
LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER);
LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER);
if (message != WM_INITDIALOG)
{
if (!lpp)
@ -1325,8 +1325,8 @@ LRESULT WINAPI ColorDlgProc16( HWND16 hDlg, UINT16 message,
case WM_INITDIALOG:
return CC_WMInitDialog(hDlg, wParam, lParam, TRUE);
case WM_NCDESTROY:
DeleteDC(lpp->hdcMem);
DeleteObject(lpp->hbmMem);
DeleteDC(lpp->hdcMem);
DeleteObject(lpp->hbmMem);
HeapFree(GetProcessHeap(), 0, lpp->lpcc);
HeapFree(GetProcessHeap(), 0, lpp);
SetWindowLongA(hDlg, DWL_USER, 0L); /* we don't need it anymore */
@ -1334,7 +1334,7 @@ LRESULT WINAPI ColorDlgProc16( HWND16 hDlg, UINT16 message,
case WM_COMMAND:
if (CC_WMCommand(hDlg, wParam, lParam, HIWORD(lParam), (HWND)LOWORD(lParam)))
return TRUE;
break;
break;
case WM_PAINT:
if (CC_WMPaint(hDlg, wParam, lParam))
return TRUE;
@ -1354,7 +1354,7 @@ LRESULT WINAPI ColorDlgProc16( HWND16 hDlg, UINT16 message,
case WM_LBUTTONDOWN:/* FIXME: ClipCursor on (if in color graph)*/
if (CC_WMLButtonDown(hDlg, wParam, lParam))
return TRUE;
break;
break;
}
return FALSE ;
}
@ -1372,9 +1372,9 @@ BOOL16 WINAPI ChooseColor16( LPCHOOSECOLOR16 lpChCol )
BOOL16 bRet = FALSE;
LPCVOID template;
FARPROC16 ptr;
TRACE("ChooseColor\n");
if (!lpChCol) return FALSE;
if (!lpChCol) return FALSE;
if (lpChCol->Flags & CC_ENABLETEMPLATEHANDLE)
hDlgTmpl16 = lpChCol->hInstance;
@ -1420,7 +1420,7 @@ BOOL16 WINAPI ChooseColor16( LPCHOOSECOLOR16 lpChCol )
return FALSE;
}
template = GlobalLock16(hGlobal16);
if (!template)
if (!template)
{
COMDLG32_SetCommDlgExtendedError(CDERR_MEMLOCKFAILURE);
ERR("global lock failure for %x handle\n", hDlgTmpl16);
@ -1456,7 +1456,7 @@ BOOL WINAPI ChooseColorW( LPCHOOSECOLORW lpChCol )
LPCVOID template;
TRACE("ChooseColor\n");
if (!lpChCol) return FALSE;
if (!lpChCol) return FALSE;
if (lpChCol->Flags & CC_ENABLETEMPLATEHANDLE)
{

View File

@ -39,9 +39,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
#include "cdlg.h"
#define BUFFILE 512
#define BUFFILEALLOC 512 * sizeof(WCHAR)
#define BUFFILEALLOC 512 * sizeof(WCHAR)
struct FSPRIVATE
struct FSPRIVATE
{
HWND hwnd; /* file dialog window handle */
BOOL hook; /* TRUE if the dialog is hooked */
@ -64,7 +64,7 @@ struct FSPRIVATE
#define LFS16 1
#define LFS32A 2
#define LFS32W 3
static const WCHAR FILE_star[] = {'*','.','*', 0};
static const WCHAR FILE_bslash[] = {'\\', 0};
static const WCHAR FILE_specc[] = {'%','c',':', 0};
@ -117,7 +117,7 @@ static BOOL FileDlg_Init(void)
hHDisk = LoadImageA( inst, "HDISK", IMAGE_ICON, 16, 16, LR_SHARED );
hCDRom = LoadImageA( inst, "CDROM", IMAGE_ICON, 16, 16, LR_SHARED );
hNet = LoadImageA( inst, "NETWORK", IMAGE_ICON, 16, 16, LR_SHARED );
if (hFolder == 0 || hFolder2 == 0 || hFloppy == 0 ||
if (hFolder == 0 || hFolder2 == 0 || hFloppy == 0 ||
hHDisk == 0 || hCDRom == 0 || hNet == 0)
{
ERR("Error loading icons !\n");
@ -174,7 +174,7 @@ BOOL Get32BitsTemplate(LFSPRIVATE lfs)
}
} else { /* get it from internal Wine resource */
HANDLE hResInfo;
if (!(hResInfo = FindResourceA(COMMDLG_hInstance32,
if (!(hResInfo = FindResourceA(COMMDLG_hInstance32,
lfs->open? "OPEN_FILE":"SAVE_FILE", RT_DIALOGA)))
{
COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
@ -229,7 +229,7 @@ BOOL Get16BitsTemplate(LFSPRIVATE lfs)
LPCVOID template32;
DWORD size;
if (!(hResInfo = FindResourceA(COMMDLG_hInstance32,
if (!(hResInfo = FindResourceA(COMMDLG_hInstance32,
lfs->open ? "OPEN_FILE":"SAVE_FILE", RT_DIALOGA)))
{
COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
@ -376,7 +376,7 @@ static LPWSTR FILEDLG_GetFileType(LPWSTR cfptr, LPWSTR fptr, WORD index)
int n, i;
i = 0;
if (cfptr)
for ( ;(n = lstrlenW(cfptr)) != 0; i++)
for ( ;(n = lstrlenW(cfptr)) != 0; i++)
{
cfptr += n + 1;
if (i == index)
@ -384,7 +384,7 @@ static LPWSTR FILEDLG_GetFileType(LPWSTR cfptr, LPWSTR fptr, WORD index)
cfptr += lstrlenW(cfptr) + 1;
}
if (fptr)
for ( ;(n = lstrlenW(fptr)) != 0; i++)
for ( ;(n = lstrlenW(fptr)) != 0; i++)
{
fptr += n + 1;
if (i == index)
@ -407,7 +407,7 @@ static LONG FILEDLG_WMDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam,
if (lpdis->CtlType == ODT_LISTBOX && lpdis->CtlID == lst1)
{
if (!(str = HeapAlloc(GetProcessHeap(), 0, BUFFILEALLOC))) return FALSE;
SendMessageW(lpdis->hwndItem, LB_GETTEXT, lpdis->itemID,
SendMessageW(lpdis->hwndItem, LB_GETTEXT, lpdis->itemID,
(LPARAM)str);
if ((lpdis->itemState & ODS_SELECTED) && !savedlg)
@ -438,7 +438,7 @@ static LONG FILEDLG_WMDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam,
{
if (!(str = HeapAlloc(GetProcessHeap(), 0, BUFFILEALLOC)))
return FALSE;
SendMessageW(lpdis->hwndItem, LB_GETTEXT, lpdis->itemID,
SendMessageW(lpdis->hwndItem, LB_GETTEXT, lpdis->itemID,
(LPARAM)str);
if (lpdis->itemState & ODS_SELECTED)
@ -467,7 +467,7 @@ static LONG FILEDLG_WMDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam,
char root[] = "a:";
if (!(str = HeapAlloc(GetProcessHeap(), 0, BUFFILEALLOC)))
return FALSE;
SendMessageW(lpdis->hwndItem, CB_GETLBTEXT, lpdis->itemID,
SendMessageW(lpdis->hwndItem, CB_GETLBTEXT, lpdis->itemID,
(LPARAM)str);
root[0] += str[2] - 'a';
switch(GetDriveTypeA(root))
@ -502,10 +502,10 @@ static LONG FILEDLG_WMDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam,
/***********************************************************************
* FILEDLG_WMMeasureItem [internal]
*/
static LONG FILEDLG_WMMeasureItem(HWND hWnd, WPARAM wParam, LPARAM lParam)
static LONG FILEDLG_WMMeasureItem(HWND hWnd, WPARAM wParam, LPARAM lParam)
{
LPMEASUREITEMSTRUCT lpmeasure;
lpmeasure = (LPMEASUREITEMSTRUCT)lParam;
lpmeasure->itemHeight = fldrHeight;
return TRUE;
@ -514,10 +514,10 @@ static LONG FILEDLG_WMMeasureItem(HWND hWnd, WPARAM wParam, LPARAM lParam)
/***********************************************************************
* FILEDLG_WMMeasureItem16 [internal]
*/
static LONG FILEDLG_WMMeasureItem16(HWND16 hWnd, WPARAM16 wParam, LPARAM lParam)
static LONG FILEDLG_WMMeasureItem16(HWND16 hWnd, WPARAM16 wParam, LPARAM lParam)
{
LPMEASUREITEMSTRUCT16 lpmeasure;
lpmeasure = MapSL(lParam);
lpmeasure->itemHeight = fldrHeight;
return TRUE;
@ -583,10 +583,10 @@ static LONG FILEDLG_WMInitDialog(HWND hWnd, WPARAM wParam, LPARAM lParam)
/* set default filter */
if (ofn->nFilterIndex == 0 && ofn->lpstrCustomFilter == NULL)
ofn->nFilterIndex = 1;
SendDlgItemMessageW(hWnd, cmb1, CB_SETCURSEL, ofn->nFilterIndex - 1, 0);
SendDlgItemMessageW(hWnd, cmb1, CB_SETCURSEL, ofn->nFilterIndex - 1, 0);
lstrcpynW(tmpstr, FILEDLG_GetFileType(ofn->lpstrCustomFilter,
(LPWSTR)ofn->lpstrFilter, ofn->nFilterIndex - 1),BUFFILE);
TRACE("nFilterIndex = %ld, SetText of edt1 to %s\n",
TRACE("nFilterIndex = %ld, SetText of edt1 to %s\n",
ofn->nFilterIndex, debugstr_w(tmpstr));
SetDlgItemTextW( hWnd, edt1, tmpstr );
/* get drive list */
@ -597,7 +597,7 @@ static LONG FILEDLG_WMInitDialog(HWND hWnd, WPARAM wParam, LPARAM lParam)
* the OPENFILENAME structure). For example under 2000/XP any path in the
* lpstrFile overrides the lpstrInitialDir, but not under 95/98/ME
*/
if (ofn->lpstrInitialDir != NULL)
if (ofn->lpstrInitialDir != NULL)
{
int len;
lstrcpynW(tmpstr, ofn->lpstrInitialDir, 511);
@ -638,7 +638,7 @@ static LONG FILEDLG_WMInitDialog(HWND hWnd, WPARAM wParam, LPARAM lParam)
/***********************************************************************
* FILEDLG_UpdateResult [internal]
* update the displayed file name (with path)
* update the displayed file name (with path)
*/
void FILEDLG_UpdateResult(LFSPRIVATE lfs, WCHAR *tmpstr)
{
@ -695,13 +695,13 @@ void FILEDLG_UpdateResult(LFSPRIVATE lfs, WCHAR *tmpstr)
/***********************************************************************
* FILEDLG_UpdateFileTitle [internal]
* update the displayed file name (without path)
* update the displayed file name (without path)
*/
void FILEDLG_UpdateFileTitle(LFSPRIVATE lfs)
{
LONG lRet;
LPOPENFILENAMEW ofnW = lfs->ofnW;
if (ofnW->lpstrFileTitle != NULL)
if (ofnW->lpstrFileTitle != NULL)
{
lRet = SendDlgItemMessageW(lfs->hwnd, lst1, LB_GETCURSEL, 0, 0);
SendDlgItemMessageW(lfs->hwnd, lst1, LB_GETTEXT, lRet,
@ -907,7 +907,7 @@ static LRESULT FILEDLG_Validate( LFSPRIVATE lfs, LPWSTR path, UINT control, INT
{
lRet = (BOOL)FILEDLG_CallWindowProc(lfs, lfs->fileokstring,
0, lfs->lParam );
if (lRet)
if (lRet)
{
*ofnW = ofnsav; /* restore old state */
return FALSE;
@ -945,7 +945,7 @@ static LRESULT FILEDLG_DiskChange( LFSPRIVATE lfs )
SendDlgItemMessageW(hWnd, cmb2, CB_GETLBTEXT, lRet,
(LPARAM)pstr);
wsprintfW(diskname, FILE_specc, pstr[2]);
HeapFree(GetProcessHeap(), 0, pstr);
HeapFree(GetProcessHeap(), 0, pstr);
return FILEDLG_Validate( lfs, diskname, cmb2, lRet, TRUE );
}
@ -977,7 +977,7 @@ static LRESULT FILEDLG_FileTypeChange( LFSPRIVATE lfs )
* FILEDLG_WMCommand [internal]
*/
static LRESULT FILEDLG_WMCommand(HWND hWnd, LPARAM lParam, UINT notification,
UINT control, LFSPRIVATE lfs )
UINT control, LFSPRIVATE lfs )
{
switch (control)
{
@ -1000,7 +1000,7 @@ static LRESULT FILEDLG_WMCommand(HWND hWnd, LPARAM lParam, UINT notification,
break;
case cmb1: /* file type drop list */
if (notification == CBN_SELCHANGE)
if (notification == CBN_SELCHANGE)
return FILEDLG_FileTypeChange( lfs );
break;
@ -1117,7 +1117,7 @@ void FILEDLG_MapOfnStructA(LPOPENFILENAMEA ofnA, LPOPENFILENAMEW ofnW, BOOL open
ofnW->lpstrInitialDir = HEAP_strdupAtoW(GetProcessHeap(),0,ofnA->lpstrInitialDir);
if (ofnA->lpstrTitle)
str = ofnA->lpstrTitle;
else
else
/* Allocates default title (FIXME : get it from resource) */
str = open ? defaultopen:defaultsave;
ofnW->lpstrTitle = HEAP_strdupAtoW(GetProcessHeap(),0, str);
@ -1174,7 +1174,7 @@ void FILEDLG_MapOfnStruct16(LPOPENFILENAME16 ofn16, LPOPENFILENAMEW ofnW, BOOL o
/************************************************************************
* FILEDLG_DestroyPrivate [internal]
* destroys the private object
* destroys the private object
*/
void FILEDLG_DestroyPrivate(LFSPRIVATE lfs)
{
@ -1209,7 +1209,7 @@ void FILEDLG_DestroyPrivate(LFSPRIVATE lfs)
/************************************************************************
* FILEDLG_AllocPrivate [internal]
* allocate a private object to hold 32 bits Unicode
* allocate a private object to hold 32 bits Unicode
* structure that will be used throughtout the calls, while
* keeping available the original structures and a few variables
* On entry : type = dialog procedure type (16,32A,32W)
@ -1264,7 +1264,7 @@ LFSPRIVATE FILEDLG_AllocPrivate(LPARAM lParam, int type, UINT dlgType)
if (lfs->ofnA)
FILEDLG_MapOfnStructA(lfs->ofnA, lfs->ofnW, lfs->open);
}
else
else
ret = NULL;
}
if (lfs->ofn16)
@ -1283,7 +1283,7 @@ LFSPRIVATE FILEDLG_AllocPrivate(LPARAM lParam, int type, UINT dlgType)
*
* Creates a win31 style dialog box for the user to select a file to open/save.
*/
BOOL WINAPI GetFileName31A(
BOOL WINAPI GetFileName31A(
LPOPENFILENAMEA lpofn, /* addess of structure with data*/
UINT dlgType /* type dialogue : open/save */
)
@ -1298,7 +1298,7 @@ BOOL WINAPI GetFileName31A(
if (lfs)
{
hInst = GetWindowLongA( lpofn->hwndOwner, GWL_HINSTANCE );
bRet = DialogBoxIndirectParamA( hInst, lfs->template, lpofn->hwndOwner,
bRet = DialogBoxIndirectParamA( hInst, lfs->template, lpofn->hwndOwner,
(DLGPROC) FileOpenDlgProc, (DWORD) lfs);
FILEDLG_DestroyPrivate(lfs);
}
@ -1313,7 +1313,7 @@ BOOL WINAPI GetFileName31A(
*
* Creates a win31 style dialog box for the user to select a file to open/save
*/
BOOL WINAPI GetFileName31W(
BOOL WINAPI GetFileName31W(
LPOPENFILENAMEW lpofn, /* addess of structure with data*/
UINT dlgType /* type dialogue : open/save */
)
@ -1328,7 +1328,7 @@ BOOL WINAPI GetFileName31W(
if (lfs)
{
hInst = GetWindowLongA( lpofn->hwndOwner, GWL_HINSTANCE );
bRet = DialogBoxIndirectParamW( hInst, lfs->template, lpofn->hwndOwner,
bRet = DialogBoxIndirectParamW( hInst, lfs->template, lpofn->hwndOwner,
(DLGPROC) FileOpenDlgProc, (DWORD) lfs);
FILEDLG_DestroyPrivate(lfs);
}
@ -1345,15 +1345,15 @@ BOOL WINAPI GetFileName31W(
*/
LRESULT WINAPI FileOpenDlgProc16(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam,
LPARAM lParam)
{
{
LFSPRIVATE lfs = (LFSPRIVATE)GetPropA(hWnd,OFN_PROP);
DRAWITEMSTRUCT dis;
TRACE("msg=%x wparam=%x lParam=%lx\n", wMsg, wParam, lParam);
if ((wMsg != WM_INITDIALOG) && lfs && lfs->hook)
{
LRESULT lRet = (BOOL16)FILEDLG_CallWindowProc(lfs, wMsg, wParam, lParam);
if (lRet)
if (lRet)
return lRet; /* else continue message processing */
}
switch (wMsg)
@ -1402,16 +1402,16 @@ LRESULT WINAPI FileSaveDlgProc16(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam,
{
LRESULT lRet;
lRet = (BOOL16)FILEDLG_CallWindowProc(lfs, wMsg, wParam, lParam);
if (lRet)
if (lRet)
return lRet; /* else continue message processing */
}
}
switch (wMsg) {
case WM_INITDIALOG:
return FILEDLG_WMInitDialog(hWnd, wParam, lParam);
case WM_MEASUREITEM:
return FILEDLG_WMMeasureItem16(hWnd, wParam, lParam);
case WM_DRAWITEM:
FILEDLG_MapDrawItemStruct(MapSL(lParam), &dis);
return FILEDLG_WMDrawItem(hWnd, wParam, lParam, TRUE, &dis);
@ -1419,7 +1419,7 @@ LRESULT WINAPI FileSaveDlgProc16(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam,
case WM_COMMAND:
return FILEDLG_WMCommand(hWnd, lParam, HIWORD(lParam), wParam, lfs);
}
/*
case WM_CTLCOLOR:
SetBkColor((HDC16)wParam, 0x00C0C0C0);
@ -1433,14 +1433,14 @@ LRESULT WINAPI FileSaveDlgProc16(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam,
return hGRAYBrush;
}
return FALSE;
*/
return FALSE;
}
/***********************************************************************
* FileOpenDlgProc [internal]
* Used for open and save, in fact.
* Used for open and save, in fact.
*/
static LRESULT WINAPI FileOpenDlgProc(HWND hWnd, UINT wMsg,
WPARAM wParam, LPARAM lParam)
@ -1452,7 +1452,7 @@ static LRESULT WINAPI FileOpenDlgProc(HWND hWnd, UINT wMsg,
{
LRESULT lRet;
lRet = (BOOL)FILEDLG_CallWindowProc(lfs, wMsg, wParam, lParam);
if (lRet)
if (lRet)
return lRet; /* else continue message processing */
}
switch (wMsg)
@ -1486,7 +1486,7 @@ static LRESULT WINAPI FileOpenDlgProc(HWND hWnd, UINT wMsg,
return FALSE;
}
/* ------------------ APIs ---------------------- */
/* ------------------ APIs ---------------------- */
/***********************************************************************
* GetOpenFileName (COMMDLG.1)
@ -1500,7 +1500,7 @@ static LRESULT WINAPI FileOpenDlgProc(HWND hWnd, UINT wMsg,
* BUGS
* unknown, there are some FIXME's left.
*/
BOOL16 WINAPI GetOpenFileName16(
BOOL16 WINAPI GetOpenFileName16(
SEGPTR ofn /* [in/out] address of structure with data*/
)
{
@ -1517,7 +1517,7 @@ BOOL16 WINAPI GetOpenFileName16(
{
hInst = GetWindowLongA( lpofn->hwndOwner, GWL_HINSTANCE );
ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (LPCSTR) 6);
bRet = DialogBoxIndirectParam16( hInst, lfs->hDlgTmpl16, lpofn->hwndOwner,
bRet = DialogBoxIndirectParam16( hInst, lfs->hDlgTmpl16, lpofn->hwndOwner,
(DLGPROC16) ptr, (DWORD) lfs);
FILEDLG_DestroyPrivate(lfs);
}
@ -1538,7 +1538,7 @@ BOOL16 WINAPI GetOpenFileName16(
* BUGS
* unknown. There are some FIXME's left.
*/
BOOL16 WINAPI GetSaveFileName16(
BOOL16 WINAPI GetSaveFileName16(
SEGPTR ofn /* [in/out] addess of structure with data*/
)
{
@ -1555,10 +1555,10 @@ BOOL16 WINAPI GetSaveFileName16(
{
hInst = GetWindowLongA( lpofn->hwndOwner, GWL_HINSTANCE );
ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (LPCSTR) 7);
bRet = DialogBoxIndirectParam16( hInst, lfs->hDlgTmpl16, lpofn->hwndOwner,
bRet = DialogBoxIndirectParam16( hInst, lfs->hDlgTmpl16, lpofn->hwndOwner,
(DLGPROC16) ptr, (DWORD) lfs);
FILEDLG_DestroyPrivate(lfs);
}
}
TRACE("return lpstrFile='%s' !\n", (char *)MapSL(lpofn->lpstrFile));
return bRet;
@ -1650,7 +1650,7 @@ BOOL WINAPI GetSaveFileNameA(
if (newlook)
{
return GetFileDialog95A(ofn, SAVE_DIALOG);
}
}
else
{
return GetFileName31A(ofn, SAVE_DIALOG);
@ -1681,7 +1681,7 @@ BOOL WINAPI GetSaveFileNameW(
if (newlook)
{
return GetFileDialog95W(ofn, SAVE_DIALOG);
}
}
else
{
return GetFileName31W(ofn, SAVE_DIALOG);

View File

@ -92,7 +92,7 @@ typedef struct SFolder
int m_iImageIndex; /* Index of picture in image list */
HIMAGELIST hImgList;
int m_iIndent; /* Indentation index */
LPITEMIDLIST pidlItem; /* absolute pidl of the item */
LPITEMIDLIST pidlItem; /* absolute pidl of the item */
} SFOLDER,*LPSFOLDER;
@ -222,7 +222,7 @@ static BOOL BrowseSelectedFolder(HWND hwnd);
/***********************************************************************
* GetFileName95
*
* Creates an Open common dialog box that lets the user select
* Creates an Open common dialog box that lets the user select
* the drive, directory, and the name of a file or set of files to open.
*
* IN : The FileOpenDlgInfos structure associated with the dialog
@ -257,7 +257,7 @@ BOOL WINAPI GetFileName95(FileOpenDlgInfos *fodInfos)
COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
return FALSE;
}
/* old style hook messages */
if (IsHooked(fodInfos))
{
@ -266,7 +266,7 @@ BOOL WINAPI GetFileName95(FileOpenDlgInfos *fodInfos)
fodInfos->HookMsg.helpmsgstring = RegisterWindowMessageA(HELPMSGSTRINGA);
fodInfos->HookMsg.sharevistring = RegisterWindowMessageA(SHAREVISTRINGA);
}
lRes = DialogBoxIndirectParamA(COMMDLG_hInstance32,
(LPDLGTEMPLATEA) template,
fodInfos->ofnInfos->hwndOwner,
@ -276,7 +276,7 @@ BOOL WINAPI GetFileName95(FileOpenDlgInfos *fodInfos)
/* Unable to create the dialog */
if( lRes == -1)
return FALSE;
return lRes;
}
@ -297,14 +297,14 @@ BOOL WINAPI GetFileDialog95A(LPOPENFILENAMEA ofn,UINT iDlgType)
LPCSTR lpstrInitialDir = (LPCSTR)-1;
LPSTR lpstrSavDir = NULL;
DWORD dwFlags = 0;
/* Initialize FileOpenDlgInfos structure */
fodInfos = (FileOpenDlgInfos*)MemAlloc(sizeof(FileOpenDlgInfos));
ZeroMemory(fodInfos, sizeof(FileOpenDlgInfos));
/* Pass in the original ofn */
fodInfos->ofnInfos = ofn;
/* Save original hInstance value */
hInstance = ofn->hInstance;
fodInfos->ofnInfos->hInstance = MapHModuleLS(ofn->hInstance);
@ -322,7 +322,7 @@ BOOL WINAPI GetFileDialog95A(LPOPENFILENAMEA ofn,UINT iDlgType)
/* Initialize the dialog property */
fodInfos->DlgInfos.dwDlgProp = 0;
fodInfos->DlgInfos.hwndCustomDlg = (HWND)NULL;
switch(iDlgType)
{
case OPEN_DIALOG :
@ -402,7 +402,7 @@ BOOL WINAPI GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType)
BOOL ret;
FileOpenDlgInfos *fodInfos;
HINSTANCE hInstance;
/* out arguments */
LPWSTR lpstrFile = NULL;
LPWSTR lpstrFileTitle = NULL;
@ -436,7 +436,7 @@ BOOL WINAPI GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType)
/* filter is a list... title\0ext\0......\0\0 */
s = ofn->lpstrFilter;
while (*s) s = s+strlenW(s)+1;
s++;
n = s - ofn->lpstrFilter; /* already divides by 2. ptr magic */
@ -490,7 +490,7 @@ BOOL WINAPI GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType)
default :
ret = 0;
}
/* restore saved IN arguments and convert OUT arguments back */
ofn->Flags = dwFlags;
ofn->hInstance = hInstance;
@ -568,7 +568,7 @@ void ArrangeCtrlPositions( HWND hwndChildDlg, HWND hwndParentDlg)
SetWindowPos(hwndChildDlg, 0, 0,0, ptParentClient.x,ptParentClient.y, SWP_NOZORDER );
SetWindowPos(hwndParentDlg, 0, rectParent.left,rectParent.top, (rectParent.right- rectParent.left),
(rectParent.bottom-rectParent.top),SWP_NOMOVE | SWP_NOZORDER);
hwndChild = GetWindow(hwndChildDlg,GW_CHILD);
if(hwndStc32)
{
@ -588,7 +588,7 @@ void ArrangeCtrlPositions( HWND hwndChildDlg, HWND hwndParentDlg)
continue;
GetWindowRect(hwndChild,&rectCtrl);
MapWindowPoints( 0, hwndParentDlg,(LPPOINT)&rectCtrl,2);
/*
Check the initial position of the controls relative to the initial
position and size of stc32 (before it is expanded).
@ -606,15 +606,15 @@ void ArrangeCtrlPositions( HWND hwndChildDlg, HWND hwndParentDlg)
{
rectCtrl.top += ptMoveCtl.y;
}
SetWindowPos( hwndChild, 0, rectCtrl.left, rectCtrl.top,
SetWindowPos( hwndChild, 0, rectCtrl.left, rectCtrl.top,
rectCtrl.right-rectCtrl.left,rectCtrl.bottom-rectCtrl.top,
SWP_NOSIZE | SWP_NOZORDER );
}
} while ((hwndChild=GetWindow( hwndChild, GW_HWNDNEXT )) != (HWND)NULL);
}
hwndChild = GetWindow(hwndParentDlg,GW_CHILD);
if(hwndStc32)
{
GetWindowRect(hwndStc32,&rectStc32);
@ -635,12 +635,12 @@ void ArrangeCtrlPositions( HWND hwndChildDlg, HWND hwndParentDlg)
rectCtrl.left += ptMoveCtl.x;
rectCtrl.top += ptMoveCtl.y;
SetWindowPos( hwndChild, 0, rectCtrl.left, rectCtrl.top,
SetWindowPos( hwndChild, 0, rectCtrl.left, rectCtrl.top,
rectCtrl.right-rectCtrl.left,rectCtrl.bottom-rectCtrl.top,
SWP_NOSIZE |SWP_NOZORDER );
}
} while ((hwndChild=GetWindow( hwndChild, GW_HWNDNEXT )) != (HWND)NULL);
}
}
}
}
@ -656,7 +656,7 @@ HRESULT WINAPI FileOpenDlgProcUserTemplate(HWND hwnd, UINT uMsg, WPARAM wParam,
switch(uMsg)
{
case WM_INITDIALOG:
{
{
/* Hide caption since some program may leave it */
DWORD Style = GetWindowLongA(hwnd, GWL_STYLE);
if (Style & WS_CAPTION) SetWindowLongA(hwnd, GWL_STYLE, Style & (~WS_CAPTION));
@ -667,14 +667,14 @@ HRESULT WINAPI FileOpenDlgProcUserTemplate(HWND hwnd, UINT uMsg, WPARAM wParam,
if(fodInfos && IsHooked(fodInfos))
return CallWindowProcA((WNDPROC)fodInfos->ofnInfos->lpfnHook,hwnd,uMsg,wParam,lParam);
return 0;
}
return 0;
}
}
if(fodInfos && IsHooked(fodInfos))
return CallWindowProcA((WNDPROC)fodInfos->ofnInfos->lpfnHook,hwnd,uMsg,wParam,lParam);
return CallWindowProcA((WNDPROC)fodInfos->ofnInfos->lpfnHook,hwnd,uMsg,wParam,lParam);
return DefWindowProcA(hwnd,uMsg,wParam,lParam);
return DefWindowProcA(hwnd,uMsg,wParam,lParam);
}
HWND CreateTemplateDialog(FileOpenDlgInfos *fodInfos, HWND hwnd)
@ -716,7 +716,7 @@ HWND CreateTemplateDialog(FileOpenDlgInfos *fodInfos, HWND hwnd)
hChildDlg= CreateDialogIndirectParamA(fodInfos->ofnInfos->hInstance,template,hwnd,(DLGPROC)FileOpenDlgProcUserTemplate,(LPARAM)fodInfos);
if(hChildDlg)
{
ShowWindow(hChildDlg,SW_SHOW);
ShowWindow(hChildDlg,SW_SHOW);
return hChildDlg;
}
}
@ -742,7 +742,7 @@ HWND CreateTemplateDialog(FileOpenDlgInfos *fodInfos, HWND hwnd)
}
return (HWND)NULL;
}
/***********************************************************************
* SendCustomDlgNotificationMessage
*
@ -794,7 +794,7 @@ HRESULT FILEDLG95_HandleCustomDialogMessages(HWND hwnd, UINT uMsg, WPARAM wParam
case CDM_GETFILEPATH:
GetDlgItemTextA(hwnd,IDC_FILENAME,lpstrPath, sizeof(lpstrPath));
lpstrFileSpec = (LPSTR)PathFindFileNameA(lpstrPath);
if (lpstrFileSpec==lpstrPath)
if (lpstrFileSpec==lpstrPath)
{
char lpstrCurrentDir[MAX_PATH];
/* Prepend the current path */
@ -802,8 +802,8 @@ HRESULT FILEDLG95_HandleCustomDialogMessages(HWND hwnd, UINT uMsg, WPARAM wParam
if ((LPSTR)lParam!=NULL)
snprintf((LPSTR)lParam,(int)wParam,"%s\\%s",lpstrCurrentDir,lpstrPath);
reqSize=strlen(lpstrCurrentDir)+1+strlen(lpstrPath)+1;
}
else
}
else
{
lstrcpynA((LPSTR)lParam,(LPSTR)lpstrPath,(int)wParam);
reqSize=strlen(lpstrPath);
@ -836,7 +836,7 @@ HRESULT FILEDLG95_HandleCustomDialogMessages(HWND hwnd, UINT uMsg, WPARAM wParam
}
return TRUE;
}
/***********************************************************************
* FileOpenDlgProc95
*
@ -847,18 +847,18 @@ HRESULT WINAPI FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
#if 0
TRACE("0x%04x 0x%04x\n", hwnd, uMsg);
#endif
switch(uMsg)
{
case WM_INITDIALOG:
{
FileOpenDlgInfos * fodInfos = (FileOpenDlgInfos *)lParam;
/* Adds the FileOpenDlgInfos in the property list of the dialog
/* Adds the FileOpenDlgInfos in the property list of the dialog
so it will be easily accessible through a GetPropA(...) */
SetPropA(hwnd, FileOpenDlgInfosStr, (HANDLE) fodInfos);
fodInfos->DlgInfos.hwndCustomDlg =
fodInfos->DlgInfos.hwndCustomDlg =
CreateTemplateDialog((FileOpenDlgInfos *)lParam, hwnd);
FILEDLG95_InitControls(hwnd);
@ -881,7 +881,7 @@ HRESULT WINAPI FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
}
}
return FALSE;
case WM_GETISHELLBROWSER:
return FILEDLG95_OnWMGetIShellBrowser(hwnd);
@ -897,7 +897,7 @@ HRESULT WINAPI FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
/* set up the button tooltips strings */
if(TTN_GETDISPINFOA == lpnmh->code )
{
LPNMTTDISPINFOA lpdi = (LPNMTTDISPINFOA)lParam;
LPNMTTDISPINFOA lpdi = (LPNMTTDISPINFOA)lParam;
switch(lpnmh->idFrom )
{
/* Up folder button */
@ -923,7 +923,7 @@ HRESULT WINAPI FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
default:
stringId = 0;
}
lpdi->hinst = COMMDLG_hInstance32;
lpdi->hinst = COMMDLG_hInstance32;
lpdi->lpszText = (LPSTR) stringId;
}
return FALSE;
@ -959,9 +959,9 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd)
{ HINST_COMMCTRL, IDB_VIEW_SMALL_COLOR },
{ COMDLG32_hInstance, 800 } /* desktop icon */
};
RECT rectTB;
FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwnd,FileOpenDlgInfosStr);
TRACE("%p\n", fodInfos);
@ -975,11 +975,11 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd)
GetWindowRect(GetDlgItem(hwnd,IDC_TOOLBARSTATIC),&rectTB);
MapWindowPoints( 0, hwnd,(LPPOINT)&rectTB,2);
fodInfos->DlgInfos.hwndTB = CreateWindowExA(0, TOOLBARCLASSNAMEA, (LPSTR) NULL,
fodInfos->DlgInfos.hwndTB = CreateWindowExA(0, TOOLBARCLASSNAMEA, (LPSTR) NULL,
WS_CHILD | WS_GROUP | TBSTYLE_TOOLTIPS | CCS_NODIVIDER | CCS_NORESIZE,
0, 0, 150, 26, hwnd, (HMENU) IDC_TOOLBAR, COMMDLG_hInstance32, NULL);
SetWindowPos(fodInfos->DlgInfos.hwndTB, 0,
0, 0, 150, 26, hwnd, (HMENU) IDC_TOOLBAR, COMMDLG_hInstance32, NULL);
SetWindowPos(fodInfos->DlgInfos.hwndTB, 0,
rectTB.left,rectTB.top, rectTB.right-rectTB.left, rectTB.bottom-rectTB.top,
SWP_SHOWWINDOW | SWP_NOACTIVATE | SWP_NOZORDER );
@ -991,7 +991,7 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd)
SendMessageA(fodInfos->DlgInfos.hwndTB, TB_ADDBITMAP, (WPARAM) 1, (LPARAM) &tba[1]);
SendMessageA(fodInfos->DlgInfos.hwndTB, TB_ADDBUTTONSA, (WPARAM) 9,(LPARAM) &tbb);
SendMessageA(fodInfos->DlgInfos.hwndTB, TB_AUTOSIZE, 0, 0);
SendMessageA(fodInfos->DlgInfos.hwndTB, TB_AUTOSIZE, 0, 0);
/* Set the window text with the text specified in the OPENFILENAME structure */
if(fodInfos->ofnInfos->lpstrTitle)
@ -1031,7 +1031,7 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd)
/* Resize the height, if open as read only checkbox ad help button
are hidden and we are not using a custom template */
if ( (fodInfos->ofnInfos->Flags & OFN_HIDEREADONLY) &&
(!(fodInfos->ofnInfos->Flags &
(!(fodInfos->ofnInfos->Flags &
(OFN_SHOWHELP|OFN_ENABLETEMPLATE|OFN_ENABLETEMPLATEHANDLE))))
{
RECT rectDlg, rectHelp, rectCancel;
@ -1040,8 +1040,8 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd)
GetWindowRect(GetDlgItem(hwnd, IDCANCEL), &rectCancel);
/* subtract the height of the help button plus the space between
the help button and the cancel button to the height of the dialog */
SetWindowPos(hwnd, 0, 0, 0, rectDlg.right-rectDlg.left,
(rectDlg.bottom-rectDlg.top) - (rectHelp.bottom - rectCancel.bottom),
SetWindowPos(hwnd, 0, 0, 0, rectDlg.right-rectDlg.left,
(rectDlg.bottom-rectDlg.top) - (rectHelp.bottom - rectCancel.bottom),
SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOZORDER);
}
@ -1062,10 +1062,10 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd)
static LRESULT FILEDLG95_FillControls(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
LPITEMIDLIST pidlItemId = NULL;
FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) lParam;
TRACE("dir=%s file=%s\n",
TRACE("dir=%s file=%s\n",
fodInfos->ofnInfos->lpstrInitialDir, fodInfos->ofnInfos->lpstrFile);
/* Get the initial directory pidl */
@ -1165,7 +1165,7 @@ static LRESULT FILEDLG95_OnWMCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
}
/* Do not use the listview selection anymore */
fodInfos->DlgInfos.dwDlgProp &= ~FODPROP_USEVIEW;
return 0;
return 0;
}
/***********************************************************************
@ -1182,13 +1182,13 @@ static LRESULT FILEDLG95_OnWMGetIShellBrowser(HWND hwnd)
SetWindowLongA(hwnd,DWL_MSGRESULT,(LONG)fodInfos->Shell.FOIShellBrowser);
return TRUE;
return TRUE;
}
/***********************************************************************
* FILEDLG95_OnOpenMultipleFiles
*
*
* Handles the opening of multiple files.
*
* FIXME
@ -1205,13 +1205,13 @@ BOOL FILEDLG95_OnOpenMultipleFiles(HWND hwnd, LPSTR lpstrFileList, UINT nFileCou
lpstrFile = fodInfos->ofnInfos->lpstrFile;
lpstrFile[0] = '\0';
SHGetPathFromIDListA( fodInfos->ShellInfos.pidlAbsCurrent, lpstrPathSpec );
if ( !(fodInfos->ofnInfos->Flags & OFN_NOVALIDATE) &&
( fodInfos->ofnInfos->Flags & OFN_FILEMUSTEXIST))
{
LPSTR lpstrTemp = lpstrFileList;
LPSTR lpstrTemp = lpstrFileList;
for ( nCount = 0; nCount < nFileCount; nCount++ )
{
@ -1236,7 +1236,7 @@ BOOL FILEDLG95_OnOpenMultipleFiles(HWND hwnd, LPSTR lpstrFileList, UINT nFileCou
MessageBoxA(hwnd, tmp, fodInfos->ofnInfos->lpstrTitle, MB_OK | MB_ICONEXCLAMATION);
return FALSE;
}
/* move to the next file in the list of files */
lpstrTemp += strlen(lpstrTemp) + 1;
COMDLG32_SHFree(pidl);
@ -1259,7 +1259,7 @@ BOOL FILEDLG95_OnOpenMultipleFiles(HWND hwnd, LPSTR lpstrFileList, UINT nFileCou
* FILEDLG95_OnOpen
*
* Ok button WM_COMMAND message handler
*
*
* If the function succeeds, the return value is nonzero.
*/
#define ONOPEN_BROWSE 1
@ -1300,7 +1300,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
BrowseSelectedFolder(hwnd);
return FALSE;
}
if(nFileCount > 1)
{
ret = FILEDLG95_OnOpenMultipleFiles(hwnd, lpstrFileList, nFileCount, sizeUsed);
@ -1359,7 +1359,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
We have to parse the path step by step to see if we have to browse
to a folder if the path points to a directory or the last
valid element is a directory.
valid variables:
lpstrPathAndFile: cleaned up path
*/
@ -1381,7 +1381,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
}
if (FAILED (SHGetDesktopFolder(&lpsf))) return FALSE;
lpszTemp1 = lpszTemp = lpstrPathAndFile;
while (lpszTemp1)
{
@ -1537,12 +1537,12 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
{
int PathLength;
PathLength = strlen(lpstrPathAndFile);
strcat(lpstrPathAndFile, ".");
strcat(lpstrPathAndFile, fodInfos->ofnInfos->lpstrDefExt);
/* if file does not exist try without extension */
if (!PathFileExistsA(lpstrPathAndFile))
if (!PathFileExistsA(lpstrPathAndFile))
lpstrPathAndFile[PathLength] = '\0';
}
}
@ -1554,7 +1554,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
((fodInfos->ofnInfos->Flags & OFN_ALLOWMULTISELECT) ? 1 : 0))
{
LPSTR lpszTemp;
/* fill destination buffer */
strcpy(fodInfos->ofnInfos->lpstrFile, lpstrPathAndFile);
if (fodInfos->ofnInfos->Flags & OFN_ALLOWMULTISELECT)
@ -1564,11 +1564,11 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
/* set filename offset */
lpszTemp = PathFindFileNameA(lpstrPathAndFile);
fodInfos->ofnInfos->nFileOffset = lpszTemp - lpstrPathAndFile;
/* set extension offset */
lpszTemp = PathFindExtensionA(lpstrPathAndFile);
fodInfos->ofnInfos->nFileExtension = (*lpszTemp) ? lpszTemp - lpstrPathAndFile + 1 : 0;
/* set the lpstrFileTitle */
if(fodInfos->ofnInfos->lpstrFileTitle)
{
@ -1627,7 +1627,7 @@ static HRESULT FILEDLG95_SHELL_Init(HWND hwnd)
TRACE("\n");
/*
* Initialisation of the FileOpenDialogInfos structure
* Initialisation of the FileOpenDialogInfos structure
*/
/* Shell */
@ -1638,7 +1638,7 @@ static HRESULT FILEDLG95_SHELL_Init(HWND hwnd)
/* Disable multi-select if flag not set */
if (!(fodInfos->ofnInfos->Flags & OFN_ALLOWMULTISELECT))
{
fodInfos->ShellInfos.folderSettings.fFlags |= FWF_SINGLESEL;
fodInfos->ShellInfos.folderSettings.fFlags |= FWF_SINGLESEL;
}
fodInfos->ShellInfos.folderSettings.fFlags |= FWF_AUTOARRANGE | FWF_ALIGNLEFT;
fodInfos->ShellInfos.folderSettings.ViewMode = FVM_LIST;
@ -1648,8 +1648,8 @@ static HRESULT FILEDLG95_SHELL_Init(HWND hwnd)
ScreenToClient(hwnd,(LPPOINT)&fodInfos->ShellInfos.rectView.right);
/* Construct the IShellBrowser interface */
fodInfos->Shell.FOIShellBrowser = IShellBrowserImpl_Construct(hwnd);
fodInfos->Shell.FOIShellBrowser = IShellBrowserImpl_Construct(hwnd);
return NOERROR;
}
@ -1716,7 +1716,7 @@ static BOOL FILEDLG95_SHELL_BrowseToDesktop(HWND hwnd)
FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwnd,FileOpenDlgInfosStr);
LPITEMIDLIST pidl;
HRESULT hres;
TRACE("\n");
SHGetSpecialFolderLocation(0,CSIDL_DESKTOP,&pidl);
@ -1749,7 +1749,7 @@ static void FILEDLG95_SHELL_Clean(HWND hwnd)
/***********************************************************************
* FILEDLG95_FILETYPE_Init
*
* Initialisation of the file type combo box
* Initialisation of the file type combo box
*/
static HRESULT FILEDLG95_FILETYPE_Init(HWND hwnd)
{
@ -1765,7 +1765,7 @@ static HRESULT FILEDLG95_FILETYPE_Init(HWND hwnd)
for(;;)
{
/* filter is a list... title\0ext\0......\0\0
/* filter is a list... title\0ext\0......\0\0
* Set the combo item text to the title and the item data
* to the ext
*/
@ -1782,7 +1782,7 @@ static HRESULT FILEDLG95_FILETYPE_Init(HWND hwnd)
if (!(lpstrExt = (LPSTR) MemAlloc(strlen(lpstrPos)+1))) return E_FAIL;
strcpy(lpstrExt,lpstrPos);
lpstrPos += strlen(lpstrPos) + 1;
/* Add the item at the end of the combo */
CBAddString(fodInfos->DlgInfos.hwndFileTypeCB, lpstrDisplay);
CBSetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB, nFilters, lpstrExt);
@ -1793,7 +1793,7 @@ static HRESULT FILEDLG95_FILETYPE_Init(HWND hwnd)
* in the initialisation structure
* FIXME: lpstrCustomFilter not handled at all
*/
/* set default filter index */
if(fodInfos->ofnInfos->nFilterIndex == 0 && fodInfos->ofnInfos->lpstrCustomFilter == NULL)
fodInfos->ofnInfos->nFilterIndex = 1;
@ -1801,16 +1801,16 @@ static HRESULT FILEDLG95_FILETYPE_Init(HWND hwnd)
/* First, check to make sure our index isn't out of bounds. */
if ( fodInfos->ofnInfos->nFilterIndex > nFilters )
fodInfos->ofnInfos->nFilterIndex = nFilters;
/* Set the current index selection. */
CBSetCurSel(fodInfos->DlgInfos.hwndFileTypeCB, fodInfos->ofnInfos->nFilterIndex-1);
/* Get the corresponding text string from the combo box. */
lpstrFilter = (LPSTR) CBGetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB,
fodInfos->ofnInfos->nFilterIndex-1);
if ((INT)lpstrFilter == CB_ERR) /* control is empty */
lpstrFilter = NULL;
lpstrFilter = NULL;
if(lpstrFilter)
{
@ -1919,11 +1919,11 @@ static void FILEDLG95_FILETYPE_Clean(HWND hwnd)
MemFree(fodInfos->ShellInfos.lpstrCurrentFilter);
}
/***********************************************************************
* FILEDLG95_LOOKIN_Init
*
* Initialisation of the look in combo box
* Initialisation of the look in combo box
*/
static HRESULT FILEDLG95_LOOKIN_Init(HWND hwndCombo)
{
@ -2026,21 +2026,21 @@ static LRESULT FILEDLG95_LOOKIN_DrawItem(LPDRAWITEMSTRUCT pDIStruct)
if(pDIStruct->itemID == liInfos->uSelectedItem)
{
ilItemImage = (HIMAGELIST) SHGetFileInfoA ((LPCSTR) tmpFolder->pidlItem,
0,
&sfi,
sizeof (SHFILEINFOA),
SHGFI_PIDL | SHGFI_SMALLICON |
SHGFI_OPENICON | SHGFI_SYSICONINDEX |
SHGFI_DISPLAYNAME );
0,
&sfi,
sizeof (SHFILEINFOA),
SHGFI_PIDL | SHGFI_SMALLICON |
SHGFI_OPENICON | SHGFI_SYSICONINDEX |
SHGFI_DISPLAYNAME );
}
else
{
ilItemImage = (HIMAGELIST) SHGetFileInfoA ((LPCSTR) tmpFolder->pidlItem,
0,
&sfi,
0,
&sfi,
sizeof (SHFILEINFOA),
SHGFI_PIDL | SHGFI_SMALLICON |
SHGFI_SYSICONINDEX |
SHGFI_PIDL | SHGFI_SMALLICON |
SHGFI_SYSICONINDEX |
SHGFI_DISPLAYNAME);
}
@ -2063,10 +2063,10 @@ static LRESULT FILEDLG95_LOOKIN_DrawItem(LPDRAWITEMSTRUCT pDIStruct)
{
iIndentation = 0;
ilItemImage = (HIMAGELIST) SHGetFileInfoA ((LPCSTR) tmpFolder->pidlItem,
0,
&sfi,
sizeof (SHFILEINFOA),
SHGFI_PIDL | SHGFI_SMALLICON | SHGFI_OPENICON
0,
&sfi,
sizeof (SHFILEINFOA),
SHGFI_PIDL | SHGFI_SMALLICON | SHGFI_OPENICON
| SHGFI_SYSICONINDEX | SHGFI_DISPLAYNAME );
}
@ -2090,14 +2090,14 @@ static LRESULT FILEDLG95_LOOKIN_DrawItem(LPDRAWITEMSTRUCT pDIStruct)
rectText.right = pDIStruct->rcItem.right + XTEXTOFFSET;
rectText.bottom =
(pDIStruct->rcItem.top + pDIStruct->rcItem.bottom + tm.tmHeight) / 2;
/* Draw the icon from the image list */
ImageList_Draw(ilItemImage,
sfi.iIcon,
pDIStruct->hDC,
rectIcon.left,
rectIcon.top,
ILD_TRANSPARENT );
pDIStruct->hDC,
rectIcon.left,
rectIcon.top,
ILD_TRANSPARENT );
/* Draw the associated text */
if(sfi.szDisplayName)
@ -2124,7 +2124,7 @@ static BOOL FILEDLG95_LOOKIN_OnCommand(HWND hwnd, WORD wNotifyCode)
case CBN_SELENDOK:
{
LPSFOLDER tmpFolder;
int iItem;
int iItem;
iItem = CBGetCurSel(fodInfos->DlgInfos.hwndLookInCB);
@ -2141,7 +2141,7 @@ static BOOL FILEDLG95_LOOKIN_OnCommand(HWND hwnd, WORD wNotifyCode)
}
break;
}
}
return FALSE;
}
@ -2166,7 +2166,7 @@ static int FILEDLG95_LOOKIN_AddItem(HWND hwnd,LPITEMIDLIST pidl, int iInsertId)
if(!(liInfos = (LookInInfos *)GetPropA(hwnd,LookInInfosStr)))
return -1;
tmpFolder = MemAlloc(sizeof(SFOLDER));
tmpFolder->m_iIndent = 0;
@ -2181,13 +2181,13 @@ static int FILEDLG95_LOOKIN_AddItem(HWND hwnd,LPITEMIDLIST pidl, int iInsertId)
if(tmpFolder->m_iIndent > liInfos->iMaxIndentation)
liInfos->iMaxIndentation = tmpFolder->m_iIndent;
sfi.dwAttributes = SFGAO_FILESYSANCESTOR | SFGAO_FILESYSTEM;
SHGetFileInfoA((LPSTR)pidl,
0,
&sfi,
sizeof(sfi),
SHGFI_DISPLAYNAME | SHGFI_SYSICONINDEX
SHGFI_DISPLAYNAME | SHGFI_SYSICONINDEX
| SHGFI_PIDL | SHGFI_SMALLICON | SHGFI_ATTRIBUTES | SHGFI_ATTR_SPECIFIED);
TRACE("-- Add %s attr=%08lx\n", sfi.szDisplayName, sfi.dwAttributes);
@ -2195,7 +2195,7 @@ static int FILEDLG95_LOOKIN_AddItem(HWND hwnd,LPITEMIDLIST pidl, int iInsertId)
if((sfi.dwAttributes & SFGAO_FILESYSANCESTOR) || (sfi.dwAttributes & SFGAO_FILESYSTEM))
{
int iItemID;
TRACE("-- Add %s at %u\n", sfi.szDisplayName, tmpFolder->m_iIndent);
/* Add the item at the end of the list */
@ -2221,11 +2221,11 @@ static int FILEDLG95_LOOKIN_AddItem(HWND hwnd,LPITEMIDLIST pidl, int iInsertId)
/***********************************************************************
* FILEDLG95_LOOKIN_InsertItemAfterParent
*
* Insert an item below its parent
* Insert an item below its parent
*/
static int FILEDLG95_LOOKIN_InsertItemAfterParent(HWND hwnd,LPITEMIDLIST pidl)
{
LPITEMIDLIST pidlParent = GetParentPidl(pidl);
int iParentPos;
@ -2280,7 +2280,7 @@ int FILEDLG95_LOOKIN_SelectItem(HWND hwnd,LPITEMIDLIST pidl)
iItemPos--;
}
}
CBSetCurSel(hwnd,iItemPos);
liInfos->uSelectedItem = iItemPos;
@ -2402,7 +2402,7 @@ void FILEDLG95_FILENAME_FillFromSelection (HWND hwnd)
for ( nFileToOpen = 0; nFileToOpen < nFileSelected; nFileToOpen++ )
{
pidl = GetPidlFromDataObject( fodInfos->Shell.FOIDataObject, nFileToOpen+1 );
if (pidl)
{
/* get the total length of the selected file names*/
@ -2514,7 +2514,7 @@ int FILEDLG95_FILENAME_GetFileNames (HWND hwnd, LPSTR * lpstrFileList, UINT * si
GetDlgItemTextA(hwnd, IDC_FILENAME, lpstrEdit, nStrLen+1);
TRACE("nStrLen=%u str=%s\n", nStrLen, lpstrEdit);
/* we might get single filename without any '"',
* so we need nStrLen + terminating \0 + end-of-list \0 */
*lpstrFileList = MemAlloc(nStrLen+2);
@ -2535,7 +2535,7 @@ int FILEDLG95_FILENAME_GetFileNames (HWND hwnd, LPSTR * lpstrFileList, UINT * si
(*lpstrFileList)[nFileIndex++] = '\0';
(*sizeUsed)++;
nFileCount++;
}
}
nStrCharCount++;
}
@ -2596,13 +2596,13 @@ static void COMCTL32_ReleaseStgMedium (STGMEDIUM medium)
*/
LPITEMIDLIST GetPidlFromDataObject ( IDataObject *doSelected, UINT nPidlIndex)
{
STGMEDIUM medium;
FORMATETC formatetc;
LPITEMIDLIST pidl = NULL;
TRACE("sv=%p index=%u\n", doSelected, nPidlIndex);
/* Set the FORMATETC structure*/
SETDefFormatEtc(formatetc, RegisterClipboardFormatA(CFSTR_SHELLIDLIST), TYMED_HGLOBAL);
@ -2656,9 +2656,9 @@ UINT GetNumSelected( IDataObject *doSelected )
/***********************************************************************
* GetName
*
* Get the pidl's display name (relative to folder) and
* Get the pidl's display name (relative to folder) and
* put it in lpstrFileName.
*
*
* Return NOERROR on success,
* E_FAIL otherwise
*/
@ -2690,7 +2690,7 @@ HRESULT GetName(LPSHELLFOLDER lpsf, LPITEMIDLIST pidl,DWORD dwFlags,LPSTR lpstrF
/***********************************************************************
* GetShellFolderFromPidl
*
* pidlRel is the item pidl relative
* pidlRel is the item pidl relative
* Return the IShellFolder of the absolute pidl
*/
IShellFolder *GetShellFolderFromPidl(LPITEMIDLIST pidlAbs)
@ -2726,17 +2726,17 @@ LPITEMIDLIST GetParentPidl(LPITEMIDLIST pidl)
LPITEMIDLIST pidlParent;
TRACE("%p\n", pidl);
pidlParent = COMDLG32_PIDL_ILClone(pidl);
COMDLG32_PIDL_ILRemoveLastID(pidlParent);
return pidlParent;
}
/***********************************************************************
* GetPidlFromName
*
* returns the pidl of the file name relative to folder
* returns the pidl of the file name relative to folder
* NULL if an error occurred
*/
LPITEMIDLIST GetPidlFromName(IShellFolder *lpsf,LPCSTR lpcstrFileName)
@ -2750,7 +2750,7 @@ LPITEMIDLIST GetPidlFromName(IShellFolder *lpsf,LPCSTR lpcstrFileName)
if(!lpcstrFileName) return NULL;
if(!*lpcstrFileName) return NULL;
MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,lpcstrFileName,-1,(LPWSTR)lpwstrDirName,MAX_PATH);
MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,lpcstrFileName,-1,(LPWSTR)lpwstrDirName,MAX_PATH);
if(!lpsf)
{
@ -2760,7 +2760,7 @@ LPITEMIDLIST GetPidlFromName(IShellFolder *lpsf,LPCSTR lpcstrFileName)
}
else
{
IShellFolder_ParseDisplayName(lpsf, 0, NULL, (LPWSTR)lpwstrDirName, &ulEaten, &pidl, NULL);
IShellFolder_ParseDisplayName(lpsf, 0, NULL, (LPWSTR)lpwstrDirName, &ulEaten, &pidl, NULL);
}
return pidl;
}
@ -2771,11 +2771,11 @@ BOOL IsPidlFolder (LPSHELLFOLDER psf, LPITEMIDLIST pidl)
{
ULONG uAttr = SFGAO_FOLDER | SFGAO_HASSUBFOLDER;
HRESULT ret;
TRACE("%p, %p\n", psf, pidl);
ret = IShellFolder_GetAttributesOf( psf, 1, &pidl, &uAttr );
TRACE("-- 0x%08lx 0x%08lx\n", uAttr, ret);
/* see documentation shell 4.1*/
return uAttr & (SFGAO_FOLDER | SFGAO_HASSUBFOLDER);
@ -2812,7 +2812,7 @@ static BOOL BrowseSelectedFolder(HWND hwnd)
}
return bBrowseSelFolder;
}
}
/*
* Memory allocation methods */

View File

@ -1,6 +1,6 @@
/*
* Implementation of IShellBrowser for the File Open common dialog
*
*
* Copyright 1999 Francois Boisvert
* Copyright 1999, 2000 Juergen Schmied
*
@ -69,7 +69,7 @@ LPITEMIDLIST GetSelectedPidl(IShellView *ppshv);
/**************************************************************************
* External Prototypes
*/
extern const char *FileOpenDlgInfosStr;
extern const char *FileOpenDlgInfosStr;
extern HRESULT GetName(LPSHELLFOLDER lpsf, LPITEMIDLIST pidl,DWORD dwFlags,LPSTR lpstrFileName);
extern HRESULT GetFileName(HWND hwnd, LPITEMIDLIST pidl, LPSTR lpstrFileName);
@ -137,7 +137,7 @@ static HRESULT COMDLG32_StrRetToStrNW (LPVOID dest, DWORD len, LPSTRRET src, LPI
/*
* IShellBrowser
*/
/**************************************************************************
* IShellBrowserImpl_Construct
*/
@ -168,7 +168,7 @@ IShellBrowser * IShellBrowserImpl_Construct(HWND hwndOwner)
* IShellBrowserImpl_QueryInterface
*/
HRESULT WINAPI IShellBrowserImpl_QueryInterface(IShellBrowser *iface,
REFIID riid,
REFIID riid,
LPVOID *ppvObj)
{
ICOM_THIS(IShellBrowserImpl, iface);
@ -178,7 +178,7 @@ HRESULT WINAPI IShellBrowserImpl_QueryInterface(IShellBrowser *iface,
*ppvObj = NULL;
if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/
{ *ppvObj = This;
{ *ppvObj = This;
}
else if(IsEqualIID(riid, &IID_IOleWindow)) /*IOleWindow*/
{ *ppvObj = (IOleWindow*)This;
@ -225,8 +225,8 @@ ULONG WINAPI IShellBrowserImpl_Release(IShellBrowser * iface)
TRACE("(%p)\n", This);
if (!--(This->ref))
{
if (!--(This->ref))
{
HeapFree(GetProcessHeap(),0, This);
return 0;
}
@ -245,9 +245,9 @@ ULONG WINAPI IShellBrowserImpl_Release(IShellBrowser * iface)
* See Windows documentation for more details
*
* Note : We will never be window less in the File Open dialog
*
*
*/
HRESULT WINAPI IShellBrowserImpl_GetWindow(IShellBrowser * iface,
HRESULT WINAPI IShellBrowserImpl_GetWindow(IShellBrowser * iface,
HWND * phwnd)
{
ICOM_THIS(IShellBrowserImpl, iface);
@ -259,7 +259,7 @@ HRESULT WINAPI IShellBrowserImpl_GetWindow(IShellBrowser * iface,
*phwnd = This->hwndOwner;
return (*phwnd) ? S_OK : E_UNEXPECTED;
return (*phwnd) ? S_OK : E_UNEXPECTED;
}
@ -286,11 +286,11 @@ HRESULT WINAPI IShellBrowserImpl_ContextSensitiveHelp(IShellBrowser * iface,
*
* See Windows documentation on IShellBrowser::BrowseObject for more details
*
* This function will override user specified flags and will always
* use SBSP_DEFBROWSER and SBSP_DEFMODE.
* This function will override user specified flags and will always
* use SBSP_DEFBROWSER and SBSP_DEFMODE.
*/
HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface,
LPCITEMIDLIST pidl,
HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface,
LPCITEMIDLIST pidl,
UINT wFlags)
{
HRESULT hRes;
@ -311,7 +311,7 @@ HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface,
/* Format the pidl according to its parameter's category */
if(wFlags & SBSP_RELATIVE)
{
/* SBSP_RELATIVE A relative pidl (relative from the current folder) */
if(FAILED(hRes = IShellFolder_BindToObject(fodInfos->Shell.FOIShellFolder,
pidl, NULL, &IID_IShellFolder, (LPVOID *)&psfTmp)))
@ -336,14 +336,14 @@ HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface,
pidlTmp = COMDLG32_PIDL_ILClone((LPITEMIDLIST)pidl);
psfTmp = GetShellFolderFromPidl(pidlTmp);
}
if(!psfTmp)
{
ERR("could not browse to folder\n");
return E_FAIL;
}
/* If the pidl to browse to is equal to the actual pidl ...
/* If the pidl to browse to is equal to the actual pidl ...
do nothing and pretend you did it*/
if(COMDLG32_PIDL_ILIsEqual(pidlTmp,fodInfos->ShellInfos.pidlAbsCurrent))
{
@ -405,14 +405,14 @@ HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface,
FILEDLG95_LOOKIN_SelectItem(fodInfos->DlgInfos.hwndLookInCB,fodInfos->ShellInfos.pidlAbsCurrent);
/* changes the tab order of the ListView to reflect the window's File Dialog */
hDlgWnd = GetDlgItem(GetParent(hwndView), IDC_LOOKIN);
hDlgWnd = GetDlgItem(GetParent(hwndView), IDC_LOOKIN);
SetWindowPos(hwndView, hDlgWnd, 0,0,0,0, SWP_NOMOVE | SWP_NOSIZE);
/* Since we destroyed the old view if it had focus set focus to the newly created view */
if (bViewHasFocus)
SetFocus(fodInfos->ShellInfos.hwndView);
return hRes;
return hRes;
error:
ERR("Failed with error 0x%08lx\n", hRes);
return hRes;
@ -421,9 +421,9 @@ error:
/**************************************************************************
* IShellBrowserImpl_EnableModelessSB
*/
HRESULT WINAPI IShellBrowserImpl_EnableModelessSB(IShellBrowser *iface,
HRESULT WINAPI IShellBrowserImpl_EnableModelessSB(IShellBrowser *iface,
BOOL fEnable)
{
ICOM_THIS(IShellBrowserImpl, iface);
@ -436,10 +436,10 @@ HRESULT WINAPI IShellBrowserImpl_EnableModelessSB(IShellBrowser *iface,
/**************************************************************************
* IShellBrowserImpl_GetControlWindow
*/
HRESULT WINAPI IShellBrowserImpl_GetControlWindow(IShellBrowser *iface,
UINT id,
HRESULT WINAPI IShellBrowserImpl_GetControlWindow(IShellBrowser *iface,
UINT id,
HWND *lphwnd)
{
ICOM_THIS(IShellBrowserImpl, iface);
@ -452,9 +452,9 @@ HRESULT WINAPI IShellBrowserImpl_GetControlWindow(IShellBrowser *iface,
* IShellBrowserImpl_GetViewStateStream
*/
HRESULT WINAPI IShellBrowserImpl_GetViewStateStream(IShellBrowser *iface,
DWORD grfMode,
DWORD grfMode,
LPSTREAM *ppStrm)
{
ICOM_THIS(IShellBrowserImpl, iface);
@ -462,14 +462,14 @@ HRESULT WINAPI IShellBrowserImpl_GetViewStateStream(IShellBrowser *iface,
/* Feature not implemented */
return E_NOTIMPL;
}
}
/**************************************************************************
* IShellBrowserImpl_InsertMenusSB
*/
HRESULT WINAPI IShellBrowserImpl_InsertMenusSB(IShellBrowser *iface,
HMENU hmenuShared,
LPOLEMENUGROUPWIDTHS lpMenuWidths)
{
ICOM_THIS(IShellBrowserImpl, iface);
@ -483,7 +483,7 @@ HRESULT WINAPI IShellBrowserImpl_InsertMenusSB(IShellBrowser *iface,
*/
HRESULT WINAPI IShellBrowserImpl_OnViewWindowActive(IShellBrowser *iface,
IShellView *ppshv)
{
ICOM_THIS(IShellBrowserImpl, iface);
@ -491,13 +491,13 @@ HRESULT WINAPI IShellBrowserImpl_OnViewWindowActive(IShellBrowser *iface,
/* Feature not implemented */
return E_NOTIMPL;
}
}
/**************************************************************************
* IShellBrowserImpl_QueryActiveShellView
*/
HRESULT WINAPI IShellBrowserImpl_QueryActiveShellView(IShellBrowser *iface,
IShellView **ppshv)
{
ICOM_THIS(IShellBrowserImpl, iface);
@ -513,13 +513,13 @@ HRESULT WINAPI IShellBrowserImpl_QueryActiveShellView(IShellBrowser *iface,
}
IShellView_AddRef(fodInfos->Shell.FOIShellView);
return NOERROR;
}
}
/**************************************************************************
* IShellBrowserImpl_RemoveMenusSB
*/
HRESULT WINAPI IShellBrowserImpl_RemoveMenusSB(IShellBrowser *iface,
HMENU hmenuShared)
{
ICOM_THIS(IShellBrowserImpl, iface);
@ -527,21 +527,21 @@ HRESULT WINAPI IShellBrowserImpl_RemoveMenusSB(IShellBrowser *iface,
/* Feature not implemented */
return E_NOTIMPL;
}
}
/**************************************************************************
* IShellBrowserImpl_SendControlMsg
*/
HRESULT WINAPI IShellBrowserImpl_SendControlMsg(IShellBrowser *iface,
UINT id,
UINT uMsg,
WPARAM wParam,
HRESULT WINAPI IShellBrowserImpl_SendControlMsg(IShellBrowser *iface,
UINT id,
UINT uMsg,
WPARAM wParam,
LPARAM lParam,
LRESULT *pret)
{
ICOM_THIS(IShellBrowserImpl, iface);
LRESULT lres;
TRACE("(%p)->(0x%08x 0x%08x 0x%08x 0x%08lx %p)\n", This, id, uMsg, wParam, lParam, pret);
switch (id)
@ -560,10 +560,10 @@ HRESULT WINAPI IShellBrowserImpl_SendControlMsg(IShellBrowser *iface,
* IShellBrowserImpl_SetMenuSB
*/
HRESULT WINAPI IShellBrowserImpl_SetMenuSB(IShellBrowser *iface,
HMENU hmenuShared,
HMENU hmenuShared,
HOLEMENU holemenuReserved,
HWND hwndActiveObject)
{
ICOM_THIS(IShellBrowserImpl, iface);
@ -571,13 +571,13 @@ HRESULT WINAPI IShellBrowserImpl_SetMenuSB(IShellBrowser *iface,
/* Feature not implemented */
return E_NOTIMPL;
}
}
/**************************************************************************
* IShellBrowserImpl_SetStatusTextSB
*/
HRESULT WINAPI IShellBrowserImpl_SetStatusTextSB(IShellBrowser *iface,
LPCOLESTR lpszStatusText)
{
ICOM_THIS(IShellBrowserImpl, iface);
@ -585,15 +585,15 @@ HRESULT WINAPI IShellBrowserImpl_SetStatusTextSB(IShellBrowser *iface,
/* Feature not implemented */
return E_NOTIMPL;
}
}
/**************************************************************************
* IShellBrowserImpl_SetToolbarItems
*/
HRESULT WINAPI IShellBrowserImpl_SetToolbarItems(IShellBrowser *iface,
LPTBBUTTON lpButtons,
UINT nButtons,
LPTBBUTTON lpButtons,
UINT nButtons,
UINT uFlags)
{
ICOM_THIS(IShellBrowserImpl, iface);
@ -601,14 +601,14 @@ HRESULT WINAPI IShellBrowserImpl_SetToolbarItems(IShellBrowser *iface,
/* Feature not implemented */
return E_NOTIMPL;
}
}
/**************************************************************************
* IShellBrowserImpl_TranslateAcceleratorSB
*/
HRESULT WINAPI IShellBrowserImpl_TranslateAcceleratorSB(IShellBrowser *iface,
LPMSG lpmsg,
LPMSG lpmsg,
WORD wID)
{
ICOM_THIS(IShellBrowserImpl, iface);
@ -655,7 +655,7 @@ static ICOM_VTABLE(IShellBrowser) IShellBrowserImpl_Vtbl =
*/
HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_QueryInterface(
ICommDlgBrowser *iface,
REFIID riid,
REFIID riid,
LPVOID *ppvObj)
{
_ICOM_THIS_FromICommDlgBrowser(IShellBrowser,iface);
@ -703,8 +703,8 @@ HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand(ICommDlgBrowse
TRACE("(%p)\n", This);
fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
/* If the selected object is not a folder, send a IDOK command to parent window */
if((pidl = GetPidlFromDataObject(fodInfos->Shell.FOIDataObject, 1)))
{
@ -753,7 +753,7 @@ HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnStateChange(ICommDlgBrowser *
SendMessageA(This->hwndOwner, DM_SETDEFID, IDOK, 0);
break;
case CDBOSC_KILLFOCUS:
case CDBOSC_KILLFOCUS:
{
FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
if(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG)
@ -767,13 +767,13 @@ HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnStateChange(ICommDlgBrowser *
break;
}
return NOERROR;
return NOERROR;
}
/**************************************************************************
* IShellBrowserImpl_ICommDlgBrowser_IncludeObject
*/
HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser *iface,
HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser *iface,
IShellView * ppshv,
LPCITEMIDLIST pidl)
{
@ -790,13 +790,13 @@ HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser *
ulAttr = SFGAO_HIDDEN | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_FILESYSANCESTOR | SFGAO_LINK;
IShellFolder_GetAttributesOf(fodInfos->Shell.FOIShellFolder, 1, &pidl, &ulAttr);
if( (ulAttr & SFGAO_HIDDEN) /* hidden */
| !(ulAttr & (SFGAO_FILESYSTEM | SFGAO_FILESYSANCESTOR))) /* special folder */
return S_FALSE;
/* always include directories and links */
if(ulAttr & (SFGAO_FOLDER | SFGAO_LINK))
if(ulAttr & (SFGAO_FOLDER | SFGAO_LINK))
return S_OK;
/* Check if there is a mask to apply if not */
@ -817,7 +817,7 @@ HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser *
/**************************************************************************
* IShellBrowserImpl_ICommDlgBrowser_OnSelChange
*/
*/
HRESULT IShellBrowserImpl_ICommDlgBrowser_OnSelChange(ICommDlgBrowser *iface, IShellView *ppshv)
{
FileOpenDlgInfos *fodInfos;
@ -826,16 +826,16 @@ HRESULT IShellBrowserImpl_ICommDlgBrowser_OnSelChange(ICommDlgBrowser *iface, IS
fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
TRACE("(%p do=%p view=%p)\n", This, fodInfos->Shell.FOIDataObject, fodInfos->Shell.FOIShellView);
/* release old selections */
if (fodInfos->Shell.FOIDataObject)
IDataObject_Release(fodInfos->Shell.FOIDataObject);
/* get a new DataObject from the ShellView */
if(FAILED(IShellView_GetItemObject(fodInfos->Shell.FOIShellView, SVGIO_SELECTION,
&IID_IDataObject, (LPVOID*)&fodInfos->Shell.FOIDataObject)))
return E_FAIL;
FILEDLG95_FILENAME_FillFromSelection(This->hwndOwner);
SendCustomDlgNotificationMessage(This->hwndOwner, CDN_SELCHANGE);
@ -867,7 +867,7 @@ static ICOM_VTABLE(ICommDlgBrowser) IShellBrowserImpl_ICommDlgBrowser_Vtbl =
*/
HRESULT WINAPI IShellBrowserImpl_IServiceProvider_QueryInterface(
IServiceProvider *iface,
REFIID riid,
REFIID riid,
LPVOID *ppvObj)
{
_ICOM_THIS_FromIServiceProvider(IShellBrowser,iface);
@ -905,7 +905,7 @@ ULONG WINAPI IShellBrowserImpl_IServiceProvider_Release(IServiceProvider * iface
* IShellBrowserImpl_IServiceProvider_Release
*
* NOTES
* the w2k shellview asks for
* the w2k shellview asks for
* guidService = SID_STopLevelBrowser
* riid = IShellBrowser
*

View File

@ -1,6 +1,6 @@
/*
* Implementation of IShellBrowser for the File Open common dialog
*
*
* Copyright 1999 Francois Boisvert
* Copyright 1999, 2000 Juergen Schmied
*
@ -39,7 +39,7 @@
/* dialog internal property */
#define FODPROP_SAVEDLG 0x0001 /* File dialog is a Save file dialog */
#define FODPROP_USEVIEW 0x0002 /* Indicates the user selection must be taken
#define FODPROP_USEVIEW 0x0002 /* Indicates the user selection must be taken
from the IShellView */
/***********************************************************************
@ -49,10 +49,10 @@
typedef struct
{
LPOPENFILENAMEA ofnInfos;
struct {
IShellBrowser *FOIShellBrowser;
IShellBrowser *FOIShellBrowser;
IShellFolder *FOIShellFolder;
IShellView *FOIShellView;
IDataObject *FOIDataObject;

View File

@ -71,7 +71,7 @@ short WINAPI GetFileTitleA(LPCSTR lpFile, LPSTR lpTitle, UINT cbBuf)
i++;
TRACE("---> '%s' \n", &lpFile[i]);
len = strlen(lpFile+i)+1;
if(cbBuf < len)
return len;

View File

@ -33,7 +33,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
#include "cdlg.h"
struct FRPRIVATE
struct FRPRIVATE
{
HANDLE16 hDlgTmpl16; /* handle for resource 16 */
HANDLE16 hResource16; /* handle for allocated resource 16 */
@ -101,7 +101,7 @@ BOOL FINDDLG_Get16BitsTemplate(LFRPRIVATE lfr)
DWORD size;
HGLOBAL16 hGlobal16;
if (!(hResInfo = FindResourceA(COMMDLG_hInstance32,
if (!(hResInfo = FindResourceA(COMMDLG_hInstance32,
lfr->find ?
MAKEINTRESOURCEA(FINDDLGORD):MAKEINTRESOURCEA(REPLACEDLGORD),
RT_DIALOGA)))
@ -142,7 +142,7 @@ BOOL FINDDLG_Get16BitsTemplate(LFRPRIVATE lfr)
/***********************************************************************
* FINDDLG_FreeResources [internal]
*
* Free resources allocated
* Free resources allocated
*/
void FINDDLG_FreeResources(LFRPRIVATE lfr)
{
@ -259,15 +259,15 @@ static LRESULT FINDDLG_WMInitDialog(HWND hWnd, LPARAM lParam, LPDWORD lpFlags,
}
ShowWindow(hWnd, SW_SHOWNORMAL);
return TRUE;
}
}
/***********************************************************************
* FINDDLG_WMCommand [internal]
*/
static LRESULT FINDDLG_WMCommand(HWND hWnd, WPARAM wParam,
static LRESULT FINDDLG_WMCommand(HWND hWnd, WPARAM wParam,
HWND hwndOwner, LPDWORD lpFlags,
LPSTR lpstrFindWhat, WORD wFindWhatLen,
LPSTR lpstrFindWhat, WORD wFindWhatLen,
BOOL fUnicode)
{
int uFindReplaceMessage = RegisterWindowMessageA( FINDMSGSTRINGA );
@ -275,17 +275,17 @@ static LRESULT FINDDLG_WMCommand(HWND hWnd, WPARAM wParam,
switch (wParam) {
case IDOK:
if (fUnicode)
if (fUnicode)
GetDlgItemTextW(hWnd, edt1, (LPWSTR)lpstrFindWhat, wFindWhatLen/2);
else GetDlgItemTextA(hWnd, edt1, lpstrFindWhat, wFindWhatLen);
if (IsDlgButtonChecked(hWnd, rad2))
*lpFlags |= FR_DOWN;
else *lpFlags &= ~FR_DOWN;
if (IsDlgButtonChecked(hWnd, chx1))
*lpFlags |= FR_WHOLEWORD;
*lpFlags |= FR_WHOLEWORD;
else *lpFlags &= ~FR_WHOLEWORD;
if (IsDlgButtonChecked(hWnd, chx2))
*lpFlags |= FR_MATCHCASE;
*lpFlags |= FR_MATCHCASE;
else *lpFlags &= ~FR_MATCHCASE;
*lpFlags &= ~(FR_REPLACE | FR_REPLACEALL | FR_DIALOGTERM);
*lpFlags |= FR_FINDNEXT;
@ -305,7 +305,7 @@ static LRESULT FINDDLG_WMCommand(HWND hWnd, WPARAM wParam,
return TRUE;
}
return FALSE;
}
}
/***********************************************************************
@ -334,7 +334,7 @@ LRESULT WINAPI FindTextDlgProc16(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam,
* REPLACEDLG_WMInitDialog [internal]
*/
static LRESULT REPLACEDLG_WMInitDialog(HWND hWnd, LPARAM lParam,
LPDWORD lpFlags, LPSTR lpstrFindWhat,
LPDWORD lpFlags, LPSTR lpstrFindWhat,
LPSTR lpstrReplaceWith, BOOL fUnicode)
{
SetWindowLongA(hWnd, DWL_USER, lParam);
@ -344,7 +344,7 @@ static LRESULT REPLACEDLG_WMInitDialog(HWND hWnd, LPARAM lParam,
* Replace / ReplaceAll buttons. Only after typing some text, the buttons should be
* enabled.
*/
if (fUnicode)
if (fUnicode)
{
SetDlgItemTextW(hWnd, edt1, (LPWSTR)lpstrFindWhat);
SetDlgItemTextW(hWnd, edt2, (LPWSTR)lpstrReplaceWith);
@ -369,7 +369,7 @@ static LRESULT REPLACEDLG_WMInitDialog(HWND hWnd, LPARAM lParam,
}
ShowWindow(hWnd, SW_SHOWNORMAL);
return TRUE;
}
}
/***********************************************************************
@ -396,10 +396,10 @@ static LRESULT REPLACEDLG_WMCommand(HWND hWnd, WPARAM16 wParam,
GetDlgItemTextA(hWnd, edt2, lpstrReplaceWith, wReplaceWithLen);
}
if (IsDlgButtonChecked(hWnd, chx1))
*lpFlags |= FR_WHOLEWORD;
*lpFlags |= FR_WHOLEWORD;
else *lpFlags &= ~FR_WHOLEWORD;
if (IsDlgButtonChecked(hWnd, chx2))
*lpFlags |= FR_MATCHCASE;
*lpFlags |= FR_MATCHCASE;
else *lpFlags &= ~FR_MATCHCASE;
*lpFlags &= ~(FR_REPLACE | FR_REPLACEALL | FR_DIALOGTERM);
*lpFlags |= FR_FINDNEXT;
@ -419,15 +419,15 @@ static LRESULT REPLACEDLG_WMCommand(HWND hWnd, WPARAM16 wParam,
GetDlgItemTextW(hWnd, edt1, (LPWSTR)lpstrFindWhat, wFindWhatLen/2);
GetDlgItemTextW(hWnd, edt2, (LPWSTR)lpstrReplaceWith, wReplaceWithLen/2);
} else
{
{
GetDlgItemTextA(hWnd, edt1, lpstrFindWhat, wFindWhatLen);
GetDlgItemTextA(hWnd, edt2, lpstrReplaceWith, wReplaceWithLen);
}
if (IsDlgButtonChecked(hWnd, chx1))
*lpFlags |= FR_WHOLEWORD;
*lpFlags |= FR_WHOLEWORD;
else *lpFlags &= ~FR_WHOLEWORD;
if (IsDlgButtonChecked(hWnd, chx2))
*lpFlags |= FR_MATCHCASE;
*lpFlags |= FR_MATCHCASE;
else *lpFlags &= ~FR_MATCHCASE;
*lpFlags &= ~(FR_FINDNEXT | FR_REPLACEALL | FR_DIALOGTERM);
*lpFlags |= FR_REPLACE;
@ -445,10 +445,10 @@ static LRESULT REPLACEDLG_WMCommand(HWND hWnd, WPARAM16 wParam,
GetDlgItemTextA(hWnd, edt2, lpstrReplaceWith, wReplaceWithLen);
}
if (IsDlgButtonChecked(hWnd, chx1))
*lpFlags |= FR_WHOLEWORD;
*lpFlags |= FR_WHOLEWORD;
else *lpFlags &= ~FR_WHOLEWORD;
if (IsDlgButtonChecked(hWnd, chx2))
*lpFlags |= FR_MATCHCASE;
*lpFlags |= FR_MATCHCASE;
else *lpFlags &= ~FR_MATCHCASE;
*lpFlags &= ~(FR_FINDNEXT | FR_REPLACE | FR_DIALOGTERM);
*lpFlags |= FR_REPLACEALL;
@ -461,7 +461,7 @@ static LRESULT REPLACEDLG_WMCommand(HWND hWnd, WPARAM16 wParam,
return TRUE;
}
return FALSE;
}
}
/***********************************************************************
@ -479,7 +479,7 @@ LRESULT WINAPI ReplaceTextDlgProc16(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam,
MapSL(lpfr->lpstrReplaceWith), FALSE);
case WM_COMMAND:
lpfr=MapSL(GetWindowLongA(hWnd, DWL_USER));
return REPLACEDLG_WMCommand(hWnd, wParam, lpfr->hwndOwner,
return REPLACEDLG_WMCommand(hWnd, wParam, lpfr->hwndOwner,
&lpfr->Flags, MapSL(lpfr->lpstrFindWhat),
lpfr->wFindWhatLen, MapSL(lpfr->lpstrReplaceWith),
lpfr->wReplaceWithLen, FALSE);

View File

@ -175,7 +175,7 @@ Replace:
static BOOL CALLBACK COMDLG32_FindReplaceDlgProc(HWND hDlgWnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
{
COMDLG32_FR_Data *pdata = (COMDLG32_FR_Data *)GetPropA(hDlgWnd, (LPSTR)COMDLG32_Atom);
BOOL retval = TRUE;;
BOOL retval = TRUE;
if(iMsg == WM_INITDIALOG)
{

View File

@ -39,7 +39,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
#include "cdlg.h"
static HBITMAP16 hBitmapTT = 0;
static HBITMAP16 hBitmapTT = 0;
LRESULT WINAPI FormatCharDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam,
@ -132,7 +132,7 @@ _dump_cf_flags(DWORD cflags) {
/***********************************************************************
* ChooseFont (COMMDLG.15)
* ChooseFont (COMMDLG.15)
*/
BOOL16 WINAPI ChooseFont16(LPCHOOSEFONT16 lpChFont)
{
@ -146,12 +146,12 @@ BOOL16 WINAPI ChooseFont16(LPCHOOSEFONT16 lpChFont)
LOGFONTA lf32a;
LOGFONT16 *font16;
SEGPTR lpTemplateName;
cf32a.lpLogFont=&lf32a;
CFn_CHOOSEFONT16to32A(lpChFont, &cf32a);
TRACE("ChooseFont\n");
if (!lpChFont) return FALSE;
if (!lpChFont) return FALSE;
if (TRACE_ON(commdlg))
_dump_cf_flags(lpChFont->Flags);
@ -214,7 +214,7 @@ BOOL16 WINAPI ChooseFont16(LPCHOOSEFONT16 lpChFont)
return FALSE;
}
ConvertDialog32To16((LPVOID)template32, size, (LPVOID)template);
hDlgTmpl16 = hGlobal16;
hDlgTmpl16 = hGlobal16;
}
@ -278,7 +278,7 @@ BOOL WINAPI ChooseFontA(LPCHOOSEFONTA lpChFont)
if (lpChFont->Flags & (CF_SELECTSCRIPT | CF_NOVERTFONTS | CF_ENABLETEMPLATE |
CF_ENABLETEMPLATEHANDLE)) FIXME(": unimplemented flag (ignored)\n");
return DialogBoxIndirectParamA(COMMDLG_hInstance32, template,
return DialogBoxIndirectParamA(COMMDLG_hInstance32, template,
lpChFont->hwndOwner, (DLGPROC)FormatCharDlgProcA, (LPARAM)lpChFont );
}
@ -320,9 +320,9 @@ static BOOL ChooseFontWtoA(const CHOOSEFONTW *cfw, CHOOSEFONTA *cfa)
memcpy(cfa, cfw, sizeof(CHOOSEFONTA));
cfa->lpLogFont = lpLogFont;
cfa->lpszStyle = lpszStyle;
LogFontWtoA(cfw->lpLogFont, lpLogFont);
if (cfw->lpTemplateName != NULL)
{
cfa->lpTemplateName = HEAP_strdupWtoA(GetProcessHeap(), 0,
@ -330,14 +330,14 @@ static BOOL ChooseFontWtoA(const CHOOSEFONTW *cfw, CHOOSEFONTA *cfa)
if (cfa->lpTemplateName == NULL)
return FALSE;
}
if ((cfw->Flags & CF_USESTYLE) != 0 && cfw->lpszStyle != NULL)
{
WideCharToMultiByte(CP_ACP, 0, cfw->lpszStyle, -1, cfa->lpszStyle,
LF_FACESIZE, NULL, NULL);
cfa->lpszStyle[LF_FACESIZE - 1] = '\0';
}
return TRUE;
}
@ -351,12 +351,12 @@ static VOID ChooseFontAtoW(const CHOOSEFONTA *cfa, CHOOSEFONTW *cfw)
cfw->lpLogFont = lpLogFont;
cfw->lpszStyle = lpszStyle;
cfw->lpTemplateName = lpTemplateName;
LogFontAtoW(cfa->lpLogFont, lpLogFont);
if (cfa->lpTemplateName != NULL)
HeapFree(GetProcessHeap(), 0, (LPSTR)(cfa->lpTemplateName));
if ((cfa->Flags & CF_USESTYLE) != 0 && cfa->lpszStyle != NULL)
{
MultiByteToWideChar(CP_ACP, 0, cfa->lpszStyle, -1, cfw->lpszStyle,
@ -370,25 +370,25 @@ BOOL WINAPI ChooseFontW(LPCHOOSEFONTW lpChFont)
CHOOSEFONTA cf_a;
LOGFONTA lf_a;
CHAR style_a[LF_FACESIZE];
cf_a.lpLogFont = &lf_a;
cf_a.lpszStyle = style_a;
if (ChooseFontWtoA(lpChFont, &cf_a) == FALSE)
{
COMDLG32_SetCommDlgExtendedError(CDERR_MEMALLOCFAILURE);
return FALSE;
}
if (ChooseFontA(&cf_a) == FALSE)
{
if (cf_a.lpTemplateName != NULL)
HeapFree(GetProcessHeap(), 0, (LPSTR)(cf_a.lpTemplateName));
return FALSE;
}
ChooseFontAtoW(&cf_a, lpChFont);
return TRUE;
}
@ -430,7 +430,7 @@ BOOL WINAPI ChooseFontW(LPCHOOSEFONTW lpChFont)
cf32a.lpLogFont=&lf32a;
cf32a.lpszStyle=HEAP_strdupWtoA(GetProcessHeap(), 0, lpChFont->lpszStyle);
lpChFont->lpTemplateName=(LPWSTR)&cf32a;
bRet = DialogBoxIndirectParamW(COMMDLG_hInstance32, template,
bRet = DialogBoxIndirectParamW(COMMDLG_hInstance32, template,
lpChFont->hwndOwner, (DLGPROC)FormatCharDlgProcW, (LPARAM)lpChFont );
HeapFree(GetProcessHeap(), 0, cf32a.lpszStyle);
lpChFont->lpTemplateName=(LPWSTR)cf32a.lpTemplateName;
@ -488,7 +488,7 @@ typedef struct
/*************************************************************************
* AddFontFamily [internal]
*/
static INT AddFontFamily(const LOGFONTA *lplf, UINT nFontType,
static INT AddFontFamily(const LOGFONTA *lplf, UINT nFontType,
LPCHOOSEFONTA lpcf, HWND hwnd, LPCFn_ENUMSTRUCT e)
{
int i;
@ -504,7 +504,7 @@ static INT AddFontFamily(const LOGFONTA *lplf, UINT nFontType,
return 1;
if (lpcf->Flags & CF_TTONLY)
if (!(nFontType & TRUETYPE_FONTTYPE))
return 1;
return 1;
if (e) e->added++;
@ -522,7 +522,7 @@ static INT AddFontFamily(const LOGFONTA *lplf, UINT nFontType,
/*************************************************************************
* FontFamilyEnumProc32 [internal]
*/
static INT WINAPI FontFamilyEnumProc(const LOGFONTA *lpLogFont,
static INT WINAPI FontFamilyEnumProc(const LOGFONTA *lpLogFont,
const TEXTMETRICA *metrics, DWORD dwFontType, LPARAM lParam)
{
LPCFn_ENUMSTRUCT e;
@ -538,7 +538,7 @@ INT16 WINAPI FontFamilyEnumProc16( SEGPTR logfont, SEGPTR metrics,
{
HWND16 hwnd=LOWORD(lParam);
HWND hDlg=GetParent(hwnd);
LPCHOOSEFONT16 lpcf=(LPCHOOSEFONT16)GetWindowLongA(hDlg, DWL_USER);
LPCHOOSEFONT16 lpcf=(LPCHOOSEFONT16)GetWindowLongA(hDlg, DWL_USER);
LOGFONT16 *lplf = MapSL( logfont );
LOGFONTA lf32a;
FONT_LogFont16To32A(lplf, &lf32a);
@ -555,10 +555,10 @@ static int SetFontStylesToCombo2(HWND hwnd, HDC hdc, const LOGFONTA *lplf)
{
#define FSTYLES 4
struct FONTSTYLE
{ int italic;
{ int italic;
int weight;
char stname[20]; };
static struct FONTSTYLE fontstyles[FSTYLES]={
static struct FONTSTYLE fontstyles[FSTYLES]={
{ 0,FW_NORMAL,"Regular"},{0,FW_BOLD,"Bold"},
{ 1,FW_NORMAL,"Italic"}, {1,FW_BOLD,"Bold Italic"}};
HFONT hf;
@ -585,9 +585,9 @@ static int SetFontStylesToCombo2(HWND hwnd, HDC hdc, const LOGFONTA *lplf)
if (j==CB_ERR) return 1;
j=SendMessageA(hwnd, CB_SETITEMDATA, j,
MAKELONG(fontstyles[i].weight,fontstyles[i].italic));
if (j==CB_ERR) return 1;
if (j==CB_ERR) return 1;
}
}
}
return 0;
}
@ -606,14 +606,14 @@ static int AddFontSizeToCombo3(HWND hwnd, UINT h, LPCHOOSEFONTA lpcf)
j=SendMessageA(hwnd, CB_FINDSTRINGEXACT, -1, (LPARAM)buffer);
if (j==CB_ERR)
{
j=SendMessageA(hwnd, CB_ADDSTRING, 0, (LPARAM)buffer);
if (j!=CB_ERR) j = SendMessageA(hwnd, CB_SETITEMDATA, j, h);
j=SendMessageA(hwnd, CB_ADDSTRING, 0, (LPARAM)buffer);
if (j!=CB_ERR) j = SendMessageA(hwnd, CB_SETITEMDATA, j, h);
if (j==CB_ERR) return 1;
}
}
return 0;
}
}
/*************************************************************************
* SetFontSizesToCombo3 [internal]
*/
@ -630,11 +630,11 @@ static int SetFontSizesToCombo3(HWND hwnd, LPCHOOSEFONTA lpcf)
/***********************************************************************
* AddFontStyle [internal]
*/
static INT AddFontStyle(const LOGFONTA *lplf, UINT nFontType,
static INT AddFontStyle(const LOGFONTA *lplf, UINT nFontType,
LPCHOOSEFONTA lpcf, HWND hcmb2, HWND hcmb3, HWND hDlg)
{
int i;
TRACE("(nFontType=%d)\n",nFontType);
TRACE(" %s h=%ld w=%ld e=%ld o=%ld wg=%ld i=%d u=%d s=%d"
" ch=%d op=%d cp=%d q=%d pf=%xh\n",
@ -659,7 +659,7 @@ static INT AddFontStyle(const LOGFONTA *lplf, UINT nFontType,
}
return 1 ;
}
}
/***********************************************************************
* FontStyleEnumProc (COMMDLG.18)
@ -670,7 +670,7 @@ INT16 WINAPI FontStyleEnumProc16( SEGPTR logfont, SEGPTR metrics,
HWND16 hcmb2=LOWORD(lParam);
HWND16 hcmb3=HIWORD(lParam);
HWND hDlg=GetParent(hcmb3);
LPCHOOSEFONT16 lpcf=(LPCHOOSEFONT16)GetWindowLongA(hDlg, DWL_USER);
LPCHOOSEFONT16 lpcf=(LPCHOOSEFONT16)GetWindowLongA(hDlg, DWL_USER);
LOGFONT16 *lplf = MapSL(logfont);
LOGFONTA lf32a;
FONT_LogFont16To32A(lplf, &lf32a);
@ -681,7 +681,7 @@ INT16 WINAPI FontStyleEnumProc16( SEGPTR logfont, SEGPTR metrics,
/***********************************************************************
* FontStyleEnumProc32 [internal]
*/
static INT WINAPI FontStyleEnumProc( const LOGFONTA *lpFont,
static INT WINAPI FontStyleEnumProc( const LOGFONTA *lpFont,
const TEXTMETRICA *metrics, DWORD dwFontType, LPARAM lParam )
{
LPCFn_ENUMSTRUCT s=(LPCFn_ENUMSTRUCT)lParam;
@ -704,14 +704,14 @@ static LRESULT CFn_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam,
LPLOGFONTA lpxx;
HCURSOR hcursor=SetCursor(LoadCursorA(0,IDC_WAITA));
SetWindowLongA(hDlg, DWL_USER, lParam);
SetWindowLongA(hDlg, DWL_USER, lParam);
lpxx=lpcf->lpLogFont;
TRACE("WM_INITDIALOG lParam=%08lX\n", lParam);
if (lpcf->lStructSize != sizeof(CHOOSEFONTA))
{
ERR("structure size failure !!!\n");
EndDialog (hDlg, 0);
EndDialog (hDlg, 0);
return FALSE;
}
if (!hBitmapTT)
@ -720,7 +720,7 @@ static LRESULT CFn_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam,
/* This font will be deleted by WM_COMMAND */
SendDlgItemMessageA(hDlg,stc6,WM_SETFONT,
CreateFontA(0, 0, 1, 1, 400, 0, 0, 0, 0, 0, 0, 0, 0, NULL),FALSE);
if (!(lpcf->Flags & CF_SHOWHELP) || !IsWindow(lpcf->hwndOwner))
ShowWindow(GetDlgItem(hDlg,pshHelp),SW_HIDE);
if (!(lpcf->Flags & CF_APPLY))
@ -791,7 +791,7 @@ static LRESULT CFn_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam,
if (l==SendDlgItemMessageA(hDlg, cmb2, CB_GETITEMDATA, i, 0))
SendDlgItemMessageA(hDlg, cmb2, CB_SETCURSEL, i, 0);
}
/* look for fitting font size in combobox3 */
j=SendDlgItemMessageA(hDlg, cmb3, CB_GETCOUNT, 0, 0);
for (i=0;i<j;i++)
@ -806,7 +806,7 @@ static LRESULT CFn_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam,
SendDlgItemMessageA(hDlg,cmb1,CB_SETCURSEL,0,0);
SendMessageA(hDlg, WM_COMMAND, MAKEWPARAM(cmb1, CBN_SELCHANGE),
GetDlgItem(hDlg,cmb1));
}
}
if (lpcf->Flags & CF_USESTYLE && lpcf->lpszStyle)
{
j=SendDlgItemMessageA(hDlg,cmb2,CB_FINDSTRING,-1,(LONG)lpcf->lpszStyle);
@ -821,13 +821,13 @@ static LRESULT CFn_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam,
else
{
WARN("HDC failure !!!\n");
EndDialog (hDlg, 0);
EndDialog (hDlg, 0);
return FALSE;
}
if (!((lpcf->Flags & CF_PRINTERFONTS) && lpcf->hDC))
ReleaseDC(hDlg,hdc);
SetCursor(hcursor);
SetCursor(hcursor);
return TRUE;
}
@ -858,11 +858,11 @@ static LRESULT CFn_WMDrawItem(HWND hDlg, WPARAM wParam, LPARAM lParam)
BITMAP bm;
COLORREF cr, oldText=0, oldBk=0;
RECT rect;
#if 0
#if 0
HDC hMemDC;
int nFontType;
HBITMAP hBitmap; /* for later TT usage */
#endif
#endif
LPDRAWITEMSTRUCT lpdi = (LPDRAWITEMSTRUCT)lParam;
if (lpdi->itemID == (UINT)-1) /* got no items */
@ -891,7 +891,7 @@ static LRESULT CFn_WMDrawItem(HWND hDlg, WPARAM wParam, LPARAM lParam)
{
case cmb1: /* TRACE(commdlg,"WM_Drawitem cmb1\n"); */
SendMessageA(lpdi->hwndItem, CB_GETLBTEXT, lpdi->itemID,
(LPARAM)buffer);
(LPARAM)buffer);
GetObjectA( hBitmapTT, sizeof(bm), &bm );
TextOutA(lpdi->hDC, lpdi->rcItem.left + bm.bmWidth + 10,
lpdi->rcItem.top, buffer, strlen(buffer));
@ -976,7 +976,7 @@ static LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam,
long l;
HDC hdc;
LPLOGFONTA lpxx=lpcf->lpLogFont;
TRACE("WM_COMMAND wParam=%08lX lParam=%08lX\n", (LONG)wParam, lParam);
switch (LOWORD(wParam))
{
@ -985,7 +985,7 @@ static LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam,
hdc=((lpcf->Flags & CF_PRINTERFONTS) && lpcf->hDC) ? lpcf->hDC : GetDC(hDlg);
if (hdc)
{
SendDlgItemMessageA(hDlg, cmb2, CB_RESETCONTENT16, 0, 0);
SendDlgItemMessageA(hDlg, cmb2, CB_RESETCONTENT16, 0, 0);
SendDlgItemMessageA(hDlg, cmb3, CB_RESETCONTENT16, 0, 0);
i=SendDlgItemMessageA(hDlg, cmb1, CB_GETCURSEL16, 0, 0);
if (i!=CB_ERR)
@ -1010,7 +1010,7 @@ static LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam,
else
{
WARN("HDC failure !!!\n");
EndDialog (hDlg, 0);
EndDialog (hDlg, 0);
return TRUE;
}
}
@ -1063,7 +1063,7 @@ static LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam,
hFont=CreateFontIndirectA(lpxx);
if (hFont)
{
HFONT oldFont=SendDlgItemMessageA(hDlg, stc6,
HFONT oldFont=SendDlgItemMessageA(hDlg, stc6,
WM_GETFONT, 0, 0);
SendDlgItemMessageA(hDlg,stc6,WM_SETFONT,hFont,TRUE);
DeleteObject(oldFont);
@ -1078,7 +1078,7 @@ static LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam,
InvalidateRect( GetDlgItem(hDlg,stc6), NULL, 0 );
}
break;
case psh15:i=RegisterWindowMessageA( HELPMSGSTRINGA );
if (lpcf->hwndOwner)
SendMessageA(lpcf->hwndOwner, i, 0, (LPARAM)GetWindowLongA(hDlg, DWL_USER));
@ -1087,8 +1087,8 @@ static LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam,
break;
case IDOK:if ( (!(lpcf->Flags & CF_LIMITSIZE)) ||
( (lpcf->Flags & CF_LIMITSIZE) &&
(-lpxx->lfHeight >= lpcf->nSizeMin) &&
( (lpcf->Flags & CF_LIMITSIZE) &&
(-lpxx->lfHeight >= lpcf->nSizeMin) &&
(-lpxx->lfHeight <= lpcf->nSizeMax)))
EndDialog(hDlg, TRUE);
else
@ -1097,7 +1097,7 @@ static LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam,
sprintf(buffer,"Select a font size between %d and %d points.",
lpcf->nSizeMin,lpcf->nSizeMax);
MessageBoxA(hDlg, buffer, NULL, MB_OK);
}
}
return(TRUE);
case IDCANCEL:EndDialog(hDlg, FALSE);
return(TRUE);
@ -1123,10 +1123,10 @@ LRESULT WINAPI FormatCharDlgProc16(HWND16 hDlg, UINT16 message, WPARAM16 wParam,
{
LPCHOOSEFONT16 lpcf;
LPCHOOSEFONTA lpcf32a;
LRESULT res=0;
LRESULT res=0;
if (message!=WM_INITDIALOG)
{
lpcf=(LPCHOOSEFONT16)GetWindowLongA(hDlg, DWL_USER);
lpcf=(LPCHOOSEFONT16)GetWindowLongA(hDlg, DWL_USER);
if (!lpcf)
return FALSE;
if (CFn_HookCallChk(lpcf))
@ -1138,11 +1138,11 @@ LRESULT WINAPI FormatCharDlgProc16(HWND16 hDlg, UINT16 message, WPARAM16 wParam,
{
lpcf=(LPCHOOSEFONT16)lParam;
lpcf32a=(LPCHOOSEFONTA)lpcf->lpTemplateName;
if (!CFn_WMInitDialog(hDlg, wParam, lParam, lpcf32a))
if (!CFn_WMInitDialog(hDlg, wParam, lParam, lpcf32a))
{
TRACE("CFn_WMInitDialog returned FALSE\n");
return FALSE;
}
}
if (CFn_HookCallChk(lpcf))
return CallWindowProc16((WNDPROC16)lpcf->lpfnHook,hDlg,WM_INITDIALOG,wParam,lParam);
}
@ -1208,7 +1208,7 @@ LRESULT WINAPI FormatCharDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam,
LRESULT res=FALSE;
if (uMsg!=WM_INITDIALOG)
{
lpcf=(LPCHOOSEFONTA)GetWindowLongA(hDlg, DWL_USER);
lpcf=(LPCHOOSEFONTA)GetWindowLongA(hDlg, DWL_USER);
if (!lpcf)
return FALSE;
if (CFn_HookCallChk32(lpcf))
@ -1219,11 +1219,11 @@ LRESULT WINAPI FormatCharDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam,
else
{
lpcf=(LPCHOOSEFONTA)lParam;
if (!CFn_WMInitDialog(hDlg, wParam, lParam, lpcf))
if (!CFn_WMInitDialog(hDlg, wParam, lParam, lpcf))
{
TRACE("CFn_WMInitDialog returned FALSE\n");
return FALSE;
}
}
if (CFn_HookCallChk32(lpcf))
return CallWindowProcA((WNDPROC)lpcf->lpfnHook,hDlg,WM_INITDIALOG,wParam,lParam);
}
@ -1259,7 +1259,7 @@ LRESULT WINAPI FormatCharDlgProcW(HWND hDlg, UINT uMsg, WPARAM wParam,
LRESULT res=FALSE;
if (uMsg!=WM_INITDIALOG)
{
lpcf32w=(LPCHOOSEFONTW)GetWindowLongA(hDlg, DWL_USER);
lpcf32w=(LPCHOOSEFONTW)GetWindowLongA(hDlg, DWL_USER);
if (!lpcf32w)
return FALSE;
if (CFn_HookCallChk32((LPCHOOSEFONTA)lpcf32w))
@ -1271,11 +1271,11 @@ LRESULT WINAPI FormatCharDlgProcW(HWND hDlg, UINT uMsg, WPARAM wParam,
{
lpcf32w=(LPCHOOSEFONTW)lParam;
lpcf32a=(LPCHOOSEFONTA)lpcf32w->lpTemplateName;
if (!CFn_WMInitDialog(hDlg, wParam, lParam, lpcf32a))
if (!CFn_WMInitDialog(hDlg, wParam, lParam, lpcf32a))
{
TRACE("CFn_WMInitDialog returned FALSE\n");
return FALSE;
}
}
if (CFn_HookCallChk32((LPCHOOSEFONTA)lpcf32w))
return CallWindowProcW((WNDPROC)lpcf32w->lpfnHook,hDlg,WM_INITDIALOG,wParam,lParam);
}
@ -1292,7 +1292,7 @@ LRESULT WINAPI FormatCharDlgProcW(HWND hDlg, UINT uMsg, WPARAM wParam,
return CFn_WMCommand(hDlg, wParam, lParam, lpcf32a);
case WM_DESTROY:
return CFn_WMDestroy(hDlg, wParam, lParam);
case WM_CHOOSEFONT_GETLOGFONT:
case WM_CHOOSEFONT_GETLOGFONT:
TRACE("WM_CHOOSEFONT_GETLOGFONT lParam=%08lX\n",
lParam);
FIXME("current logfont back to caller\n");

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
/*
/*
* Implementation of DCIMAN32 - DCI Manager
* "Device Context Interface" ?
*
*
* Copyright 2000 Marcus Meissner
*
* This library is free software; you can redistribute it and/or

View File

@ -38,7 +38,7 @@ static void pixel_convert_16_to_8(void *src, void *dst, DWORD width, DWORD heigh
/* gcc generates slightly inefficient code for the the copy/lookup,
* it generates one excess memory access (to pal) per pixel. Since
* we know that pal is not modified by the memory write we can
* put it into a register and reduce the number of memory accesses
* put it into a register and reduce the number of memory accesses
* from 4 to 3 pp. There are two xor eax,eax to avoid pipeline
* stalls. (This is not guaranteed to be the fastest method.)
*/

View File

@ -108,7 +108,7 @@ extern HRESULT WINAPI IDirect3DImpl_FindDevice(
LPDIRECT3D iface, LPD3DFINDDEVICESEARCH lpfinddevsrc,
LPD3DFINDDEVICERESULT lpfinddevrst)
;
extern HRESULT WINAPI IDirect3D2Impl_QueryInterface(LPDIRECT3D2 iface,REFIID refiid,LPVOID *obj);
extern HRESULT WINAPI IDirect3D2Impl_QueryInterface(LPDIRECT3D2 iface,REFIID refiid,LPVOID *obj);
extern ULONG WINAPI IDirect3D2Impl_AddRef(LPDIRECT3D2 iface);
extern ULONG WINAPI IDirect3D2Impl_Release(LPDIRECT3D2 iface);
extern HRESULT WINAPI IDirect3D2Impl_EnumDevices(
@ -144,7 +144,7 @@ struct IDirect3DLightImpl
IDirect3D2Impl* d3d2;
} d3d;
int type;
D3DLIGHT2 light;
/* Chained list used for adding / removing from viewports */
@ -153,7 +153,7 @@ struct IDirect3DLightImpl
/* Activation function */
void (*activate)(IDirect3DLightImpl*);
int is_active;
LPVOID private;
};
@ -250,13 +250,13 @@ struct IDirect3DViewport2Impl
/* Activation function */
void (*activate)(IDirect3DViewport2Impl*);
/* Field used to chain viewports together */
IDirect3DViewport2Impl* next;
/* Lights list */
IDirect3DLightImpl* lights;
LPVOID private;
};

View File

@ -1,6 +1,6 @@
/* Direct3D Device
* Copyright (c) 1998 Lionel ULMER
*
*
* This file contains all the common stuff for D3D devices.
*
* This library is free software; you can redistribute it and/or
@ -379,12 +379,12 @@ HRESULT WINAPI IDirect3DDevice2Impl_DrawPrimitive(
LPVOID lpvertex, DWORD vertcount, DWORD dwFlags
) {
ICOM_THIS(IDirect3DDevice2Impl,iface);
TRACE("(%p)->(%d,%d,%p,%ld,%08lx): stub\n", This, d3dp, d3dv, lpvertex, vertcount, dwFlags);
return D3D_OK;
}
HRESULT WINAPI IDirect3DDevice2Impl_DrawIndexedPrimitive(
LPDIRECT3DDEVICE2 iface, D3DPRIMITIVETYPE d3dp, D3DVERTEXTYPE d3dv,
LPVOID lpvertex, DWORD vertcount, LPWORD lpindexes, DWORD indexcount,
@ -670,7 +670,7 @@ HRESULT WINAPI IDirect3DDeviceImpl_EndScene(LPDIRECT3DDEVICE iface)
{
ICOM_THIS(IDirect3DDeviceImpl,iface);
FIXME("(%p)->(): stub\n", This);
return DD_OK;
return DD_OK;
}
HRESULT WINAPI IDirect3DDeviceImpl_GetDirect3D(
@ -685,7 +685,7 @@ HRESULT WINAPI IDirect3DDeviceImpl_GetDirect3D(
/*******************************************************************************
* Direct3DDevice VTable
*/
static ICOM_VTABLE(IDirect3DDevice) WINE_UNUSED d3d_d3ddevice_vtbl =
static ICOM_VTABLE(IDirect3DDevice) WINE_UNUSED d3d_d3ddevice_vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirect3DDeviceImpl_QueryInterface,

View File

@ -1,6 +1,6 @@
/* Direct3D Device
* Copyright (c) 1998 Lionel ULMER
*
*
* This file contains the MESA implementation of all the D3D devices that
* Wine supports.
*
@ -98,7 +98,7 @@ static void fill_opengl_primcaps(D3DPRIMCAPS *pc)
static void fill_opengl_caps(D3DDEVICEDESC *d1, D3DDEVICEDESC *d2)
{
/* GLint maxlight; */
d1->dwSize = sizeof(*d1);
d1->dwFlags = D3DDD_DEVCAPS | D3DDD_BCLIPPING | D3DDD_COLORMODEL | D3DDD_DEVICERENDERBITDEPTH | D3DDD_DEVICEZBUFFERBITDEPTH
| D3DDD_LIGHTINGCAPS | D3DDD_LINECAPS | D3DDD_MAXBUFFERSIZE | D3DDD_MAXVERTEXCOUNT | D3DDD_TRANSFORMCAPS | D3DDD_TRICAPS;
@ -114,7 +114,7 @@ static void fill_opengl_caps(D3DDEVICEDESC *d1, D3DDEVICEDESC *d2)
d1->dlcLightingCaps.dwLightingModel = D3DLIGHTINGMODEL_RGB;
d1->dlcLightingCaps.dwNumLights = 16; /* glGetIntegerv(GL_MAX_LIGHTS, &maxlight); d1->dlcLightingCaps.dwNumLights = maxlight; */
fill_opengl_primcaps(&(d1->dpcLineCaps));
fill_opengl_primcaps(&(d1->dpcTriCaps));
fill_opengl_primcaps(&(d1->dpcTriCaps));
d1->dwDeviceRenderBitDepth = DDBD_16;
d1->dwDeviceZBufferBitDepth = DDBD_16;
d1->dwMaxBufferSize = 0;
@ -137,10 +137,10 @@ static void fill_device_capabilities(IDirectDrawImpl* ddraw) {
x11_dd_private *private = (x11_dd_private *) ddraw->d->private;
const char *ext_string;
Mesa_DeviceCapabilities *devcap;
private->device_capabilities = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(Mesa_DeviceCapabilities));
devcap = (Mesa_DeviceCapabilities *) private->device_capabilities;
ENTER_GL();
ext_string = glGetString(GL_EXTENSIONS);
/* Query for the ColorTable Extension */
@ -174,7 +174,7 @@ is_OpenGL(
(!memcmp(&IID_IDirect3DHALDevice,rguid,sizeof(IID_IDirect3DHALDevice))) ||
/* OpenGL Device */
(!memcmp(&IID_D3DDEVICE2_OpenGL,rguid,sizeof(IID_D3DDEVICE2_OpenGL)))) {
*device = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DDevice2Impl));
(*device)->private = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(mesa_d3dd_private));
odev = (mesa_d3dd_private*)(*device)->private;
@ -185,7 +185,7 @@ is_OpenGL(
(*device)->viewport_list = NULL;
(*device)->current_viewport = NULL;
(*device)->set_context = set_context;
TRACE("Creating OpenGL device for surface %p\n", surface);
/* Create the OpenGL context */
#if COMPILABLE
@ -203,12 +203,12 @@ is_OpenGL(
odev->ctx = glXCreateContext(gdi_display, vis,
NULL, GL_TRUE);
}
if (odev->ctx == NULL)
ERR("Error in context creation !\n");
else
TRACE("Context created (%p)\n", odev->ctx);
/* Now override the surface's Flip method (if in double buffering) */
((x11_ds_private *) surface->private)->opengl_flip = TRUE;
{
@ -230,7 +230,7 @@ is_OpenGL(
odev->world_mat = (D3DMATRIX *) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 16 * sizeof(float));
odev->view_mat = (D3DMATRIX *) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 16 * sizeof(float));
odev->proj_mat = (D3DMATRIX *) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 16 * sizeof(float));
memcpy(odev->world_mat, id_mat, 16 * sizeof(float));
memcpy(odev->view_mat , id_mat, 16 * sizeof(float));
memcpy(odev->proj_mat , id_mat, 16 * sizeof(float));
@ -244,7 +244,7 @@ is_OpenGL(
LEAVE_GL();
fill_device_capabilities(d3d->ddraw);
TRACE("OpenGL device created \n");
return 1;
}
@ -260,7 +260,7 @@ static ULONG WINAPI MESA_IDirect3DDevice2Impl_Release(LPDIRECT3DDEVICE2 iface)
{
ICOM_THIS(IDirect3DDevice2Impl,iface);
FIXME("(%p)->() decrementing from %lu.\n", This, This->ref );
if (!--(This->ref)) {
#if 0 /* broken for now */
D3DDPRIVATE(This);
@ -298,7 +298,7 @@ static HRESULT enum_texture_format_OpenGL(LPD3DENUMTEXTUREFORMATSCALLBACK cb,
pformat = &(sdesc.ddpfPixelFormat);
pformat->dwSize = sizeof(DDPIXELFORMAT);
pformat->dwFourCC = 0;
TRACE("Enumerating GL_RGBA unpacked (32)\n");
pformat->dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS;
pformat->u1.dwRGBBitCount = 32;
@ -371,8 +371,8 @@ static HRESULT enum_texture_format_OpenGL(LPD3DENUMTEXTUREFORMATSCALLBACK cb,
pformat->u4.dwBBitMask = 0x0000001F;
pformat->u5.dwRGBAlphaBitMask = 0x00008000;
if (cb(&sdesc, context) == 0)
return DD_OK;
return DD_OK;
TRACE("Enumerating Paletted (8)\n");
pformat->dwFlags = DDPF_PALETTEINDEXED8;
pformat->u1.dwRGBBitCount = 8;
@ -382,9 +382,9 @@ static HRESULT enum_texture_format_OpenGL(LPD3DENUMTEXTUREFORMATSCALLBACK cb,
pformat->u5.dwRGBAlphaBitMask = 0x00000000;
if (cb(&sdesc, context) == 0)
return DD_OK;
TRACE("End of enumeration\n");
return DD_OK;
}
@ -393,7 +393,7 @@ static HRESULT WINAPI MESA_IDirect3DDevice2Impl_EnumTextureFormats(
) {
ICOM_THIS(IDirect3DDevice2Impl,iface);
FIXME("(%p)->(%p,%p): stub\n", This, cb, context);
return enum_texture_format_OpenGL(cb, context);
}
@ -401,12 +401,12 @@ static HRESULT WINAPI MESA_IDirect3DDevice2Impl_BeginScene(
LPDIRECT3DDEVICE2 iface
) {
ICOM_THIS(IDirect3DDevice2Impl,iface);
FIXME("(%p)->(): stub\n", This);
/* Here, we should get the DDraw surface and 'copy it' to the
OpenGL surface.... */
return DD_OK;
}
@ -416,7 +416,7 @@ HRESULT WINAPI MESA_IDirect3DDevice2Impl_EndScene(LPDIRECT3DDEVICE2 iface) {
FIXME("(%p)->(): stub\n", This);
/* No need to do anything here... */
return DD_OK;
}
@ -428,10 +428,10 @@ static HRESULT WINAPI MESA_IDirect3DDevice2Impl_SetRenderState(
D3DDPRIVATE(This);
TRACE("(%p)->(%d,%ld)\n", This, dwRenderStateType, dwRenderState);
/* Call the render state functions */
set_render_state(dwRenderStateType, dwRenderState, &(odev->rs));
return DD_OK;
}
@ -441,11 +441,11 @@ static HRESULT WINAPI MESA_IDirect3DDevice2Impl_SetLightState(
) {
ICOM_THIS(IDirect3DDevice2Impl,iface);
FIXME("(%p)->(%d,%08lx): stub\n", This, dwLightStateType, dwLightState);
switch (dwLightStateType) {
case D3DLIGHTSTATE_MATERIAL: { /* 1 */
IDirect3DMaterial2Impl* mat = (IDirect3DMaterial2Impl*) dwLightState;
if (mat != NULL) {
ENTER_GL();
mat->activate(mat);
@ -454,10 +454,10 @@ static HRESULT WINAPI MESA_IDirect3DDevice2Impl_SetLightState(
TRACE("Zoups !!!\n");
}
} break;
case D3DLIGHTSTATE_AMBIENT: { /* 2 */
float light[4];
light[0] = ((dwLightState >> 16) & 0xFF) / 255.0;
light[1] = ((dwLightState >> 8) & 0xFF) / 255.0;
light[2] = ((dwLightState >> 0) & 0xFF) / 255.0;
@ -478,7 +478,7 @@ static HRESULT WINAPI MESA_IDirect3DDevice2Impl_SetLightState(
TRACE("Unexpected Light State Type\n");
return DDERR_INVALIDPARAMS;
}
return DD_OK;
}
@ -488,12 +488,12 @@ static HRESULT WINAPI MESA_IDirect3DDevice2Impl_SetTransform(
) {
ICOM_THIS(IDirect3DDevice2Impl,iface);
D3DDPRIVATE(This);
FIXME("(%p)->(%d,%p): stub\n", This, d3dts, lpmatrix);
ENTER_GL();
/* Using a trial and failure approach, I found that the order of
/* Using a trial and failure approach, I found that the order of
Direct3D transformations that works best is :
ScreenCoord = ProjectionMat * ViewMat * WorldMat * ObjectCoord
@ -504,7 +504,7 @@ static HRESULT WINAPI MESA_IDirect3DDevice2Impl_SetTransform(
If anyone has a good explanation of the three different matrices in
the SDK online documentation, feel free to point it to me. For example,
which matrices transform lights ? In OpenGL only the PROJECTION matrix
transform the lights, not the MODELVIEW. Using the matrix names, I
transform the lights, not the MODELVIEW. Using the matrix names, I
supposed that PROJECTION and VIEW (all 'camera' related names) do
transform lights, but WORLD do not. It may be wrong though... */
@ -530,21 +530,21 @@ static HRESULT WINAPI MESA_IDirect3DDevice2Impl_SetTransform(
glMatrixMode(GL_MODELVIEW);
glLoadMatrixf((float *) odev->world_mat);
} break;
case D3DTRANSFORMSTATE_VIEW: {
conv_mat(lpmatrix, odev->view_mat);
glMatrixMode(GL_PROJECTION);
glLoadMatrixf((float *) odev->proj_mat);
glMultMatrixf((float *) odev->view_mat);
} break;
case D3DTRANSFORMSTATE_PROJECTION: {
conv_mat(lpmatrix, odev->proj_mat);
glMatrixMode(GL_PROJECTION);
glLoadMatrixf((float *) odev->proj_mat);
glMultMatrixf((float *) odev->view_mat);
} break;
default:
break;
}
@ -720,16 +720,16 @@ static HRESULT WINAPI MESA_IDirect3DDevice2Impl_DrawPrimitive(
ICOM_THIS(IDirect3DDevice2Impl,iface);
D3DDPRIVATE(This);
int vx_index;
TRACE("(%p)->(%d,%d,%p,%ld,%08lx): stub\n", This, d3dp, d3dv, lpvertex, vertcount, dwFlags);
ENTER_GL();
DRAW_PRIMITIVE(vertcount, vx_index);
LEAVE_GL();
return D3D_OK;
}
static HRESULT WINAPI MESA_IDirect3DDevice2Impl_DrawIndexedPrimitive(
LPDIRECT3DDEVICE2 iface, D3DPRIMITIVETYPE d3dp, D3DVERTEXTYPE d3dv,
LPVOID lpvertex, DWORD vertcount, LPWORD lpindexes, DWORD indexcount,
@ -738,13 +738,13 @@ static HRESULT WINAPI MESA_IDirect3DDevice2Impl_DrawIndexedPrimitive(
ICOM_THIS(IDirect3DDevice2Impl,iface);
D3DDPRIVATE(This);
int vx_index;
TRACE("(%p)->(%d,%d,%p,%ld,%p,%ld,%08lx): stub\n", This, d3dp, d3dv, lpvertex, vertcount, lpindexes, indexcount, dwFlags);
ENTER_GL();
DRAW_PRIMITIVE(indexcount, lpindexes[vx_index]);
LEAVE_GL();
return D3D_OK;
}
@ -767,7 +767,7 @@ static HRESULT WINAPI MESA_IDirect3DDeviceImpl_CreateExecuteBuffer(
* OpenGL-specific VTable
*/
ICOM_VTABLE(IDirect3DDevice2) OpenGL_vtable =
ICOM_VTABLE(IDirect3DDevice2) OpenGL_vtable =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirect3DDevice2Impl_QueryInterface,
@ -784,20 +784,20 @@ ICOM_VTABLE(IDirect3DDevice2) OpenGL_vtable =
MESA_IDirect3DDevice2Impl_BeginScene,
MESA_IDirect3DDevice2Impl_EndScene,
IDirect3DDevice2Impl_GetDirect3D,
/*** DrawPrimitive API ***/
IDirect3DDevice2Impl_SetCurrentViewport,
IDirect3DDevice2Impl_GetCurrentViewport,
IDirect3DDevice2Impl_SetRenderTarget,
IDirect3DDevice2Impl_GetRenderTarget,
IDirect3DDevice2Impl_Begin,
IDirect3DDevice2Impl_BeginIndexed,
IDirect3DDevice2Impl_Vertex,
IDirect3DDevice2Impl_Index,
IDirect3DDevice2Impl_End,
IDirect3DDevice2Impl_GetRenderState,
MESA_IDirect3DDevice2Impl_SetRenderState,
IDirect3DDevice2Impl_GetLightState,
@ -805,10 +805,10 @@ ICOM_VTABLE(IDirect3DDevice2) OpenGL_vtable =
MESA_IDirect3DDevice2Impl_SetTransform,
IDirect3DDevice2Impl_GetTransform,
IDirect3DDevice2Impl_MultiplyTransform,
MESA_IDirect3DDevice2Impl_DrawPrimitive,
MESA_IDirect3DDevice2Impl_DrawIndexedPrimitive,
IDirect3DDevice2Impl_SetClipStatus,
IDirect3DDevice2Impl_GetClipStatus,
};
@ -818,11 +818,11 @@ ICOM_VTABLE(IDirect3DDevice2) OpenGL_vtable =
*/
int d3d_OpenGL_dx3(LPD3DENUMDEVICESCALLBACK cb, LPVOID context) {
D3DDEVICEDESC d1,d2;
TRACE(" Enumerating OpenGL D3D device (IID %s).\n", debugstr_guid(&IID_D3DDEVICE_OpenGL));
fill_opengl_caps(&d1, &d2);
return cb((void*)&IID_D3DDEVICE_OpenGL,"WINE Direct3D using OpenGL","direct3d",&d1,&d2,context);
}
@ -834,7 +834,7 @@ int is_OpenGL_dx3(REFCLSID rguid, IDirectDrawSurfaceImpl* surface, IDirect3DDevi
int attributeList[]={ GLX_RGBA, GLX_DEPTH_SIZE, 16, GLX_DOUBLEBUFFER, None };
XVisualInfo *xvis;
#endif
*device = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DDeviceImpl));
(*device)->private = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(mesa_d3dd_private));
odev = (mesa_d3dd_private*)(*device)->private;
@ -842,14 +842,14 @@ int is_OpenGL_dx3(REFCLSID rguid, IDirectDrawSurfaceImpl* surface, IDirect3DDevi
ICOM_VTBL(*device) = &OpenGL_vtable_dx3;
(*device)->d3d = NULL;
(*device)->surface = surface;
(*device)->viewport_list = NULL;
(*device)->current_viewport = NULL;
(*device)->set_context = (void*)set_context;
TRACE("OpenGL device created \n");
/* Create the OpenGL context */
/* First get the correct visual */
/* if (surface->s.backbuffer == NULL)
@ -869,7 +869,7 @@ int is_OpenGL_dx3(REFCLSID rguid, IDirectDrawSurfaceImpl* surface, IDirect3DDevi
NULL,
GL_TRUE);
TRACE("Context created\n");
/* Now override the surface's Flip method (if in double buffering) */
surface->s.d3d_device = (void *) odev;
{
@ -893,12 +893,12 @@ int is_OpenGL_dx3(REFCLSID rguid, IDirectDrawSurfaceImpl* surface, IDirect3DDevi
(*device)->set_context(*device);
glClearColor(0.0, 0.0, 0.0, 0.0);
glColor3f(1.0, 1.0, 1.0);
fill_device_capabilities((IDirectDrawImpl *) surface->ddraw_owner);
return 1;
}
/* This is not the OpenGL UID */
return DD_OK;
}
@ -907,7 +907,7 @@ static ULONG WINAPI MESA_IDirect3DDeviceImpl_Release(LPDIRECT3DDEVICE iface)
{
ICOM_THIS(IDirect3DDeviceImpl,iface);
FIXME("(%p)->() decrementing from %lu.\n", This, This->ref );
if (!--(This->ref)) {
#if 0 /* broken for now */
D3DDPRIVATE(This);
@ -928,7 +928,7 @@ static HRESULT WINAPI MESA_IDirect3DDeviceImpl_EnumTextureFormats(
{
ICOM_THIS(IDirect3DDeviceImpl,iface);
TRACE("(%p)->(%p,%p): stub\n", This, lpd3dEnumTextureProc, lpArg);
return enum_texture_format_OpenGL(lpd3dEnumTextureProc, lpArg);
}
@ -937,12 +937,12 @@ static HRESULT WINAPI MESA_IDirect3DDeviceImpl_BeginScene(LPDIRECT3DDEVICE iface
{
ICOM_THIS(IDirect3DDeviceImpl,iface);
/* OpenGL_IDirect3DDevice *odev = (OpenGL_IDirect3DDevice *) This; */
FIXME("(%p)->(): stub\n", This);
/* We get the pointer to the surface (should be done on flip) */
/* odev->zb->pbuf = This->surface->s.surface_desc.u2.lpSurface; */
return DD_OK;
}
@ -952,18 +952,18 @@ static HRESULT WINAPI MESA_IDirect3DDeviceImpl_BeginScene(LPDIRECT3DDEVICE iface
static HRESULT WINAPI MESA_IDirect3DDeviceImpl_EndScene(LPDIRECT3DDEVICE iface)
{
ICOM_THIS(IDirect3DDeviceImpl,iface);
FIXME("(%p)->(): stub\n", This);
/* No need to do anything here... */
return DD_OK;
return DD_OK;
}
/*******************************************************************************
* Direct3DDevice VTable
*/
ICOM_VTABLE(IDirect3DDevice) OpenGL_vtable_dx3 =
ICOM_VTABLE(IDirect3DDevice) OpenGL_vtable_dx3 =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirect3DDeviceImpl_QueryInterface,

View File

@ -69,7 +69,7 @@ static ICOM_VTABLE(IDirect3DExecuteBuffer) executebuffer_vtable;
* ExecuteBuffer static functions
*/
void _dump_d3dstatus(LPD3DSTATUS lpStatus) {
}
void _dump_executedata(LPD3DEXECUTEDATA lpData) {
@ -193,16 +193,16 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff,
/* DWORD vc = ilpBuff->data.dwVertexCount; */
DWORD is = ilpBuff->data.dwInstructionOffset;
/* DWORD il = ilpBuff->data.dwInstructionLength; */
void *instr = ilpBuff->desc.lpData + is;
D3DDPRIVATE((IDirect3DDeviceImpl*)dev);
TRACE("ExecuteData : \n");
if (TRACE_ON(ddraw))
_dump_executedata(&(ilpBuff->data));
ENTER_GL();
while (1) {
LPD3DINSTRUCTION current = (LPD3DINSTRUCTION) instr;
BYTE size;
@ -211,20 +211,20 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff,
count = current->wCount;
size = current->bSize;
instr += sizeof(D3DINSTRUCTION);
switch (current->bOpcode) {
case D3DOP_POINT: {
TRACE("POINT-s (%d)\n", count);
instr += count * size;
} break;
case D3DOP_LINE: {
TRACE("LINE-s (%d)\n", count);
instr += count * size;
} break;
case D3DOP_TRIANGLE: {
int i;
float z_inv_matrix[16] = {
@ -233,18 +233,18 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff,
0.0, 0.0, -1.0, 0.0,
0.0, 0.0, 1.0, 1.0
};
OGL_Vertex *vx = (OGL_Vertex *) ilpBuff->vertex_data;
OGL_LVertex *l_vx = (OGL_LVertex *) ilpBuff->vertex_data;
D3DTLVERTEX *tl_vx = (D3DTLVERTEX *) ilpBuff->vertex_data;
TRACE("TRIANGLE (%d)\n", count);
switch (ilpBuff->vertex_type) {
case D3DVT_VERTEX:
/* This time, there is lighting */
glEnable(GL_LIGHTING);
/* Use given matrixes */
glMatrixMode(GL_MODELVIEW);
glLoadIdentity(); /* The model transformation was done during the
@ -282,16 +282,16 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff,
case D3DVT_TLVERTEX: {
GLdouble height, width, minZ, maxZ;
/* First, disable lighting */
glDisable(GL_LIGHTING);
/* Then do not put any transformation matrixes */
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
if (ivp == NULL) {
ERR("No current viewport !\n");
/* Using standard values */
@ -314,7 +314,7 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff,
glOrtho(0.0, width, height, 0.0, -minZ, -maxZ);
} break;
default:
ERR("Unhandled vertex type !\n");
break;
@ -324,27 +324,27 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff,
case D3DVT_VERTEX:
TRIANGLE_LOOP(DO_VERTEX);
break;
case D3DVT_LVERTEX:
TRIANGLE_LOOP(DO_LVERTEX);
break;
case D3DVT_TLVERTEX:
TRIANGLE_LOOP(DO_TLVERTEX);
break;
default:
ERR("Unhandled vertex type !\n");
}
} break;
case D3DOP_MATRIXLOAD: {
TRACE("MATRIXLOAD-s (%d)\n", count);
instr += count * size;
} break;
case D3DOP_MATRIXMULTIPLY: {
int i;
TRACE("MATRIXMULTIPLY (%d)\n", count);
@ -354,7 +354,7 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff,
LPD3DMATRIX a = (LPD3DMATRIX) ci->hDestMatrix;
LPD3DMATRIX b = (LPD3DMATRIX) ci->hSrcMatrix1;
LPD3DMATRIX c = (LPD3DMATRIX) ci->hSrcMatrix2;
TRACE(" Dest : %08lx Src1 : %08lx Src2 : %08lx\n",
ci->hDestMatrix, ci->hSrcMatrix1, ci->hSrcMatrix2);
@ -369,11 +369,11 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff,
glGetFloatv(GL_PROJECTION_MATRIX, (float *) a);
/* Restore the current matrix */
glPopMatrix();
instr += size;
}
} break;
case D3DOP_STATETRANSFORM: {
int i;
TRACE("STATETRANSFORM (%d)\n", count);
@ -401,38 +401,38 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff,
default:
ERR(" Unhandled state transformation !! (%d)\n", (int) ci->u1.dtstTransformStateType);
break;
}
instr += size;
}
} break;
case D3DOP_STATELIGHT: {
int i;
TRACE("STATELIGHT (%d)\n", count);
for (i = 0; i < count; i++) {
LPD3DSTATE ci = (LPD3DSTATE) instr;
/* Handle the state transform */
switch (ci->u1.dlstLightStateType) {
case D3DLIGHTSTATE_MATERIAL: {
IDirect3DMaterial2Impl* mat = (IDirect3DMaterial2Impl*) ci->u2.dwArg[0];
TRACE(" MATERIAL\n");
if (mat != NULL) {
mat->activate(mat);
} else {
TRACE(" bad Material Handle\n");
}
} break ;
case D3DLIGHTSTATE_AMBIENT: {
float light[4];
DWORD dwLightState = ci->u2.dwArg[0];
TRACE(" AMBIENT\n");
light[0] = ((dwLightState >> 16) & 0xFF) / 255.0;
light[1] = ((dwLightState >> 8) & 0xFF) / 255.0;
light[2] = ((dwLightState >> 0) & 0xFF) / 255.0;
@ -445,27 +445,27 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff,
((dwLightState >> 0) & 0xFF),
((dwLightState >> 24) & 0xFF));
} break ;
case D3DLIGHTSTATE_COLORMODEL: {
TRACE(" COLORMODEL\n");
} break ;
case D3DLIGHTSTATE_FOGMODE: {
TRACE(" FOGMODE\n");
} break ;
case D3DLIGHTSTATE_FOGSTART: {
TRACE(" FOGSTART\n");
} break ;
case D3DLIGHTSTATE_FOGEND: {
TRACE(" FOGEND\n");
} break ;
case D3DLIGHTSTATE_FOGDENSITY: {
TRACE(" FOGDENSITY\n");
} break ;
default:
ERR(" Unhandled light state !! (%d)\n", (int) ci->u1.dlstLightStateType);
break;
@ -473,28 +473,28 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff,
instr += size;
}
} break;
case D3DOP_STATERENDER: {
int i;
TRACE("STATERENDER (%d)\n", count);
for (i = 0; i < count; i++) {
LPD3DSTATE ci = (LPD3DSTATE) instr;
/* Handle the state transform */
set_render_state(ci->u1.drstRenderStateType, ci->u2.dwArg[0], &(odev->rs));
instr += size;
}
} break;
case D3DOP_PROCESSVERTICES: {
int i;
TRACE("PROCESSVERTICES (%d)\n", count);
for (i = 0; i < count; i++) {
LPD3DPROCESSVERTICES ci = (LPD3DPROCESSVERTICES) instr;
TRACE(" Start : %d Dest : %d Count : %ld\n",
ci->wStart, ci->wDest, ci->dwCount);
TRACE(" Flags : ");
@ -523,13 +523,13 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff,
In this implementation, I will emulate only ONE thing : each
vertex can have its own "WORLD" transformation (this is used in the
TWIST.EXE demo of the 5.2 SDK). I suppose that all vertices of the
TWIST.EXE demo of the 5.2 SDK). I suppose that all vertices of the
execute buffer use the same state.
If I find applications that change other states, I will try to do a
more 'fine-tuned' state emulation (but I may become quite tricky if
more 'fine-tuned' state emulation (but I may become quite tricky if
it changes a light position in the middle of a triangle).
In this case, a 'direct' approach (i.e. without using OpenGL, but
writing our own 3D rasterizer) would be easier. */
@ -551,13 +551,13 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff,
dump_mat(mat);
ilpBuff->vertex_type = D3DVT_VERTEX;
for (nb = 0; nb < ci->dwCount; nb++) {
/* For the moment, no normal transformation... */
dst->nx = src->u4.nx;
dst->ny = src->u5.ny;
dst->nz = src->u6.nz;
dst->u = src->u7.tu;
dst->v = src->u8.tv;
@ -566,7 +566,7 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff,
dst->y = (src->u1.x * mat->_12) + (src->u2.y * mat->_22) + (src->u3.z * mat->_32) + (1.0 * mat->_42);
dst->z = (src->u1.x * mat->_13) + (src->u2.y * mat->_23) + (src->u3.z * mat->_33) + (1.0 * mat->_43);
dst->w = (src->u1.x * mat->_14) + (src->u2.y * mat->_24) + (src->u3.z * mat->_34) + (1.0 * mat->_44);
src++;
dst++;
}
@ -580,7 +580,7 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff,
dump_mat(mat);
ilpBuff->vertex_type = D3DVT_LVERTEX;
for (nb = 0; nb < ci->dwCount; nb++) {
dst->c = src->u4.color;
dst->sc = src->u5.specular;
@ -592,7 +592,7 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff,
dst->y = (src->u1.x * mat->_12) + (src->u2.y * mat->_22) + (src->u3.z * mat->_32) + (1.0 * mat->_42);
dst->z = (src->u1.x * mat->_13) + (src->u2.y * mat->_23) + (src->u3.z * mat->_33) + (1.0 * mat->_43);
dst->w = (src->u1.x * mat->_14) + (src->u2.y * mat->_24) + (src->u3.z * mat->_34) + (1.0 * mat->_44);
src++;
dst++;
}
@ -601,22 +601,22 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff,
D3DTLVERTEX *dst = ((LPD3DTLVERTEX) (ilpBuff->vertex_data)) + ci->wDest;
ilpBuff->vertex_type = D3DVT_TLVERTEX;
memcpy(dst, src, ci->dwCount * sizeof(D3DTLVERTEX));
} else {
ERR("Unhandled vertex processing !\n");
}
instr += size;
}
} break;
case D3DOP_TEXTURELOAD: {
TRACE("TEXTURELOAD-s (%d)\n", count);
instr += count * size;
} break;
case D3DOP_EXIT: {
TRACE("EXIT (%d)\n", count);
/* We did this instruction */
@ -624,14 +624,14 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff,
/* Exit this loop */
goto end_of_buffer;
} break;
case D3DOP_BRANCHFORWARD: {
int i;
TRACE("BRANCHFORWARD (%d)\n", count);
for (i = 0; i < count; i++) {
LPD3DBRANCH ci = (LPD3DBRANCH) instr;
if ((ilpBuff->data.dsStatus.dwStatus & ci->dwMask) == ci->dwValue) {
if (!ci->bNegate) {
TRACE(" Should branch to %ld\n", ci->dwOffset);
@ -645,22 +645,22 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff,
instr += size;
}
} break;
case D3DOP_SPAN: {
TRACE("SPAN-s (%d)\n", count);
instr += count * size;
} break;
case D3DOP_SETSTATUS: {
int i;
TRACE("SETSTATUS (%d)\n", count);
for (i = 0; i < count; i++) {
LPD3DSTATUS ci = (LPD3DSTATUS) instr;
ilpBuff->data.dsStatus = *ci;
instr += size;
}
} break;
@ -683,7 +683,7 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff,
LPDIRECT3DEXECUTEBUFFER d3dexecutebuffer_create(IDirect3DDeviceImpl* d3ddev, LPD3DEXECUTEBUFFERDESC lpDesc)
{
IDirect3DExecuteBufferImpl* eb;
eb = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DExecuteBufferImpl));
eb->ref = 1;
ICOM_VTBL(eb) = &executebuffer_vtable;
@ -707,14 +707,14 @@ LPDIRECT3DEXECUTEBUFFER d3dexecutebuffer_create(IDirect3DDeviceImpl* d3ddev, LPD
} else {
eb->need_free = FALSE;
}
/* No vertices for the moment */
eb->vertex_data = NULL;
eb->desc.dwFlags |= D3DDEB_LPDATA;
eb->execute = execute;
return (LPDIRECT3DEXECUTEBUFFER)eb;
}
@ -727,9 +727,9 @@ static HRESULT WINAPI IDirect3DExecuteBufferImpl_QueryInterface(LPDIRECT3DEXECUT
LPVOID* ppvObj)
{
ICOM_THIS(IDirect3DExecuteBufferImpl,iface);
FIXME("(%p)->(%s,%p): stub\n", This, debugstr_guid(riid),ppvObj);
return S_OK;
}
@ -739,7 +739,7 @@ static ULONG WINAPI IDirect3DExecuteBufferImpl_AddRef(LPDIRECT3DEXECUTEBUFFER if
{
ICOM_THIS(IDirect3DExecuteBufferImpl,iface);
TRACE("(%p)->()incrementing from %lu.\n", This, This->ref );
return ++(This->ref);
}
@ -749,7 +749,7 @@ static ULONG WINAPI IDirect3DExecuteBufferImpl_Release(LPDIRECT3DEXECUTEBUFFER i
{
ICOM_THIS(IDirect3DExecuteBufferImpl,iface);
FIXME("(%p)->() decrementing from %lu.\n", This, This->ref );
if (!--(This->ref)) {
if ((This->desc.lpData != NULL) && This->need_free)
HeapFree(GetProcessHeap(),0,This->desc.lpData);
@ -760,7 +760,7 @@ static ULONG WINAPI IDirect3DExecuteBufferImpl_Release(LPDIRECT3DEXECUTEBUFFER i
HeapFree(GetProcessHeap(),0,This);
return 0;
}
return This->ref;
}
@ -770,7 +770,7 @@ static HRESULT WINAPI IDirect3DExecuteBufferImpl_Initialize(LPDIRECT3DEXECUTEBUF
{
ICOM_THIS(IDirect3DExecuteBufferImpl,iface);
FIXME("(%p)->(%p,%p): stub\n", This, lpDirect3DDevice, lpDesc);
return DD_OK;
}
@ -782,7 +782,7 @@ static HRESULT WINAPI IDirect3DExecuteBufferImpl_Lock(LPDIRECT3DEXECUTEBUFFER if
/* Copies the buffer description */
*lpDesc = This->desc;
return DD_OK;
}
@ -806,7 +806,7 @@ static HRESULT WINAPI IDirect3DExecuteBufferImpl_SetExecuteData(LPDIRECT3DEXECUT
/* Get the number of vertices in the execute buffer */
nbvert = This->data.dwVertexCount;
/* Prepares the transformed vertex buffer */
if (This->vertex_data != NULL)
HeapFree(GetProcessHeap(), 0, This->vertex_data);
@ -816,7 +816,7 @@ static HRESULT WINAPI IDirect3DExecuteBufferImpl_SetExecuteData(LPDIRECT3DEXECUT
if (TRACE_ON(ddraw)) {
_dump_executedata(lpData);
}
return DD_OK;
}
@ -827,7 +827,7 @@ static HRESULT WINAPI IDirect3DExecuteBufferImpl_GetExecuteData(LPDIRECT3DEXECUT
TRACE("(%p)->(%p): stub\n", This, lpData);
*lpData = This->data;
return DD_OK;
}
@ -856,7 +856,7 @@ static HRESULT WINAPI IDirect3DExecuteBufferImpl_Optimize(LPDIRECT3DEXECUTEBUFFE
/*******************************************************************************
* IDirect3DLight VTable
*/
static ICOM_VTABLE(IDirect3DExecuteBuffer) executebuffer_vtable =
static ICOM_VTABLE(IDirect3DExecuteBuffer) executebuffer_vtable =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
/*** IUnknown methods ***/

View File

@ -29,7 +29,7 @@
#include "mesa_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(ddraw);
#define D3DLPRIVATE(x) mesa_d3dl_private*dlpriv=((mesa_d3dl_private*)x->private)
static ICOM_VTABLE(IDirect3DLight) light_vtable;
@ -52,14 +52,14 @@ static void update(IDirect3DLightImpl* This) {
case D3DLIGHT_POINT: /* 1 */
TRACE("Activating POINT\n");
break;
case D3DLIGHT_SPOT: /* 2 */
TRACE("Activating SPOT\n");
break;
case D3DLIGHT_DIRECTIONAL: { /* 3 */
float direction[4];
TRACE("Activating DIRECTIONAL\n");
TRACE(" direction : %f %f %f\n",
This->light.dvDirection.u1.x,
@ -77,7 +77,7 @@ static void update(IDirect3DLightImpl* This) {
glLightfv(dlpriv->light_num, GL_POSITION, (float *) direction);
} break;
case D3DLIGHT_PARALLELPOINT: /* 4 */
TRACE("Activating PARRALLEL-POINT\n");
break;
@ -109,7 +109,7 @@ static void activate(IDirect3DLightImpl* This) {
LPDIRECT3DLIGHT d3dlight_create(IDirect3D2Impl* d3d2)
{
IDirect3DLightImpl* light;
light = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DLightImpl));
light->ref = 1;
ICOM_VTBL(light) = &light_vtable;
@ -120,26 +120,26 @@ LPDIRECT3DLIGHT d3dlight_create(IDirect3D2Impl* d3d2)
light->prev = NULL;
light->activate = activate;
light->is_active = 0;
return (LPDIRECT3DLIGHT)light;
}
LPDIRECT3DLIGHT d3dlight_create_dx3(IDirect3DImpl* d3d1)
{
IDirect3DLightImpl* light;
light = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DLightImpl));
light->ref = 1;
ICOM_VTBL(light) = &light_vtable;
light->d3d.d3d1 = d3d1;
light->type = D3D_1;
light->next = NULL;
light->prev = NULL;
light->activate = activate;
light->is_active = 0;
return (LPDIRECT3DLIGHT)light;
}
@ -152,9 +152,9 @@ static HRESULT WINAPI IDirect3DLightImpl_QueryInterface(LPDIRECT3DLIGHT iface,
LPVOID* ppvObj)
{
ICOM_THIS(IDirect3DLightImpl,iface);
FIXME("(%p)->(%s,%p): stub\n", This, debugstr_guid(riid),ppvObj);
return S_OK;
}
@ -164,7 +164,7 @@ static ULONG WINAPI IDirect3DLightImpl_AddRef(LPDIRECT3DLIGHT iface)
{
ICOM_THIS(IDirect3DLightImpl,iface);
TRACE("(%p)->()incrementing from %lu.\n", This, This->ref );
return ++(This->ref);
}
@ -174,12 +174,12 @@ static ULONG WINAPI IDirect3DLightImpl_Release(LPDIRECT3DLIGHT iface)
{
ICOM_THIS(IDirect3DLightImpl,iface);
FIXME("(%p)->() decrementing from %lu.\n", This, This->ref );
if (!--(This->ref)) {
HeapFree(GetProcessHeap(),0,This);
return 0;
}
return This->ref;
}
@ -196,7 +196,7 @@ static HRESULT WINAPI IDirect3DLightImpl_GetLight(LPDIRECT3DLIGHT iface,
TRACE("(%p)->(%p)\n", This, lpLight);
if (TRACE_ON(ddraw))
dump_light(lpLight);
/* Copies the light structure */
switch (This->type) {
case D3D_1:
@ -206,7 +206,7 @@ static HRESULT WINAPI IDirect3DLightImpl_GetLight(LPDIRECT3DLIGHT iface,
*((LPD3DLIGHT2)lpLight) = *((LPD3DLIGHT2) &(This->light));
break;
}
return DD_OK;
}
@ -217,7 +217,7 @@ static HRESULT WINAPI IDirect3DLightImpl_SetLight(LPDIRECT3DLIGHT iface,
TRACE("(%p)->(%p)\n", This, lpLight);
if (TRACE_ON(ddraw))
dump_light(lpLight);
/* Stores the light */
switch (This->type) {
case D3D_1:
@ -227,12 +227,12 @@ static HRESULT WINAPI IDirect3DLightImpl_SetLight(LPDIRECT3DLIGHT iface,
*((LPD3DLIGHT2) &(This->light)) = *((LPD3DLIGHT2)lpLight);
break;
}
ENTER_GL();
if (This->is_active)
update(This);
LEAVE_GL();
return DD_OK;
}
@ -250,7 +250,7 @@ static HRESULT WINAPI IDirect3DLightImpl_Initialize(LPDIRECT3DLIGHT iface,
/*******************************************************************************
* IDirect3DLight VTable
*/
static ICOM_VTABLE(IDirect3DLight) light_vtable =
static ICOM_VTABLE(IDirect3DLight) light_vtable =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
/*** IUnknown methods ***/

View File

@ -38,7 +38,7 @@ static ICOM_VTABLE(IDirect3DMaterial) material_vtable;
*/
static void activate(IDirect3DMaterial2Impl* This) {
TRACE("Activating material %p\n", This);
ENTER_GL();
/* First, set the rendering context */
if (This->use_d3d2)
@ -63,13 +63,13 @@ static void activate(IDirect3DMaterial2Impl* This) {
glMaterialfv(GL_FRONT,
GL_EMISSION,
(float *) &(This->mat.u3.emissive));
TRACE("Size : %ld\n", This->mat.dwSize);
TRACE("Power : %f\n", This->mat.u4.power);
TRACE("Texture handle : %08lx\n", (DWORD)This->mat.hTexture);
LEAVE_GL();
return ;
}
@ -79,7 +79,7 @@ static void activate(IDirect3DMaterial2Impl* This) {
LPDIRECT3DMATERIAL2 d3dmaterial2_create(IDirect3D2Impl* d3d2)
{
IDirect3DMaterial2Impl* mat;
mat = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DMaterial2Impl));
mat->ref = 1;
ICOM_VTBL(mat) = &material2_vtable;
@ -88,14 +88,14 @@ LPDIRECT3DMATERIAL2 d3dmaterial2_create(IDirect3D2Impl* d3d2)
mat->d3d.d3d2 = d3d2;
mat->activate = activate;
return (LPDIRECT3DMATERIAL2)mat;
}
LPDIRECT3DMATERIAL d3dmaterial_create(IDirect3DImpl* d3d1)
{
IDirect3DMaterial2Impl* mat;
mat = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DMaterial2Impl));
mat->ref = 1;
ICOM_VTBL(mat) = (ICOM_VTABLE(IDirect3DMaterial2)*)&material_vtable;
@ -104,7 +104,7 @@ LPDIRECT3DMATERIAL d3dmaterial_create(IDirect3DImpl* d3d1)
mat->d3d.d3d1 = d3d1;
mat->activate = activate;
return (LPDIRECT3DMATERIAL) mat;
}
@ -117,9 +117,9 @@ static HRESULT WINAPI IDirect3DMaterial2Impl_QueryInterface(LPDIRECT3DMATERIAL2
LPVOID* ppvObj)
{
ICOM_THIS(IDirect3DMaterial2Impl,iface);
FIXME("(%p)->(%s,%p): stub\n", This, debugstr_guid(riid),ppvObj);
return S_OK;
}
@ -129,7 +129,7 @@ static ULONG WINAPI IDirect3DMaterial2Impl_AddRef(LPDIRECT3DMATERIAL2 iface)
{
ICOM_THIS(IDirect3DMaterial2Impl,iface);
TRACE("(%p)->()incrementing from %lu.\n", This, This->ref );
return ++(This->ref);
}
@ -139,12 +139,12 @@ static ULONG WINAPI IDirect3DMaterial2Impl_Release(LPDIRECT3DMATERIAL2 iface)
{
ICOM_THIS(IDirect3DMaterial2Impl,iface);
FIXME("(%p)->() decrementing from %lu.\n", This, This->ref );
if (!--(This->ref)) {
HeapFree(GetProcessHeap(),0,This);
return 0;
}
return This->ref;
}
@ -161,10 +161,10 @@ static HRESULT WINAPI IDirect3DMaterial2Impl_GetMaterial(LPDIRECT3DMATERIAL2 ifa
TRACE("(%p)->(%p)\n", This, lpMat);
if (TRACE_ON(ddraw))
dump_material(lpMat);
/* Copies the material structure */
*lpMat = This->mat;
return DD_OK;
}
@ -175,10 +175,10 @@ static HRESULT WINAPI IDirect3DMaterial2Impl_SetMaterial(LPDIRECT3DMATERIAL2 ifa
TRACE("(%p)->(%p)\n", This, lpMat);
if (TRACE_ON(ddraw))
dump_material(lpMat);
/* Stores the material */
This->mat = *lpMat;
return DD_OK;
}
@ -194,9 +194,9 @@ static HRESULT WINAPI IDirect3DMaterial2Impl_GetHandle(LPDIRECT3DMATERIAL2 iface
This->device.active_device2 = (IDirect3DDevice2Impl*)lpD3DDevice2;
else
This->device.active_device1 = (IDirect3DDeviceImpl*)lpD3DDevice2;
*lpMatHandle = (DWORD) This; /* lpD3DDevice2->store_material(This); */
return DD_OK;
}
@ -207,7 +207,7 @@ static HRESULT WINAPI IDirect3DMaterialImpl_Reserve(LPDIRECT3DMATERIAL iface)
return DDERR_INVALIDPARAMS;
}
static HRESULT WINAPI IDirect3DMaterialImpl_Unreserve(LPDIRECT3DMATERIAL iface)
{
ICOM_THIS(IDirect3DMaterial2Impl,iface);
@ -222,7 +222,7 @@ static HRESULT WINAPI IDirect3DMaterialImpl_Initialize(LPDIRECT3DMATERIAL iface,
{
ICOM_THIS(IDirect3DMaterial2Impl,iface);
TRACE("(%p)->(%p)\n", This, lpDirect3D);
return DDERR_ALREADYINITIALIZED;
}
@ -236,7 +236,7 @@ static HRESULT WINAPI IDirect3DMaterialImpl_Initialize(LPDIRECT3DMATERIAL iface,
# define XCAST(fun) (void*)
#endif
static ICOM_VTABLE(IDirect3DMaterial) material_vtable =
static ICOM_VTABLE(IDirect3DMaterial) material_vtable =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
/*** IUnknown methods ***/
@ -259,7 +259,7 @@ static ICOM_VTABLE(IDirect3DMaterial) material_vtable =
/*******************************************************************************
* IDirect3DMaterial2 VTable
*/
static ICOM_VTABLE(IDirect3DMaterial2) material2_vtable =
static ICOM_VTABLE(IDirect3DMaterial2) material2_vtable =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
/*** IUnknown methods ***/

View File

@ -43,7 +43,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ddraw);
#ifdef TEXTURE_SNOOP
#include <stdio.h>
#define SNOOP_PALETTED() \
{ \
FILE *f; \
@ -118,14 +118,14 @@ extern ICOM_VTABLE(IDirect3DTexture) mesa_texture_vtable;
LPDIRECT3DTEXTURE2 d3dtexture2_create(IDirectDrawSurfaceImpl* surf)
{
IDirect3DTexture2Impl* tex;
tex = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DTexture2Impl));
tex->ref = 1;
ICOM_VTBL(tex) = &mesa_texture2_vtable;
tex->surface = surf;
tex->private = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(mesa_d3dt_private));
return (LPDIRECT3DTEXTURE2)tex;
}
@ -135,14 +135,14 @@ LPDIRECT3DTEXTURE2 d3dtexture2_create(IDirectDrawSurfaceImpl* surf)
LPDIRECT3DTEXTURE d3dtexture_create(IDirectDrawSurfaceImpl* surf)
{
IDirect3DTexture2Impl* tex;
tex = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DTexture2Impl));
tex->ref = 1;
ICOM_VTBL(tex) = (ICOM_VTABLE(IDirect3DTexture2)*)&mesa_texture_vtable;
tex->surface = surf;
tex->private = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(mesa_d3dt_private));
return (LPDIRECT3DTEXTURE)tex;
}
@ -155,7 +155,7 @@ HRESULT WINAPI SetColorKey_cb(IDirect3DTexture2Impl *texture, DWORD dwFlags, LP
D3DTPRIVATE(texture);
int bpp;
GLuint current_texture;
TRACE("(%p) : colorkey callback\n", texture);
/* Get the texture description */
@ -163,7 +163,7 @@ HRESULT WINAPI SetColorKey_cb(IDirect3DTexture2Impl *texture, DWORD dwFlags, LP
bpp = (tex_d->ddpfPixelFormat.dwFlags & DDPF_PALETTEINDEXED8 ?
1 /* 8 bit of palette index */:
tex_d->ddpfPixelFormat.u1.dwRGBBitCount / 8 /* RGB bits for each colors */ );
/* Now, save the current texture */
ENTER_GL();
glGetIntegerv(GL_TEXTURE_BINDING_2D, &current_texture);
@ -193,13 +193,13 @@ HRESULT WINAPI SetColorKey_cb(IDirect3DTexture2Impl *texture, DWORD dwFlags, LP
for (y = 0; y < tex_d->dwHeight; y++) {
for (x = 0; x < tex_d->dwWidth; x++) {
unsigned short cpixel = src[x + y * tex_d->dwWidth];
if ((dwFlags & DDCKEY_SRCBLT) &&
(cpixel >= ckey->dwColorSpaceLowValue) &&
(cpixel <= ckey->dwColorSpaceHighValue)) /* No alpha bit => this pixel is transparent */
dest[x + y * tex_d->dwWidth] = (cpixel & ~0x003F) | ((cpixel & 0x001F) << 1) | 0x0000;
else /* Alpha bit is set => this pixel will be seen */
dest[x + y * tex_d->dwWidth] = (cpixel & ~0x003F) | ((cpixel & 0x001F) << 1) | 0x0001;
dest[x + y * tex_d->dwWidth] = (cpixel & ~0x003F) | ((cpixel & 0x001F) << 1) | 0x0001;
}
}
@ -245,9 +245,9 @@ HRESULT WINAPI IDirect3DTexture2Impl_QueryInterface(LPDIRECT3DTEXTURE2 iface,
LPVOID* ppvObj)
{
ICOM_THIS(IDirect3DTexture2Impl,iface);
FIXME("(%p)->(%s,%p): stub\n", This, debugstr_guid(riid),ppvObj);
return S_OK;
}
@ -257,7 +257,7 @@ ULONG WINAPI IDirect3DTexture2Impl_AddRef(LPDIRECT3DTEXTURE2 iface)
{
ICOM_THIS(IDirect3DTexture2Impl,iface);
TRACE("(%p)->()incrementing from %lu.\n", This, This->ref );
return ++(This->ref);
}
@ -268,20 +268,20 @@ ULONG WINAPI IDirect3DTexture2Impl_Release(LPDIRECT3DTEXTURE2 iface)
ICOM_THIS(IDirect3DTexture2Impl,iface);
D3DTPRIVATE(This);
FIXME("(%p)->() decrementing from %lu.\n", This, This->ref );
if (!--(This->ref)) {
/* Delete texture from OpenGL */
ENTER_GL();
glDeleteTextures(1, &(dtpriv->tex_name));
LEAVE_GL();
/* Release surface */
IDirectDrawSurface4_Release((IDirectDrawSurface4*)This->surface);
HeapFree(GetProcessHeap(),0,This);
return 0;
}
return This->ref;
}
@ -392,7 +392,7 @@ HRESULT WINAPI IDirect3DTexture2Impl_Load(
/* Install the callbacks to the destination surface */
This->surface->texture = This;
This->surface->SetColorKey_cb = SetColorKey_cb;
if ((src_d->dwWidth != dst_d->dwWidth) || (src_d->dwHeight != dst_d->dwHeight)) {
/* Should also check for same pixel format, lPitch, ... */
ERR("Error in surface sizes\n");
@ -410,7 +410,7 @@ HRESULT WINAPI IDirect3DTexture2Impl_Load(
memcpy(dst_d->lpSurface, src_d->lpSurface, src_d->dwWidth * src_d->dwHeight * bpp);
ENTER_GL();
/* Now, load the texture */
/* d3dd->set_context(d3dd); We need to set the context somehow.... */
glGetIntegerv(GL_TEXTURE_BINDING_2D, &current_texture);
@ -434,7 +434,7 @@ HRESULT WINAPI IDirect3DTexture2Impl_Load(
((Mesa_DeviceCapabilities *) ((x11_dd_private *) This->surface->s.ddraw->d->private)->device_capabilities)->ptr_ColorTableEXT;
}
#endif
if (pal == NULL) {
ERR("Palettized texture Loading with a NULL palette !\n");
LEAVE_GL();
@ -453,7 +453,7 @@ HRESULT WINAPI IDirect3DTexture2Impl_Load(
else
table[i][3] = 0xFF;
}
/* Texture snooping */
SNOOP_PALETTED();
@ -465,7 +465,7 @@ HRESULT WINAPI IDirect3DTexture2Impl_Load(
GL_RGBA, /* table format */
GL_UNSIGNED_BYTE, /* table type */
table); /* the color table */
glTexImage2D(GL_TEXTURE_2D, /* target */
0, /* level */
GL_COLOR_INDEX8_EXT, /* internal format */
@ -478,7 +478,7 @@ HRESULT WINAPI IDirect3DTexture2Impl_Load(
DWORD *surface = (DWORD *) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, src_d->dwWidth * src_d->dwHeight * sizeof(DWORD));
DWORD i;
BYTE *src = (BYTE *) src_d->lpSurface, *dst = (BYTE *) surface;
for (i = 0; i < src_d->dwHeight * src_d->dwWidth; i++) {
BYTE color = *src++;
*dst++ = table[color][0];
@ -486,7 +486,7 @@ HRESULT WINAPI IDirect3DTexture2Impl_Load(
*dst++ = table[color][2];
*dst++ = table[color][3];
}
glTexImage2D(GL_TEXTURE_2D,
0,
GL_RGBA,
@ -495,7 +495,7 @@ HRESULT WINAPI IDirect3DTexture2Impl_Load(
GL_RGBA,
GL_UNSIGNED_BYTE,
surface);
HeapFree(GetProcessHeap(), 0, surface);
}
} else if (src_d->ddpfPixelFormat.dwFlags & DDPF_RGB) {
@ -504,7 +504,7 @@ HRESULT WINAPI IDirect3DTexture2Impl_Load(
************ */
if (src_d->ddpfPixelFormat.u1.dwRGBBitCount == 8) {
/* **********************
GL_UNSIGNED_BYTE_3_3_2
GL_UNSIGNED_BYTE_3_3_2
********************** */
glTexImage2D(GL_TEXTURE_2D,
0,
@ -516,10 +516,10 @@ HRESULT WINAPI IDirect3DTexture2Impl_Load(
src_d->lpSurface);
} else if (src_d->ddpfPixelFormat.u1.dwRGBBitCount == 16) {
if (src_d->ddpfPixelFormat.u5.dwRGBAlphaBitMask == 0x00000000) {
/* Texture snooping */
SNOOP_5650();
glTexImage2D(GL_TEXTURE_2D,
0,
GL_RGB,
@ -531,7 +531,7 @@ HRESULT WINAPI IDirect3DTexture2Impl_Load(
} else if (src_d->ddpfPixelFormat.u5.dwRGBAlphaBitMask == 0x00000001) {
/* Texture snooping */
SNOOP_5551();
glTexImage2D(GL_TEXTURE_2D,
0,
GL_RGBA,
@ -560,7 +560,7 @@ HRESULT WINAPI IDirect3DTexture2Impl_Load(
((*src & 0x7FFF) << 1));
src++;
}
glTexImage2D(GL_TEXTURE_2D,
0,
GL_RGBA,
@ -569,8 +569,8 @@ HRESULT WINAPI IDirect3DTexture2Impl_Load(
GL_RGBA,
GL_UNSIGNED_SHORT_5_5_5_1,
surface);
HeapFree(GetProcessHeap(), 0, surface);
HeapFree(GetProcessHeap(), 0, surface);
} else {
ERR("Unhandled texture format (bad Aplha channel for a 16 bit texture)\n");
}
@ -603,7 +603,7 @@ HRESULT WINAPI IDirect3DTexture2Impl_Load(
LEAVE_GL();
}
return D3D_OK;
}
@ -611,7 +611,7 @@ HRESULT WINAPI IDirect3DTexture2Impl_Load(
/*******************************************************************************
* IDirect3DTexture2 VTable
*/
ICOM_VTABLE(IDirect3DTexture2) mesa_texture2_vtable =
ICOM_VTABLE(IDirect3DTexture2) mesa_texture2_vtable =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
/*** IUnknown methods ***/
@ -633,7 +633,7 @@ ICOM_VTABLE(IDirect3DTexture2) mesa_texture2_vtable =
# define XCAST(fun) (void*)
#endif
ICOM_VTABLE(IDirect3DTexture) mesa_texture_vtable =
ICOM_VTABLE(IDirect3DTexture) mesa_texture_vtable =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
/*** IUnknown methods ***/

View File

@ -43,7 +43,7 @@ static ICOM_VTABLE(IDirect3DViewport2) viewport2_vtable;
*/
static void activate(IDirect3DViewport2Impl* This) {
IDirect3DLightImpl* l;
/* Activate all the lights associated with this context */
l = This->lights;
@ -59,7 +59,7 @@ static void activate(IDirect3DViewport2Impl* This) {
LPDIRECT3DVIEWPORT2 d3dviewport2_create(IDirect3D2Impl* d3d2)
{
IDirect3DViewport2Impl* vp;
vp = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DViewport2Impl));
vp->private = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(mesa_d3dv_private));
vp->ref = 1;
@ -73,14 +73,14 @@ LPDIRECT3DVIEWPORT2 d3dviewport2_create(IDirect3D2Impl* d3d2)
vp->lights = NULL;
((mesa_d3dv_private *) vp->private)->nextlight = GL_LIGHT0;
return (LPDIRECT3DVIEWPORT2)vp;
}
LPDIRECT3DVIEWPORT d3dviewport_create(IDirect3DImpl* d3d1)
{
IDirect3DViewport2Impl* vp;
vp = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DViewport2Impl));
vp->private = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(mesa_d3dv_private));
vp->ref = 1;
@ -94,7 +94,7 @@ LPDIRECT3DVIEWPORT d3dviewport_create(IDirect3DImpl* d3d1)
vp->lights = NULL;
((mesa_d3dv_private *) vp->private)->nextlight = GL_LIGHT0;
return (LPDIRECT3DVIEWPORT) vp;
}
@ -107,9 +107,9 @@ HRESULT WINAPI IDirect3DViewport2Impl_QueryInterface(LPDIRECT3DVIEWPORT2 iface,
LPVOID* ppvObj)
{
ICOM_THIS(IDirect3DViewport2Impl,iface);
FIXME("(%p)->(%s,%p): stub\n", This, debugstr_guid(riid),ppvObj);
return S_OK;
}
@ -119,7 +119,7 @@ ULONG WINAPI IDirect3DViewport2Impl_AddRef(LPDIRECT3DVIEWPORT2 iface)
{
ICOM_THIS(IDirect3DViewport2Impl,iface);
TRACE("(%p)->()incrementing from %lu.\n", This, This->ref );
return ++(This->ref);
}
@ -129,12 +129,12 @@ ULONG WINAPI IDirect3DViewport2Impl_Release(LPDIRECT3DVIEWPORT2 iface)
{
ICOM_THIS(IDirect3DViewport2Impl,iface);
FIXME("(%p)->() decrementing from %lu.\n", This, This->ref );
if (!--(This->ref)) {
HeapFree(GetProcessHeap(),0,This);
return 0;
}
return This->ref;
}
@ -144,7 +144,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_Initialize(LPDIRECT3DVIEWPORT2 iface,
{
ICOM_THIS(IDirect3DViewport2Impl,iface);
FIXME("(%p)->(%p): stub\n", This, d3d);
return DD_OK;
}
@ -153,12 +153,12 @@ HRESULT WINAPI IDirect3DViewport2Impl_GetViewport(LPDIRECT3DVIEWPORT2 iface,
{
ICOM_THIS(IDirect3DViewport2Impl,iface);
FIXME("(%p)->(%p): stub\n", This, lpvp);
if (This->use_vp2 != 0)
return DDERR_INVALIDPARAMS;
*lpvp = This->viewport.vp1;
return DD_OK;
}
@ -170,7 +170,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_SetViewport(LPDIRECT3DVIEWPORT2 iface,
This->use_vp2 = 0;
This->viewport.vp1 = *lpvp;
TRACE("dwSize = %ld dwX = %ld dwY = %ld\n",
lpvp->dwSize, lpvp->dwX, lpvp->dwY);
TRACE("dwWidth = %ld dwHeight = %ld\n",
@ -182,7 +182,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_SetViewport(LPDIRECT3DVIEWPORT2 iface,
TRACE("dvMinZ = %f dvMaxZ = %f\n",
lpvp->dvMinZ, lpvp->dvMaxZ);
return DD_OK;
}
@ -195,7 +195,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_TransformVertices(LPDIRECT3DVIEWPORT2 ifac
ICOM_THIS(IDirect3DViewport2Impl,iface);
FIXME("(%p)->(%8ld,%p,%08lx,%p): stub\n",
This, dwVertexCount, lpData, dwFlags, lpOffScreen);
return DD_OK;
}
@ -205,7 +205,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_LightElements(LPDIRECT3DVIEWPORT2 iface,
{
ICOM_THIS(IDirect3DViewport2Impl,iface);
FIXME("(%p)->(%8ld,%p): stub\n", This, dwElementCount, lpData);
return DD_OK;
}
@ -214,7 +214,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_SetBackground(LPDIRECT3DVIEWPORT2 iface,
{
ICOM_THIS(IDirect3DViewport2Impl,iface);
FIXME("(%p)->(%08lx): stub\n", This, (DWORD) hMat);
return DD_OK;
}
@ -224,7 +224,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_GetBackground(LPDIRECT3DVIEWPORT2 iface,
{
ICOM_THIS(IDirect3DViewport2Impl,iface);
FIXME("(%p)->(%p,%p): stub\n", This, lphMat, lpValid);
return DD_OK;
}
@ -233,7 +233,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_SetBackgroundDepth(LPDIRECT3DVIEWPORT2 ifa
{
ICOM_THIS(IDirect3DViewport2Impl,iface);
FIXME("(%p)->(%p): stub\n", This, lpDDSurface);
return DD_OK;
}
@ -243,7 +243,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_GetBackgroundDepth(LPDIRECT3DVIEWPORT2 ifa
{
ICOM_THIS(IDirect3DViewport2Impl,iface);
FIXME("(%p)->(%p,%p): stub\n", This, lplpDDSurface, lpValid);
return DD_OK;
}
@ -272,7 +272,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_Clear(LPDIRECT3DVIEWPORT2 iface,
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glDepthMask(ztest);
LEAVE_GL();
return DD_OK;
}
@ -291,18 +291,18 @@ HRESULT WINAPI IDirect3DViewport2Impl_AddLight(LPDIRECT3DVIEWPORT2 iface,
if (This->device.active_device1 != NULL) {
D3DVPRIVATE(This);
D3DLPRIVATE(ilpLight);
/* Get the rendering context */
if (This->use_d3d2)
This->device.active_device2->set_context(This->device.active_device2);
else
This->device.active_device1->set_context(This->device.active_device1);
/* Activate the light */
dlpriv->light_num = dvpriv->nextlight++;
ilpLight->activate(ilpLight);
}
return DD_OK;
}
@ -311,7 +311,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_DeleteLight(LPDIRECT3DVIEWPORT2 iface,
{
ICOM_THIS(IDirect3DViewport2Impl,iface);
FIXME("(%p)->(%p): stub\n", This, lpLight);
return DD_OK;
}
@ -322,7 +322,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_NextLight(LPDIRECT3DVIEWPORT2 iface,
{
ICOM_THIS(IDirect3DViewport2Impl,iface);
FIXME("(%p)->(%p,%p,%08lx): stub\n", This, lpLight, lplpLight, dwFlags);
return DD_OK;
}
@ -337,7 +337,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_GetViewport2(LPDIRECT3DVIEWPORT2 iface,
return DDERR_INVALIDPARAMS;
*lpViewport2 = This->viewport.vp2;
return DD_OK;
}
@ -360,7 +360,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_SetViewport2(LPDIRECT3DVIEWPORT2 iface,
This->viewport.vp2 = *lpViewport2;
This->use_vp2 = 1;
return DD_OK;
}
@ -368,7 +368,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_SetViewport2(LPDIRECT3DVIEWPORT2 iface,
/*******************************************************************************
* IDirect3DViewport1/2 VTable
*/
static ICOM_VTABLE(IDirect3DViewport2) viewport2_vtable =
static ICOM_VTABLE(IDirect3DViewport2) viewport2_vtable =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
/*** IUnknown methods ***/

View File

@ -54,7 +54,7 @@ HRESULT WINAPI DirectDrawCreateClipper(
ICOM_INIT_INTERFACE(This, IDirectDrawClipper, DDRAW_Clipper_VTable);
This->ref = 1;
This->hWnd = 0;
This->hWnd = 0;
This->ddraw_owner = NULL;
*lplpDDClipper = ICOM_INTERFACE(This, IDirectDrawClipper);
@ -87,7 +87,7 @@ HRESULT WINAPI Main_DirectDrawClipper_SetHwnd(
TRACE("(%p)->SetHwnd(0x%08lx,0x%08lx)\n",This,dwFlags,(DWORD)hWnd);
if( dwFlags ) {
FIXME("dwFlags = 0x%08lx, not supported.\n",dwFlags);
return DDERR_INVALIDPARAMS;
return DDERR_INVALIDPARAMS;
}
This->hWnd = hWnd;
@ -170,7 +170,7 @@ HRESULT WINAPI Main_DirectDrawClipper_GetHWnd(
ICOM_THIS(IDirectDrawClipperImpl,iface);
FIXME("(%p)->(%p),stub!\n",This,hWndPtr);
*hWndPtr = This->hWnd;
*hWndPtr = This->hWnd;
return DD_OK;
}

View File

@ -47,7 +47,7 @@ static DDVERSIONDATA hal_version;
static DD32BITDRIVERDATA hal_driverdata;
static HINSTANCE hal_instance;
static const DDDEVICEIDENTIFIER2 hal_device =
static const DDDEVICEIDENTIFIER2 hal_device =
{
"display",
"DirectDraw HAL",
@ -501,7 +501,7 @@ HAL_DirectDraw_SetDisplayMode(LPDIRECTDRAW7 iface, DWORD dwWidth,
TRACE("(%p)->(%ldx%ldx%ld,%ld Hz,%08lx)\n",This,dwWidth,dwHeight,dwBPP,dwRefreshRate,dwFlags);
hr = User_DirectDraw_SetDisplayMode(iface, dwWidth, dwHeight, dwBPP,
dwRefreshRate, dwFlags);
dwRefreshRate, dwFlags);
if (SUCCEEDED(hr)) {
if (!(dd_gbl.dwFlags & DDRAWI_MODECHANGED)) dd_gbl.dwModeIndexOrig = dd_gbl.dwModeIndex;

View File

@ -50,11 +50,11 @@ HRESULT HAL_DirectDraw_create_texture(IDirectDrawImpl* This,
LPDIRECTDRAWSURFACE7* ppSurf,
LPUNKNOWN pOuter,
DWORD dwMipMapLevel);
HRESULT HAL_DirectDraw_Construct(IDirectDrawImpl *This, BOOL ex);
HRESULT HAL_DirectDraw_Create(const GUID* pGUID, LPDIRECTDRAW7* pIface,
IUnknown* pUnkOuter, BOOL ex);
HRESULT WINAPI
HAL_DirectDraw_GetDeviceIdentifier(LPDIRECTDRAW7 iface,

View File

@ -915,11 +915,11 @@ Main_DirectDraw_SetCooperativeLevel(LPDIRECTDRAW7 iface, HWND hwnd,
return DD_OK;
/* XXX "It cannot be reset while the process has surfaces or palettes
* created." Otherwise the window can be changed???
*
* created." Otherwise the window can be changed???
*
* This appears to be wrong - comment it out for now.
if (This->window)
return DDERR_HWNDALREADYSET;
return DDERR_HWNDALREADYSET;
*/
if (!(cooplevel & (DDSCL_EXCLUSIVE|DDSCL_NORMAL)))
@ -965,7 +965,7 @@ Main_DirectDraw_SetDisplayMode(LPDIRECTDRAW7 iface, DWORD dwWidth,
{
short screenX;
short screenY;
ICOM_THIS(IDirectDrawImpl,iface);
TRACE("(%p)->SetDisplayMode(%ld,%ld)\n",This,dwWidth,dwHeight);
@ -980,14 +980,14 @@ Main_DirectDraw_SetDisplayMode(LPDIRECTDRAW7 iface, DWORD dwWidth,
screenX = GetSystemMetrics(SM_CXSCREEN);
screenY = GetSystemMetrics(SM_CYSCREEN);
This->width = dwWidth;
This->height = dwHeight;
This->pitch = lPitch;
This->pixelformat = *pixelformat;
/* Position the window in the center of the screen - don't center for now */
/* MoveWindow(This->window, (screenX-dwWidth)/2, (screenY-dwHeight)/2,
/* MoveWindow(This->window, (screenX-dwWidth)/2, (screenY-dwHeight)/2,
dwWidth, dwHeight, TRUE);*/
MoveWindow(This->window, 0, 0, dwWidth, dwHeight, TRUE);
@ -1208,7 +1208,7 @@ LosePrimarySurface(IDirectDrawImpl *This)
/******************************************************************************
* Uninitialised DirectDraw functions
*
*
* This vtable is used when a DirectDraw object is created with
* CoCreateInstance. The only usable method is Initialize.
*/

View File

@ -202,7 +202,7 @@ IDirectDrawImpl_CreateSurface(LPDIRECTDRAW This, LPDDSURFACEDESC pSDesc,
LPDIRECTDRAWSURFACE7 pSurface7;
HRESULT hr;
/* the LPDDSURFACEDESC -> LPDDSURFACEDESC2 conversion should be ok,
/* the LPDDSURFACEDESC -> LPDDSURFACEDESC2 conversion should be ok,
* since the data layout is the same */
hr = IDirectDraw7_CreateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
IDirectDraw,
@ -387,7 +387,7 @@ EnumSurfacesCallbackThunk(LPDIRECTDRAWSURFACE7 pSurf, LPDDSURFACEDESC2 pDDSD,
/* This coercion is safe, since the IDirectDrawSurface3 vtable has the
* IDirectDrawSurface vtable layout at the beginning */
return cbcontext->func((LPDIRECTDRAWSURFACE)
return cbcontext->func((LPDIRECTDRAWSURFACE)
COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
IDirectDrawSurface7,
IDirectDrawSurface3, pSurf),

View File

@ -37,7 +37,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ddraw);
static ICOM_VTABLE(IDirectDraw7) User_DirectDraw_VTable;
static const DDDEVICEIDENTIFIER2 user_device =
static const DDDEVICEIDENTIFIER2 user_device =
{
"display",
"User (and GDI)",
@ -48,7 +48,7 @@ static const DDDEVICEIDENTIFIER2 user_device =
0
};
static const DDPIXELFORMAT pixelformats[] =
static const DDPIXELFORMAT pixelformats[] =
{
/* 8bpp paletted */
{ sizeof(DDPIXELFORMAT), DDPF_RGB|DDPF_PALETTEINDEXED8, 0, { 8 } },
@ -409,7 +409,7 @@ User_DirectDraw_GetCaps(LPDIRECTDRAW7 iface, LPDDCAPS pDriverCaps,
#define ROPS { 0, }
#endif
static const DDCAPS caps =
static const DDCAPS caps =
{ sizeof(DDCAPS),
DDCAPS_3D | DDCAPS_GDI | DDCAPS_PALETTE | BLIT_CAPS,
DDCAPS2_CANMANAGETEXTURE | DDCAPS2_CANRENDERWINDOWED | DDCAPS2_CERTIFIED
@ -484,7 +484,7 @@ User_DirectDraw_GetCaps(LPDIRECTDRAW7 iface, LPDDCAPS pDriverCaps,
#undef ROPS
ICOM_THIS(IDirectDrawImpl, iface);
TRACE("(%p)->(%p,%p)\n",This,pDriverCaps,pHELCaps);
if (pDriverCaps != NULL)

View File

@ -139,7 +139,7 @@ struct IDirectDrawImpl
HRESULT (*create_zbuffer)(IDirectDrawImpl* This,
const DDSURFACEDESC2* pDDSD,
LPDIRECTDRAWSURFACE7* ppSurf, LPUNKNOWN pOuter);
LPVOID private;
/* Everything below here is still questionable. */
@ -281,7 +281,7 @@ struct IDirectDrawSurfaceImpl
BOOL (*aux_flip)(LPVOID ctx, LPVOID data);
void (*aux_unlock)(LPVOID ctx, LPVOID data, LPRECT lpRect);
struct IDirect3DTexture2Impl* texture;
HRESULT (WINAPI *SetColorKey_cb)(struct IDirect3DTexture2Impl *texture, DWORD dwFlags, LPDDCOLORKEY ckey ) ;
HRESULT (WINAPI *SetColorKey_cb)(struct IDirect3DTexture2Impl *texture, DWORD dwFlags, LPDDCOLORKEY ckey ) ;
};
/*****************************************************************************

View File

@ -167,7 +167,7 @@ static ICOM_VTABLE(IDirect3D) WINE_UNUSED d3dvt = {
* IDirect3D2
*/
HRESULT WINAPI IDirect3D2Impl_QueryInterface(
LPDIRECT3D2 iface,REFIID refiid,LPVOID *obj) {
LPDIRECT3D2 iface,REFIID refiid,LPVOID *obj) {
ICOM_THIS(IDirect3D2Impl,iface);
/* FIXME: Not sure if this is correct */
@ -180,7 +180,7 @@ HRESULT WINAPI IDirect3D2Impl_QueryInterface(
IDirect3D2_AddRef(iface);
TRACE(" Creating IDirectDrawX interface (%p)\n", *obj);
return S_OK;
}
if ( ( IsEqualGUID( &IID_IDirect3D2, refiid ) ) ||
@ -280,7 +280,7 @@ HRESULT WINAPI IDirect3D2Impl_CreateDevice(
/* This is for checking the correctness of the prototypes/functions.
* Do not remove.
*/
static ICOM_VTABLE(IDirect3D2) WINE_UNUSED d3d2vt =
static ICOM_VTABLE(IDirect3D2) WINE_UNUSED d3d2vt =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirect3D2Impl_QueryInterface,

View File

@ -148,7 +148,7 @@ static HRESULT WINAPI MESA_IDirect3DImpl_FindDevice(
return D3D_OK;
}
ICOM_VTABLE(IDirect3D) mesa_d3dvt =
ICOM_VTABLE(IDirect3D) mesa_d3dvt =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
MESA_IDirect3DImpl_QueryInterface,
@ -166,7 +166,7 @@ ICOM_VTABLE(IDirect3D) mesa_d3dvt =
* IDirect3D2
*/
static HRESULT WINAPI MESA_IDirect3D2Impl_QueryInterface(
LPDIRECT3D2 iface,REFIID refiid,LPVOID *obj) {
LPDIRECT3D2 iface,REFIID refiid,LPVOID *obj) {
ICOM_THIS(IDirect3D2Impl,iface);
/* FIXME: Not sure if this is correct */
@ -179,7 +179,7 @@ static HRESULT WINAPI MESA_IDirect3D2Impl_QueryInterface(
IDirect3D2_AddRef(iface);
TRACE(" Creating IDirectDrawX interface (%p)\n", *obj);
return S_OK;
}
if ( ( IsEqualGUID( &IID_IDirect3D2, refiid ) ) ||
@ -292,7 +292,7 @@ static HRESULT WINAPI MESA_IDirect3D2Impl_CreateDevice(
return DDERR_INVALIDPARAMS;
}
ICOM_VTABLE(IDirect3D2) mesa_d3d2vt =
ICOM_VTABLE(IDirect3D2) mesa_d3d2vt =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
MESA_IDirect3D2Impl_QueryInterface,
@ -405,7 +405,7 @@ HRESULT create_direct3d3(LPVOID *obj,IDirectDrawImpl* ddraw) {
*obj = (LPUNKNOWN)d3d;
TRACE(" Creating IDirect3D3 interface (%p)\n", *obj);
return S_OK;
}

View File

@ -194,7 +194,7 @@ static void Main_DirectDrawPalette_Destroy(IDirectDrawPaletteImpl* This)
if (This->private != This+1)
HeapFree(GetProcessHeap(), 0, This->private);
HeapFree(GetProcessHeap(),0,This);
}
@ -244,7 +244,7 @@ Main_DirectDrawPalette_GetCaps(LPDIRECTDRAWPALETTE iface, LPDWORD lpdwCaps)
*lpdwCaps = This->flags;
return DD_OK;
}
}
HRESULT WINAPI
Main_DirectDrawPalette_QueryInterface(LPDIRECTDRAWPALETTE iface,

View File

@ -455,7 +455,7 @@ DIB_DirectDrawSurface_Blt(LPDIRECTDRAWSURFACE7 iface, LPRECT rdst,
break;
case SRCCOPY: /* well, we do that below ? */
break;
default:
default:
FIXME("Unsupported raster op: %08lx Pattern: %p\n", lpbltfx->dwROP, lpbltfx->u5.lpDDSPattern);
goto error;
}
@ -623,7 +623,7 @@ DIB_DirectDrawSurface_BltFast(LPDIRECTDRAWSURFACE7 iface, DWORD dstx,
else
FIXME(" srcrect: NULL\n");
}
/* We need to lock the surfaces, or we won't get refreshes when done. */
sdesc.dwSize = sizeof(sdesc);
IDirectDrawSurface7_Lock(src, NULL,&sdesc,DDLOCK_READONLY, 0);
@ -824,7 +824,7 @@ DIB_DirectDrawSurface_Restore(LPDIRECTDRAWSURFACE7 iface)
/* SetOverlayPosition: generic */
void DIB_DirectDrawSurface_set_palette(IDirectDrawSurfaceImpl* This,
IDirectDrawPaletteImpl* pal)
IDirectDrawPaletteImpl* pal)
{
if (!pal) return;
if (This->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)

View File

@ -36,7 +36,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ddraw);
static HRESULT WINAPI
DirectDrawGammaControl_QueryInterface(LPDIRECTDRAWGAMMACONTROL iface, REFIID riid,
LPVOID *ppObj)
LPVOID *ppObj)
{
TRACE("(%p)->(%s,%p)\n", iface, debugstr_guid(riid), ppObj);
return E_NOINTERFACE;
@ -47,13 +47,13 @@ DirectDrawGammaControl_AddRef(LPDIRECTDRAWGAMMACONTROL iface)
{
return IDirectDrawSurface7_AddRef(CONVERT(iface));
}
static ULONG WINAPI
DirectDrawGammaControl_Release(LPDIRECTDRAWGAMMACONTROL iface)
{
return IDirectDrawSurface7_Release(CONVERT(iface));
}
static HRESULT WINAPI
DirectDrawGammaControl_GetGammaRamp(LPDIRECTDRAWGAMMACONTROL iface, DWORD dwFlags, LPDDGAMMARAMP lpGammaRamp)
{

View File

@ -107,7 +107,7 @@ HAL_DirectDrawSurface_Construct(IDirectDrawSurfaceImpl* This,
/* the driver may want to dereference these pointers */
This->local.lpSurfMore = &This->more;
This->local.lpGbl = &This->global;
This->local.lpGbl = &This->global;
This->gmore = &This->global_more;
if (This->surface_desc.ddsCaps.dwCaps & DDSCAPS_TEXTURE) {
@ -229,7 +229,7 @@ HRESULT HAL_DirectDrawSurface_late_allocate(IDirectDrawSurfaceImpl* This)
}
void HAL_DirectDrawSurface_set_palette(IDirectDrawSurfaceImpl* This,
IDirectDrawPaletteImpl* pal)
IDirectDrawPaletteImpl* pal)
{
LPDDRAWI_DIRECTDRAW_GBL dd_gbl = This->more.lpDD_lcl->lpGbl;
DDHAL_SETPALETTEDATA data;

View File

@ -480,7 +480,7 @@ Main_DirectDrawSurface_Flip(LPDIRECTDRAWSURFACE7 iface,
/* MSDN: "The method fails if the specified [override] surface is not
* a member of the flipping chain." */
/* Verify that override is on this flip chain. We assume that
* surf is the head of the flipping chain, because it's the front
* buffer. */
@ -575,8 +575,8 @@ Main_DirectDrawSurface_GetAttachedSurface(LPDIRECTDRAWSURFACE7 iface,
if (found != NULL)
{
FIXME("More than one attached surface matches requested caps. What should we do here?\n");
/* Previous code returned 'DDERR_NOTFOUND'. That appears not
to be correct, given what 3DMark expects from MipMapped surfaces.
/* Previous code returned 'DDERR_NOTFOUND'. That appears not
to be correct, given what 3DMark expects from MipMapped surfaces.
We shall just continue instead. */
}
@ -846,12 +846,12 @@ Main_DirectDrawSurface_GetSurfaceDesc(LPDIRECTDRAWSURFACE7 iface,
ICOM_THIS(IDirectDrawSurfaceImpl, iface);
TRACE("(%p)->(%p)\n",This,pDDSD);
if ((pDDSD->dwSize < sizeof(DDSURFACEDESC)) ||
if ((pDDSD->dwSize < sizeof(DDSURFACEDESC)) ||
(pDDSD->dwSize > sizeof(DDSURFACEDESC2))) {
ERR("Impossible/Strange struct size %ld.\n",pDDSD->dwSize);
return DDERR_GENERIC;
}
DD_STRUCT_COPY_BYSIZE(pDDSD,&This->surface_desc);
return DD_OK;
}
@ -920,7 +920,7 @@ Main_DirectDrawSurface_Lock(LPDIRECTDRAWSURFACE7 iface, LPRECT prect,
}
This->lock_update(This, prect, flags);
pDDSD->lpSurface = (char *)This->surface_desc.lpSurface
+ prect->top * This->surface_desc.u1.lPitch
+ prect->left * GET_BPP(This->surface_desc);

View File

@ -210,7 +210,7 @@ void User_DirectDrawSurface_unlock_update(IDirectDrawSurfaceImpl* This,
}
void User_DirectDrawSurface_set_palette(IDirectDrawSurfaceImpl* This,
IDirectDrawPaletteImpl* pal)
IDirectDrawPaletteImpl* pal)
{
USER_PRIV_VAR(priv, This);

View File

@ -153,7 +153,7 @@ void DDRAW_dump_DDBLT(DWORD flagmask)
void DDRAW_dump_DDSCAPS(const DDSCAPS2 *in)
{
static const flag_info flags[] =
static const flag_info flags[] =
{
FE(DDSCAPS_RESERVED1),
FE(DDSCAPS_ALPHA),

View File

@ -49,7 +49,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ddraw);
typedef struct {
LPVOID lpCallback;
LPVOID lpContext;
LPVOID lpContext;
} DirectDrawEnumerateProcData;
/***********************************************************************
@ -104,7 +104,7 @@ HRESULT WINAPI DirectDrawEnumerateExA(
*/
static BOOL CALLBACK DirectDrawEnumerateExProcW(
GUID *lpGUID, LPSTR lpDriverDescription, LPSTR lpDriverName,
GUID *lpGUID, LPSTR lpDriverDescription, LPSTR lpDriverName,
LPVOID lpContext, HMONITOR hm)
{
INT len;
@ -143,7 +143,7 @@ HRESULT WINAPI DirectDrawEnumerateExW(
*/
static BOOL CALLBACK DirectDrawEnumerateProcA(
GUID *lpGUID, LPSTR lpDriverDescription, LPSTR lpDriverName,
GUID *lpGUID, LPSTR lpDriverDescription, LPSTR lpDriverName,
LPVOID lpContext, HMONITOR hm)
{
DirectDrawEnumerateProcData *pEPD = (DirectDrawEnumerateProcData*)lpContext;
@ -153,9 +153,9 @@ static BOOL CALLBACK DirectDrawEnumerateProcA(
}
HRESULT WINAPI DirectDrawEnumerateA(
LPDDENUMCALLBACKA lpCallback, LPVOID lpContext)
LPDDENUMCALLBACKA lpCallback, LPVOID lpContext)
{
DirectDrawEnumerateProcData epd;
DirectDrawEnumerateProcData epd;
epd.lpCallback = (LPVOID) lpCallback;
epd.lpContext = lpContext;
@ -167,17 +167,17 @@ HRESULT WINAPI DirectDrawEnumerateA(
*/
static BOOL WINAPI DirectDrawEnumerateProcW(
GUID *lpGUID, LPWSTR lpDriverDescription, LPWSTR lpDriverName,
GUID *lpGUID, LPWSTR lpDriverDescription, LPWSTR lpDriverName,
LPVOID lpContext, HMONITOR hm)
{
DirectDrawEnumerateProcData *pEPD = (DirectDrawEnumerateProcData*)lpContext;
return ((LPDDENUMCALLBACKW) pEPD->lpCallback)(
lpGUID, lpDriverDescription, lpDriverName, pEPD->lpContext);
}
HRESULT WINAPI DirectDrawEnumerateW(
LPDDENUMCALLBACKW lpCallback, LPVOID lpContext)
LPDDENUMCALLBACKW lpCallback, LPVOID lpContext)
{
DirectDrawEnumerateProcData epd;
epd.lpCallback = (LPVOID) lpCallback;
@ -341,7 +341,7 @@ static const struct object_creation_info object_creation[] =
{ &CLSID_DirectDrawClipper, DDRAW_CreateDirectDrawClipper }
};
static HRESULT WINAPI
static HRESULT WINAPI
DDCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
ICOM_THIS(IClassFactoryImpl,iface);
@ -391,7 +391,7 @@ static HRESULT WINAPI DDCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
return S_OK;
}
static ICOM_VTABLE(IClassFactory) DDCF_Vtbl =
static ICOM_VTABLE(IClassFactory) DDCF_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
DDCF_QueryInterface,

View File

@ -29,7 +29,7 @@
#include "mesa_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(ddraw);
#define D3DTPRIVATE(x) mesa_d3dt_private *dtpriv = (mesa_d3dt_private*)(x)->private
void set_render_state(D3DRENDERSTATETYPE dwRenderStateType,
@ -40,25 +40,25 @@ void set_render_state(D3DRENDERSTATETYPE dwRenderStateType,
_dump_renderstate(dwRenderStateType, dwRenderState);
/* First, all the stipple patterns */
if ((dwRenderStateType >= D3DRENDERSTATE_STIPPLEPATTERN00) &&
if ((dwRenderStateType >= D3DRENDERSTATE_STIPPLEPATTERN00) &&
(dwRenderStateType <= D3DRENDERSTATE_STIPPLEPATTERN31)) {
ERR("Unhandled dwRenderStateType stipple %d!\n",dwRenderStateType);
} else {
ENTER_GL();
/* All others state variables */
switch (dwRenderStateType) {
case D3DRENDERSTATE_TEXTUREHANDLE: { /* 1 */
IDirect3DTexture2Impl* tex = (IDirect3DTexture2Impl*) dwRenderState;
if (tex == NULL) {
glBindTexture(GL_TEXTURE_2D, 0);
glDisable(GL_TEXTURE_2D);
TRACE("disabling texturing\n");
} else {
D3DTPRIVATE(tex);
glEnable(GL_TEXTURE_2D);
/* Default parameters */
glBindTexture(GL_TEXTURE_2D, dtpriv->tex_name);
@ -76,14 +76,14 @@ void set_render_state(D3DRENDERSTATETYPE dwRenderStateType,
else
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
break;
case D3DRENDERSTATE_ZENABLE: /* 7 */
if (dwRenderState)
glEnable(GL_DEPTH_TEST);
else
glDisable(GL_DEPTH_TEST);
break;
case D3DRENDERSTATE_FILLMODE: /* 8 */
switch ((D3DFILLMODE) dwRenderState) {
case D3DFILL_SOLID:
@ -108,24 +108,24 @@ void set_render_state(D3DRENDERSTATETYPE dwRenderStateType,
ERR("Unhandled shade mode !\n");
}
break;
case D3DRENDERSTATE_ZWRITEENABLE: /* 14 */
if (dwRenderState)
glDepthMask(GL_TRUE);
else
glDepthMask(GL_FALSE);
break;
case D3DRENDERSTATE_TEXTUREMAG: /* 17 */
switch ((D3DTEXTUREFILTER) dwRenderState) {
case D3DFILTER_NEAREST:
rs->mag = GL_NEAREST;
break;
case D3DFILTER_LINEAR:
rs->mag = GL_LINEAR;
break;
default:
ERR("Unhandled texture mag !\n");
}
@ -136,16 +136,16 @@ void set_render_state(D3DRENDERSTATETYPE dwRenderStateType,
case D3DFILTER_NEAREST:
rs->min = GL_NEAREST;
break;
case D3DFILTER_LINEAR:
rs->mag = GL_LINEAR;
break;
default:
ERR("Unhandled texture min !\n");
}
break;
case D3DRENDERSTATE_SRCBLEND: /* 19 */
switch ((D3DBLEND) dwRenderState) {
case D3DBLEND_SRCALPHA:
@ -155,20 +155,20 @@ void set_render_state(D3DRENDERSTATETYPE dwRenderStateType,
default:
ERR("Unhandled blend mode !\n");
}
glBlendFunc(rs->src, rs->dst);
break;
case D3DRENDERSTATE_DESTBLEND: /* 20 */
switch ((D3DBLEND) dwRenderState) {
case D3DBLEND_INVSRCALPHA:
rs->dst = GL_ONE_MINUS_SRC_ALPHA;
break;
default:
ERR("Unhandled blend mode !\n");
}
glBlendFunc(rs->src, rs->dst);
break;
@ -183,28 +183,28 @@ void set_render_state(D3DRENDERSTATETYPE dwRenderStateType,
ERR("Unhandled texture environment !\n");
}
break;
case D3DRENDERSTATE_CULLMODE: /* 22 */
switch ((D3DCULL) dwRenderState) {
case D3DCULL_NONE:
glDisable(GL_CULL_FACE);
break;
case D3DCULL_CW:
glEnable(GL_CULL_FACE);
glFrontFace(GL_CW);
break;
case D3DCULL_CCW:
glEnable(GL_CULL_FACE);
glFrontFace(GL_CCW);
break;
default:
ERR("Unhandled cull mode !\n");
}
break;
case D3DRENDERSTATE_ZFUNC: /* 23 */
switch ((D3DCMPFUNC) dwRenderState) {
case D3DCMP_NEVER:
@ -236,14 +236,14 @@ void set_render_state(D3DRENDERSTATETYPE dwRenderStateType,
ERR("Unexpected value\n");
}
break;
case D3DRENDERSTATE_DITHERENABLE: /* 26 */
if (dwRenderState)
glEnable(GL_DITHER);
else
glDisable(GL_DITHER);
break;
case D3DRENDERSTATE_ALPHABLENDENABLE: /* 27 */
if (dwRenderState)
glEnable(GL_BLEND);
@ -260,7 +260,7 @@ void set_render_state(D3DRENDERSTATETYPE dwRenderStateType,
case D3DRENDERSTATE_FLUSHBATCH: /* 50 */
break;
default:
ERR("Unhandled dwRenderStateType %d!\n",dwRenderStateType);
break;

View File

@ -125,19 +125,19 @@ void fill_DataFormat(void *out, void *in, DataFormat *df) {
df->dt[i].offset_out, df->dt[i].offset_in, *((char *) (in_c + df->dt[i].offset_in)));
*((char *) (out_c + df->dt[i].offset_out)) = *((char *) (in_c + df->dt[i].offset_in));
break;
case 2:
TRACE("Copying (s) to %d from %d (value %d)\n",
df->dt[i].offset_out, df->dt[i].offset_in, *((short *) (in_c + df->dt[i].offset_in)));
*((short *) (out_c + df->dt[i].offset_out)) = *((short *) (in_c + df->dt[i].offset_in));
break;
case 4:
TRACE("Copying (i) to %d from %d (value %d)\n",
df->dt[i].offset_out, df->dt[i].offset_in, *((int *) (in_c + df->dt[i].offset_in)));
*((int *) (out_c + df->dt[i].offset_out)) = *((int *) (in_c + df->dt[i].offset_in));
break;
default:
memcpy((out_c + df->dt[i].offset_out), (in_c + df->dt[i].offset_in), df->dt[i].size);
}
@ -148,19 +148,19 @@ void fill_DataFormat(void *out, void *in, DataFormat *df) {
df->dt[i].offset_out, df->dt[i].value);
*((char *) (out_c + df->dt[i].offset_out)) = (char) df->dt[i].value;
break;
case 2:
TRACE("Copying (s) to %d default value %d\n",
df->dt[i].offset_out, df->dt[i].value);
*((short *) (out_c + df->dt[i].offset_out)) = (short) df->dt[i].value;
break;
case 4:
TRACE("Copying (i) to %d default value %d\n",
df->dt[i].offset_out, df->dt[i].value);
*((int *) (out_c + df->dt[i].offset_out)) = (int) df->dt[i].value;
break;
default:
memset((out_c + df->dt[i].offset_out), df->dt[i].size, 0);
}
@ -176,40 +176,40 @@ DataFormat *create_DataFormat(DIDATAFORMAT *wine_format, LPCDIDATAFORMAT asked_f
int same = 1;
int *done;
int index = 0;
ret = (DataFormat *) HeapAlloc(GetProcessHeap(), 0, sizeof(DataFormat));
done = (int *) HeapAlloc(GetProcessHeap(), 0, sizeof(int) * asked_format->dwNumObjs);
memset(done, 0, sizeof(int) * asked_format->dwNumObjs);
dt = (DataTransform *) HeapAlloc(GetProcessHeap(), 0, asked_format->dwNumObjs * sizeof(DataTransform));
TRACE("Creating DataTransform : \n");
for (i = 0; i < wine_format->dwNumObjs; i++) {
offset[i] = -1;
for (j = 0; j < asked_format->dwNumObjs; j++) {
if (done[j] == 1)
continue;
if (((asked_format->rgodf[j].pguid == NULL) || (IsEqualGUID(wine_format->rgodf[i].pguid, asked_format->rgodf[j].pguid)))
&&
(wine_format->rgodf[i].dwType & asked_format->rgodf[j].dwType)) {
done[j] = 1;
TRACE("Matching : \n");
TRACE("Matching : \n");
TRACE(" - Asked (%d) : %s - Ofs = %3ld - (Type = 0x%02x | Instance = %04x)\n",
j, debugstr_guid(asked_format->rgodf[j].pguid),
j, debugstr_guid(asked_format->rgodf[j].pguid),
asked_format->rgodf[j].dwOfs,
DIDFT_GETTYPE(asked_format->rgodf[j].dwType), DIDFT_GETINSTANCE(asked_format->rgodf[j].dwType));
TRACE(" - Wine (%d) : %s - Ofs = %3ld - (Type = 0x%02x | Instance = %04x)\n",
j, debugstr_guid(wine_format->rgodf[i].pguid),
j, debugstr_guid(wine_format->rgodf[i].pguid),
wine_format->rgodf[i].dwOfs,
DIDFT_GETTYPE(wine_format->rgodf[i].dwType), DIDFT_GETINSTANCE(wine_format->rgodf[i].dwType));
if (wine_format->rgodf[i].dwType & DIDFT_BUTTON)
dt[index].size = sizeof(BYTE);
else
@ -218,7 +218,7 @@ DataFormat *create_DataFormat(DIDATAFORMAT *wine_format, LPCDIDATAFORMAT asked_f
dt[index].offset_out = asked_format->rgodf[j].dwOfs;
dt[index].value = 0;
index++;
if (wine_format->rgodf[i].dwOfs != asked_format->rgodf[j].dwOfs)
same = 0;
@ -235,11 +235,11 @@ DataFormat *create_DataFormat(DIDATAFORMAT *wine_format, LPCDIDATAFORMAT asked_f
for (j = 0; j < asked_format->dwNumObjs; j++) {
if (done[j] == 0) {
TRACE(" - Asked (%d) : %s - Ofs = %3ld - (Type = 0x%02x | Instance = %04x)\n",
j, debugstr_guid(asked_format->rgodf[j].pguid),
j, debugstr_guid(asked_format->rgodf[j].pguid),
asked_format->rgodf[j].dwOfs,
DIDFT_GETTYPE(asked_format->rgodf[j].dwType), DIDFT_GETINSTANCE(asked_format->rgodf[j].dwType));
if (asked_format->rgodf[j].dwType & DIDFT_BUTTON)
dt[index].size = sizeof(BYTE);
else
@ -261,7 +261,7 @@ DataFormat *create_DataFormat(DIDATAFORMAT *wine_format, LPCDIDATAFORMAT asked_f
} else {
ret->dt = dt;
}
HeapFree(GetProcessHeap(), 0, done);
return ret;
@ -278,13 +278,13 @@ HRESULT WINAPI IDirectInputDevice2AImpl_SetDataFormat(
ICOM_THIS(IDirectInputDevice2AImpl,iface);
TRACE("(this=%p,%p)\n",This,df);
TRACE("df.dwSize=%ld\n",df->dwSize);
TRACE("(df.dwObjsize=%ld)\n",df->dwObjSize);
TRACE("(df.dwFlags=0x%08lx)\n",df->dwFlags);
TRACE("(df.dwDataSize=%ld)\n",df->dwDataSize);
TRACE("(df.dwNumObjs=%ld)\n",df->dwNumObjs);
for (i=0;i<df->dwNumObjs;i++) {
TRACE("df.rgodf[%d].guid %s\n",i,debugstr_guid(df->rgodf[i].pguid));
TRACE("df.rgodf[%d].dwOfs %ld\n",i,df->rgodf[i].dwOfs);
@ -367,10 +367,10 @@ HRESULT WINAPI IDirectInputDevice2AImpl_EnumObjects(
_dump_EnumObjects_flags(dwFlags);
DPRINTF("\n");
}
return DI_OK;
}
HRESULT WINAPI IDirectInputDevice2AImpl_GetProperty(
LPDIRECTINPUTDEVICE2A iface,
REFGUID rguid,
@ -378,10 +378,10 @@ HRESULT WINAPI IDirectInputDevice2AImpl_GetProperty(
{
FIXME("(this=%p,%s,%p): stub!\n",
iface, debugstr_guid(rguid), pdiph);
if (TRACE_ON(dinput))
_dump_DIPROPHEADER(pdiph);
return DI_OK;
}
@ -393,20 +393,20 @@ HRESULT WINAPI IDirectInputDevice2AImpl_GetObjectInfo(
{
FIXME("(this=%p,%p,%ld,0x%08lx): stub!\n",
iface, pdidoi, dwObj, dwHow);
return DI_OK;
}
HRESULT WINAPI IDirectInputDevice2AImpl_GetDeviceInfo(
LPDIRECTINPUTDEVICE2A iface,
LPDIDEVICEINSTANCEA pdidi)
{
FIXME("(this=%p,%p): stub!\n",
iface, pdidi);
return DI_OK;
}
HRESULT WINAPI IDirectInputDevice2AImpl_RunControlPanel(
LPDIRECTINPUTDEVICE2A iface,
HWND hwndOwner,
@ -414,10 +414,10 @@ HRESULT WINAPI IDirectInputDevice2AImpl_RunControlPanel(
{
FIXME("(this=%p,0x%08x,0x%08lx): stub!\n",
iface, hwndOwner, dwFlags);
return DI_OK;
}
HRESULT WINAPI IDirectInputDevice2AImpl_Initialize(
LPDIRECTINPUTDEVICE2A iface,
HINSTANCE hinst,
@ -428,7 +428,7 @@ HRESULT WINAPI IDirectInputDevice2AImpl_Initialize(
iface, hinst, dwVersion, debugstr_guid(rguid));
return DI_OK;
}
/******************************************************************************
* IDirectInputDevice2A
*/
@ -453,7 +453,7 @@ HRESULT WINAPI IDirectInputDevice2AImpl_EnumEffects(
{
FIXME("(this=%p,%p,%p,0x%08lx): stub!\n",
iface, lpCallback, lpvRef, dwFlags);
if (lpCallback)
lpCallback(NULL, lpvRef);
return DI_OK;
@ -525,7 +525,7 @@ HRESULT WINAPI IDirectInputDevice2AImpl_SendDeviceData(
{
FIXME("(this=%p,0x%08lx,%p,%p,0x%08lx): stub!\n",
iface, cbObjectData, rgdod, pdwInOut, dwFlags);
return DI_OK;
}
@ -547,6 +547,6 @@ HRESULT WINAPI IDirectInputDevice7AImpl_WriteEffectToFile(LPDIRECTINPUTDEVICE7A
DWORD dwFlags)
{
FIXME("(%p)->(%s,%08lx,%p,%08lx): stub !\n", iface, lpszFileName, dwEntries, rgDiFileEft, dwFlags);
return DI_OK;
}

Some files were not shown because too many files have changed in this diff Show More