os/boardsupport/emulator/emulatorbsp/specific/display_dev.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 
    17 #include <kernel/kern_priv.h>
    18 #include "display_dev.h"
    19 #include "display_chan.h"
    20 
    21 
    22 DECLARE_STANDARD_LDD()
    23 	{
    24 	return new DDisplayDevice;
    25 	}
    26 
    27 
    28 DDisplayDevice::DDisplayDevice()
    29 	{
    30 	iVersion = TVersion(KDisplayChMajorVersionNumber,
    31 			KDisplayChMinorVersionNumber, KDisplayChBuildVersionNumber);
    32 	iParseMask=KDeviceAllowUnit;
    33 	}
    34 
    35 
    36 DDisplayDevice::~DDisplayDevice()
    37 	{
    38 	}
    39 
    40 
    41 TInt DDisplayDevice::Install()
    42 	{
    43 	return SetName(&RDisplayChannel::Name());
    44 	}
    45 
    46 
    47 /**
    48 Called by the kernel's device driver framework to create a Logical Channel.
    49 This is called in the context of the user thread (client) which requested the
    50 creation of a Logical Channel (e.g. through a call to RBusLogicalChannel::DoCreate)
    51 The thread is in a critical section.
    52 
    53 @param aChannel Set to point to the created Logical Channel
    54 
    55 @return KErrNone if successful, otherwise one of the other system wide error codes.
    56 */
    57 TInt DDisplayDevice::Create(DLogicalChannelBase*& aChannel)
    58 	{
    59 	aChannel = new DDisplayChannel();
    60 
    61 	return aChannel ? KErrNone : KErrNoMemory;
    62 	}
    63 
    64 
    65 /**
    66 Return the drivers capabilities.
    67 Called in the response to an RDevice::GetCaps() request.
    68 
    69 @param aDes User-side descriptor to write capabilities information into
    70 */
    71 void DDisplayDevice::GetCaps(TDes8& aDes) const
    72 	{
    73 	// Create a capabilities object
    74 	DDisplayChannel::TCaps caps;
    75 	caps.iVersion = iVersion;
    76 	// Write it back to user memory
    77 	Kern::InfoCopy(aDes,reinterpret_cast<TUint8*>(&caps),sizeof(caps));
    78 	}
    79