Clean up, added missing message handlers
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8600 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+273
-254
@@ -118,24 +118,20 @@ InputServer::~InputServer(void)
|
|||||||
* Method: InputServer::ArgvReceived()
|
* Method: InputServer::ArgvReceived()
|
||||||
* Descr:
|
* Descr:
|
||||||
*/
|
*/
|
||||||
void InputServer::ArgvReceived(int32 argc, char** argv)
|
void
|
||||||
|
InputServer::ArgvReceived(int32 argc, char** argv)
|
||||||
{
|
{
|
||||||
if (2 == argc)
|
if (2 == argc) {
|
||||||
{
|
if (0 == strcmp("-q", argv[1]) ) {
|
||||||
if (0 == strcmp("-q", argv[1]) )
|
|
||||||
{
|
|
||||||
// :TODO: Shutdown and restart the InputServer.
|
// :TODO: Shutdown and restart the InputServer.
|
||||||
printf("InputServer::ArgvReceived - Restarting . . .\n");
|
printf("InputServer::ArgvReceived - Restarting . . .\n");
|
||||||
status_t quit_status;
|
status_t quit_status;
|
||||||
//BMessenger msgr = BMessenger("application/x-vnd.OpenBeOS-input_server", -1, &quit_status);
|
//BMessenger msgr = BMessenger("application/x-vnd.OpenBeOS-input_server", -1, &quit_status);
|
||||||
BMessenger msgr = BMessenger("application/x-vnd.OBOS-input_server", -1, &quit_status);
|
BMessenger msgr = BMessenger("application/x-vnd.OBOS-input_server", -1, &quit_status);
|
||||||
if (B_OK == quit_status)
|
if (B_OK == quit_status) {
|
||||||
{
|
|
||||||
BMessage msg = BMessage(B_QUIT_REQUESTED);
|
BMessage msg = BMessage(B_QUIT_REQUESTED);
|
||||||
msgr.SendMessage(&msg);
|
msgr.SendMessage(&msg);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
printf("Unable to send Quit message to running InputServer.");
|
printf("Unable to send Quit message to running InputServer.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -147,7 +143,8 @@ void InputServer::ArgvReceived(int32 argc, char** argv)
|
|||||||
* Method: InputServer::InitKeyboardMouseStates()
|
* Method: InputServer::InitKeyboardMouseStates()
|
||||||
* Descr:
|
* Descr:
|
||||||
*/
|
*/
|
||||||
void InputServer::InitKeyboardMouseStates(void)
|
void
|
||||||
|
InputServer::InitKeyboardMouseStates(void)
|
||||||
{
|
{
|
||||||
// This is where we read in the preferences data for the mouse and keyboard as well as
|
// This is where we read in the preferences data for the mouse and keyboard as well as
|
||||||
// determine the screen resolution from the app_server and find the center of the screen
|
// determine the screen resolution from the app_server and find the center of the screen
|
||||||
@@ -158,7 +155,8 @@ void InputServer::InitKeyboardMouseStates(void)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputServer::InitTestDevice()
|
void
|
||||||
|
InputServer::InitTestDevice()
|
||||||
{
|
{
|
||||||
printf("InputServer::InitTestDevice - Enter\n");
|
printf("InputServer::InitTestDevice - Enter\n");
|
||||||
const char* path = "/boot/home/Projects/InputServer/ISD/nervous/nervous";
|
const char* path = "/boot/home/Projects/InputServer/ISD/nervous/nervous";
|
||||||
@@ -208,7 +206,8 @@ void InputServer::InitTestDevice()
|
|||||||
* Method: InputServer::InitDevices()
|
* Method: InputServer::InitDevices()
|
||||||
* Descr:
|
* Descr:
|
||||||
*/
|
*/
|
||||||
void InputServer::InitDevices(void)
|
void
|
||||||
|
InputServer::InitDevices(void)
|
||||||
{
|
{
|
||||||
BDirectory dir;
|
BDirectory dir;
|
||||||
BPath addon_dir;
|
BPath addon_dir;
|
||||||
@@ -249,7 +248,8 @@ void InputServer::InitDevices(void)
|
|||||||
* Method: InputServer::AddInputServerDevice()
|
* Method: InputServer::AddInputServerDevice()
|
||||||
* Descr:
|
* Descr:
|
||||||
*/
|
*/
|
||||||
status_t InputServer::AddInputServerDevice(const char* path)
|
status_t
|
||||||
|
InputServer::AddInputServerDevice(const char* path)
|
||||||
{
|
{
|
||||||
image_id addon_image= load_add_on(path);
|
image_id addon_image= load_add_on(path);
|
||||||
if (B_ERROR != addon_image)
|
if (B_ERROR != addon_image)
|
||||||
@@ -293,7 +293,8 @@ status_t InputServer::AddInputServerDevice(const char* path)
|
|||||||
* Method: InputServer::InitFilters()
|
* Method: InputServer::InitFilters()
|
||||||
* Descr:
|
* Descr:
|
||||||
*/
|
*/
|
||||||
void InputServer::InitFilters(void)
|
void
|
||||||
|
InputServer::InitFilters(void)
|
||||||
{
|
{
|
||||||
BDirectory dir;
|
BDirectory dir;
|
||||||
BPath addon_dir;
|
BPath addon_dir;
|
||||||
@@ -334,7 +335,8 @@ void InputServer::InitFilters(void)
|
|||||||
* Method: InputServer::AddInputServerFilter()
|
* Method: InputServer::AddInputServerFilter()
|
||||||
* Descr:
|
* Descr:
|
||||||
*/
|
*/
|
||||||
status_t InputServer::AddInputServerFilter(const char* path)
|
status_t
|
||||||
|
InputServer::AddInputServerFilter(const char* path)
|
||||||
{
|
{
|
||||||
image_id addon_image= load_add_on(path);
|
image_id addon_image= load_add_on(path);
|
||||||
if (B_ERROR != addon_image)
|
if (B_ERROR != addon_image)
|
||||||
@@ -378,7 +380,8 @@ status_t InputServer::AddInputServerFilter(const char* path)
|
|||||||
* Method: InputServer::InitMethods()
|
* Method: InputServer::InitMethods()
|
||||||
* Descr:
|
* Descr:
|
||||||
*/
|
*/
|
||||||
void InputServer::InitMethods(void)
|
void
|
||||||
|
InputServer::InitMethods(void)
|
||||||
{
|
{
|
||||||
BDirectory dir;
|
BDirectory dir;
|
||||||
BPath addon_dir;
|
BPath addon_dir;
|
||||||
@@ -419,7 +422,8 @@ void InputServer::InitMethods(void)
|
|||||||
* Method: InputServer::AddInputServerMethod()
|
* Method: InputServer::AddInputServerMethod()
|
||||||
* Descr:
|
* Descr:
|
||||||
*/
|
*/
|
||||||
status_t InputServer::AddInputServerMethod(const char* path)
|
status_t
|
||||||
|
InputServer::AddInputServerMethod(const char* path)
|
||||||
{
|
{
|
||||||
image_id addon_image= load_add_on(path);
|
image_id addon_image= load_add_on(path);
|
||||||
if (B_ERROR != addon_image)
|
if (B_ERROR != addon_image)
|
||||||
@@ -463,7 +467,8 @@ status_t InputServer::AddInputServerMethod(const char* path)
|
|||||||
* Method: InputServer::QuitRequested()
|
* Method: InputServer::QuitRequested()
|
||||||
* Descr:
|
* Descr:
|
||||||
*/
|
*/
|
||||||
bool InputServer::QuitRequested(void)
|
bool
|
||||||
|
InputServer::QuitRequested(void)
|
||||||
{
|
{
|
||||||
kill_thread(ISPortThread);
|
kill_thread(ISPortThread);
|
||||||
delete_port(EventLooperPort);
|
delete_port(EventLooperPort);
|
||||||
@@ -492,153 +497,125 @@ void InputServer::ReadyToRun(void)
|
|||||||
* Method: InputServer::MessageReceived()
|
* Method: InputServer::MessageReceived()
|
||||||
* Descr:
|
* Descr:
|
||||||
*/
|
*/
|
||||||
void InputServer::MessageReceived(BMessage *message)
|
void
|
||||||
|
InputServer::MessageReceived(BMessage *message)
|
||||||
{
|
{
|
||||||
BMessenger *app_server;
|
|
||||||
BMessage *reply = NULL;
|
BMessage *reply = NULL;
|
||||||
|
|
||||||
switch(message->what)
|
switch(message->what)
|
||||||
{
|
{
|
||||||
case SET_METHOD:
|
case IS_SET_METHOD:
|
||||||
{
|
HandleSetMethod(message);
|
||||||
//HandleSetMethod();
|
|
||||||
break;
|
break;
|
||||||
}
|
case IS_GET_MOUSE_TYPE:
|
||||||
case GET_MOUSE_TYPE:
|
HandleGetSetMouseType(message, reply);
|
||||||
{
|
|
||||||
//HandleGetSetMouseType();
|
|
||||||
break;
|
break;
|
||||||
}
|
case IS_SET_MOUSE_TYPE:
|
||||||
case SET_MOUSE_TYPE:
|
HandleGetSetMouseType(message, reply);
|
||||||
{
|
|
||||||
//HandleGetSetMouseType();
|
|
||||||
break;
|
break;
|
||||||
}
|
case IS_GET_MOUSE_ACCELERATION:
|
||||||
case GET_MOUSE_ACCELERATION:
|
HandleGetSetMouseAcceleration(message, reply);
|
||||||
{
|
|
||||||
//HandleGetSetMouseAcceleration();
|
|
||||||
break;
|
break;
|
||||||
}
|
case IS_SET_MOUSE_ACCELERATION:
|
||||||
case SET_MOUSE_ACCELERATION:
|
HandleGetSetMouseAcceleration(message, reply);
|
||||||
{
|
|
||||||
//HandleGetSetMouseAcceleration();
|
|
||||||
break;
|
break;
|
||||||
}
|
case IS_GET_KEY_REPEAT_DELAY:
|
||||||
case GET_KEY_REPEAT_DELAY:
|
HandleGetSetKeyRepeatDelay(message, reply);
|
||||||
{
|
|
||||||
//HandleGetSetKeyRepeatDelay();
|
|
||||||
break;
|
break;
|
||||||
}
|
case IS_SET_KEY_REPEAT_DELAY:
|
||||||
case SET_KEY_REPEAT_DELAY:
|
HandleGetSetKeyRepeatDelay(message, reply);
|
||||||
{
|
|
||||||
//HandleGetSetKeyRepeatDelay();
|
|
||||||
break;
|
break;
|
||||||
}
|
case IS_GET_KEY_INFO:
|
||||||
case GET_KEY_INFO:
|
HandleGetKeyInfo(message, reply);
|
||||||
{
|
|
||||||
//HandleGetKeyInfo();
|
|
||||||
break;
|
break;
|
||||||
}
|
case IS_GET_MODIFIERS:
|
||||||
case GET_MODIFIERS:
|
HandleGetModifiers(message, reply);
|
||||||
{
|
|
||||||
//HandleGetModifiers();
|
|
||||||
break;
|
break;
|
||||||
}
|
case IS_SET_MODIFIER_KEY:
|
||||||
case SET_MODIFIER_KEY:
|
HandleSetModifierKey(message, reply);
|
||||||
{
|
|
||||||
//HandleSetModifierKey();
|
|
||||||
break;
|
break;
|
||||||
}
|
case IS_SET_KEYBOARD_LOCKS:
|
||||||
case SET_KEYBOARD_LOCKS:
|
HandleSetKeyboardLocks(message, reply);
|
||||||
{
|
|
||||||
//HandleSetKeyboardLocks();
|
|
||||||
break;
|
break;
|
||||||
}
|
case IS_GET_MOUSE_SPEED:
|
||||||
case GET_MOUSE_SPEED:
|
HandleGetSetMouseSpeed(message, reply);
|
||||||
{
|
|
||||||
//HandleGetSetMouseSpeed();
|
|
||||||
break;
|
break;
|
||||||
}
|
case IS_SET_MOUSE_SPEED:
|
||||||
case SET_MOUSE_SPEED:
|
HandleGetSetMouseSpeed(message, reply);
|
||||||
{
|
|
||||||
//HandleGetSetMouseSpeed();
|
|
||||||
break;
|
break;
|
||||||
}
|
case IS_SET_MOUSE_POSITION:
|
||||||
case SET_MOUSE_POSITION:
|
HandleSetMousePosition(message, reply);
|
||||||
{
|
|
||||||
//HandleSetMousePosition();
|
|
||||||
break;
|
break;
|
||||||
}
|
case IS_GET_MOUSE_MAP:
|
||||||
case GET_MOUSE_MAP:
|
HandleGetSetMouseMap(message, reply);
|
||||||
{
|
|
||||||
//HandleGetSetMouseMap();
|
|
||||||
break;
|
break;
|
||||||
}
|
case IS_SET_MOUSE_MAP:
|
||||||
case SET_MOUSE_MAP:
|
HandleGetSetMouseMap(message, reply);
|
||||||
{
|
|
||||||
//HandleGetSetMouseMap();
|
|
||||||
break;
|
break;
|
||||||
}
|
case IS_GET_KEYBOARD_ID:
|
||||||
case GET_KEYBOARD_ID:
|
HandleGetKeyboardID(message, reply);
|
||||||
{
|
|
||||||
//HandleGetKeyboardID();
|
|
||||||
break;
|
break;
|
||||||
}
|
case IS_GET_CLICK_SPEED:
|
||||||
case GET_CLICK_SPEED:
|
|
||||||
{
|
|
||||||
HandleGetClickSpeed(message, reply);
|
HandleGetClickSpeed(message, reply);
|
||||||
break;
|
break;
|
||||||
}
|
case IS_SET_CLICK_SPEED:
|
||||||
case SET_CLICK_SPEED:
|
|
||||||
{
|
|
||||||
HandleSetClickSpeed(message, reply);
|
HandleSetClickSpeed(message, reply);
|
||||||
break;
|
break;
|
||||||
}
|
case IS_GET_KEY_REPEAT_RATE:
|
||||||
case GET_KEY_REPEAT_RATE:
|
HandleGetSetKeyRepeatRate(message, reply);
|
||||||
{
|
|
||||||
//HandleGetSetKeyRepeatRate();
|
|
||||||
break;
|
break;
|
||||||
}
|
case IS_SET_KEY_REPEAT_RATE:
|
||||||
case SET_KEY_REPEAT_RATE:
|
HandleGetSetKeyRepeatRate(message, reply);
|
||||||
{
|
|
||||||
//HandleGetSetKeyRepeatRate();
|
|
||||||
break;
|
break;
|
||||||
}
|
case IS_GET_KEY_MAP:
|
||||||
case GET_KEY_MAP:
|
HandleGetSetKeyMap(message, reply);
|
||||||
{
|
|
||||||
//HandleGetSetKeyMap();
|
|
||||||
break;
|
break;
|
||||||
}
|
case IS_RESTORE_KEY_MAP:
|
||||||
case SET_KEY_MAP:
|
HandleGetSetKeyMap(message, reply);
|
||||||
{
|
|
||||||
//HandleGetSetKeyMap();
|
|
||||||
break;
|
break;
|
||||||
}
|
case IS_FOCUS_IM_AWARE_VIEW:
|
||||||
case FOCUS_IM_AWARE_VIEW:
|
HandleFocusUnfocusIMAwareView(message, reply);
|
||||||
{
|
|
||||||
//HandleFocusUnfocusIMAwareView();
|
|
||||||
break;
|
break;
|
||||||
}
|
case IS_UNFOCUS_IM_AWARE_VIEW:
|
||||||
case UNFOCUS_IM_AWARE_VIEW:
|
HandleFocusUnfocusIMAwareView(message, reply);
|
||||||
{
|
|
||||||
//HandleFocusUnfocusIMAwareView();
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case B_QUIT_REQUESTED:
|
// device looper related
|
||||||
{
|
case IS_FIND_DEVICES:
|
||||||
|
HandleFindDevices(message, reply);
|
||||||
|
break;
|
||||||
|
case IS_WATCH_DEVICES:
|
||||||
|
HandleWatchDevices(message, reply);
|
||||||
|
break;
|
||||||
|
case IS_IS_DEVICE_RUNNING:
|
||||||
|
HandleIsDeviceRunning(message, reply);
|
||||||
|
break;
|
||||||
|
case IS_START_DEVICE:
|
||||||
|
HandleStartStopDevices(message, reply);
|
||||||
|
break;
|
||||||
|
case IS_STOP_DEVICE:
|
||||||
|
HandleStartStopDevices(message, reply);
|
||||||
|
break;
|
||||||
|
case IS_CONTROL_DEVICES:
|
||||||
|
HandleControlDevices(message, reply);
|
||||||
|
break;
|
||||||
|
case SYSTEM_SHUTTING_DOWN:
|
||||||
|
HandleSystemShuttingDown(message, reply);
|
||||||
|
break;
|
||||||
|
case B_NODE_MONITOR:
|
||||||
|
HandleNodeMonitor(message);
|
||||||
|
break;
|
||||||
|
/*case B_QUIT_REQUESTED:
|
||||||
QuitRequested();
|
QuitRequested();
|
||||||
}
|
break;*/
|
||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
printf("Default message . . .\n");
|
printf("Default message . . .\n");
|
||||||
app_server = new BMessenger("application/x-vnd.Be-APPS", -1, NULL);
|
BMessenger app_server("application/x-vnd.Be-APPS", -1, NULL);
|
||||||
if (app_server->IsValid())
|
if (app_server.IsValid()) {
|
||||||
{
|
//app_server->SendMessage(message);
|
||||||
//app_server->SendMessage(message);
|
|
||||||
|
}
|
||||||
}
|
|
||||||
delete app_server;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -649,82 +626,59 @@ void InputServer::MessageReceived(BMessage *message)
|
|||||||
* Method: InputServer::HandleSetMethod()
|
* Method: InputServer::HandleSetMethod()
|
||||||
* Descr:
|
* Descr:
|
||||||
*/
|
*/
|
||||||
void InputServer::HandleSetMethod(BMessage *)
|
void
|
||||||
|
InputServer::HandleSetMethod(BMessage *)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Method: InputServer::HandleGetMouseType()
|
* Method: InputServer::HandleGetSetMouseType()
|
||||||
* Descr:
|
* Descr:
|
||||||
*/
|
*/
|
||||||
void InputServer::HandleGetMouseType(BMessage* message,
|
void
|
||||||
|
InputServer::HandleGetSetMouseType(BMessage* message,
|
||||||
BMessage* reply)
|
BMessage* reply)
|
||||||
{
|
{
|
||||||
status_t status = reply->AddInt32("mouse_type", sMouseType);
|
status_t status;
|
||||||
|
if (message->FindInt32("mouse_type", &sMouseType)==B_OK)
|
||||||
|
status = ControlDevices(NULL, B_POINTING_DEVICE, B_MOUSE_TYPE_CHANGED, NULL);
|
||||||
|
else
|
||||||
|
status = reply->AddInt32("mouse_type", sMouseType);
|
||||||
message->SendReply(status, reply);
|
message->SendReply(status, reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Method: InputServer::HandleSetMouseType()
|
* Method: InputServer::HandleGetSetMouseAcceleration()
|
||||||
* Descr:
|
* Descr:
|
||||||
*/
|
*/
|
||||||
void InputServer::HandleSetMouseType(BMessage* message,
|
void
|
||||||
BMessage* reply)
|
InputServer::HandleGetSetMouseAcceleration(BMessage* message,
|
||||||
{
|
|
||||||
message->FindInt32("mouse_type", &sMouseType);
|
|
||||||
status_t status = ControlDevices(NULL, B_POINTING_DEVICE, B_MOUSE_TYPE_CHANGED, NULL);
|
|
||||||
message->SendReply(status, reply);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Method: InputServer::HandleGetMouseAcceleration()
|
|
||||||
* Descr:
|
|
||||||
*/
|
|
||||||
void InputServer::HandleGetMouseAcceleration(BMessage* message,
|
|
||||||
BMessage* reply)
|
BMessage* reply)
|
||||||
{
|
{
|
||||||
status_t status = reply->AddInt32("mouse_acceleration", sMouseAcceleration);
|
status_t status;
|
||||||
|
if (message->FindInt32("mouse_acceleration", &sMouseAcceleration) == B_OK)
|
||||||
|
status = ControlDevices(NULL, B_POINTING_DEVICE, B_MOUSE_ACCELERATION_CHANGED, NULL);
|
||||||
|
else
|
||||||
|
status = reply->AddInt32("mouse_acceleration", sMouseAcceleration);
|
||||||
message->SendReply(status, reply);
|
message->SendReply(status, reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Method: InputServer::HandleSetMouseAcceleration()
|
* Method: InputServer::HandleGetSetKeyRepeatDelay()
|
||||||
* Descr:
|
* Descr:
|
||||||
*/
|
*/
|
||||||
void InputServer::HandleSetMouseAcceleration(BMessage* message,
|
void
|
||||||
BMessage* reply)
|
InputServer::HandleGetSetKeyRepeatDelay(BMessage* message,
|
||||||
{
|
|
||||||
message->FindInt32("mouse_acceleration", &sMouseAcceleration);
|
|
||||||
status_t status = ControlDevices(NULL, B_POINTING_DEVICE, B_MOUSE_ACCELERATION_CHANGED, NULL);
|
|
||||||
message->SendReply(status, reply);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Method: InputServer::HandleGetKeyRepeatDelay()
|
|
||||||
* Descr:
|
|
||||||
*/
|
|
||||||
void InputServer::HandleGetKeyRepeatDelay(BMessage* message,
|
|
||||||
BMessage* reply)
|
BMessage* reply)
|
||||||
{
|
{
|
||||||
status_t status = reply->AddInt64("key_repeat_delay", sKeyRepeatDelay);
|
status_t status;
|
||||||
message->SendReply(status, reply);
|
if (message->FindInt64("key_repeat_delay", &sKeyRepeatDelay) == B_OK)
|
||||||
}
|
status = ControlDevices(NULL, B_KEYBOARD_DEVICE, B_KEY_REPEAT_DELAY_CHANGED, NULL);
|
||||||
|
else
|
||||||
|
status = reply->AddInt64("key_repeat_delay", sKeyRepeatDelay);
|
||||||
/*
|
|
||||||
* Method: InputServer::HandleSetKeyRepeatDelay()
|
|
||||||
* Descr:
|
|
||||||
*/
|
|
||||||
void InputServer::HandleSetKeyRepeatDelay(BMessage* message,
|
|
||||||
BMessage* reply)
|
|
||||||
{
|
|
||||||
message->FindInt64("key_repeat_delay", &sKeyRepeatDelay);
|
|
||||||
status_t status = ControlDevices(NULL, B_KEYBOARD_DEVICE, B_KEY_REPEAT_DELAY_CHANGED, NULL);
|
|
||||||
message->SendReply(status, reply);
|
message->SendReply(status, reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -733,8 +687,9 @@ void InputServer::HandleSetKeyRepeatDelay(BMessage* message,
|
|||||||
* Method: InputServer::HandleGetKeyInfo()
|
* Method: InputServer::HandleGetKeyInfo()
|
||||||
* Descr:
|
* Descr:
|
||||||
*/
|
*/
|
||||||
void InputServer::HandleGetKeyInfo(BMessage *,
|
void
|
||||||
BMessage *)
|
InputServer::HandleGetKeyInfo(BMessage *message,
|
||||||
|
BMessage *reply)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -743,8 +698,9 @@ void InputServer::HandleGetKeyInfo(BMessage *,
|
|||||||
* Method: InputServer::HandleGetModifiers()
|
* Method: InputServer::HandleGetModifiers()
|
||||||
* Descr:
|
* Descr:
|
||||||
*/
|
*/
|
||||||
void InputServer::HandleGetModifiers(BMessage *,
|
void
|
||||||
BMessage *)
|
InputServer::HandleGetModifiers(BMessage *message,
|
||||||
|
BMessage *reply)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -753,8 +709,9 @@ void InputServer::HandleGetModifiers(BMessage *,
|
|||||||
* Method: InputServer::HandleSetModifierKey()
|
* Method: InputServer::HandleSetModifierKey()
|
||||||
* Descr:
|
* Descr:
|
||||||
*/
|
*/
|
||||||
void InputServer::HandleSetModifierKey(BMessage *,
|
void
|
||||||
BMessage *)
|
InputServer::HandleSetModifierKey(BMessage *message,
|
||||||
|
BMessage *reply)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -763,33 +720,25 @@ void InputServer::HandleSetModifierKey(BMessage *,
|
|||||||
* Method: InputServer::HandleSetKeyboardLocks()
|
* Method: InputServer::HandleSetKeyboardLocks()
|
||||||
* Descr:
|
* Descr:
|
||||||
*/
|
*/
|
||||||
void InputServer::HandleSetKeyboardLocks(BMessage *,
|
void InputServer::HandleSetKeyboardLocks(BMessage *message,
|
||||||
BMessage *)
|
BMessage *reply)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Method: InputServer::HandleGetMouseSpeed()
|
* Method: InputServer::HandleGetSetMouseSpeed()
|
||||||
* Descr:
|
* Descr:
|
||||||
*/
|
*/
|
||||||
void InputServer::HandleGetMouseSpeed(BMessage* message,
|
void
|
||||||
|
InputServer::HandleGetSetMouseSpeed(BMessage* message,
|
||||||
BMessage* reply)
|
BMessage* reply)
|
||||||
{
|
{
|
||||||
status_t status = reply->AddInt32("mouse_speed", sMouseSpeed);
|
status_t status;
|
||||||
message->SendReply(status, reply);
|
if (message->FindInt32("mouse_speed", &sMouseSpeed) == B_OK)
|
||||||
}
|
status = ControlDevices(NULL, B_POINTING_DEVICE, B_MOUSE_SPEED_CHANGED, NULL);
|
||||||
|
else
|
||||||
|
status = reply->AddInt32("mouse_speed", sMouseSpeed);
|
||||||
/*
|
|
||||||
* Method: InputServer::HandleSetMouseSpeed()
|
|
||||||
* Descr:
|
|
||||||
*/
|
|
||||||
void InputServer::HandleSetMouseSpeed(BMessage* message,
|
|
||||||
BMessage* reply)
|
|
||||||
{
|
|
||||||
message->FindInt32("mouse_speed", &sMouseSpeed);
|
|
||||||
status_t status = ControlDevices(NULL, B_POINTING_DEVICE, B_MOUSE_SPEED_CHANGED, NULL);
|
|
||||||
message->SendReply(status, reply);
|
message->SendReply(status, reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -798,7 +747,8 @@ void InputServer::HandleSetMouseSpeed(BMessage* message,
|
|||||||
* Method: InputServer::HandleSetMousePosition()
|
* Method: InputServer::HandleSetMousePosition()
|
||||||
* Descr:
|
* Descr:
|
||||||
*/
|
*/
|
||||||
void InputServer::HandleSetMousePosition(BMessage *message, BMessage *outbound)
|
void
|
||||||
|
InputServer::HandleSetMousePosition(BMessage *message, BMessage *outbound)
|
||||||
{
|
{
|
||||||
|
|
||||||
// this assumes that both supplied pointers are identical
|
// this assumes that both supplied pointers are identical
|
||||||
@@ -838,26 +788,19 @@ void InputServer::HandleSetMousePosition(BMessage *message, BMessage *outbound)
|
|||||||
* Method: InputServer::HandleGetMouseMap()
|
* Method: InputServer::HandleGetMouseMap()
|
||||||
* Descr:
|
* Descr:
|
||||||
*/
|
*/
|
||||||
void InputServer::HandleGetMouseMap(BMessage* message,
|
void
|
||||||
|
InputServer::HandleGetSetMouseMap(BMessage* message,
|
||||||
BMessage* reply)
|
BMessage* reply)
|
||||||
{
|
{
|
||||||
status_t status = reply->AddData("mouse_map", B_RAW_TYPE, &sMouseMap, sizeof(sMouseMap) );
|
status_t status;
|
||||||
message->SendReply(status, reply);
|
mouse_map *map;
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Method: InputServer::HandleSetMouseMap()
|
|
||||||
* Descr:
|
|
||||||
*/
|
|
||||||
void InputServer::HandleSetMouseMap(BMessage* message,
|
|
||||||
BMessage* reply)
|
|
||||||
{
|
|
||||||
mouse_map* map;
|
|
||||||
ssize_t size;
|
ssize_t size;
|
||||||
message->FindData("mouse_map", B_RAW_TYPE, (const void**)&map, &size);
|
|
||||||
memcpy(&sMouseMap, map, sizeof(sMouseMap) );
|
if (message->FindData("mouse_map", B_RAW_TYPE, (const void**)&map, &size) == B_OK) {
|
||||||
status_t status = ControlDevices(NULL, B_POINTING_DEVICE, B_MOUSE_MAP_CHANGED, NULL);
|
memcpy(&sMouseMap, map, sizeof(sMouseMap) );
|
||||||
|
status = ControlDevices(NULL, B_POINTING_DEVICE, B_MOUSE_MAP_CHANGED, NULL);
|
||||||
|
} else
|
||||||
|
status = reply->AddData("mouse_map", B_RAW_TYPE, &sMouseMap, sizeof(sMouseMap) );
|
||||||
message->SendReply(status, reply);
|
message->SendReply(status, reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -866,7 +809,8 @@ void InputServer::HandleSetMouseMap(BMessage* message,
|
|||||||
* Method: InputServer::HandleGetKeyboardID()
|
* Method: InputServer::HandleGetKeyboardID()
|
||||||
* Descr:
|
* Descr:
|
||||||
*/
|
*/
|
||||||
void InputServer::HandleGetKeyboardID(BMessage *,
|
void
|
||||||
|
InputServer::HandleGetKeyboardID(BMessage *,
|
||||||
BMessage *)
|
BMessage *)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -876,7 +820,8 @@ void InputServer::HandleGetKeyboardID(BMessage *,
|
|||||||
* Method: InputServer::HandleGetClickSpeed()
|
* Method: InputServer::HandleGetClickSpeed()
|
||||||
* Descr:
|
* Descr:
|
||||||
*/
|
*/
|
||||||
void InputServer::HandleGetClickSpeed(BMessage* message,
|
void
|
||||||
|
InputServer::HandleGetClickSpeed(BMessage* message,
|
||||||
BMessage* reply)
|
BMessage* reply)
|
||||||
{
|
{
|
||||||
status_t status = reply->AddInt64("mouse_click_speed", sMouseClickSpeed);
|
status_t status = reply->AddInt64("mouse_click_speed", sMouseClickSpeed);
|
||||||
@@ -887,7 +832,8 @@ void InputServer::HandleGetClickSpeed(BMessage* message,
|
|||||||
* Method: InputServer::HandleSetClickSpeed()
|
* Method: InputServer::HandleSetClickSpeed()
|
||||||
* Descr:
|
* Descr:
|
||||||
*/
|
*/
|
||||||
void InputServer::HandleSetClickSpeed(BMessage* message,
|
void
|
||||||
|
InputServer::HandleSetClickSpeed(BMessage* message,
|
||||||
BMessage* reply)
|
BMessage* reply)
|
||||||
{
|
{
|
||||||
message->FindInt64("mouse_click_speed", &sMouseClickSpeed);
|
message->FindInt64("mouse_click_speed", &sMouseClickSpeed);
|
||||||
@@ -897,26 +843,18 @@ void InputServer::HandleSetClickSpeed(BMessage* message,
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Method: InputServer::HandleGetKeyRepeatRate()
|
* Method: InputServer::HandleGetSetKeyRepeatRate()
|
||||||
* Descr:
|
* Descr:
|
||||||
*/
|
*/
|
||||||
void InputServer::HandleGetKeyRepeatRate(BMessage* message,
|
void
|
||||||
|
InputServer::HandleGetSetKeyRepeatRate(BMessage* message,
|
||||||
BMessage* reply)
|
BMessage* reply)
|
||||||
{
|
{
|
||||||
status_t status = reply->AddInt32("key_repeat_rate", sKeyRepeatRate);
|
status_t status;
|
||||||
message->SendReply(status, reply);
|
if (message->FindInt32("key_repeat_rate", &sKeyRepeatRate) == B_OK)
|
||||||
}
|
status = ControlDevices(NULL, B_KEYBOARD_DEVICE, B_KEY_REPEAT_RATE_CHANGED, NULL);
|
||||||
|
else
|
||||||
|
status = reply->AddInt32("key_repeat_rate", sKeyRepeatRate);
|
||||||
/*
|
|
||||||
* Method: InputServer::HandleSetKeyRepeatRate()
|
|
||||||
* Descr:
|
|
||||||
*/
|
|
||||||
void InputServer::HandleSetKeyRepeatRate(BMessage* message,
|
|
||||||
BMessage* reply)
|
|
||||||
{
|
|
||||||
message->FindInt32("key_repeat_rate", &sKeyRepeatRate);
|
|
||||||
status_t status = ControlDevices(NULL, B_KEYBOARD_DEVICE, B_KEY_REPEAT_RATE_CHANGED, NULL);
|
|
||||||
message->SendReply(status, reply);
|
message->SendReply(status, reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -925,8 +863,9 @@ void InputServer::HandleSetKeyRepeatRate(BMessage* message,
|
|||||||
* Method: InputServer::HandleGetSetKeyMap()
|
* Method: InputServer::HandleGetSetKeyMap()
|
||||||
* Descr:
|
* Descr:
|
||||||
*/
|
*/
|
||||||
void InputServer::HandleGetSetKeyMap(BMessage *,
|
void
|
||||||
BMessage *)
|
InputServer::HandleGetSetKeyMap(BMessage *message,
|
||||||
|
BMessage *reply)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -935,12 +874,89 @@ void InputServer::HandleGetSetKeyMap(BMessage *,
|
|||||||
* Method: InputServer::HandleFocusUnfocusIMAwareView()
|
* Method: InputServer::HandleFocusUnfocusIMAwareView()
|
||||||
* Descr:
|
* Descr:
|
||||||
*/
|
*/
|
||||||
void InputServer::HandleFocusUnfocusIMAwareView(BMessage *,
|
void
|
||||||
|
InputServer::HandleFocusUnfocusIMAwareView(BMessage *,
|
||||||
BMessage *)
|
BMessage *)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Method: InputServer::HandleFindDevices()
|
||||||
|
* Descr:
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
InputServer::HandleFindDevices(BMessage *message,
|
||||||
|
BMessage *reply)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Method: InputServer::HandleWatchDevices()
|
||||||
|
* Descr:
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
InputServer::HandleWatchDevices(BMessage *message,
|
||||||
|
BMessage *reply)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Method: InputServer::HandleIsDeviceRunning()
|
||||||
|
* Descr:
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
InputServer::HandleIsDeviceRunning(BMessage *message,
|
||||||
|
BMessage *reply)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Method: InputServer::HandleStartStopDevices()
|
||||||
|
* Descr:
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
InputServer::HandleStartStopDevices(BMessage *message,
|
||||||
|
BMessage *reply)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Method: InputServer::HandleControlDevices()
|
||||||
|
* Descr:
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
InputServer::HandleControlDevices(BMessage *message,
|
||||||
|
BMessage *reply)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Method: InputServer::HandleSystemShuttingDown()
|
||||||
|
* Descr:
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
InputServer::HandleSystemShuttingDown(BMessage *message,
|
||||||
|
BMessage *reply)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Method: InputServer::HandleNodeMonitor()
|
||||||
|
* Descr:
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
InputServer::HandleNodeMonitor(BMessage *message)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Method: InputServer::EnqueueDeviceMessage()
|
* Method: InputServer::EnqueueDeviceMessage()
|
||||||
* Descr:
|
* Descr:
|
||||||
@@ -956,7 +972,8 @@ status_t InputServer::EnqueueDeviceMessage(BMessage *message)
|
|||||||
* Method: InputServer::EnqueueMethodMessage()
|
* Method: InputServer::EnqueueMethodMessage()
|
||||||
* Descr:
|
* Descr:
|
||||||
*/
|
*/
|
||||||
status_t InputServer::EnqueueMethodMessage(BMessage *)
|
status_t
|
||||||
|
InputServer::EnqueueMethodMessage(BMessage *)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -986,7 +1003,8 @@ status_t InputServer::LockMethodQueue(void)
|
|||||||
* Method: InputServer::SetNextMethod()
|
* Method: InputServer::SetNextMethod()
|
||||||
* Descr:
|
* Descr:
|
||||||
*/
|
*/
|
||||||
status_t InputServer::SetNextMethod(bool)
|
status_t
|
||||||
|
InputServer::SetNextMethod(bool)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -1018,7 +1036,8 @@ const BMessenger* InputServer::MethodReplicant(void)
|
|||||||
* Method: InputServer::EventLoop()
|
* Method: InputServer::EventLoop()
|
||||||
* Descr:
|
* Descr:
|
||||||
*/
|
*/
|
||||||
status_t InputServer::EventLoop(void *)
|
status_t
|
||||||
|
InputServer::EventLoop(void *)
|
||||||
{
|
{
|
||||||
printf("Starting event loop . . .\n");
|
printf("Starting event loop . . .\n");
|
||||||
EventLooperPort = create_port(100, "obos_is_event_port");
|
EventLooperPort = create_port(100, "obos_is_event_port");
|
||||||
@@ -1046,14 +1065,14 @@ bool InputServer::EventLoopRunning(void)
|
|||||||
* Method: InputServer::DispatchEvents()
|
* Method: InputServer::DispatchEvents()
|
||||||
* Descr:
|
* Descr:
|
||||||
*/
|
*/
|
||||||
bool InputServer::DispatchEvents(BList *eventList)
|
bool
|
||||||
|
InputServer::DispatchEvents(BList *eventList)
|
||||||
{
|
{
|
||||||
BMessage *event;
|
BMessage *event;
|
||||||
|
|
||||||
for ( int32 i = 0; NULL != (event = (BMessage *)eventList->ItemAt(i)); i++ )
|
for ( int32 i = 0; NULL != (event = (BMessage *)eventList->ItemAt(i)); i++ ) {
|
||||||
{
|
// now we must send each event to the app_server
|
||||||
// now we must send each event to the app_server
|
DispatchEvent(event);
|
||||||
DispatchEvent(event);
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}// end DispatchEvents()
|
}// end DispatchEvents()
|
||||||
|
|||||||
@@ -86,29 +86,31 @@ public:
|
|||||||
virtual void MessageReceived(BMessage*);
|
virtual void MessageReceived(BMessage*);
|
||||||
|
|
||||||
void HandleSetMethod(BMessage*);
|
void HandleSetMethod(BMessage*);
|
||||||
void HandleGetMouseType(BMessage*, BMessage*);
|
void HandleGetSetMouseType(BMessage*, BMessage*);
|
||||||
void HandleSetMouseType(BMessage*, BMessage*);
|
void HandleGetSetMouseAcceleration(BMessage*, BMessage*);
|
||||||
void HandleGetMouseAcceleration(BMessage*, BMessage*);
|
void HandleGetSetKeyRepeatDelay(BMessage*, BMessage*);
|
||||||
void HandleSetMouseAcceleration(BMessage*, BMessage*);
|
|
||||||
void HandleGetKeyRepeatDelay(BMessage*, BMessage*);
|
|
||||||
void HandleSetKeyRepeatDelay(BMessage*, BMessage*);
|
|
||||||
void HandleGetKeyInfo(BMessage*, BMessage*);
|
void HandleGetKeyInfo(BMessage*, BMessage*);
|
||||||
void HandleGetModifiers(BMessage*, BMessage*);
|
void HandleGetModifiers(BMessage*, BMessage*);
|
||||||
void HandleSetModifierKey(BMessage*, BMessage*);
|
void HandleSetModifierKey(BMessage*, BMessage*);
|
||||||
void HandleSetKeyboardLocks(BMessage*, BMessage*);
|
void HandleSetKeyboardLocks(BMessage*, BMessage*);
|
||||||
void HandleGetMouseSpeed(BMessage*, BMessage*);
|
void HandleGetSetMouseSpeed(BMessage*, BMessage*);
|
||||||
void HandleSetMouseSpeed(BMessage*, BMessage*);
|
|
||||||
void HandleSetMousePosition(BMessage*, BMessage*);
|
void HandleSetMousePosition(BMessage*, BMessage*);
|
||||||
void HandleGetMouseMap(BMessage*, BMessage*);
|
void HandleGetSetMouseMap(BMessage*, BMessage*);
|
||||||
void HandleSetMouseMap(BMessage*, BMessage*);
|
|
||||||
void HandleGetKeyboardID(BMessage*, BMessage*);
|
void HandleGetKeyboardID(BMessage*, BMessage*);
|
||||||
void HandleGetClickSpeed(BMessage*, BMessage*);
|
void HandleGetClickSpeed(BMessage*, BMessage*);
|
||||||
void HandleSetClickSpeed(BMessage*, BMessage*);
|
void HandleSetClickSpeed(BMessage*, BMessage*);
|
||||||
void HandleGetKeyRepeatRate(BMessage*, BMessage*);
|
void HandleGetSetKeyRepeatRate(BMessage*, BMessage*);
|
||||||
void HandleSetKeyRepeatRate(BMessage*, BMessage*);
|
|
||||||
void HandleGetSetKeyMap(BMessage*, BMessage*);
|
void HandleGetSetKeyMap(BMessage*, BMessage*);
|
||||||
void HandleFocusUnfocusIMAwareView(BMessage*, BMessage*);
|
void HandleFocusUnfocusIMAwareView(BMessage*, BMessage*);
|
||||||
|
|
||||||
|
void HandleFindDevices(BMessage*, BMessage*);
|
||||||
|
void HandleWatchDevices(BMessage*, BMessage*);
|
||||||
|
void HandleIsDeviceRunning(BMessage*, BMessage*);
|
||||||
|
void HandleStartStopDevices(BMessage*, BMessage*);
|
||||||
|
void HandleControlDevices(BMessage*, BMessage*);
|
||||||
|
void HandleSystemShuttingDown(BMessage*, BMessage*);
|
||||||
|
void HandleNodeMonitor(BMessage*);
|
||||||
|
|
||||||
status_t EnqueueDeviceMessage(BMessage*);
|
status_t EnqueueDeviceMessage(BMessage*);
|
||||||
status_t EnqueueMethodMessage(BMessage*);
|
status_t EnqueueMethodMessage(BMessage*);
|
||||||
status_t UnlockMethodQueue(void);
|
status_t UnlockMethodQueue(void);
|
||||||
|
|||||||
Reference in New Issue
Block a user