Clean up mouse functions in InterfaceDefs.
* Fully remove unused and deprecated functions. * Comment as to which functions are deprecated. * Rename _by_name functions to be without the suffix, as this is C++ and there's no reason not to use overloads here. Change-Id: I4e2152f17806605eb965795417013cea800e661e
This commit is contained in:
@@ -418,22 +418,19 @@ status_t set_screen_space(int32 index, uint32 resolution,
|
|||||||
status_t get_scroll_bar_info(scroll_bar_info* info);
|
status_t get_scroll_bar_info(scroll_bar_info* info);
|
||||||
status_t set_scroll_bar_info(scroll_bar_info* info);
|
status_t set_scroll_bar_info(scroll_bar_info* info);
|
||||||
|
|
||||||
status_t get_mouse_type(int32* type);
|
status_t get_mouse_type(int32* type); // deprecated
|
||||||
status_t set_mouse_type(int32 type);
|
status_t get_mouse_type(const char* mouse_name, int32* type);
|
||||||
status_t get_mouse_type_by_name(BString mouse_name, int32* type);
|
status_t set_mouse_type(const char* mouse_name, int32 type);
|
||||||
status_t set_mouse_type_by_name(BString mouse_name, int32 type);
|
|
||||||
status_t get_mouse_map(mouse_map* map);
|
status_t get_mouse_map(mouse_map* map);
|
||||||
status_t set_mouse_map(mouse_map* map);
|
status_t set_mouse_map(mouse_map* map);
|
||||||
status_t get_click_speed(bigtime_t* speed);
|
status_t get_click_speed(bigtime_t* speed);
|
||||||
status_t set_click_speed(bigtime_t speed);
|
status_t set_click_speed(bigtime_t speed);
|
||||||
status_t get_mouse_speed(int32* speed);
|
status_t get_mouse_speed(int32* speed); // deprecated
|
||||||
status_t set_mouse_speed(int32 speed);
|
status_t get_mouse_speed(const char* mouse_name, int32* speed);
|
||||||
status_t get_mouse_speed_by_name(BString mouse_name, int32* speed);
|
status_t set_mouse_speed(const char* mouse_name, int32 speed);
|
||||||
status_t set_mouse_speed_by_name(BString mouse_name, int32 speed);
|
status_t get_mouse_acceleration(int32* speed); // deprecated
|
||||||
status_t get_mouse_acceleration(int32* speed);
|
status_t get_mouse_acceleration(const char* mouse_name, int32* speed);
|
||||||
status_t set_mouse_acceleration(int32 speed);
|
status_t set_mouse_acceleration(const char* mouse_name, int32 speed);
|
||||||
status_t get_mouse_acceleration_by_name(BString mouse_name, int32* speed);
|
|
||||||
status_t set_mouse_acceleration_by_name(BString mouse_name, int32 speed);
|
|
||||||
|
|
||||||
status_t get_key_repeat_rate(int32* rate);
|
status_t get_key_repeat_rate(int32* rate);
|
||||||
status_t set_key_repeat_rate(int32 rate);
|
status_t set_key_repeat_rate(int32 rate);
|
||||||
|
|||||||
@@ -529,10 +529,10 @@ MouseDevice::_UpdateSettings()
|
|||||||
else
|
else
|
||||||
ioctl(fDevice, MS_SET_CLICKSPEED, &fSettings.click_speed);
|
ioctl(fDevice, MS_SET_CLICKSPEED, &fSettings.click_speed);
|
||||||
|
|
||||||
if (get_mouse_speed_by_name(fDeviceRef.name, &fSettings.accel.speed) != B_OK)
|
if (get_mouse_speed(fDeviceRef.name, &fSettings.accel.speed) != B_OK)
|
||||||
LOG_ERR("error when get_mouse_speed\n");
|
LOG_ERR("error when get_mouse_speed\n");
|
||||||
else {
|
else {
|
||||||
if (get_mouse_acceleration_by_name(fDeviceRef.name, &fSettings.accel.accel_factor) != B_OK)
|
if (get_mouse_acceleration(fDeviceRef.name, &fSettings.accel.accel_factor) != B_OK)
|
||||||
LOG_ERR("error when get_mouse_acceleration\n");
|
LOG_ERR("error when get_mouse_acceleration\n");
|
||||||
else {
|
else {
|
||||||
mouse_accel accel;
|
mouse_accel accel;
|
||||||
@@ -543,7 +543,7 @@ MouseDevice::_UpdateSettings()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (get_mouse_type_by_name(fDeviceRef.name, &fSettings.type) != B_OK)
|
if (get_mouse_type(fDeviceRef.name, &fSettings.type) != B_OK)
|
||||||
LOG_ERR("error when get_mouse_type\n");
|
LOG_ERR("error when get_mouse_type\n");
|
||||||
else
|
else
|
||||||
ioctl(fDevice, MS_SET_TYPE, &fSettings.type);
|
ioctl(fDevice, MS_SET_TYPE, &fSettings.type);
|
||||||
|
|||||||
@@ -137,14 +137,14 @@ MasterServerDevice::Control(const char* device, void* cookie, uint32 code, BMess
|
|||||||
// respond to changes in the system
|
// respond to changes in the system
|
||||||
switch (code) {
|
switch (code) {
|
||||||
case B_MOUSE_SPEED_CHANGED:
|
case B_MOUSE_SPEED_CHANGED:
|
||||||
get_mouse_speed(&fSpeed);
|
get_mouse_speed(device, &fSpeed);
|
||||||
_CalculateAccelerationTable();
|
_CalculateAccelerationTable();
|
||||||
break;
|
break;
|
||||||
case B_CLICK_SPEED_CHANGED:
|
case B_CLICK_SPEED_CHANGED:
|
||||||
get_click_speed(&fDblClickSpeed);
|
get_click_speed(&fDblClickSpeed);
|
||||||
break;
|
break;
|
||||||
case B_MOUSE_ACCELERATION_CHANGED:
|
case B_MOUSE_ACCELERATION_CHANGED:
|
||||||
get_mouse_acceleration(&fAcceleration);
|
get_mouse_acceleration(device, &fAcceleration);
|
||||||
_CalculateAccelerationTable();
|
_CalculateAccelerationTable();
|
||||||
break;
|
break;
|
||||||
case B_NODE_MONITOR:
|
case B_NODE_MONITOR:
|
||||||
|
|||||||
@@ -505,12 +505,11 @@ set_mouse_type(int32 type)
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
get_mouse_type_by_name(BString mouse_name, int32 *type)
|
get_mouse_type(const char* mouse_name, int32 *type)
|
||||||
{
|
{
|
||||||
BMessage command(IS_GET_MOUSE_TYPE);
|
BMessage command(IS_GET_MOUSE_TYPE);
|
||||||
BMessage reply;
|
BMessage reply;
|
||||||
command.AddString("mouse_name", mouse_name.String());
|
command.AddString("mouse_name", mouse_name);
|
||||||
|
|
||||||
|
|
||||||
status_t err = _control_input_server_(&command, &reply);
|
status_t err = _control_input_server_(&command, &reply);
|
||||||
if (err != B_OK)
|
if (err != B_OK)
|
||||||
@@ -521,13 +520,12 @@ get_mouse_type_by_name(BString mouse_name, int32 *type)
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
set_mouse_type_by_name(BString mouse_name, int32 type)
|
set_mouse_type(const char* mouse_name, int32 type)
|
||||||
{
|
{
|
||||||
BMessage command(IS_SET_MOUSE_TYPE);
|
BMessage command(IS_SET_MOUSE_TYPE);
|
||||||
BMessage reply;
|
BMessage reply;
|
||||||
|
|
||||||
status_t err_mouse_name = command.AddString("mouse_name",
|
status_t err_mouse_name = command.AddString("mouse_name", mouse_name);
|
||||||
mouse_name.String());
|
|
||||||
if (err_mouse_name != B_OK)
|
if (err_mouse_name != B_OK)
|
||||||
return err_mouse_name;
|
return err_mouse_name;
|
||||||
|
|
||||||
@@ -627,11 +625,11 @@ set_mouse_speed(int32 speed)
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
get_mouse_speed_by_name(BString mouse_name, int32 *speed)
|
get_mouse_speed(const char* mouse_name, int32 *speed)
|
||||||
{
|
{
|
||||||
BMessage command(IS_GET_MOUSE_SPEED);
|
BMessage command(IS_GET_MOUSE_SPEED);
|
||||||
BMessage reply;
|
BMessage reply;
|
||||||
command.AddString("mouse_name", mouse_name.String());
|
command.AddString("mouse_name", mouse_name);
|
||||||
|
|
||||||
status_t err = _control_input_server_(&command, &reply);
|
status_t err = _control_input_server_(&command, &reply);
|
||||||
if (err != B_OK)
|
if (err != B_OK)
|
||||||
@@ -646,11 +644,11 @@ get_mouse_speed_by_name(BString mouse_name, int32 *speed)
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
set_mouse_speed_by_name(BString mouse_name, int32 speed)
|
set_mouse_speed(const char* mouse_name, int32 speed)
|
||||||
{
|
{
|
||||||
BMessage command(IS_SET_MOUSE_SPEED);
|
BMessage command(IS_SET_MOUSE_SPEED);
|
||||||
BMessage reply;
|
BMessage reply;
|
||||||
command.AddString("mouse_name", mouse_name.String());
|
command.AddString("mouse_name", mouse_name);
|
||||||
|
|
||||||
command.AddInt32("speed", speed);
|
command.AddInt32("speed", speed);
|
||||||
|
|
||||||
@@ -684,11 +682,11 @@ set_mouse_acceleration(int32 speed)
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
get_mouse_acceleration_by_name(BString mouse_name, int32 *speed)
|
get_mouse_acceleration(const char* mouse_name, int32 *speed)
|
||||||
{
|
{
|
||||||
BMessage command(IS_GET_MOUSE_ACCELERATION);
|
BMessage command(IS_GET_MOUSE_ACCELERATION);
|
||||||
BMessage reply;
|
BMessage reply;
|
||||||
command.AddString("mouse_name", mouse_name.String());
|
command.AddString("mouse_name", mouse_name);
|
||||||
|
|
||||||
_control_input_server_(&command, &reply);
|
_control_input_server_(&command, &reply);
|
||||||
|
|
||||||
@@ -700,11 +698,11 @@ get_mouse_acceleration_by_name(BString mouse_name, int32 *speed)
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
set_mouse_acceleration_by_name(BString mouse_name, int32 speed)
|
set_mouse_acceleration(const char* mouse_name, int32 speed)
|
||||||
{
|
{
|
||||||
BMessage command(IS_SET_MOUSE_ACCELERATION);
|
BMessage command(IS_SET_MOUSE_ACCELERATION);
|
||||||
BMessage reply;
|
BMessage reply;
|
||||||
command.AddString("mouse_name", mouse_name.String());
|
command.AddString("mouse_name", mouse_name);
|
||||||
|
|
||||||
command.AddInt32("speed", speed);
|
command.AddInt32("speed", speed);
|
||||||
|
|
||||||
|
|||||||
@@ -93,11 +93,11 @@ MouseSettings::_RetrieveSettings()
|
|||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
if (get_click_speed(&fSettings.click_speed) != B_OK)
|
if (get_click_speed(&fSettings.click_speed) != B_OK)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
if (get_mouse_speed_by_name(fName, &fSettings.accel.speed) != B_OK)
|
if (get_mouse_speed(fName, &fSettings.accel.speed) != B_OK)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
if (get_mouse_acceleration_by_name(fName, &fSettings.accel.accel_factor) != B_OK)
|
if (get_mouse_acceleration(fName, &fSettings.accel.accel_factor) != B_OK)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
if (get_mouse_type_by_name(fName, &fSettings.type) != B_OK)
|
if (get_mouse_type(fName, &fSettings.type) != B_OK)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|
||||||
fMode = mouse_mode();
|
fMode = mouse_mode();
|
||||||
@@ -260,7 +260,7 @@ MouseSettings::IsRevertable()
|
|||||||
void
|
void
|
||||||
MouseSettings::SetMouseType(int32 type)
|
MouseSettings::SetMouseType(int32 type)
|
||||||
{
|
{
|
||||||
if (set_mouse_type_by_name(fName, type) == B_OK)
|
if (set_mouse_type(fName, type) == B_OK)
|
||||||
fSettings.type = type;
|
fSettings.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -286,7 +286,7 @@ MouseSettings::SetClickSpeed(bigtime_t clickSpeed)
|
|||||||
void
|
void
|
||||||
MouseSettings::SetMouseSpeed(int32 speed)
|
MouseSettings::SetMouseSpeed(int32 speed)
|
||||||
{
|
{
|
||||||
if (set_mouse_speed_by_name(fName, speed) == B_OK)
|
if (set_mouse_speed(fName, speed) == B_OK)
|
||||||
fSettings.accel.speed = speed;
|
fSettings.accel.speed = speed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -294,7 +294,7 @@ MouseSettings::SetMouseSpeed(int32 speed)
|
|||||||
void
|
void
|
||||||
MouseSettings::SetAccelerationFactor(int32 factor)
|
MouseSettings::SetAccelerationFactor(int32 factor)
|
||||||
{
|
{
|
||||||
if (set_mouse_acceleration_by_name(fName, factor) == B_OK)
|
if (set_mouse_acceleration(fName, factor) == B_OK)
|
||||||
fSettings.accel.accel_factor = factor;
|
fSettings.accel.accel_factor = factor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user