diff options
author | XhmikosR <xhmikosr@users.sourceforge.net> | 2012-06-13 13:05:30 +0400 |
---|---|---|
committer | XhmikosR <xhmikosr@users.sourceforge.net> | 2012-06-13 13:05:30 +0400 |
commit | 0b9ec9a361f62ce15fc58763ca8b533afe405973 (patch) | |
tree | 02fb318875748db7e28f0b303d9907e58d69ca8c /src/filters/InternalPropertyPage.cpp | |
parent | d3b052fb035d8b242e4b328722f4ed7ac84ee20c (diff) |
apply the new astyle command; use 4 spaces for indentation and k&r style
Note: if you have any local patches just run astyle.bat
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@5110 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/InternalPropertyPage.cpp')
-rw-r--r-- | src/filters/InternalPropertyPage.cpp | 360 |
1 files changed, 180 insertions, 180 deletions
diff --git a/src/filters/InternalPropertyPage.cpp b/src/filters/InternalPropertyPage.cpp index 51f91cf70..a7ef8c39a 100644 --- a/src/filters/InternalPropertyPage.cpp +++ b/src/filters/InternalPropertyPage.cpp @@ -30,75 +30,75 @@ //
CInternalPropertyPageWnd::CInternalPropertyPageWnd()
- : m_fDirty(false)
- , m_fontheight(13)
+ : m_fDirty(false)
+ , m_fontheight(13)
{
}
BOOL CInternalPropertyPageWnd::Create(IPropertyPageSite* pPageSite, LPCRECT pRect, CWnd* pParentWnd)
{
- if (!pPageSite || !pRect) {
- return FALSE;
- }
-
- m_pPageSite = pPageSite;
-
- if (!m_font.m_hObject) {
- CString face;
- WORD height;
- extern BOOL AFXAPI AfxGetPropSheetFont(CString& strFace, WORD& wSize, BOOL bWizard); // yay
- if (!AfxGetPropSheetFont(face, height, FALSE)) {
- return FALSE;
- }
-
- LOGFONT lf;
- memset(&lf, 0, sizeof(lf));
- _tcscpy_s(lf.lfFaceName, face);
- HDC hDC = ::GetDC(0);
- lf.lfHeight = -MulDiv(height, GetDeviceCaps(hDC, LOGPIXELSY), 72);
- ::ReleaseDC(0, hDC);
- lf.lfWeight = FW_NORMAL;
- lf.lfCharSet = DEFAULT_CHARSET;
- if (!m_font.CreateFontIndirect(&lf)) {
- return FALSE;
- }
-
- lf.lfHeight -= -1;
- _tcscpy_s(lf.lfFaceName, _T("Lucida Console"));
- if (!m_monospacefont.CreateFontIndirect(&lf)) {
- _tcscpy_s(lf.lfFaceName, _T("Courier New"));
- if (!m_monospacefont.CreateFontIndirect(&lf)) {
- return FALSE;
- }
- }
-
- hDC = ::GetDC(0);
- HFONT hFontOld = (HFONT)::SelectObject(hDC, m_font.m_hObject);
- CSize size;
- ::GetTextExtentPoint32(hDC, _T("x"), 1, &size);
- ::SelectObject(hDC, hFontOld);
- ::ReleaseDC(0, hDC);
-
- m_fontheight = size.cy;
- }
-
- LPCTSTR wc = AfxRegisterWndClass(CS_VREDRAW|CS_HREDRAW|CS_DBLCLKS, 0, (HBRUSH)(COLOR_BTNFACE + 1));
- if (!CreateEx(0, wc, _T("CInternalPropertyPageWnd"), WS_CHILDWINDOW, *pRect, pParentWnd, 0)) {
- return FALSE;
- }
-
- SetFont(&m_font);
-
- return TRUE;
+ if (!pPageSite || !pRect) {
+ return FALSE;
+ }
+
+ m_pPageSite = pPageSite;
+
+ if (!m_font.m_hObject) {
+ CString face;
+ WORD height;
+ extern BOOL AFXAPI AfxGetPropSheetFont(CString & strFace, WORD & wSize, BOOL bWizard); // yay
+ if (!AfxGetPropSheetFont(face, height, FALSE)) {
+ return FALSE;
+ }
+
+ LOGFONT lf;
+ memset(&lf, 0, sizeof(lf));
+ _tcscpy_s(lf.lfFaceName, face);
+ HDC hDC = ::GetDC(0);
+ lf.lfHeight = -MulDiv(height, GetDeviceCaps(hDC, LOGPIXELSY), 72);
+ ::ReleaseDC(0, hDC);
+ lf.lfWeight = FW_NORMAL;
+ lf.lfCharSet = DEFAULT_CHARSET;
+ if (!m_font.CreateFontIndirect(&lf)) {
+ return FALSE;
+ }
+
+ lf.lfHeight -= -1;
+ _tcscpy_s(lf.lfFaceName, _T("Lucida Console"));
+ if (!m_monospacefont.CreateFontIndirect(&lf)) {
+ _tcscpy_s(lf.lfFaceName, _T("Courier New"));
+ if (!m_monospacefont.CreateFontIndirect(&lf)) {
+ return FALSE;
+ }
+ }
+
+ hDC = ::GetDC(0);
+ HFONT hFontOld = (HFONT)::SelectObject(hDC, m_font.m_hObject);
+ CSize size;
+ ::GetTextExtentPoint32(hDC, _T("x"), 1, &size);
+ ::SelectObject(hDC, hFontOld);
+ ::ReleaseDC(0, hDC);
+
+ m_fontheight = size.cy;
+ }
+
+ LPCTSTR wc = AfxRegisterWndClass(CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS, 0, (HBRUSH)(COLOR_BTNFACE + 1));
+ if (!CreateEx(0, wc, _T("CInternalPropertyPageWnd"), WS_CHILDWINDOW, *pRect, pParentWnd, 0)) {
+ return FALSE;
+ }
+
+ SetFont(&m_font);
+
+ return TRUE;
}
BOOL CInternalPropertyPageWnd::OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
- if (message == WM_COMMAND || message == WM_HSCROLL || message == WM_VSCROLL) {
- SetDirty(true);
- }
+ if (message == WM_COMMAND || message == WM_HSCROLL || message == WM_VSCROLL) {
+ SetDirty(true);
+ }
- return __super::OnWndMsg(message, wParam, lParam, pResult);
+ return __super::OnWndMsg(message, wParam, lParam, pResult);
}
BEGIN_MESSAGE_MAP(CInternalPropertyPageWnd, CWnd)
@@ -109,225 +109,225 @@ END_MESSAGE_MAP() //
CInternalPropertyPage::CInternalPropertyPage(LPUNKNOWN lpunk, HRESULT* phr)
- : CUnknown(_T("CInternalPropertyPage"), lpunk)
- , m_pWnd(NULL)
+ : CUnknown(_T("CInternalPropertyPage"), lpunk)
+ , m_pWnd(NULL)
{
- if (phr) {
- *phr = S_OK;
- }
+ if (phr) {
+ *phr = S_OK;
+ }
}
CInternalPropertyPage::~CInternalPropertyPage()
{
- if (m_pWnd) {
- if (m_pWnd->m_hWnd) {
- ASSERT(0);
- m_pWnd->DestroyWindow();
- }
- delete m_pWnd;
- m_pWnd = NULL;
- }
+ if (m_pWnd) {
+ if (m_pWnd->m_hWnd) {
+ ASSERT(0);
+ m_pWnd->DestroyWindow();
+ }
+ delete m_pWnd;
+ m_pWnd = NULL;
+ }
}
STDMETHODIMP CInternalPropertyPage::NonDelegatingQueryInterface(REFIID riid, void** ppv)
{
- return
- QI2(IPropertyPage)
- __super::NonDelegatingQueryInterface(riid, ppv);
+ return
+ QI2(IPropertyPage)
+ __super::NonDelegatingQueryInterface(riid, ppv);
}
// IPropertyPage
STDMETHODIMP CInternalPropertyPage::SetPageSite(IPropertyPageSite* pPageSite)
{
- CAutoLock cAutoLock(this);
+ CAutoLock cAutoLock(this);
- if (pPageSite && m_pPageSite || !pPageSite && !m_pPageSite) {
- return E_UNEXPECTED;
- }
+ if (pPageSite && m_pPageSite || !pPageSite && !m_pPageSite) {
+ return E_UNEXPECTED;
+ }
- m_pPageSite = pPageSite;
+ m_pPageSite = pPageSite;
- return S_OK;
+ return S_OK;
}
STDMETHODIMP CInternalPropertyPage::Activate(HWND hwndParent, LPCRECT pRect, BOOL fModal)
{
- AFX_MANAGE_STATE(AfxGetStaticModuleState());
+ AFX_MANAGE_STATE(AfxGetStaticModuleState());
- CAutoLock cAutoLock(this);
+ CAutoLock cAutoLock(this);
- CheckPointer(pRect, E_POINTER);
+ CheckPointer(pRect, E_POINTER);
- if (!m_pWnd || m_pWnd->m_hWnd || m_pUnks.IsEmpty()) {
- return E_UNEXPECTED;
- }
+ if (!m_pWnd || m_pWnd->m_hWnd || m_pUnks.IsEmpty()) {
+ return E_UNEXPECTED;
+ }
- if (!m_pWnd->Create(m_pPageSite, pRect, CWnd::FromHandle(hwndParent))) {
- return E_OUTOFMEMORY;
- }
+ if (!m_pWnd->Create(m_pPageSite, pRect, CWnd::FromHandle(hwndParent))) {
+ return E_OUTOFMEMORY;
+ }
- if (!m_pWnd->OnActivate()) {
- m_pWnd->DestroyWindow();
- return E_FAIL;
- }
+ if (!m_pWnd->OnActivate()) {
+ m_pWnd->DestroyWindow();
+ return E_FAIL;
+ }
- m_pWnd->ModifyStyleEx(WS_EX_DLGMODALFRAME, WS_EX_CONTROLPARENT);
- m_pWnd->ShowWindow(SW_SHOWNORMAL);
+ m_pWnd->ModifyStyleEx(WS_EX_DLGMODALFRAME, WS_EX_CONTROLPARENT);
+ m_pWnd->ShowWindow(SW_SHOWNORMAL);
- return S_OK;
+ return S_OK;
}
STDMETHODIMP CInternalPropertyPage::Deactivate()
{
- AFX_MANAGE_STATE(AfxGetStaticModuleState());
+ AFX_MANAGE_STATE(AfxGetStaticModuleState());
- CAutoLock cAutoLock(this);
+ CAutoLock cAutoLock(this);
- if (!m_pWnd || !m_pWnd->m_hWnd) {
- return E_UNEXPECTED;
- }
+ if (!m_pWnd || !m_pWnd->m_hWnd) {
+ return E_UNEXPECTED;
+ }
- m_pWnd->OnDeactivate();
+ m_pWnd->OnDeactivate();
- m_pWnd->ModifyStyleEx(WS_EX_CONTROLPARENT, 0);
- m_pWnd->DestroyWindow();
+ m_pWnd->ModifyStyleEx(WS_EX_CONTROLPARENT, 0);
+ m_pWnd->DestroyWindow();
- return S_OK;
+ return S_OK;
}
STDMETHODIMP CInternalPropertyPage::GetPageInfo(PROPPAGEINFO* pPageInfo)
{
- CAutoLock cAutoLock(this);
+ CAutoLock cAutoLock(this);
- CheckPointer(pPageInfo, E_POINTER);
+ CheckPointer(pPageInfo, E_POINTER);
- LPOLESTR pszTitle;
- HRESULT hr = AMGetWideString(CStringW(GetWindowTitle()), &pszTitle);
- if (FAILED(hr)) {
- return hr;
- }
+ LPOLESTR pszTitle;
+ HRESULT hr = AMGetWideString(CStringW(GetWindowTitle()), &pszTitle);
+ if (FAILED(hr)) {
+ return hr;
+ }
- pPageInfo->cb = sizeof(PROPPAGEINFO);
- pPageInfo->pszTitle = pszTitle;
- pPageInfo->pszDocString = NULL;
- pPageInfo->pszHelpFile = NULL;
- pPageInfo->dwHelpContext = 0;
- pPageInfo->size = GetWindowSize();
+ pPageInfo->cb = sizeof(PROPPAGEINFO);
+ pPageInfo->pszTitle = pszTitle;
+ pPageInfo->pszDocString = NULL;
+ pPageInfo->pszHelpFile = NULL;
+ pPageInfo->dwHelpContext = 0;
+ pPageInfo->size = GetWindowSize();
- return S_OK;
+ return S_OK;
}
STDMETHODIMP CInternalPropertyPage::SetObjects(ULONG cObjects, LPUNKNOWN* ppUnk)
{
- CAutoLock cAutoLock(this);
+ CAutoLock cAutoLock(this);
- if (cObjects && m_pWnd || !cObjects && !m_pWnd) {
- return E_UNEXPECTED;
- }
+ if (cObjects && m_pWnd || !cObjects && !m_pWnd) {
+ return E_UNEXPECTED;
+ }
- m_pUnks.RemoveAll();
+ m_pUnks.RemoveAll();
- if (cObjects > 0) {
- CheckPointer(ppUnk, E_POINTER);
+ if (cObjects > 0) {
+ CheckPointer(ppUnk, E_POINTER);
- for (ULONG i = 0; i < cObjects; i++) {
- m_pUnks.AddTail(ppUnk[i]);
- }
+ for (ULONG i = 0; i < cObjects; i++) {
+ m_pUnks.AddTail(ppUnk[i]);
+ }
- m_pWnd = GetWindow();
- if (!m_pWnd) {
- return E_OUTOFMEMORY;
- }
+ m_pWnd = GetWindow();
+ if (!m_pWnd) {
+ return E_OUTOFMEMORY;
+ }
- if (!m_pWnd->OnConnect(m_pUnks)) {
- delete m_pWnd;
- m_pWnd = NULL;
+ if (!m_pWnd->OnConnect(m_pUnks)) {
+ delete m_pWnd;
+ m_pWnd = NULL;
- return E_FAIL;
- }
- } else {
- m_pWnd->OnDisconnect();
+ return E_FAIL;
+ }
+ } else {
+ m_pWnd->OnDisconnect();
- m_pWnd->DestroyWindow();
- delete m_pWnd;
- m_pWnd = NULL;
- }
+ m_pWnd->DestroyWindow();
+ delete m_pWnd;
+ m_pWnd = NULL;
+ }
- return S_OK;
+ return S_OK;
}
STDMETHODIMP CInternalPropertyPage::Show(UINT nCmdShow)
{
- AFX_MANAGE_STATE(AfxGetStaticModuleState());
+ AFX_MANAGE_STATE(AfxGetStaticModuleState());
- CAutoLock cAutoLock(this);
+ CAutoLock cAutoLock(this);
- if (!m_pWnd) {
- return E_UNEXPECTED;
- }
+ if (!m_pWnd) {
+ return E_UNEXPECTED;
+ }
- if ((nCmdShow != SW_SHOW) && (nCmdShow != SW_SHOWNORMAL) && (nCmdShow != SW_HIDE)) {
- return E_INVALIDARG;
- }
+ if ((nCmdShow != SW_SHOW) && (nCmdShow != SW_SHOWNORMAL) && (nCmdShow != SW_HIDE)) {
+ return E_INVALIDARG;
+ }
- m_pWnd->ShowWindow(nCmdShow);
- m_pWnd->Invalidate();
+ m_pWnd->ShowWindow(nCmdShow);
+ m_pWnd->Invalidate();
- return S_OK;
+ return S_OK;
}
STDMETHODIMP CInternalPropertyPage::Move(LPCRECT pRect)
{
- AFX_MANAGE_STATE(AfxGetStaticModuleState());
+ AFX_MANAGE_STATE(AfxGetStaticModuleState());
- CAutoLock cAutoLock(this);
+ CAutoLock cAutoLock(this);
- CheckPointer(pRect, E_POINTER);
+ CheckPointer(pRect, E_POINTER);
- if (!m_pWnd) {
- return E_UNEXPECTED;
- }
+ if (!m_pWnd) {
+ return E_UNEXPECTED;
+ }
- m_pWnd->MoveWindow(pRect, TRUE);
+ m_pWnd->MoveWindow(pRect, TRUE);
- return S_OK;
+ return S_OK;
}
STDMETHODIMP CInternalPropertyPage::IsPageDirty()
{
- CAutoLock cAutoLock(this);
+ CAutoLock cAutoLock(this);
- return m_pWnd && m_pWnd->GetDirty() ? S_OK : S_FALSE;
+ return m_pWnd && m_pWnd->GetDirty() ? S_OK : S_FALSE;
}
STDMETHODIMP CInternalPropertyPage::Apply()
{
- AFX_MANAGE_STATE(AfxGetStaticModuleState());
+ AFX_MANAGE_STATE(AfxGetStaticModuleState());
- CAutoLock cAutoLock(this);
+ CAutoLock cAutoLock(this);
- if (!m_pWnd || m_pUnks.IsEmpty() || !m_pPageSite) {
- return E_UNEXPECTED;
- }
+ if (!m_pWnd || m_pUnks.IsEmpty() || !m_pPageSite) {
+ return E_UNEXPECTED;
+ }
- if (m_pWnd->GetDirty() && m_pWnd->OnApply()) {
- m_pWnd->SetDirty(false);
- }
+ if (m_pWnd->GetDirty() && m_pWnd->OnApply()) {
+ m_pWnd->SetDirty(false);
+ }
- return S_OK;
+ return S_OK;
}
STDMETHODIMP CInternalPropertyPage::Help(LPCWSTR lpszHelpDir)
{
- CAutoLock cAutoLock(this);
+ CAutoLock cAutoLock(this);
- return E_NOTIMPL;
+ return E_NOTIMPL;
}
STDMETHODIMP CInternalPropertyPage::TranslateAccelerator(LPMSG lpMsg)
{
- CAutoLock cAutoLock(this);
+ CAutoLock cAutoLock(this);
- return E_NOTIMPL;
+ return E_NOTIMPL;
}
|