Checkin, per Jason Vandermark.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@294 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,12 +1,41 @@
|
||||
/***********************************************************************
|
||||
* AUTHOR: nobody <baron>
|
||||
* FILE: InputServerDevice.cpp
|
||||
* DATE: Sun Dec 16 15:57:43 2001
|
||||
* DESCR:
|
||||
***********************************************************************/
|
||||
#include "InputServerDevice.h"
|
||||
/*****************************************************************************/
|
||||
// OpenBeOS InputServer
|
||||
//
|
||||
// Version: [0.0.5] [Development Stage]
|
||||
//
|
||||
// [Description]
|
||||
//
|
||||
//
|
||||
// This application and all source files used in its construction, except
|
||||
// where noted, are licensed under the MIT License, and have been written
|
||||
// and are:
|
||||
//
|
||||
// Copyright (c) 2002 OpenBeOS Project
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the "Software"),
|
||||
// to deal in the Software without restriction, including without limitation
|
||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
// and/or sell copies of the Software, and to permit persons to whom the
|
||||
// Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
|
||||
#include "InputServerDevice.h"
|
||||
#include "InputServer.h"
|
||||
|
||||
/**
|
||||
* Method: BInputServerDevice::BInputServerDevice()
|
||||
* Descr:
|
||||
*/
|
||||
@@ -15,7 +44,7 @@ BInputServerDevice::BInputServerDevice()
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* Method: BInputServerDevice::~BInputServerDevice()
|
||||
* Descr:
|
||||
*/
|
||||
@@ -24,7 +53,7 @@ BInputServerDevice::~BInputServerDevice()
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* Method: BInputServerDevice::InitCheck()
|
||||
* Descr:
|
||||
*/
|
||||
@@ -37,7 +66,7 @@ BInputServerDevice::InitCheck()
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* Method: BInputServerDevice::SystemShuttingDown()
|
||||
* Descr:
|
||||
*/
|
||||
@@ -50,7 +79,7 @@ BInputServerDevice::SystemShuttingDown()
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* Method: BInputServerDevice::Start()
|
||||
* Descr:
|
||||
*/
|
||||
@@ -64,7 +93,7 @@ BInputServerDevice::Start(const char *device,
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* Method: BInputServerDevice::Stop()
|
||||
* Descr:
|
||||
*/
|
||||
@@ -78,7 +107,7 @@ BInputServerDevice::Stop(const char *device,
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* Method: BInputServerDevice::Control()
|
||||
* Descr:
|
||||
*/
|
||||
@@ -94,20 +123,57 @@ BInputServerDevice::Control(const char *device,
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* Method: BInputServerDevice::RegisterDevices()
|
||||
* Descr:
|
||||
*/
|
||||
status_t
|
||||
BInputServerDevice::RegisterDevices(input_device_ref **devices)
|
||||
{
|
||||
status_t dummy;
|
||||
/*
|
||||
// Lock this section of code so that access to the device list
|
||||
// is serialized. Be sure to release the lock before exitting.
|
||||
//
|
||||
InputServer::gInputDeviceListLocker.Lock();
|
||||
|
||||
bool has_pointing_device = false;
|
||||
bool has_keyboard_device = false;
|
||||
|
||||
input_device_ref *device = NULL;
|
||||
for (int i = 0; NULL != (device = devices[i]); i++)
|
||||
{
|
||||
// :TODO: Check to make sure that each device is valid and
|
||||
// that it is not already registered.
|
||||
// getDeviceIndex()
|
||||
|
||||
InputServer::gInputDeviceList.AddItem(new InputDeviceListItem(this, device) );
|
||||
|
||||
has_pointing_device = has_pointing_device || (device->type == B_POINTING_DEVICE);
|
||||
has_keyboard_device = has_keyboard_device || (device->type == B_KEYBOARD_DEVICE);
|
||||
}
|
||||
|
||||
return dummy;
|
||||
// If the InputServer event loop is running, signal the InputServer
|
||||
// to start all devices of the type managed by this InputServerDevice.
|
||||
//
|
||||
if (InputServer::EventLoopRunning() )
|
||||
{
|
||||
if (has_pointing_device)
|
||||
{
|
||||
InputServer::StartStopDevices(NULL, B_POINTING_DEVICE, true);
|
||||
}
|
||||
if (has_keyboard_device)
|
||||
{
|
||||
InputServer::StartStopDevices(NULL, B_KEYBOARD_DEVICE, true);
|
||||
}
|
||||
}
|
||||
|
||||
InputServer::gInputDeviceListLocker.Unlock();
|
||||
*/
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* Method: BInputServerDevice::UnregisterDevices()
|
||||
* Descr:
|
||||
*/
|
||||
@@ -120,20 +186,33 @@ BInputServerDevice::UnregisterDevices(input_device_ref **devices)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* Method: BInputServerDevice::EnqueueMessage()
|
||||
* Descr:
|
||||
*/
|
||||
status_t
|
||||
BInputServerDevice::EnqueueMessage(BMessage *message)
|
||||
{
|
||||
status_t dummy;
|
||||
|
||||
return dummy;
|
||||
/* status_t err;
|
||||
|
||||
ssize_t length = message->FlattenedSize();
|
||||
char* buffer = new char[length];
|
||||
if ((err = message->Flatten(buffer,length)) < 0) {
|
||||
} else {
|
||||
if((write_port(mEventPort, 0, buffer, length)) < 0) {
|
||||
|
||||
}else {
|
||||
free(buffer);
|
||||
err = B_OK;
|
||||
}
|
||||
}
|
||||
return err;
|
||||
*/
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* Method: BInputServerDevice::StartMonitoringDevice()
|
||||
* Descr:
|
||||
*/
|
||||
@@ -146,7 +225,7 @@ BInputServerDevice::StartMonitoringDevice(const char *device)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* Method: BInputServerDevice::StopMonitoringDevice()
|
||||
* Descr:
|
||||
*/
|
||||
@@ -158,8 +237,12 @@ BInputServerDevice::StopMonitoringDevice(const char *device)
|
||||
return dummy;
|
||||
}
|
||||
|
||||
/**
|
||||
///////////////////////// Below this line is reserved functions /////////////////////////////
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
/**
|
||||
* Method: BInputServerDevice::_ReservedInputServerDevice1()
|
||||
* Descr:
|
||||
*/
|
||||
@@ -169,7 +252,7 @@ BInputServerDevice::_ReservedInputServerDevice1()
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* Method: BInputServerDevice::_ReservedInputServerDevice2()
|
||||
* Descr:
|
||||
*/
|
||||
@@ -179,7 +262,7 @@ BInputServerDevice::_ReservedInputServerDevice2()
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* Method: BInputServerDevice::_ReservedInputServerDevice3()
|
||||
* Descr:
|
||||
*/
|
||||
@@ -189,7 +272,7 @@ BInputServerDevice::_ReservedInputServerDevice3()
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* Method: BInputServerDevice::_ReservedInputServerDevice4()
|
||||
* Descr:
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user