clean up (white spaces, spacing and parenthesis)
added a TODO about using kMaxWorkspaces in ScreenMode.cpp git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36242 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -231,6 +231,7 @@ ScreenMode::GetOriginalMode(screen_mode& mode, int32 workspace) const
|
|||||||
{
|
{
|
||||||
if (workspace == ~0)
|
if (workspace == ~0)
|
||||||
workspace = current_workspace();
|
workspace = current_workspace();
|
||||||
|
// TODO this should use kMaxWorkspaces
|
||||||
else if (workspace > 31)
|
else if (workspace > 31)
|
||||||
return B_BAD_INDEX;
|
return B_BAD_INDEX;
|
||||||
|
|
||||||
|
|||||||
@@ -18,8 +18,8 @@
|
|||||||
|
|
||||||
|
|
||||||
// prepare parameters so they recognized as tunneled settings
|
// prepare parameters so they recognized as tunneled settings
|
||||||
static void PrepareTunnel(
|
static void
|
||||||
display_mode *mode, display_mode *low, display_mode *high )
|
PrepareTunnel(display_mode *mode, display_mode *low, display_mode *high)
|
||||||
{
|
{
|
||||||
memset(mode, 0, sizeof(*mode));
|
memset(mode, 0, sizeof(*mode));
|
||||||
|
|
||||||
@@ -36,8 +36,8 @@ static void PrepareTunnel(
|
|||||||
|
|
||||||
|
|
||||||
// retrieve value of setting "code"
|
// retrieve value of setting "code"
|
||||||
static status_t GetSetting(
|
static status_t
|
||||||
BScreen *screen, uint16 code, uint32 *setting )
|
GetSetting(BScreen *screen, uint16 code, uint32 *setting)
|
||||||
{
|
{
|
||||||
display_mode mode, low, high;
|
display_mode mode, low, high;
|
||||||
status_t result;
|
status_t result;
|
||||||
@@ -62,8 +62,8 @@ static status_t GetSetting(
|
|||||||
|
|
||||||
|
|
||||||
// set setting "code" to "value"
|
// set setting "code" to "value"
|
||||||
static status_t SetSetting(
|
static status_t
|
||||||
BScreen *screen, uint16 code, uint32 value )
|
SetSetting(BScreen *screen, uint16 code, uint32 value)
|
||||||
{
|
{
|
||||||
display_mode mode, low, high;
|
display_mode mode, low, high;
|
||||||
status_t result;
|
status_t result;
|
||||||
@@ -83,8 +83,9 @@ static status_t SetSetting(
|
|||||||
|
|
||||||
|
|
||||||
// retrieve n-th supported value of setting "code"
|
// retrieve n-th supported value of setting "code"
|
||||||
static status_t GetNthSupportedSetting(
|
static status_t
|
||||||
BScreen *screen, uint16 code, int32 idx, uint32 *setting )
|
GetNthSupportedSetting(BScreen *screen, uint16 code, int32 idx,
|
||||||
|
uint32 *setting)
|
||||||
{
|
{
|
||||||
display_mode mode, low, high;
|
display_mode mode, low, high;
|
||||||
status_t result;
|
status_t result;
|
||||||
@@ -110,8 +111,8 @@ static status_t GetNthSupportedSetting(
|
|||||||
|
|
||||||
|
|
||||||
// get current Swap Displays settings
|
// get current Swap Displays settings
|
||||||
status_t GetSwapDisplays(
|
status_t
|
||||||
BScreen *screen, bool *swap )
|
GetSwapDisplays(BScreen *screen, bool *swap)
|
||||||
{
|
{
|
||||||
status_t result;
|
status_t result;
|
||||||
uint32 tmp;
|
uint32 tmp;
|
||||||
@@ -127,16 +128,16 @@ status_t GetSwapDisplays(
|
|||||||
|
|
||||||
|
|
||||||
// set "Swap Displays"
|
// set "Swap Displays"
|
||||||
status_t SetSwapDisplays(
|
status_t
|
||||||
BScreen *screen, bool swap )
|
SetSwapDisplays(BScreen *screen, bool swap)
|
||||||
{
|
{
|
||||||
return SetSetting(screen, ms_swap, swap);
|
return SetSetting(screen, ms_swap, swap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// get current "Use Laptop Panel" settings
|
// get current "Use Laptop Panel" settings
|
||||||
status_t GetUseLaptopPanel(
|
status_t
|
||||||
BScreen *screen, bool *use )
|
GetUseLaptopPanel(BScreen *screen, bool *use)
|
||||||
{
|
{
|
||||||
status_t result;
|
status_t result;
|
||||||
uint32 tmp;
|
uint32 tmp;
|
||||||
@@ -151,15 +152,16 @@ status_t GetUseLaptopPanel(
|
|||||||
|
|
||||||
|
|
||||||
// set "Use Laptop Panel"
|
// set "Use Laptop Panel"
|
||||||
status_t SetUseLaptopPanel(
|
status_t
|
||||||
BScreen *screen, bool use )
|
SetUseLaptopPanel(BScreen *screen, bool use)
|
||||||
{
|
{
|
||||||
return SetSetting(screen, ms_use_laptop_panel, use);
|
return SetSetting(screen, ms_use_laptop_panel, use);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// get n-th supported TV standard
|
// get n-th supported TV standard
|
||||||
status_t GetNthSupportedTVStandard( BScreen *screen, int idx, uint32 *standard )
|
status_t
|
||||||
|
GetNthSupportedTVStandard(BScreen *screen, int idx, uint32 *standard)
|
||||||
{
|
{
|
||||||
return GetNthSupportedSetting(
|
return GetNthSupportedSetting(
|
||||||
screen, ms_tv_standard, (int32)idx, standard);
|
screen, ms_tv_standard, (int32)idx, standard);
|
||||||
@@ -167,14 +169,16 @@ status_t GetNthSupportedTVStandard( BScreen *screen, int idx, uint32 *standard )
|
|||||||
|
|
||||||
|
|
||||||
// get current TV Standard settings
|
// get current TV Standard settings
|
||||||
status_t GetTVStandard( BScreen *screen, uint32 *standard )
|
status_t
|
||||||
|
GetTVStandard(BScreen *screen, uint32 *standard)
|
||||||
{
|
{
|
||||||
return GetSetting(screen, ms_tv_standard, standard);
|
return GetSetting(screen, ms_tv_standard, standard);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// set TV Standard
|
// set TV Standard
|
||||||
status_t SetTVStandard( BScreen *screen, uint32 standard )
|
status_t
|
||||||
|
SetTVStandard(BScreen *screen, uint32 standard)
|
||||||
{
|
{
|
||||||
return SetSetting(screen, ms_tv_standard, standard);
|
return SetSetting(screen, ms_tv_standard, standard);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,31 +1,29 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "LEDAnimation.h"
|
#include "LEDAnimation.h"
|
||||||
|
|
||||||
#include <InterfaceDefs.h>
|
#include <InterfaceDefs.h>
|
||||||
|
|
||||||
#define SNOOZE_TIME 150000
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
/***********************************************************
|
#define SNOOZE_TIME 150000
|
||||||
* Constructor
|
|
||||||
***********************************************************/
|
|
||||||
LEDAnimation::LEDAnimation()
|
LEDAnimation::LEDAnimation()
|
||||||
:fThread(-1)
|
:
|
||||||
,fRunning(false)
|
fThread(-1),
|
||||||
,fOrigModifiers(::modifiers())
|
fRunning(false),
|
||||||
|
fOrigModifiers(::modifiers())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************
|
|
||||||
* Destructor
|
|
||||||
***********************************************************/
|
|
||||||
LEDAnimation::~LEDAnimation()
|
LEDAnimation::~LEDAnimation()
|
||||||
{
|
{
|
||||||
Stop();
|
Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************
|
|
||||||
* Start
|
|
||||||
***********************************************************/
|
|
||||||
void
|
void
|
||||||
LEDAnimation::Start()
|
LEDAnimation::Start()
|
||||||
{
|
{
|
||||||
@@ -40,9 +38,7 @@ LEDAnimation::Start()
|
|||||||
::resume_thread(fThread);
|
::resume_thread(fThread);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************
|
|
||||||
* Stop
|
|
||||||
***********************************************************/
|
|
||||||
void
|
void
|
||||||
LEDAnimation::Stop()
|
LEDAnimation::Stop()
|
||||||
{
|
{
|
||||||
@@ -57,16 +53,13 @@ LEDAnimation::Stop()
|
|||||||
::set_keyboard_locks(fOrigModifiers);
|
::set_keyboard_locks(fOrigModifiers);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************
|
|
||||||
* AnimationThread
|
|
||||||
***********************************************************/
|
|
||||||
int32
|
int32
|
||||||
LEDAnimation::AnimationThread(void* data)
|
LEDAnimation::AnimationThread(void* data)
|
||||||
{
|
{
|
||||||
LEDAnimation *anim = (LEDAnimation*)data;
|
LEDAnimation *anim = (LEDAnimation*)data;
|
||||||
|
|
||||||
while (anim->fRunning)
|
while (anim->fRunning) {
|
||||||
{
|
|
||||||
LED(B_NUM_LOCK,true);
|
LED(B_NUM_LOCK,true);
|
||||||
LED(B_NUM_LOCK,false);
|
LED(B_NUM_LOCK,false);
|
||||||
|
|
||||||
@@ -83,9 +76,7 @@ LEDAnimation::AnimationThread(void* data)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************
|
|
||||||
* LED
|
|
||||||
***********************************************************/
|
|
||||||
void
|
void
|
||||||
LEDAnimation::LED(uint32 mod,bool on)
|
LEDAnimation::LED(uint32 mod,bool on)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user