implemented AS_GET_ACCELERANT/DRIVER_PATH and renamed the relative constants
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15666 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
a66e501974
commit
51a523b147
@ -991,16 +991,16 @@ BWindowScreen::InitClone()
|
||||
|
||||
CALLED();
|
||||
AppServerLink link;
|
||||
link.StartMessage(AS_GET_ACCELERANT_NAME);
|
||||
link.StartMessage(AS_GET_ACCELERANT_PATH);
|
||||
link.Attach<int32>(fScreenIndex);
|
||||
|
||||
status_t status = B_ERROR;
|
||||
if (link.FlushWithReply(status) < B_OK || status < B_OK)
|
||||
return status;
|
||||
|
||||
BString accelerantName;
|
||||
link.ReadString(accelerantName);
|
||||
fAddonImage = load_add_on(accelerantName.String());
|
||||
BString accelerantPath;
|
||||
link.ReadString(accelerantPath);
|
||||
fAddonImage = load_add_on(accelerantPath.String());
|
||||
if (fAddonImage < B_OK) {
|
||||
printf("InitClone: cannot load accelerant image\n");
|
||||
return fAddonImage;
|
||||
@ -1025,12 +1025,12 @@ BWindowScreen::InitClone()
|
||||
}
|
||||
|
||||
status = B_ERROR;
|
||||
link.StartMessage(AS_GET_DRIVER_NAME);
|
||||
link.StartMessage(AS_GET_DRIVER_PATH);
|
||||
link.Attach<int32>(fScreenIndex);
|
||||
if (link.FlushWithReply(status) == B_OK && status == B_OK) {
|
||||
BString driverName;
|
||||
link.ReadString(driverName);
|
||||
status = clone((void *)driverName.String());
|
||||
BString driverPath;
|
||||
link.ReadString(driverPath);
|
||||
status = clone((void *)driverPath.String());
|
||||
}
|
||||
|
||||
if (status < B_OK) {
|
||||
|
@ -2280,6 +2280,36 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
|
||||
fLink.Flush();
|
||||
break;
|
||||
}
|
||||
|
||||
case AS_GET_ACCELERANT_PATH:
|
||||
{
|
||||
int32 index;
|
||||
fLink.Read<int32>(&index);
|
||||
|
||||
BString path;
|
||||
status_t status = fDesktop->HWInterface()->GetAccelerantPath(path);
|
||||
fLink.StartMessage(status);
|
||||
if (status == B_OK)
|
||||
fLink.AttachString(path.String());
|
||||
|
||||
fLink.Flush();
|
||||
break;
|
||||
}
|
||||
|
||||
case AS_GET_DRIVER_PATH:
|
||||
{
|
||||
int32 index;
|
||||
fLink.Read<int32>(&index);
|
||||
|
||||
BString path;
|
||||
status_t status = fDesktop->HWInterface()->GetDriverPath(path);
|
||||
fLink.StartMessage(status);
|
||||
if (status == B_OK)
|
||||
fLink.AttachString(path.String());
|
||||
|
||||
fLink.Flush();
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
printf("ServerApp %s received unhandled message code %ld\n",
|
||||
|
@ -616,6 +616,26 @@ AccelerantHWInterface::DPMSCapabilities()
|
||||
return fAccDPMSCapabilities();
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
AccelerantHWInterface::GetAccelerantPath(BString &string)
|
||||
{
|
||||
image_info info;
|
||||
status_t status = get_image_info(fAccelerantImage, &info);
|
||||
if (status == B_OK)
|
||||
string = info.name;
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
AccelerantHWInterface::GetDriverPath(BString &string)
|
||||
{
|
||||
// TODO: Get path from fCardFD: is that possible ?
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
|
||||
// AvailableHardwareAcceleration
|
||||
uint32
|
||||
AccelerantHWInterface::AvailableHWAcceleration() const
|
||||
|
@ -47,6 +47,9 @@ public:
|
||||
virtual uint32 DPMSMode();
|
||||
virtual uint32 DPMSCapabilities();
|
||||
|
||||
virtual status_t GetAccelerantPath(BString &path);
|
||||
virtual status_t GetDriverPath(BString &path);
|
||||
|
||||
// query for available hardware accleration and perform it
|
||||
virtual uint32 AvailableHWAcceleration() const;
|
||||
|
||||
|
@ -38,6 +38,21 @@ HWInterface::Initialize()
|
||||
return MultiLocker::InitCheck();
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
HWInterface::GetAccelerantPath(BString &path)
|
||||
{
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
HWInterface::GetDriverPath(BString &path)
|
||||
{
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
|
||||
// SetCursor
|
||||
void
|
||||
HWInterface::SetCursor(ServerCursor* cursor)
|
||||
|
@ -19,6 +19,7 @@ class RenderingBuffer;
|
||||
class RGBColor;
|
||||
class ServerCursor;
|
||||
class UpdateQueue;
|
||||
class BString;
|
||||
|
||||
enum {
|
||||
HW_ACC_COPY_REGION = 0x00000001,
|
||||
@ -58,6 +59,9 @@ class HWInterface : public MultiLocker {
|
||||
virtual uint32 DPMSMode() = 0;
|
||||
virtual uint32 DPMSCapabilities() = 0;
|
||||
|
||||
virtual status_t GetAccelerantPath(BString &path);
|
||||
virtual status_t GetDriverPath(BString &path);
|
||||
|
||||
// query for available hardware accleration and perform it
|
||||
// (Initialize() must have been called already)
|
||||
virtual uint32 AvailableHWAcceleration() const
|
||||
|
Loading…
x
Reference in New Issue
Block a user