-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathEWProxyFrameBufferDriver.h
53 lines (47 loc) · 2.11 KB
/
EWProxyFrameBufferDriver.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef EWPROXYFRAMEBUFFERDRIVER_H__
#define EWPROXYFRAMEBUFFERDRIVER_H__
#include <IOKit/IOService.h>
#include <IOKit/IOBufferMemoryDescriptor.h>
#include "EWProxyFrameBuffer.h"
class info_ennowelbers_proxyframebuffer_fbuffer;
class info_ennowelbers_proxyframebuffer_client;
/*
* This class implements the basic driver functionality. It is matched against
* IOResource/IOKit and is therefore automatically loaded during bootup/upon installation
* our plist personality contains a few configuration settings which are used in this class
* Depending on those settings this class attaches the framebuffer to itself or not.
* The problem: the framebuffer already has a userclient to communicate with the rest of mac os.
* so.. if we want to fetch the screen on a different path, we need to have our own user client.
* but hacking two user clients into one class (the framebuffer) sounded risky. therefore this
* two-stage approach. Our framework connects to this class, whereas mac os x connects directly
* to the framebuffer
*/
class info_ennowelbers_proxyframebuffer_driver: public IOService
{
OSDeclareDefaultStructors(info_ennowelbers_proxyframebuffer_driver)
private:
void initFB();
bool shouldInitFB();
public:
IOBufferMemoryDescriptor *buffer;
info_ennowelbers_proxyframebuffer_fbuffer *fbuffer;
info_ennowelbers_proxyframebuffer_client *eventClient;
virtual bool init(OSDictionary *dictionary = 0);
virtual void free(void);
virtual IOService *probe(IOService *provider, SInt32 *score);
virtual bool start(IOService *provider);
virtual void stop(IOService *provider);
virtual IOReturn setPowerState(unsigned long powerStateOrdinal, IOService *originatingfrom);
//internal support functions
virtual unsigned int getMaxWidth();
virtual unsigned int getMaxHeight();
virtual unsigned int getModeCount();
virtual IOReturn getAllModes(EWProxyFramebufferModeInfo *mode);
virtual IOReturn getmodeInfo(unsigned int mode, EWProxyFramebufferModeInfo *result);
//UserClient functions
IOReturn StartFramebuffer(int mode);
IOReturn StopFramebuffer();
IOReturn CheckFramebufferState();
IOReturn UpdateMemory(void);
};
#endif