Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortetsuo55 <tetsuo55@users.sourceforge.net>2010-04-09 01:14:58 +0400
committertetsuo55 <tetsuo55@users.sourceforge.net>2010-04-09 01:14:58 +0400
commita9b7bf3fb3e1334d8defd05ca4cfae870b4912e5 (patch)
tree2dab453d94d5e003379a6cc895eceb84c80e23ec /src/apps/mplayerc/Monitors.cpp
parentaafd49a91f7c2fa9c7103971c16fa6e1b29e8bfd (diff)
astyle formatting cleanup to make the sourcecode more accessible
switch used: astyle --style=ansi --min-conditional-indent=0 --pad=oper --unpad=paren http://astyle.sourceforge.net/ git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1783 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/apps/mplayerc/Monitors.cpp')
-rw-r--r--src/apps/mplayerc/Monitors.cpp152
1 files changed, 76 insertions, 76 deletions
diff --git a/src/apps/mplayerc/Monitors.cpp b/src/apps/mplayerc/Monitors.cpp
index 0b9a31aa3..e06a0599d 100644
--- a/src/apps/mplayerc/Monitors.cpp
+++ b/src/apps/mplayerc/Monitors.cpp
@@ -30,171 +30,171 @@
CMonitors::CMonitors()
{
- // WARNING : GetSystemMetrics(SM_CMONITORS) return only visible display monitors, and EnumDisplayMonitors
- // enumerate visible and pseudo invisible monitors !!!
+ // WARNING : GetSystemMetrics(SM_CMONITORS) return only visible display monitors, and EnumDisplayMonitors
+ // enumerate visible and pseudo invisible monitors !!!
// m_MonitorArray.SetSize( GetMonitorCount() );
- ADDMONITOR addMonitor;
- addMonitor.pMonitors = &m_MonitorArray;
- addMonitor.currentIndex = 0;
+ ADDMONITOR addMonitor;
+ addMonitor.pMonitors = &m_MonitorArray;
+ addMonitor.currentIndex = 0;
- ::EnumDisplayMonitors( NULL, NULL, AddMonitorsCallBack, (LPARAM)&addMonitor );
+ ::EnumDisplayMonitors(NULL, NULL, AddMonitorsCallBack, (LPARAM)&addMonitor);
}
CMonitors::~CMonitors()
{
- for ( int i = 0; i < m_MonitorArray.GetSize(); i++ )
- delete m_MonitorArray.GetAt( i );
+ for(int i = 0; i < m_MonitorArray.GetSize(); i++)
+ delete m_MonitorArray.GetAt(i);
}
// CMonitors member functions
-BOOL CALLBACK CMonitors::AddMonitorsCallBack( HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData )
+BOOL CALLBACK CMonitors::AddMonitorsCallBack(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData)
{
- LPADDMONITOR pAddMonitor = (LPADDMONITOR)dwData;
+ LPADDMONITOR pAddMonitor = (LPADDMONITOR)dwData;
- CMonitor* pMonitor = DNew CMonitor;
- pMonitor->Attach( hMonitor );
+ CMonitor* pMonitor = DNew CMonitor;
+ pMonitor->Attach(hMonitor);
- pAddMonitor->pMonitors->Add( pMonitor );
- pAddMonitor->currentIndex++;
+ pAddMonitor->pMonitors->Add(pMonitor);
+ pAddMonitor->currentIndex++;
- return TRUE;
+ return TRUE;
}
//
// returns the primary monitor
CMonitor CMonitors::GetPrimaryMonitor()
{
- //the primary monitor always has its origin at 0,0
- HMONITOR hMonitor = ::MonitorFromPoint( CPoint( 0,0 ), MONITOR_DEFAULTTOPRIMARY );
- ASSERT( IsMonitor( hMonitor ) );
+ //the primary monitor always has its origin at 0,0
+ HMONITOR hMonitor = ::MonitorFromPoint(CPoint(0, 0), MONITOR_DEFAULTTOPRIMARY);
+ ASSERT(IsMonitor(hMonitor));
- CMonitor monitor;
- monitor.Attach( hMonitor );
- ASSERT( monitor.IsPrimaryMonitor() );
+ CMonitor monitor;
+ monitor.Attach(hMonitor);
+ ASSERT(monitor.IsPrimaryMonitor());
- return monitor;
+ return monitor;
}
//
// is the given handle a valid monitor handle
-BOOL CMonitors::IsMonitor( const HMONITOR hMonitor )
+BOOL CMonitors::IsMonitor(const HMONITOR hMonitor)
{
- if ( hMonitor == NULL )
- return FALSE;
+ if(hMonitor == NULL)
+ return FALSE;
- MATCHMONITOR match;
- match.target = hMonitor;
- match.foundMatch = FALSE;
+ MATCHMONITOR match;
+ match.target = hMonitor;
+ match.foundMatch = FALSE;
- ::EnumDisplayMonitors( NULL, NULL, FindMatchingMonitorHandle, (LPARAM)&match );
+ ::EnumDisplayMonitors(NULL, NULL, FindMatchingMonitorHandle, (LPARAM)&match);
- return match.foundMatch;
+ return match.foundMatch;
}
//this is the callback method that gets called via IsMontior
-BOOL CALLBACK CMonitors::FindMatchingMonitorHandle( HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData )
+BOOL CALLBACK CMonitors::FindMatchingMonitorHandle(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData)
{
- LPMATCHMONITOR pMatch = (LPMATCHMONITOR)dwData;
+ LPMATCHMONITOR pMatch = (LPMATCHMONITOR)dwData;
- if ( hMonitor == pMatch->target )
- {
- //found a monitor with the same handle we are looking for
- pMatch->foundMatch = TRUE;
- return FALSE; //stop enumerating
- }
+ if(hMonitor == pMatch->target)
+ {
+ //found a monitor with the same handle we are looking for
+ pMatch->foundMatch = TRUE;
+ return FALSE; //stop enumerating
+ }
- //haven't found a match yet
- pMatch->foundMatch = FALSE;
- return TRUE; //keep enumerating
+ //haven't found a match yet
+ pMatch->foundMatch = FALSE;
+ return TRUE; //keep enumerating
}
BOOL CMonitors::AllMonitorsShareDisplayFormat()
{
- return ::GetSystemMetrics( SM_SAMEDISPLAYFORMAT );
+ return ::GetSystemMetrics(SM_SAMEDISPLAYFORMAT);
}
//
// the number of monitors on the system
int CMonitors::GetMonitorCount()
-{
- return ::GetSystemMetrics(SM_CMONITORS);
+{
+ return ::GetSystemMetrics(SM_CMONITORS);
}
-CMonitor CMonitors::GetMonitor( const int index ) const
+CMonitor CMonitors::GetMonitor(const int index) const
{
#if _MFC_VER >= 0x0700
- ASSERT( index >= 0 && index < m_MonitorArray.GetCount() );
+ ASSERT(index >= 0 && index < m_MonitorArray.GetCount());
#else
- ASSERT( index >= 0 && index < m_MonitorArray.GetSize() );
+ ASSERT(index >= 0 && index < m_MonitorArray.GetSize());
#endif
- CMonitor* pMonitor = static_cast<CMonitor*>(m_MonitorArray.GetAt( index ));
+ CMonitor* pMonitor = static_cast<CMonitor*>(m_MonitorArray.GetAt(index));
- return *pMonitor;
+ return *pMonitor;
}
//
// returns the rectangle that is the union of all active monitors
-void CMonitors::GetVirtualDesktopRect( LPRECT lprc )
+void CMonitors::GetVirtualDesktopRect(LPRECT lprc)
{
- ::SetRect( lprc,
- ::GetSystemMetrics( SM_XVIRTUALSCREEN ),
- ::GetSystemMetrics( SM_YVIRTUALSCREEN ),
- ::GetSystemMetrics( SM_CXVIRTUALSCREEN ),
- ::GetSystemMetrics( SM_CYVIRTUALSCREEN ) );
-
+ ::SetRect(lprc,
+ ::GetSystemMetrics(SM_XVIRTUALSCREEN),
+ ::GetSystemMetrics(SM_YVIRTUALSCREEN),
+ ::GetSystemMetrics(SM_CXVIRTUALSCREEN),
+ ::GetSystemMetrics(SM_CYVIRTUALSCREEN));
+
}
//
// these methods determine wheter the given item is
// visible on any monitor
-BOOL CMonitors::IsOnScreen( const LPRECT lprc )
+BOOL CMonitors::IsOnScreen(const LPRECT lprc)
{
- return ::MonitorFromRect( lprc, MONITOR_DEFAULTTONULL ) != NULL;
+ return ::MonitorFromRect(lprc, MONITOR_DEFAULTTONULL) != NULL;
}
-BOOL CMonitors::IsOnScreen( const POINT pt )
+BOOL CMonitors::IsOnScreen(const POINT pt)
{
- return ::MonitorFromPoint( pt, MONITOR_DEFAULTTONULL ) != NULL;
+ return ::MonitorFromPoint(pt, MONITOR_DEFAULTTONULL) != NULL;
}
-BOOL CMonitors::IsOnScreen( const CWnd* pWnd )
+BOOL CMonitors::IsOnScreen(const CWnd* pWnd)
{
- return ::MonitorFromWindow( pWnd->GetSafeHwnd(), MONITOR_DEFAULTTONULL ) != NULL;
+ return ::MonitorFromWindow(pWnd->GetSafeHwnd(), MONITOR_DEFAULTTONULL) != NULL;
}
-CMonitor CMonitors::GetNearestMonitor( const LPRECT lprc )
+CMonitor CMonitors::GetNearestMonitor(const LPRECT lprc)
{
- CMonitor monitor;
- monitor.Attach( ::MonitorFromRect( lprc, MONITOR_DEFAULTTONEAREST ) );
+ CMonitor monitor;
+ monitor.Attach(::MonitorFromRect(lprc, MONITOR_DEFAULTTONEAREST));
- return monitor;
+ return monitor;
}
-CMonitor CMonitors::GetNearestMonitor( const POINT pt )
+CMonitor CMonitors::GetNearestMonitor(const POINT pt)
{
- CMonitor monitor;
- monitor.Attach( ::MonitorFromPoint( pt, MONITOR_DEFAULTTONEAREST ) );
+ CMonitor monitor;
+ monitor.Attach(::MonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST));
- return monitor;
+ return monitor;
}
-CMonitor CMonitors::GetNearestMonitor( const CWnd* pWnd )
+CMonitor CMonitors::GetNearestMonitor(const CWnd* pWnd)
{
- ASSERT( pWnd );
- ASSERT( ::IsWindow( pWnd->m_hWnd ) );
+ ASSERT(pWnd);
+ ASSERT(::IsWindow(pWnd->m_hWnd));
- CMonitor monitor;
- monitor.Attach( ::MonitorFromWindow( pWnd->GetSafeHwnd(), MONITOR_DEFAULTTONEAREST ) );
+ CMonitor monitor;
+ monitor.Attach(::MonitorFromWindow(pWnd->GetSafeHwnd(), MONITOR_DEFAULTTONEAREST));
- return monitor;
+ return monitor;
}