├── .gitignore
├── dist
├── EWProxyframeBufferApp.app
│ └── Contents
│ │ ├── PkgInfo
│ │ ├── Frameworks
│ │ └── EWProxyFrameBufferConnection.framework
│ │ │ ├── Versions
│ │ │ ├── Current
│ │ │ └── A
│ │ │ │ ├── EWProxyFrameBufferConnection
│ │ │ │ ├── Resources
│ │ │ │ └── Info.plist
│ │ │ │ └── Headers
│ │ │ │ └── EWProxyFrameBuffer.h
│ │ │ ├── Headers
│ │ │ ├── Resources
│ │ │ └── EWProxyFrameBufferConnection
│ │ ├── MacOS
│ │ └── EWProxyframeBufferApp
│ │ ├── Resources
│ │ └── English.lproj
│ │ │ ├── Assets.car
│ │ │ └── MenuBarApp.nib
│ │ └── Info.plist
├── EWProxyFrameBufferConnection.framework
│ ├── Versions
│ │ ├── Current
│ │ └── A
│ │ │ ├── EWProxyFrameBufferConnection
│ │ │ ├── Resources
│ │ │ └── Info.plist
│ │ │ └── Headers
│ │ │ └── EWProxyFrameBuffer.h
│ ├── Headers
│ ├── Resources
│ └── EWProxyFrameBufferConnection
└── EWProxyFrameBuffer.kext
│ └── Contents
│ ├── MacOS
│ └── EWProxyFrameBuffer
│ ├── Resources
│ ├── English.lproj
│ │ └── EWProxyFramebuffer-InfoPlist.strings
│ └── IOKit
│ │ └── graphics
│ │ └── IOFramebufferPrivate.h
│ └── Info.plist
├── .DS_Store
├── installApp.sh
├── English.lproj
├── EWProxyFramebuffer-InfoPlist.strings
├── .DS_Store
└── Images.xcassets
│ ├── Contents.json
│ ├── Menu Icon.imageset
│ ├── .DS_Store
│ ├── display-16.png
│ ├── display-32.png
│ └── Contents.json
│ ├── Check On.imageset
│ ├── check-16.png
│ ├── check-32.png
│ └── Contents.json
│ ├── Check Off.imageset
│ ├── check-off-16.png
│ ├── check-off-32.png
│ └── Contents.json
│ └── AppIcon.appiconset
│ └── Contents.json
├── EWProxyFrameBuffer.tar.gz
├── EWProxyFrameBuffer.xcodeproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ ├── xcuserdata
│ │ └── iceman.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
├── xcuserdata
│ └── iceman.xcuserdatad
│ │ └── xcschemes
│ │ └── xcschememanagement.plist
├── xcshareddata
│ └── xcschemes
│ │ ├── EWProxyFrameBuffer.xcscheme
│ │ ├── All.xcscheme
│ │ └── EWProxyframeBufferApp.xcscheme
└── project.pbxproj
├── README
├── main.m
├── install.sh
├── version.plist
├── EWProxyFrameBufferConnection-Info.plist
├── README.md
├── AppDelegate.h
├── EWProxyframeBufferApp-Info.plist
├── UIMainDialog.h
├── LICENSE
├── EWProxyFrameBufferDriver.h
├── EWProxyFrameBuffer.h
├── EWProxyFramebuffer-Info.plist
├── EWProxyFrameBufferFBuffer.h
├── EWProxyFrameBuffer.m
├── EWProxyFrameBufferClient.h
├── UIMainDialog.m
├── AppDelegate.m
├── EWProxyFrameBufferDriver.cpp
├── EWProxyFrameBufferClient.cpp
├── IOKit
└── graphics
│ └── IOFramebufferPrivate.h
├── APPLE_LICENSE
└── EWProxyFrameBufferFBuffer.cpp
/.gitignore:
--------------------------------------------------------------------------------
1 | /Release
2 |
--------------------------------------------------------------------------------
/dist/EWProxyframeBufferApp.app/Contents/PkgInfo:
--------------------------------------------------------------------------------
1 | APPL????
--------------------------------------------------------------------------------
/dist/EWProxyFrameBufferConnection.framework/Versions/Current:
--------------------------------------------------------------------------------
1 | A
--------------------------------------------------------------------------------
/dist/EWProxyFrameBufferConnection.framework/Headers:
--------------------------------------------------------------------------------
1 | Versions/Current/Headers
--------------------------------------------------------------------------------
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/miolini/macos-virtual-display/HEAD/.DS_Store
--------------------------------------------------------------------------------
/dist/EWProxyFrameBufferConnection.framework/Resources:
--------------------------------------------------------------------------------
1 | Versions/Current/Resources
--------------------------------------------------------------------------------
/installApp.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | cp -R ./Release/EWProxyFrameBufferApp.app /Applications/
4 |
5 |
--------------------------------------------------------------------------------
/English.lproj/EWProxyFramebuffer-InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/dist/EWProxyframeBufferApp.app/Contents/Frameworks/EWProxyFrameBufferConnection.framework/Versions/Current:
--------------------------------------------------------------------------------
1 | A
--------------------------------------------------------------------------------
/English.lproj/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/miolini/macos-virtual-display/HEAD/English.lproj/.DS_Store
--------------------------------------------------------------------------------
/EWProxyFrameBuffer.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/miolini/macos-virtual-display/HEAD/EWProxyFrameBuffer.tar.gz
--------------------------------------------------------------------------------
/dist/EWProxyFrameBufferConnection.framework/EWProxyFrameBufferConnection:
--------------------------------------------------------------------------------
1 | Versions/Current/EWProxyFrameBufferConnection
--------------------------------------------------------------------------------
/dist/EWProxyframeBufferApp.app/Contents/Frameworks/EWProxyFrameBufferConnection.framework/Headers:
--------------------------------------------------------------------------------
1 | Versions/Current/Headers
--------------------------------------------------------------------------------
/English.lproj/Images.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/dist/EWProxyframeBufferApp.app/Contents/Frameworks/EWProxyFrameBufferConnection.framework/Resources:
--------------------------------------------------------------------------------
1 | Versions/Current/Resources
--------------------------------------------------------------------------------
/dist/EWProxyframeBufferApp.app/Contents/Frameworks/EWProxyFrameBufferConnection.framework/EWProxyFrameBufferConnection:
--------------------------------------------------------------------------------
1 | Versions/Current/EWProxyFrameBufferConnection
--------------------------------------------------------------------------------
/English.lproj/Images.xcassets/Menu Icon.imageset/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/miolini/macos-virtual-display/HEAD/English.lproj/Images.xcassets/Menu Icon.imageset/.DS_Store
--------------------------------------------------------------------------------
/English.lproj/Images.xcassets/Check On.imageset/check-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/miolini/macos-virtual-display/HEAD/English.lproj/Images.xcassets/Check On.imageset/check-16.png
--------------------------------------------------------------------------------
/English.lproj/Images.xcassets/Check On.imageset/check-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/miolini/macos-virtual-display/HEAD/English.lproj/Images.xcassets/Check On.imageset/check-32.png
--------------------------------------------------------------------------------
/English.lproj/Images.xcassets/Menu Icon.imageset/display-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/miolini/macos-virtual-display/HEAD/English.lproj/Images.xcassets/Menu Icon.imageset/display-16.png
--------------------------------------------------------------------------------
/English.lproj/Images.xcassets/Menu Icon.imageset/display-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/miolini/macos-virtual-display/HEAD/English.lproj/Images.xcassets/Menu Icon.imageset/display-32.png
--------------------------------------------------------------------------------
/dist/EWProxyFrameBuffer.kext/Contents/MacOS/EWProxyFrameBuffer:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/miolini/macos-virtual-display/HEAD/dist/EWProxyFrameBuffer.kext/Contents/MacOS/EWProxyFrameBuffer
--------------------------------------------------------------------------------
/English.lproj/Images.xcassets/Check Off.imageset/check-off-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/miolini/macos-virtual-display/HEAD/English.lproj/Images.xcassets/Check Off.imageset/check-off-16.png
--------------------------------------------------------------------------------
/English.lproj/Images.xcassets/Check Off.imageset/check-off-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/miolini/macos-virtual-display/HEAD/English.lproj/Images.xcassets/Check Off.imageset/check-off-32.png
--------------------------------------------------------------------------------
/dist/EWProxyframeBufferApp.app/Contents/MacOS/EWProxyframeBufferApp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/miolini/macos-virtual-display/HEAD/dist/EWProxyframeBufferApp.app/Contents/MacOS/EWProxyframeBufferApp
--------------------------------------------------------------------------------
/dist/EWProxyframeBufferApp.app/Contents/Resources/English.lproj/Assets.car:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/miolini/macos-virtual-display/HEAD/dist/EWProxyframeBufferApp.app/Contents/Resources/English.lproj/Assets.car
--------------------------------------------------------------------------------
/dist/EWProxyframeBufferApp.app/Contents/Resources/English.lproj/MenuBarApp.nib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/miolini/macos-virtual-display/HEAD/dist/EWProxyframeBufferApp.app/Contents/Resources/English.lproj/MenuBarApp.nib
--------------------------------------------------------------------------------
/dist/EWProxyFrameBufferConnection.framework/Versions/A/EWProxyFrameBufferConnection:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/miolini/macos-virtual-display/HEAD/dist/EWProxyFrameBufferConnection.framework/Versions/A/EWProxyFrameBufferConnection
--------------------------------------------------------------------------------
/EWProxyFrameBuffer.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/dist/EWProxyFrameBuffer.kext/Contents/Resources/English.lproj/EWProxyFramebuffer-InfoPlist.strings:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/miolini/macos-virtual-display/HEAD/dist/EWProxyFrameBuffer.kext/Contents/Resources/English.lproj/EWProxyFramebuffer-InfoPlist.strings
--------------------------------------------------------------------------------
/EWProxyFrameBuffer.xcodeproj/project.xcworkspace/xcuserdata/iceman.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/miolini/macos-virtual-display/HEAD/EWProxyFrameBuffer.xcodeproj/project.xcworkspace/xcuserdata/iceman.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/README:
--------------------------------------------------------------------------------
1 | Licensing stuff
2 | ===============
3 |
4 | all files in the IOKit subdirectory are licensed under the Apple public license, see APPLE_LICENSE
5 |
6 | Contact the Author
7 | ==================
8 |
9 | You can contact me via twitter (@mkernel) or via mail enno.welbers@googlemail.com
10 |
--------------------------------------------------------------------------------
/dist/EWProxyframeBufferApp.app/Contents/Frameworks/EWProxyFrameBufferConnection.framework/Versions/A/EWProxyFrameBufferConnection:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/miolini/macos-virtual-display/HEAD/dist/EWProxyframeBufferApp.app/Contents/Frameworks/EWProxyFrameBufferConnection.framework/Versions/A/EWProxyFrameBufferConnection
--------------------------------------------------------------------------------
/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // PSPScreenDriverClient
4 | //
5 | // Created by Enno Welbers on 27.02.09.
6 | // Copyright __MyCompanyName__ 2009. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | int main(int argc, char *argv[])
12 | {
13 | return NSApplicationMain(argc, (const char **) argv);
14 | }
15 |
--------------------------------------------------------------------------------
/install.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | rm -rf /System/Library/Extensions/EWProxy*
4 |
5 | cp -R ./Release/EWProxyFrameBuffer.kext /System/Library/Extensions
6 | cp -R ./Release/EWProxyFrameBufferConnection.framework /System/Library/Extensions
7 |
8 | chown -R root:wheel /System/Library/Extensions/EWProxy*
9 | chmod -R 755 /System/Library/Extensions/EWProxy*
--------------------------------------------------------------------------------
/EWProxyFrameBuffer.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/English.lproj/Images.xcassets/Check On.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "check-16.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "check-32.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/English.lproj/Images.xcassets/Menu Icon.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "display-16.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "display-32.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/English.lproj/Images.xcassets/Check Off.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "check-off-16.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "check-off-32.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/version.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | BuildVersion
6 | 2
7 | CFBundleShortVersionString
8 | 1.0
9 | CFBundleVersion
10 | 1
11 | ProjectName
12 | DevToolsWizardTemplates
13 | SourceVersion
14 | 15920000
15 |
16 |
17 |
--------------------------------------------------------------------------------
/EWProxyFrameBufferConnection-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | English
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundlePackageType
14 | FMWK
15 | CFBundleShortVersionString
16 | 1.0
17 | CFBundleSignature
18 | ????
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # macos-virtual-display
2 |
3 | > Add virtual displays to achieve functionality similar to Sidecar/Duet Display/Luna Display.
4 |
5 | ## Installing
6 |
7 | Copy .kext & .framework to /System/Libraries/E with the proper permission & ownership. Reboot.
8 | EWProxyFramebuffer.app enables/disables the virtual display
9 |
10 | ## Usage
11 |
12 | 1. Create a virtual display on you mac using the attached driver (kext) and app.
13 | 2. Enable Screen Sharing or Remote Management (System Preferences/Sharing)
14 | 3. On the machine (computer or mobile device) that has the screen (connected to it) you want to use as an external monitor connect to using vnc (Screen Sharing)
15 |
16 | ## References
17 |
18 | - [Share Virtual Display (like Sidecar) on Mojave](https://www.tonymacx86.com/threads/share-virtual-display-like-sidecar-on-mojave.285494/)
19 |
--------------------------------------------------------------------------------
/AppDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | @interface AppDelegate : NSObject {
4 | NSString *imgState;
5 | NSString *driverState;
6 | NSMutableArray *Profiles;
7 | NSMutableArray *ProfileNames;
8 | io_service_t service;
9 | io_connect_t connect;
10 | int profileCount;
11 | int selectedMode;
12 | }
13 |
14 | @property (nonatomic,retain) NSMutableArray *ProfileNames;
15 | @property (nonatomic,retain) NSIndexSet *selectedProfile;
16 |
17 | @property (assign) IBOutlet NSWindow *window;
18 |
19 | @property (readwrite, retain) IBOutlet NSMenu *menu;
20 | @property (readwrite, retain) IBOutlet NSStatusItem *statusItem;
21 |
22 | - (IBAction)menuAction:(id)sender;
23 |
24 | - (IBAction) SwitchDriver:(id)sender;
25 | - (IBAction) SwitchDriver1:(id)sender;
26 | - (IBAction) SwitchDriver2:(id)sender;
27 | - (IBAction) SwitchDriver3:(id)sender;
28 | - (IBAction) SwitchDriverOff:(id)sender;
29 |
30 | - (int) getIntForkey:(NSString *)key;
31 | @end
32 |
--------------------------------------------------------------------------------
/EWProxyframeBufferApp-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | English
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | ${PRODUCT_NAME}
17 | CFBundlePackageType
18 | APPL
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | LSUIElement
24 |
25 | NSMainNibFile
26 | MenuBarApp
27 | NSPrincipalClass
28 | NSApplication
29 |
30 |
31 |
--------------------------------------------------------------------------------
/UIMainDialog.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIMainDialog.h
3 | // PSPScreenDriverClient
4 | //
5 | // Created by Enno Welbers on 27.02.09.
6 | // Copyright 2009 __MyCompanyName__. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface UIMainDialog : NSObject {
12 | NSString *imgState;
13 | NSString *driverState;
14 | NSMutableArray *Profiles;
15 | NSMutableArray *ProfileNames;
16 | IBOutlet NSImageView *imgView;
17 | NSIndexSet *selectedProfile;
18 | io_service_t service;
19 | io_connect_t connect;
20 | unsigned char *driverbuf;
21 | BOOL bufferOn;
22 | }
23 |
24 | @property (nonatomic,retain) NSString *imgState;
25 | @property (nonatomic,retain) NSString *driverState;
26 | @property (nonatomic,retain) NSMutableArray *ProfileNames;
27 | @property (nonatomic,retain) NSIndexSet *selectedProfile;
28 | @property (nonatomic) BOOL bufferOn;
29 | - (IBAction) fetchImage:(id)sender;
30 | - (IBAction) SwitchDriver:(id)sender;
31 | - (int) getMode;
32 | - (EWProxyFramebufferModeInfo*) getCurrentModeInfo;
33 | - (CGImageRef) getCursor;
34 |
35 | @end
36 |
--------------------------------------------------------------------------------
/English.lproj/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "mac",
5 | "size" : "16x16",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "mac",
10 | "size" : "16x16",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "mac",
15 | "size" : "32x32",
16 | "scale" : "1x"
17 | },
18 | {
19 | "idiom" : "mac",
20 | "size" : "32x32",
21 | "scale" : "2x"
22 | },
23 | {
24 | "idiom" : "mac",
25 | "size" : "128x128",
26 | "scale" : "1x"
27 | },
28 | {
29 | "idiom" : "mac",
30 | "size" : "128x128",
31 | "scale" : "2x"
32 | },
33 | {
34 | "idiom" : "mac",
35 | "size" : "256x256",
36 | "scale" : "1x"
37 | },
38 | {
39 | "idiom" : "mac",
40 | "size" : "256x256",
41 | "scale" : "2x"
42 | },
43 | {
44 | "idiom" : "mac",
45 | "size" : "512x512",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "mac",
50 | "size" : "512x512",
51 | "scale" : "2x"
52 | }
53 | ],
54 | "info" : {
55 | "version" : 1,
56 | "author" : "xcode"
57 | }
58 | }
--------------------------------------------------------------------------------
/EWProxyFrameBuffer.xcodeproj/xcuserdata/iceman.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | All.xcscheme_^#shared#^_
8 |
9 | orderHint
10 | 0
11 |
12 | EWProxyFrameBuffer.xcscheme_^#shared#^_
13 |
14 | orderHint
15 | 2
16 |
17 | EWProxyFrameBufferConnection.xcscheme_^#shared#^_
18 |
19 | orderHint
20 | 3
21 |
22 | EWProxyframeBufferApp.xcscheme_^#shared#^_
23 |
24 | orderHint
25 | 1
26 |
27 |
28 | SuppressBuildableAutocreation
29 |
30 | 32D94FC30562CBF700B6AF17
31 |
32 | primary
33 |
34 |
35 | 96614E0410E930720066624E
36 |
37 | primary
38 |
39 |
40 | 96614E9C10E93A820066624E
41 |
42 | primary
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/dist/EWProxyFrameBufferConnection.framework/Versions/A/Resources/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | BuildMachineOSBuild
6 | 18F132
7 | CFBundleDevelopmentRegion
8 | English
9 | CFBundleExecutable
10 | EWProxyFrameBufferConnection
11 | CFBundleIdentifier
12 | info.ennowelbers.proxyframebuffer.connection
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleSupportedPlatforms
22 |
23 | MacOSX
24 |
25 | CFBundleVersion
26 | 1
27 | DTCompiler
28 | com.apple.compilers.llvm.clang.1_0
29 | DTPlatformBuild
30 | 10B61
31 | DTPlatformVersion
32 | GM
33 | DTSDKBuild
34 | 18B71
35 | DTSDKName
36 | macosx10.14
37 | DTXcode
38 | 1010
39 | DTXcodeBuild
40 | 10B61
41 |
42 |
43 |
--------------------------------------------------------------------------------
/dist/EWProxyframeBufferApp.app/Contents/Frameworks/EWProxyFrameBufferConnection.framework/Versions/A/Resources/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | BuildMachineOSBuild
6 | 18F132
7 | CFBundleDevelopmentRegion
8 | English
9 | CFBundleExecutable
10 | EWProxyFrameBufferConnection
11 | CFBundleIdentifier
12 | info.ennowelbers.proxyframebuffer.connection
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleSupportedPlatforms
22 |
23 | MacOSX
24 |
25 | CFBundleVersion
26 | 1
27 | DTCompiler
28 | com.apple.compilers.llvm.clang.1_0
29 | DTPlatformBuild
30 | 10B61
31 | DTPlatformVersion
32 | GM
33 | DTSDKBuild
34 | 18B71
35 | DTSDKName
36 | macosx10.14
37 | DTXcode
38 | 1010
39 | DTXcodeBuild
40 | 10B61
41 |
42 |
43 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2009, Enno Welbers
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are met:
6 | * Redistributions of source code must retain the above copyright
7 | notice, this list of conditions and the following disclaimer.
8 | * Redistributions in binary form must reproduce the above copyright
9 | notice, this list of conditions and the following disclaimer in the
10 | documentation and/or other materials provided with the distribution.
11 | * Neither the name of the copyright holder nor the
12 | names of its contributors may be used to endorse or promote products
13 | derived from this software without specific prior written permission.
14 |
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 | DISCLAIMED. IN NO EVENT SHALL ENNO WELBERS BE LIABLE FOR ANY
19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
/dist/EWProxyframeBufferApp.app/Contents/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | BuildMachineOSBuild
6 | 18F132
7 | CFBundleDevelopmentRegion
8 | English
9 | CFBundleExecutable
10 | EWProxyframeBufferApp
11 | CFBundleIdentifier
12 | com.yourcompany.EWProxyframeBufferApp
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | EWProxyframeBufferApp
17 | CFBundlePackageType
18 | APPL
19 | CFBundleSignature
20 | ????
21 | CFBundleSupportedPlatforms
22 |
23 | MacOSX
24 |
25 | CFBundleVersion
26 | 1.0
27 | DTCompiler
28 | com.apple.compilers.llvm.clang.1_0
29 | DTPlatformBuild
30 | 10B61
31 | DTPlatformVersion
32 | GM
33 | DTSDKBuild
34 | 18B71
35 | DTSDKName
36 | macosx10.14
37 | DTXcode
38 | 1010
39 | DTXcodeBuild
40 | 10B61
41 | LSUIElement
42 |
43 | NSMainNibFile
44 | MenuBarApp
45 | NSPrincipalClass
46 | NSApplication
47 |
48 |
49 |
--------------------------------------------------------------------------------
/EWProxyFrameBufferDriver.h:
--------------------------------------------------------------------------------
1 | #ifndef EWPROXYFRAMEBUFFERDRIVER_H__
2 | #define EWPROXYFRAMEBUFFERDRIVER_H__
3 |
4 | #include
5 | #include
6 | #include "EWProxyFrameBuffer.h"
7 |
8 | class info_ennowelbers_proxyframebuffer_fbuffer;
9 | class info_ennowelbers_proxyframebuffer_client;
10 |
11 | /*
12 | * This class implements the basic driver functionality. It is matched against
13 | * IOResource/IOKit and is therefore automatically loaded during bootup/upon installation
14 | * our plist personality contains a few configuration settings which are used in this class
15 | * Depending on those settings this class attaches the framebuffer to itself or not.
16 | * The problem: the framebuffer already has a userclient to communicate with the rest of mac os.
17 | * so.. if we want to fetch the screen on a different path, we need to have our own user client.
18 | * but hacking two user clients into one class (the framebuffer) sounded risky. therefore this
19 | * two-stage approach. Our framework connects to this class, whereas mac os x connects directly
20 | * to the framebuffer
21 | */
22 | class info_ennowelbers_proxyframebuffer_driver: public IOService
23 | {
24 | OSDeclareDefaultStructors(info_ennowelbers_proxyframebuffer_driver)
25 | private:
26 | void initFB();
27 | bool shouldInitFB();
28 | public:
29 | IOBufferMemoryDescriptor *buffer;
30 | info_ennowelbers_proxyframebuffer_fbuffer *fbuffer;
31 | info_ennowelbers_proxyframebuffer_client *eventClient;
32 | virtual bool init(OSDictionary *dictionary = 0);
33 | virtual void free(void);
34 | virtual IOService *probe(IOService *provider, SInt32 *score);
35 | virtual bool start(IOService *provider);
36 | virtual void stop(IOService *provider);
37 | virtual IOReturn setPowerState(unsigned long powerStateOrdinal, IOService *originatingfrom);
38 | //internal support functions
39 | virtual unsigned int getMaxWidth();
40 | virtual unsigned int getMaxHeight();
41 |
42 | virtual unsigned int getModeCount();
43 | virtual IOReturn getAllModes(EWProxyFramebufferModeInfo *mode);
44 | virtual IOReturn getmodeInfo(unsigned int mode, EWProxyFramebufferModeInfo *result);
45 |
46 | //UserClient functions
47 | IOReturn StartFramebuffer(int mode);
48 | IOReturn StopFramebuffer();
49 | IOReturn CheckFramebufferState();
50 | IOReturn UpdateMemory(void);
51 | };
52 |
53 | #endif
--------------------------------------------------------------------------------
/EWProxyFrameBuffer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * PSPScreenShared.h
3 | * PSPScreenDriver
4 | *
5 | * Created by Enno Welbers on 28.02.09.
6 | * Copyright 2009 __MyCompanyName__. All rights reserved.
7 | *
8 | */
9 |
10 | #ifndef PSPSCREENSHARED_H__
11 | #define PSPSCREENSHARED_H__
12 |
13 | //this is our dispatch pointer. It contains an element for each callable function
14 | enum {
15 | kEWProxyStartFramebuffer,
16 | kEWProxyStopFramebuffer,
17 | kEWProxyCheckFramebufferState,
18 | kEWProxyUpdateMemoy,
19 | kEWProxyGetModeCount,
20 | kEWProxyGetModeInfo,
21 | kEWProxyGetCursorState,
22 | kEWProxyGetCursorResolution,
23 | kEWProxyEnableCursorEvents,
24 | kEWProxyDisableCursorEvents,
25 | kNumberOfMethods
26 | };
27 |
28 | //this enum is used to tell about the event origin.
29 | enum {
30 | kEWProxyCursorStateChanged,
31 | kEWProxyCursorImageChanged
32 | };
33 |
34 | //This structure is used to transport mode information from kernel to user space.
35 | //these information are stored in the drivers plist
36 | typedef struct {
37 | char name[32];
38 | unsigned int width;
39 | unsigned int height;
40 | } EWProxyFramebufferModeInfo;
41 |
42 | //we're matching against class name of our driver
43 | #define pspdriverclass "info_ennowelbers_proxyframebuffer_driver"
44 | //these are used as return values in state functions
45 | #define FBufEnabled 1
46 | #define FBufDisabled 0
47 |
48 | io_service_t FindEWProxyFramebufferDriver(void);
49 | int EWProxyFramebufferDriverCheckFramebufferState(io_connect_t connect);
50 | void EWProxyFramebufferDriverEnableFramebuffer(io_connect_t connect, int mode);
51 | void EWProxyFramebufferDriverDisableFramebuffer(io_connect_t connect);
52 | unsigned char *EWProxyFramebufferDriverMapCursor(io_connect_t connect, unsigned int *size, int *width, int *height);
53 | void EWProxyFramebufferDriverUnmapCursor(io_connect_t connect, unsigned char *buf);
54 | unsigned char *EWProxyFramebufferDriverMapFramebuffer(io_connect_t connect, unsigned int *size);
55 | void EWProxyFramebufferDriverUnmapFramebuffer(io_connect_t connect, unsigned char *buf);
56 | int EWProxyFramebufferDriverUpdateMemory(io_connect_t connect);
57 | int EWProxyFramebufferDriverGetModeCount(io_connect_t connect);
58 | void EWProxyFramebufferDriverGetCursorState(io_connect_t connect, int *x, int *y, bool *visible);
59 | kern_return_t EWProxyFramebufferDriverGetModeInfo(io_connect_t connect, int mode, EWProxyFramebufferModeInfo *info);
60 | bool EWProxyFramebufferDriverEnableCursorEvents(io_connect_t connect, mach_port_t recallport, void * callback, void *reference);
61 | bool EWProxyFramebufferDriverDisableCursorEvents(io_connect_t connect);
62 |
63 | #endif
--------------------------------------------------------------------------------
/dist/EWProxyFrameBufferConnection.framework/Versions/A/Headers/EWProxyFrameBuffer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * PSPScreenShared.h
3 | * PSPScreenDriver
4 | *
5 | * Created by Enno Welbers on 28.02.09.
6 | * Copyright 2009 __MyCompanyName__. All rights reserved.
7 | *
8 | */
9 |
10 | #ifndef PSPSCREENSHARED_H__
11 | #define PSPSCREENSHARED_H__
12 |
13 | //this is our dispatch pointer. It contains an element for each callable function
14 | enum {
15 | kEWProxyStartFramebuffer,
16 | kEWProxyStopFramebuffer,
17 | kEWProxyCheckFramebufferState,
18 | kEWProxyUpdateMemoy,
19 | kEWProxyGetModeCount,
20 | kEWProxyGetModeInfo,
21 | kEWProxyGetCursorState,
22 | kEWProxyGetCursorResolution,
23 | kEWProxyEnableCursorEvents,
24 | kEWProxyDisableCursorEvents,
25 | kNumberOfMethods
26 | };
27 |
28 | //this enum is used to tell about the event origin.
29 | enum {
30 | kEWProxyCursorStateChanged,
31 | kEWProxyCursorImageChanged
32 | };
33 |
34 | //This structure is used to transport mode information from kernel to user space.
35 | //these information are stored in the drivers plist
36 | typedef struct {
37 | char name[32];
38 | unsigned int width;
39 | unsigned int height;
40 | } EWProxyFramebufferModeInfo;
41 |
42 | //we're matching against class name of our driver
43 | #define pspdriverclass "info_ennowelbers_proxyframebuffer_driver"
44 | //these are used as return values in state functions
45 | #define FBufEnabled 1
46 | #define FBufDisabled 0
47 |
48 | io_service_t FindEWProxyFramebufferDriver(void);
49 | int EWProxyFramebufferDriverCheckFramebufferState(io_connect_t connect);
50 | void EWProxyFramebufferDriverEnableFramebuffer(io_connect_t connect, int mode);
51 | void EWProxyFramebufferDriverDisableFramebuffer(io_connect_t connect);
52 | unsigned char *EWProxyFramebufferDriverMapCursor(io_connect_t connect, unsigned int *size, int *width, int *height);
53 | void EWProxyFramebufferDriverUnmapCursor(io_connect_t connect, unsigned char *buf);
54 | unsigned char *EWProxyFramebufferDriverMapFramebuffer(io_connect_t connect, unsigned int *size);
55 | void EWProxyFramebufferDriverUnmapFramebuffer(io_connect_t connect, unsigned char *buf);
56 | int EWProxyFramebufferDriverUpdateMemory(io_connect_t connect);
57 | int EWProxyFramebufferDriverGetModeCount(io_connect_t connect);
58 | void EWProxyFramebufferDriverGetCursorState(io_connect_t connect, int *x, int *y, bool *visible);
59 | kern_return_t EWProxyFramebufferDriverGetModeInfo(io_connect_t connect, int mode, EWProxyFramebufferModeInfo *info);
60 | bool EWProxyFramebufferDriverEnableCursorEvents(io_connect_t connect, mach_port_t recallport, void * callback, void *reference);
61 | bool EWProxyFramebufferDriverDisableCursorEvents(io_connect_t connect);
62 |
63 | #endif
--------------------------------------------------------------------------------
/dist/EWProxyframeBufferApp.app/Contents/Frameworks/EWProxyFrameBufferConnection.framework/Versions/A/Headers/EWProxyFrameBuffer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * PSPScreenShared.h
3 | * PSPScreenDriver
4 | *
5 | * Created by Enno Welbers on 28.02.09.
6 | * Copyright 2009 __MyCompanyName__. All rights reserved.
7 | *
8 | */
9 |
10 | #ifndef PSPSCREENSHARED_H__
11 | #define PSPSCREENSHARED_H__
12 |
13 | //this is our dispatch pointer. It contains an element for each callable function
14 | enum {
15 | kEWProxyStartFramebuffer,
16 | kEWProxyStopFramebuffer,
17 | kEWProxyCheckFramebufferState,
18 | kEWProxyUpdateMemoy,
19 | kEWProxyGetModeCount,
20 | kEWProxyGetModeInfo,
21 | kEWProxyGetCursorState,
22 | kEWProxyGetCursorResolution,
23 | kEWProxyEnableCursorEvents,
24 | kEWProxyDisableCursorEvents,
25 | kNumberOfMethods
26 | };
27 |
28 | //this enum is used to tell about the event origin.
29 | enum {
30 | kEWProxyCursorStateChanged,
31 | kEWProxyCursorImageChanged
32 | };
33 |
34 | //This structure is used to transport mode information from kernel to user space.
35 | //these information are stored in the drivers plist
36 | typedef struct {
37 | char name[32];
38 | unsigned int width;
39 | unsigned int height;
40 | } EWProxyFramebufferModeInfo;
41 |
42 | //we're matching against class name of our driver
43 | #define pspdriverclass "info_ennowelbers_proxyframebuffer_driver"
44 | //these are used as return values in state functions
45 | #define FBufEnabled 1
46 | #define FBufDisabled 0
47 |
48 | io_service_t FindEWProxyFramebufferDriver(void);
49 | int EWProxyFramebufferDriverCheckFramebufferState(io_connect_t connect);
50 | void EWProxyFramebufferDriverEnableFramebuffer(io_connect_t connect, int mode);
51 | void EWProxyFramebufferDriverDisableFramebuffer(io_connect_t connect);
52 | unsigned char *EWProxyFramebufferDriverMapCursor(io_connect_t connect, unsigned int *size, int *width, int *height);
53 | void EWProxyFramebufferDriverUnmapCursor(io_connect_t connect, unsigned char *buf);
54 | unsigned char *EWProxyFramebufferDriverMapFramebuffer(io_connect_t connect, unsigned int *size);
55 | void EWProxyFramebufferDriverUnmapFramebuffer(io_connect_t connect, unsigned char *buf);
56 | int EWProxyFramebufferDriverUpdateMemory(io_connect_t connect);
57 | int EWProxyFramebufferDriverGetModeCount(io_connect_t connect);
58 | void EWProxyFramebufferDriverGetCursorState(io_connect_t connect, int *x, int *y, bool *visible);
59 | kern_return_t EWProxyFramebufferDriverGetModeInfo(io_connect_t connect, int mode, EWProxyFramebufferModeInfo *info);
60 | bool EWProxyFramebufferDriverEnableCursorEvents(io_connect_t connect, mach_port_t recallport, void * callback, void *reference);
61 | bool EWProxyFramebufferDriverDisableCursorEvents(io_connect_t connect);
62 |
63 | #endif
--------------------------------------------------------------------------------
/EWProxyFramebuffer-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | English
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | ${PRODUCT_NAME}
17 | CFBundlePackageType
18 | KEXT
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | IOKitPersonalities
26 |
27 | EWProxyFramebuffer
28 |
29 | CFBundleIdentifier
30 | info.ennowelbers.framebuffer
31 | DriverModes
32 |
33 |
34 | height
35 | 1080
36 | name
37 | 1920x1080
38 | width
39 | 1920
40 |
41 |
42 | height
43 | 900
44 | name
45 | 1600x900
46 | width
47 | 1600
48 |
49 |
50 | height
51 | 600
52 | name
53 | 800x600
54 | width
55 | 800
56 |
57 |
58 | IOClass
59 | info_ennowelbers_proxyframebuffer_driver
60 | IOKitDebug
61 | 65535
62 | IOMatchCategory
63 | info_ennowelbers_proxyframebuffer_driver
64 | IOProviderClass
65 | IOResources
66 | IOResourceMatch
67 | IOKit
68 | IOUserClientClass
69 | info_ennowelbers_proxyframebuffer_client
70 | MaxResolution
71 |
72 | height
73 | 1024
74 | width
75 | 1280
76 |
77 | loadFramebuffer
78 |
79 |
80 |
81 | OSBundleLibraries
82 |
83 | com.apple.iokit.IOGraphicsFamily
84 | 2.0
85 | com.apple.kpi.iokit
86 | 8.0.0
87 | com.apple.kpi.libkern
88 | 8.0.0
89 | com.apple.kpi.mach
90 | 8.0.0
91 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/EWProxyFrameBufferFBuffer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * PSPScreenFBuf.h
3 | * PSPScreenDriver
4 | *
5 | * Created by Enno Welbers on 28.02.09.
6 | * Copyright 2009 __MyCompanyName__. All rights reserved.
7 | *
8 | */
9 | #ifndef EWPROXYFRAMEBUFFERFBUFFER_H__
10 | #define EWPROXYFRAMEBUFFERFBUFFER_H__
11 |
12 | #include
13 | #include
14 |
15 | class info_ennowelbers_proxyframebuffer_driver;
16 |
17 | //this class is the real framebuffer implementation.
18 | //it handles a lot of stuff OS X wants from it.
19 | //and it does some strange things on first sight. I promise these were nessecary
20 | //in order to get it "up and running"
21 | class info_ennowelbers_proxyframebuffer_fbuffer : public IOFramebuffer
22 | {
23 | OSDeclareDefaultStructors(info_ennowelbers_proxyframebuffer_fbuffer)
24 | private:
25 | info_ennowelbers_proxyframebuffer_driver *fProvider;
26 | IOBufferMemoryDescriptor *graphicMem;
27 | IOMemoryMap *cursorMapping;
28 | UInt8 *cursorBuf;
29 | unsigned int graphicSize;
30 | bool started;
31 | bool connected;
32 | unsigned int mode;
33 | bool warmup;
34 | public:
35 | IOBufferMemoryDescriptor *cursorMem;
36 | int cursorWidth;
37 | int cursorHeight;
38 | int cursorX;
39 | int cursorY;
40 | bool cursorVisible;
41 | virtual bool init(OSDictionary *dictionary=0);
42 | virtual void free(void);
43 | virtual bool start(IOService *provider);
44 | virtual void stop(IOService *provider);
45 |
46 | virtual IOReturn enableController();
47 | virtual IODeviceMemory * getApertureRange( IOPixelAperture aperture );
48 | virtual IOReturn getCurrentDisplayMode(IODisplayModeID * displayMode,IOIndex * depth);
49 | virtual IOItemCount getDisplayModeCount();
50 | virtual IOReturn getDisplayModes(IODisplayModeID * allDisplayModes);
51 | virtual IOReturn getInformationForDisplayMode(IODisplayModeID displayMode, IODisplayModeInformation * info);
52 | virtual const char * getPixelFormats();
53 | virtual UInt64 getPixelFormatsForDisplayMode(IODisplayModeID displayMode, IOIndex depth);
54 | virtual IOReturn getPixelInformation(IODisplayModeID displayMode, IOIndex depth, IOPixelAperture aperture, IOPixelInformation * pixelInfo);
55 | //virtual IOReturn getStartupDisplayMode(IODisplayModeID * displayMode, IOIndex * depth);
56 | virtual IODeviceMemory * getVRAMRange();
57 | virtual IOReturn setDisplayMode(IODisplayModeID displayMode, IOIndex depth);
58 | virtual IOItemCount getConnectionCount( void );
59 | virtual IOReturn getAttributeForConnection(IOIndex connectIndex, IOSelect attribute, uintptr_t *value);
60 | virtual IOReturn setAttributeForConnection(IOIndex connection, IOSelect attribute, uintptr_t value);
61 | IOReturn setAttribute( IOSelect attribute, uintptr_t value );
62 | IOReturn getAttribute( IOSelect attribute, uintptr_t * value );
63 |
64 | virtual IOReturn Connect(int mode);
65 | virtual IOReturn Disconnect();
66 | virtual IOReturn State();
67 | virtual void SwitchResolution();
68 |
69 | virtual IOReturn setCursorImage(void *img);
70 | virtual IOReturn setCursorState(SInt32 x, SInt32 y, bool visible);
71 | };
72 |
73 | #endif
--------------------------------------------------------------------------------
/EWProxyFrameBuffer.xcodeproj/xcshareddata/xcschemes/EWProxyFrameBuffer.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
34 |
35 |
45 |
46 |
52 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
70 |
71 |
72 |
73 |
75 |
76 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/dist/EWProxyFrameBuffer.kext/Contents/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | BuildMachineOSBuild
6 | 18F132
7 | CFBundleDevelopmentRegion
8 | English
9 | CFBundleExecutable
10 | EWProxyFrameBuffer
11 | CFBundleIdentifier
12 | info.ennowelbers.framebuffer
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | EWProxyFrameBuffer
17 | CFBundlePackageType
18 | KEXT
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleSupportedPlatforms
24 |
25 | MacOSX
26 |
27 | CFBundleVersion
28 | 1
29 | DTCompiler
30 | com.apple.compilers.llvm.clang.1_0
31 | DTPlatformBuild
32 | 10B61
33 | DTPlatformVersion
34 | GM
35 | DTSDKBuild
36 | 18B71
37 | DTSDKName
38 | macosx10.14
39 | DTXcode
40 | 1010
41 | DTXcodeBuild
42 | 10B61
43 | IOKitPersonalities
44 |
45 | EWProxyFramebuffer
46 |
47 | CFBundleIdentifier
48 | info.ennowelbers.framebuffer
49 | DriverModes
50 |
51 |
52 | height
53 | 1080
54 | name
55 | 1920x1080
56 | width
57 | 1920
58 |
59 |
60 | height
61 | 900
62 | name
63 | 1600x900
64 | width
65 | 1600
66 |
67 |
68 | height
69 | 600
70 | name
71 | 800x600
72 | width
73 | 800
74 |
75 |
76 | IOClass
77 | info_ennowelbers_proxyframebuffer_driver
78 | IOKitDebug
79 | 65535
80 | IOMatchCategory
81 | info_ennowelbers_proxyframebuffer_driver
82 | IOProviderClass
83 | IOResources
84 | IOResourceMatch
85 | IOKit
86 | IOUserClientClass
87 | info_ennowelbers_proxyframebuffer_client
88 | MaxResolution
89 |
90 | height
91 | 1024
92 | width
93 | 1280
94 |
95 | loadFramebuffer
96 |
97 |
98 |
99 | OSBundleLibraries
100 |
101 | com.apple.iokit.IOGraphicsFamily
102 | 2.0
103 | com.apple.kpi.iokit
104 | 8.0.0
105 | com.apple.kpi.libkern
106 | 8.0.0
107 | com.apple.kpi.mach
108 | 8.0.0
109 |
110 |
111 |
112 |
--------------------------------------------------------------------------------
/EWProxyFrameBuffer.xcodeproj/xcshareddata/xcschemes/All.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
74 |
80 |
81 |
82 |
83 |
85 |
86 |
89 |
90 |
91 |
--------------------------------------------------------------------------------
/EWProxyFrameBuffer.xcodeproj/xcshareddata/xcschemes/EWProxyframeBufferApp.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/EWProxyFrameBuffer.m:
--------------------------------------------------------------------------------
1 | /*
2 | * PSPScreenShared.cpp
3 | * PSPScreenDriver
4 | *
5 | * Created by Enno Welbers on 28.02.09.
6 | * Copyright 2009 __MyCompanyName__. All rights reserved.
7 | *
8 | */
9 | #include
10 | #include "EWProxyFrameBuffer.h"
11 |
12 | //This function helps finding the driver
13 | io_service_t FindEWProxyFramebufferDriver(void)
14 | {
15 | return IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching(pspdriverclass));
16 | }
17 |
18 | #pragma mark memory mapping functions
19 |
20 | unsigned char *EWProxyFramebufferDriverMapCursor(io_connect_t connect, unsigned int *size, int *width, int *height)
21 | {
22 | #ifdef __LP64__
23 | mach_vm_address_t address=0;
24 | mach_vm_size_t vmsize=0;
25 | #else
26 | vm_address_t address=0;
27 | vm_size_t vmsize=0;
28 | #endif
29 | IOConnectMapMemory(connect, 1, mach_task_self(), &address, &vmsize, kIOMapAnywhere);
30 | *size=vmsize;
31 |
32 | uint64_t buf[]={0,0};
33 | uint32_t cnt=2;
34 | IOConnectCallScalarMethod(connect, kEWProxyGetCursorResolution, NULL, 0, buf, &cnt);
35 | *width=(int)buf[0];
36 | *height=(int)buf[1];
37 | return (unsigned char*)address;
38 | }
39 |
40 | void EWProxyFramebufferDriverUnmapCursor(io_connect_t connect, unsigned char *buf)
41 | {
42 | #ifdef __LP64__
43 | mach_vm_address_t address=(mach_vm_address_t)buf;
44 | #else
45 | vm_address_t address=(vm_address_t)buf;
46 | #endif
47 | IOConnectUnmapMemory(connect, 1, mach_task_self(), address);
48 | }
49 |
50 | unsigned char *EWProxyFramebufferDriverMapFramebuffer(io_connect_t connect, unsigned int *size)
51 | {
52 | #ifdef __LP64__
53 | mach_vm_address_t address=0;
54 | mach_vm_size_t vmsize=0;
55 | #else
56 | vm_address_t address=0;
57 | vm_size_t vmsize=0;
58 | #endif
59 | IOConnectMapMemory(connect, 0, mach_task_self(), &address, &vmsize, kIOMapAnywhere);
60 | *size=vmsize;
61 | return (unsigned char*)address;
62 | }
63 |
64 | void EWProxyFramebufferDriverUnmapFramebuffer(io_connect_t connect, unsigned char *buf)
65 | {
66 | #ifdef __LP64__
67 | mach_vm_address_t address=(mach_vm_address_t)buf;
68 | #else
69 | vm_address_t address=(vm_address_t)buf;
70 | #endif
71 | IOConnectUnmapMemory(connect, 0, mach_task_self(), address);
72 | }
73 |
74 | #pragma mark user->kernel call chain functions
75 |
76 | int EWProxyFramebufferDriverCheckFramebufferState(io_connect_t connect)
77 | {
78 | return (int)IOConnectCallScalarMethod(connect, kEWProxyCheckFramebufferState, NULL, 0, NULL, NULL);
79 | }
80 |
81 | void EWProxyFramebufferDriverEnableFramebuffer(io_connect_t connect, int mode)
82 | {
83 | uint64_t buf[1]={mode};
84 | IOConnectCallScalarMethod(connect, kEWProxyStartFramebuffer, buf, 1, NULL, NULL);
85 | }
86 |
87 | void EWProxyFramebufferDriverDisableFramebuffer(io_connect_t connect)
88 | {
89 | IOConnectCallScalarMethod(connect, kEWProxyStopFramebuffer, NULL, 0, NULL, NULL);
90 |
91 | }
92 |
93 | int EWProxyFramebufferDriverUpdateMemory(io_connect_t connect)
94 | {
95 | kern_return_t ret=IOConnectCallScalarMethod(connect, kEWProxyUpdateMemoy, NULL, 0, NULL, 0);
96 | return ret;
97 | }
98 |
99 | int EWProxyFramebufferDriverGetModeCount(io_connect_t connect)
100 | {
101 | kern_return_t ret=IOConnectCallScalarMethod(connect, kEWProxyGetModeCount, NULL, 0, NULL, 0);
102 | return ret;
103 | }
104 |
105 | kern_return_t EWProxyFramebufferDriverGetModeInfo(io_connect_t connect, int mode, EWProxyFramebufferModeInfo *info)
106 | {
107 | uint64_t buf=mode;
108 | size_t size=sizeof(*info);
109 | kern_return_t ret=IOConnectCallMethod(connect, kEWProxyGetModeInfo, &buf, 1, NULL, 0, NULL, NULL, (void*)info, &size);
110 | return ret;
111 | }
112 |
113 | void EWProxyFramebufferDriverGetCursorState(io_connect_t connect, int *x, int *y, bool *visible)
114 | {
115 | uint64_t buf[]={0,0,0};
116 | unsigned int cnt=3;
117 | IOConnectCallScalarMethod(connect, kEWProxyGetCursorState, NULL, 0, buf, &cnt);
118 | *x=(int)buf[0];
119 | *y=(int)buf[1];
120 | *visible=(bool)buf[2];
121 | }
122 |
123 | #pragma mark event registration functions
124 |
125 | bool EWProxyFramebufferDriverEnableCursorEvents(io_connect_t connect, mach_port_t recallport, void *callback, void *reference)
126 | {
127 | IOConnectSetNotificationPort(connect, 0, recallport, 0);
128 | #ifdef __LP64__
129 | uint64_t buf[]={(uint64_t)(mach_vm_address_t)callback, (uint64_t)(io_user_reference_t)reference};
130 | #else
131 | uint64_t buf[]={(uint64_t)(vm_address_t)callback, (uint64_t)(vm_address_t)reference};
132 | #endif
133 | kern_return_t ret=IOConnectCallScalarMethod(connect, kEWProxyEnableCursorEvents, buf, 2, NULL, NULL);
134 | if(ret!=kIOReturnSuccess)
135 | return false;
136 | return true;
137 | }
138 |
139 | bool EWProxyFramebufferDriverDisableCursorEvents(io_connect_t connect)
140 | {
141 | return IOConnectCallScalarMethod(connect, kEWProxyDisableCursorEvents, NULL, 0, NULL, NULL)==kIOReturnSuccess;
142 | }
143 |
--------------------------------------------------------------------------------
/EWProxyFrameBufferClient.h:
--------------------------------------------------------------------------------
1 | /*
2 | * PSPScreenClient.h
3 | * PSPScreenDriver
4 | *
5 | * Created by Enno Welbers on 28.02.09.
6 | * Copyright 2009 __MyCompanyName__. All rights reserved.
7 | *
8 | */
9 | #ifndef EWPROXYFRAMEBUFFERCLIENT_H__
10 | #define EWPROXYFRAMEBUFFERCLIENT_H__
11 |
12 | #include
13 | #include
14 | #include "EWProxyFrameBufferDriver.h"
15 | #include "EWProxyFrameBuffer.h"
16 |
17 | /*
18 | How does an IOKit driver talk to user space?
19 | You define a set of functions (the descriptor is an int, essentially), and define a user client class
20 | containing these functions.
21 | The call comes in through an externalArgument call which then calls static methods which in turn call
22 | class methods which then do the work.
23 | Besides, you can map kernel memory into user space and register events.
24 | The function list is provided to kernel using a dispatch table
25 | It took me a while to get this straight, however the high-level-feeling of this communication is quite cool.
26 | Why static methods? why not calling directly the class methods? Static methods have defined adresses we can use
27 | in our dispatch table. That way the dispatcher Function (externalArgument) get's a lot simpler.
28 | the con is a lot copy'n'paste-code
29 | */
30 | class info_ennowelbers_proxyframebuffer_client: public IOUserClient
31 | {
32 | OSDeclareDefaultStructors(info_ennowelbers_proxyframebuffer_client)
33 | protected:
34 | info_ennowelbers_proxyframebuffer_driver *fProvider;
35 | task_t fTask;
36 | static const IOExternalMethodDispatch sMethods[kNumberOfMethods];
37 | bool owningFB;
38 | bool eventEnabled;
39 | mach_port_t eventPort;
40 | #ifdef __LP64__
41 | OSAsyncReference64 eventFunction;
42 | #else
43 | OSAsyncReference eventFunction;
44 | #endif
45 | public:
46 | //virtual void stop(IOService *provider);
47 | virtual bool start(IOService *provider);
48 |
49 | virtual bool initWithTask(task_t owningTask, void* secuirtyToken, UInt32 type, OSDictionary * properties);
50 |
51 | virtual IOReturn clientClose(void);
52 | virtual IOReturn clientDied(void);
53 | virtual IOReturn registerNotificationPort(mach_port_t port, UInt32 type, UInt32 refCon );
54 |
55 | //virtual bool willTerminate(IOService* provider, IOOptionBits options);
56 | //virtual bool didTerminate(IOService* provider, IOOptionBits options, bool *defer);
57 |
58 | //virtual bool terminate(IOOptionBits options=0);
59 | //virtual bool finalize(IOOptionBits options);
60 | virtual void FireCursorStateChanged();
61 | virtual void FireCursorImageChanged();
62 | protected:
63 | virtual IOReturn externalMethod(uint32_t selector, IOExternalMethodArguments * arguments, IOExternalMethodDispatch *dispatch, OSObject*target, void* reference);
64 |
65 | static IOReturn sStartFramebuffer(info_ennowelbers_proxyframebuffer_client* target, void* reference, IOExternalMethodArguments *arguments);
66 |
67 | virtual IOReturn StartFramebuffer(int mode);
68 |
69 | static IOReturn sStopFramebuffer(info_ennowelbers_proxyframebuffer_client* target, void*reference, IOExternalMethodArguments *arguments);
70 |
71 | virtual IOReturn StopFramebuffer(void);
72 |
73 | static IOReturn sCheckFramebufferState(info_ennowelbers_proxyframebuffer_client* target, void *reference, IOExternalMethodArguments *arguments);
74 |
75 | virtual IOReturn CheckFramebufferState(void);
76 |
77 | static IOReturn sUpdateMemory(info_ennowelbers_proxyframebuffer_client* target, void *reference, IOExternalMethodArguments *arguments);
78 |
79 | virtual IOReturn UpdateMemory(void);
80 |
81 | static IOReturn sGetModeCount(info_ennowelbers_proxyframebuffer_client* target, void *reference, IOExternalMethodArguments *arguments);
82 |
83 | virtual IOReturn GetModeCount(void);
84 |
85 | static IOReturn sGetModeInfo(info_ennowelbers_proxyframebuffer_client* target, void *reference, IOExternalMethodArguments *arguments);
86 |
87 | virtual IOReturn GetModeInfo(int mode, EWProxyFramebufferModeInfo *info);
88 |
89 | static IOReturn sGetCursorState(info_ennowelbers_proxyframebuffer_client* target, void *reference, IOExternalMethodArguments *arguments);
90 |
91 | virtual IOReturn GetCursorState(int *x, int *y, bool *visible);
92 |
93 | static IOReturn sGetCursorResolution(info_ennowelbers_proxyframebuffer_client* target, void *reference, IOExternalMethodArguments *arguments);
94 |
95 | virtual IOReturn GetCursorResolution(int *width, int *height);
96 |
97 | static IOReturn sEnableCursorEvents(info_ennowelbers_proxyframebuffer_client* target, void *reference, IOExternalMethodArguments *arguments);
98 | #ifdef __LP64__
99 | virtual IOReturn EnableCursorEvents(mach_vm_address_t call, io_user_reference_t reference);
100 | #else
101 | virtual IOReturn EnableCursorEvents(void *call, void *reference);
102 | #endif
103 |
104 | static IOReturn sDisableCursorEvents(info_ennowelbers_proxyframebuffer_client* target, void *reference, IOExternalMethodArguments *arguments);
105 |
106 | virtual IOReturn DisableCursorEvents();
107 |
108 | virtual IOReturn clientMemoryForType( UInt32 type, IOOptionBits * options, IOMemoryDescriptor ** memory );
109 | };
110 |
111 | #endif
--------------------------------------------------------------------------------
/UIMainDialog.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIMainDialog.m
3 | // PSPScreenDriverClient
4 | //
5 | // Created by Enno Welbers on 27.02.09.
6 | // Copyright 2009 __MyCompanyName__. All rights reserved.
7 | //
8 |
9 | #include
10 | #include
11 | #import "UIMainDialog.h"
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 | #include
19 | #include
20 | //#include "huffman.h"
21 |
22 | @implementation UIMainDialog
23 | @synthesize imgState,driverState,ProfileNames,selectedProfile,bufferOn;
24 |
25 |
26 | - (IBAction) fetchImage:(id)sender
27 | {
28 | if (self.bufferOn==NO) {
29 | return;
30 | }
31 |
32 | //tell driver to update buffer mapped to client memory
33 | int ret=EWProxyFramebufferDriverUpdateMemory(connect);
34 | NSLog(@"%x",ret);
35 | EWProxyFramebufferModeInfo *info=[self getCurrentModeInfo];
36 | //copy into nsdata object
37 | NSData *image=[[NSData alloc] initWithBytes:driverbuf length:info->width*info->height*3];
38 | //encapsulate into cg data provider
39 | CGDataProviderRef dataprovider=CGDataProviderCreateWithCFData((CFDataRef)image);
40 | //create cg image from provider
41 | CGImageRef cgimg=CGImageCreate(info->width, info->height, 8, 24, info->width*3, CGColorSpaceCreateDeviceRGB(), 0, dataprovider, NULL, NO, kCGRenderingIntentDefault);
42 | //create bitmapimagerepresentation
43 | NSBitmapImageRep *rep=[[NSBitmapImageRep alloc] initWithCGImage:cgimg];
44 | //and stuff it into an nsimage
45 | NSImage *img=[[NSImage alloc] init];
46 | [img addRepresentation:rep];
47 | [imgView setImage:img];
48 | }
49 |
50 | - (EWProxyFramebufferModeInfo*) getCurrentModeInfo
51 | {
52 | NSData *data=[Profiles objectAtIndex:[self.selectedProfile firstIndex]];
53 | return (EWProxyFramebufferModeInfo*)[data bytes];
54 | }
55 |
56 | - (int) getMode {
57 | // int mode=[self.selectedProfile firstIndex];
58 | // mode++;
59 | return 1; // mode;
60 | }
61 |
62 | - (IBAction) SwitchDriver:(id)sender
63 | {
64 | //check current state.
65 | int state=EWProxyFramebufferDriverCheckFramebufferState(connect);
66 | if(state!=0)
67 | {
68 | //framebuffer is on, disable it. unmap framebuffer and disable it.
69 | EWProxyFramebufferDriverUnmapFramebuffer(connect, driverbuf);
70 | EWProxyFramebufferDriverDisableFramebuffer(connect);
71 | self.driverState=@"FB OFF";
72 | self.bufferOn=NO;
73 | }
74 | else
75 | {
76 | int mode;
77 | mode = [self getMode];
78 | //enable with selected mode
79 | EWProxyFramebufferDriverEnableFramebuffer(connect, mode);
80 | self.bufferOn=YES;
81 | unsigned int size;
82 | //map memory
83 | driverbuf=EWProxyFramebufferDriverMapFramebuffer(connect, &size);
84 | self.driverState=@"FB ON";
85 | }
86 | }
87 |
88 | - (void)awakeFromNib
89 | {
90 | self.driverState=@"UNKNOWN";
91 | //check for driver. if found, set everything up.
92 | service=FindEWProxyFramebufferDriver();
93 | if(service==IO_OBJECT_NULL)
94 | {
95 | self.driverState=@"Nicht geladen.";
96 | }
97 | else
98 | {
99 | //establish connection.
100 | //this call instantiates our user client class in kernel code and attaches it to
101 | //the IOService in question
102 | if(IOServiceOpen(service, mach_task_self(), 0, &connect)==kIOReturnSuccess)
103 | {
104 | //read the driver configuration and set up internal classes
105 | int cnt=EWProxyFramebufferDriverGetModeCount(connect);
106 | ProfileNames=[[NSMutableArray alloc] init];
107 | Profiles=[[NSMutableArray alloc] init];
108 | [self willChangeValueForKey:@"ProfileNames"];
109 | EWProxyFramebufferModeInfo data;
110 | for(int i=1;i<=cnt;i++)
111 | {
112 | EWProxyFramebufferDriverGetModeInfo(connect, i, &data);
113 | [ProfileNames addObject:[NSString stringWithCString:data.name encoding:NSASCIIStringEncoding]];
114 | [Profiles addObject:[NSData dataWithBytes:&data length:sizeof(data)]];
115 | }
116 | [self didChangeValueForKey:@"ProfileNames"];
117 | int state=EWProxyFramebufferDriverCheckFramebufferState(connect);
118 | if(state!=0)
119 | {
120 | self.bufferOn=YES;
121 | self.driverState=@"FB IN USE";
122 | }
123 | else
124 | {
125 | self.bufferOn=NO;
126 | self.driverState=@"FB OFF";
127 | }
128 | //create a notification port and register it in our runloop.
129 | //this is nessecary for the cursor change events.
130 | //we can ask the notificationport for a mach_port which is then used in registerEvent functions
131 | //however we're not implementing them yet.
132 | //TODO
133 | IONotificationPortRef notifyPort=IONotificationPortCreate(kIOMasterPortDefault);
134 | CFRunLoopSourceRef rlsource=IONotificationPortGetRunLoopSource(notifyPort);
135 | CFRunLoopAddSource([[NSRunLoop currentRunLoop] getCFRunLoop], rlsource, kCFRunLoopDefaultMode);
136 | }
137 | else
138 | {
139 | self.driverState=@"Öffnen fehlgeschlagen.";
140 | }
141 | }
142 | }
143 |
144 |
145 | -(CGImageRef)getCursor
146 | {
147 | unsigned int size;
148 | int width, height;
149 | //map the hardwarecursor memory into user space
150 | unsigned char *buf=EWProxyFramebufferDriverMapCursor(connect, &size, &width, &height);
151 | //same procedure: pointer->nsdata->cgadatprovider->cgimage
152 | NSData *image=[NSData dataWithBytes:buf length:size];
153 | CGDataProviderRef provider=CGDataProviderCreateWithCFData((CFDataRef)image);
154 | CGImageRef cgimg=CGImageCreate(width, height, 8, 32, width*4, CGColorSpaceCreateDeviceRGB(), kCGImageAlphaLast, provider, NULL, NO, kCGRenderingIntentDefault);
155 | //unmap the memory again.
156 | EWProxyFramebufferDriverUnmapCursor(connect, buf);
157 | CFRelease(provider);
158 | return cgimg;
159 | }
160 |
161 | @end
162 |
--------------------------------------------------------------------------------
/AppDelegate.m:
--------------------------------------------------------------------------------
1 | #import "AppDelegate.h"
2 |
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 |
14 | @implementation AppDelegate
15 |
16 | - (void)awakeFromNib {
17 | _statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength];
18 | [_statusItem retain];
19 |
20 | NSImage *menuIcon = [NSImage imageNamed:@"Menu Icon"];
21 | NSImage *highlightIcon = [NSImage imageNamed:@"Menu Icon"]; // Yes, we're using the exact same image asset.
22 | [highlightIcon setTemplate:YES]; // Allows the correct highlighting of the icon when the menu is clicked.
23 |
24 | [self statusItem].button.image = menuIcon;
25 | [self statusItem].button.alternateImage = highlightIcon;
26 |
27 | // [[self statusItem] setImage:menuIcon];
28 | // [[self statusItem] setAlternateImage:highlightIcon];
29 | // [[self statusItem] setHighlightMode:YES];
30 | [[self statusItem] setMenu:[self menu]];
31 |
32 | //check for driver. if found, set everything up.
33 | service=FindEWProxyFramebufferDriver();
34 | if(service==IO_OBJECT_NULL)
35 | {
36 | // self.driverState=@"Nicht geladen.";
37 | }
38 | else
39 | {
40 | //establish connection.
41 | //this call instantiates our user client class in kernel code and attaches it to
42 | //the IOService in question
43 | if(IOServiceOpen(service, mach_task_self(), 0, &connect)==kIOReturnSuccess)
44 | {
45 | //read the driver configuration and set up internal classes
46 | profileCount=EWProxyFramebufferDriverGetModeCount(connect);
47 | ProfileNames=[[NSMutableArray alloc] init];
48 | Profiles=[[NSMutableArray alloc] init];
49 | [self willChangeValueForKey:@"ProfileNames"];
50 | EWProxyFramebufferModeInfo data;
51 | for(int i=1;i<=profileCount;i++)
52 | {
53 | EWProxyFramebufferDriverGetModeInfo(connect, i, &data);
54 | [ProfileNames addObject:[NSString stringWithCString:data.name encoding:NSASCIIStringEncoding]];
55 | [Profiles addObject:[NSData dataWithBytes:&data length:sizeof(data)]];
56 | }
57 |
58 | NSInteger val = 0;
59 | NSUserDefaults *standardUserDefaults = [NSUserDefaults standardUserDefaults];
60 | if (standardUserDefaults) val = [standardUserDefaults integerForKey: @"selected-profile"];
61 | selectedMode = (int)val;
62 |
63 | [self updateProfiles];
64 | [self didChangeValueForKey:@"ProfileNames"];
65 |
66 | if (selectedMode > 0) {
67 | [self SwitchDriver: NULL];
68 | }
69 |
70 | // int state=EWProxyFramebufferDriverCheckFramebufferState(connect);
71 | //create a notification port and register it in our runloop.
72 | //this is nessecary for the cursor change events.
73 | //we can ask the notificationport for a mach_port which is then used in registerEvent functions
74 | //however we're not implementing them yet.
75 | //TODO
76 | IONotificationPortRef notifyPort=IONotificationPortCreate(kIOMasterPortDefault);
77 | CFRunLoopSourceRef rlsource=IONotificationPortGetRunLoopSource(notifyPort);
78 | CFRunLoopAddSource([[NSRunLoop currentRunLoop] getCFRunLoop], rlsource, kCFRunLoopDefaultMode);
79 | }
80 | }
81 | }
82 |
83 | - (void) updateProfiles {
84 | if (selectedMode<1 || selectedMode>profileCount) {
85 | selectedMode = 0;
86 | }
87 | for(int i=0;insdata->cgadatprovider->cgimage
164 | // NSData *image=[NSData dataWithBytes:buf length:size];
165 | // CGDataProviderRef provider=CGDataProviderCreateWithCFData((CFDataRef)image);
166 | // CGImageRef cgimg=CGImageCreate(width, height, 8, 32, width*4, CGColorSpaceCreateDeviceRGB(), kCGImageAlphaLast, provider, NULL, NO, kCGRenderingIntentDefault);
167 | // //unmap the memory again.
168 | // EWProxyFramebufferDriverUnmapCursor(connect, buf);
169 | // CFRelease(provider);
170 | // return cgimg;
171 | //}
172 |
173 | @end
174 |
--------------------------------------------------------------------------------
/EWProxyFrameBufferDriver.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include "EWProxyFrameBufferDriver.h"
3 | //#include "PSPScreenDriver.h"
4 | #include "EWProxyFrameBufferClient.h"
5 | #include "EWProxyFrameBufferFBuffer.h"
6 | #include "EWProxyFrameBuffer.h"
7 |
8 | extern "C" {
9 | #include //This is for debugging only
10 | }
11 |
12 | #define super IOService
13 |
14 | OSDefineMetaClassAndStructors(info_ennowelbers_proxyframebuffer_driver, IOService)
15 |
16 | bool info_ennowelbers_proxyframebuffer_driver::init(OSDictionary *dict)
17 | {
18 | bool res =super::init(dict);
19 | buffer=NULL;
20 | //IOLog("Initializing\n");
21 | return res;
22 | }
23 |
24 | //this function is not called when the framebuffer is enabled in plist's settings
25 | //reason: once you have a framebuffer, the system assimilates you (retain count mayhem)
26 | void info_ennowelbers_proxyframebuffer_driver::free(void)
27 | {
28 | if(buffer!=NULL)
29 | {
30 | buffer->release();
31 | buffer=NULL;
32 | }
33 | //IOLog("Freeing\n");
34 | super::free();
35 | }
36 |
37 | //we're mathing against IOKit/IOResource, so there is no probing, no real one at least.
38 | IOService *info_ennowelbers_proxyframebuffer_driver::probe(IOService *provider, SInt32 *score)
39 | {
40 | IOService *res=super::probe(provider,score);
41 | //IOLog("Probing\n");
42 | return res;
43 | }
44 |
45 | bool info_ennowelbers_proxyframebuffer_driver::start(IOService *provider)
46 | {
47 | bool res=super::start(provider);
48 | if(res)
49 | {
50 | //in order to get a framebuffer up and working, we need to correctly configure powermanagement.
51 | //we're setting up three power states: off, on and usable.
52 | PMinit();
53 | getProvider()->joinPMtree(this);
54 | static IOPMPowerState myPowerStates[3];
55 | myPowerStates[0].version=1;
56 | myPowerStates[0].capabilityFlags=0;
57 | myPowerStates[0].outputPowerCharacter=0;
58 | myPowerStates[0].inputPowerRequirement=0;
59 | myPowerStates[1].version=1;
60 | myPowerStates[1].capabilityFlags=0;
61 | myPowerStates[1].outputPowerCharacter=0;
62 | myPowerStates[1].inputPowerRequirement=IOPMPowerOn;
63 | myPowerStates[2].version=1;
64 | myPowerStates[2].capabilityFlags=IOPMDeviceUsable;
65 | myPowerStates[2].outputPowerCharacter=IOPMPowerOn;
66 | myPowerStates[2].inputPowerRequirement=IOPMPowerOn;
67 | registerPowerDriver(this, myPowerStates, 3);
68 | //and we're switching to power state USABLE
69 | changePowerStateTo(2);
70 | //you need to to this AFTER setting power configuration.
71 | //at least that's what i recall
72 | registerService();
73 | IOLog("EWProxyFrameBuffer: start with maximum resolution %dx%d\n",getMaxWidth(),getMaxHeight());
74 | if(shouldInitFB())
75 | {
76 | IOLog("EWProxyFrameBuffer: Initializing Framebuffer. Unload from this point is impossible.\n");
77 | initFB();
78 | }
79 | else
80 | {
81 | IOLog("EWProxyFrameBuffer: Framebuffer initialization deactivated.\n");
82 | }
83 | //StartFramebuffer(640, 480);
84 | }
85 | //IOLog("Starting\n");
86 | return res;
87 | }
88 |
89 | //reads the plist setting.
90 | bool info_ennowelbers_proxyframebuffer_driver::shouldInitFB()
91 | {
92 | OSBoolean *result=(OSBoolean*)getProperty("loadFramebuffer");
93 | return result->isTrue();
94 | }
95 |
96 | //initializes the framebuffer
97 | void info_ennowelbers_proxyframebuffer_driver::initFB()
98 | {
99 | if(fbuffer==NULL)
100 | {
101 | //IOLog("StartFramebuffer %d %d\n",width,height);
102 | //lookahead: there is a framebuffer->thisclassuserclient->userspace path to get the screen capture
103 | //but the framebuffer memory is not a valid image (it contains more than the normal raw image data)
104 | //therefore we init a buffer to copy the image into. However, we're getting
105 | //a memory footprint of twice maxresolution*3, or at least near that scale
106 | //(i assume it's even worse, actually... just keep reading my comments)
107 | unsigned int size=getMaxWidth()*getMaxHeight()*3;
108 | buffer=IOBufferMemoryDescriptor::withCapacity(size, kIODirectionInOut);
109 | //IOLog("buffer=%d\n",buffer);
110 |
111 | //yes, i'm not using IOKit's matching system here, i simply instanciate on my own.
112 | //yes, that's NOT the way they want ist, but
113 | //now i can control easily whether the framebuffer gets instanciated or not.
114 | //and all nessecary dictionary keys are documented.
115 | fbuffer=new info_ennowelbers_proxyframebuffer_fbuffer();
116 |
117 | OSDictionary *dict=OSDictionary::withCapacity(5);
118 | OSString *bundle=OSString::withCString("info.ennowelbers.framebuffer");
119 | OSString *classname=OSString::withCString("info_ennowelbers_proxyframebuffer_fbuffer");
120 | OSNumber *debug=OSNumber::withNumber(65535, 32);
121 | OSString *provider=OSString::withCString("info_ennowelbers_proxyframebuffer_driver");
122 | OSString *userclient=OSString::withCString("IOFramebufferUserClient");
123 |
124 | dict->setObject("CFBundleIdentifier", bundle);
125 | dict->setObject("IOClass", classname);
126 | dict->setObject("IOKitDebug", debug);
127 | dict->setObject("IOProviderClass", provider);
128 | dict->setObject("IOUserClientClass", userclient);
129 |
130 | bundle->release();
131 | classname->release();
132 | debug->release();
133 | provider->release();
134 | userclient->release();
135 |
136 | fbuffer->init(dict);
137 | IOLog("EWProxyFrameBuffer: fbuffer retain count: %d\n",fbuffer->getRetainCount());
138 | dict->release();
139 | //i forgot why i did this, maybe to ensure that
140 | //iokit does not mess up with me...
141 | //however this is kernel development, trying will keep you rebooting.
142 | requestProbe(0);
143 | //attach the framebuffer to this.
144 | fbuffer->attach(this);
145 | SInt32 score;
146 | fbuffer->probe(this, &score);
147 | fbuffer->start(this);
148 | }
149 | }
150 |
151 | //won't get called with attached framebuffer.
152 | void info_ennowelbers_proxyframebuffer_driver::stop(IOService *provider)
153 | {
154 | super::stop(provider);
155 | PMstop();
156 | //IOLog("Stopping\n");
157 | }
158 |
159 | //we're not having hardware so there is no need to disable it.
160 | IOReturn info_ennowelbers_proxyframebuffer_driver::setPowerState(unsigned long powerStateOrdinal, IOService *originatingfrom)
161 | {
162 | return super::setPowerState(powerStateOrdinal,originatingfrom);
163 | //return kIOPMAckImplied;
164 | }
165 |
166 | //reads the plist setting MaxResolution->width
167 | //MaxWidth and MaxHeight are used to initialize all buffers.
168 | //See the framebuffer
169 | unsigned int info_ennowelbers_proxyframebuffer_driver::getMaxWidth()
170 | {
171 | OSDictionary *dict=(OSDictionary*)getProperty("MaxResolution");
172 | if(dict==NULL)
173 | return 640;
174 | OSNumber *width=(OSNumber*)dict->getObject("width");
175 | if(width==NULL)
176 | return 640;
177 | return width->unsigned32BitValue();
178 | }
179 |
180 | //reads the plist setting MaxResolution->height
181 | unsigned int info_ennowelbers_proxyframebuffer_driver::getMaxHeight()
182 | {
183 | OSDictionary *dict=(OSDictionary*)getProperty("MaxResolution");
184 | if(dict==NULL)
185 | return 480;
186 | OSNumber *height=(OSNumber*)dict->getObject("height");
187 | if(height==NULL)
188 | return 480;
189 | return height->unsigned32BitValue();
190 | }
191 |
192 | //We're not a real graphic card BUT we still need to provide the OS with
193 | //a list of supported modes. Plist configuration is your help
194 | unsigned int info_ennowelbers_proxyframebuffer_driver::getModeCount()
195 | {
196 | OSArray *data=(OSArray *)getProperty("DriverModes");
197 | return data->getCount();
198 | }
199 |
200 | //fetches all Screen modes
201 | IOReturn info_ennowelbers_proxyframebuffer_driver::getAllModes(EWProxyFramebufferModeInfo *mode)
202 | {
203 | OSArray *data=(OSArray *)getProperty("DriverModes");
204 | EWProxyFramebufferModeInfo *walk=mode;
205 | for(int i=0;igetCount();i++)
206 | {
207 | OSDictionary *dict=(OSDictionary*)data->getObject(i);
208 | OSString *name=(OSString*)dict->getObject("name");
209 | OSNumber *width=(OSNumber*)dict->getObject("width");
210 | OSNumber *height=(OSNumber*)dict->getObject("height");
211 | strlcpy(mode->name, name->getCStringNoCopy(), sizeof(mode->name));
212 | walk->width=width->unsigned32BitValue();
213 | walk->height=height->unsigned32BitValue();
214 | walk++;
215 | }
216 | return kIOReturnSuccess;
217 | }
218 |
219 | //fetches a single mode from plist config.
220 | IOReturn info_ennowelbers_proxyframebuffer_driver::getmodeInfo(unsigned int mode, EWProxyFramebufferModeInfo *result)
221 | {
222 | if(mode<1 || mode>getModeCount())
223 | {
224 | return kIOReturnBadArgument;
225 | }
226 | OSArray *array=(OSArray*)getProperty("DriverModes");
227 | OSDictionary *dict=(OSDictionary*)array->getObject(mode-1);
228 | OSString *name=(OSString*)dict->getObject("name");
229 | OSNumber *width=(OSNumber*)dict->getObject("width");
230 | OSNumber *height=(OSNumber*)dict->getObject("height");
231 | result->width=width->unsigned32BitValue();
232 | result->height=height->unsigned32BitValue();
233 | strlcpy(result->name, name->getCStringNoCopy(), sizeof(result->name));
234 | return kIOReturnSuccess;
235 | }
236 |
237 | //we're not hardware based, so a running user space app is acting as hardware
238 | //this call ist just a wrapper targeting the framebuffer to signal a connected display
239 | //To draw a map in your mind: stack trace until OS senses the screen:
240 | //User Space App::Foo()
241 | //IOKit (USER SPACE) exec user client function()
242 | //IOKit (KERNEL SPACE) dispatch
243 | //ewproxyframebufferclient::dispatch(ref,params)
244 | //ewproxyframebufferclient->startframebuffer(mode)
245 | //ewproxyframebufferdriver->startframebuffer(mode)
246 | //ewproxyframebuffer->connect()
247 | //...
248 | IOReturn info_ennowelbers_proxyframebuffer_driver::StartFramebuffer(int mode)
249 | {
250 | return fbuffer->Connect(mode);
251 | }
252 |
253 | //user client wrapper to unplug the screen
254 | IOReturn info_ennowelbers_proxyframebuffer_driver::StopFramebuffer()
255 | {
256 | return fbuffer->Disconnect();
257 | }
258 |
259 | //allows user space to see the state. actually it's bad to call this if the framebuffer is not loaded...
260 | IOReturn info_ennowelbers_proxyframebuffer_driver::CheckFramebufferState()
261 | {
262 | return fbuffer->State();
263 | }
264 |
265 | //this function copies the graphic memory to our buffer so that the user client get's an
266 | //updated image
267 | //i feel that this code will break at some time in the future...
268 | //i did not find any documentation about memory usage and the reasons for
269 | //the line width and additional headers
270 | IOReturn info_ennowelbers_proxyframebuffer_driver::UpdateMemory()
271 | {
272 | if(fbuffer->State()!=0)//fbuffer->connected==1)
273 | {
274 | IODeviceMemory *mem=fbuffer->getApertureRange(kIOFBSystemAperture);
275 | IOMemoryMap *map=mem->map(kIOMapAnywhere);
276 | IOMemoryMap *bmap=buffer->map(kIOMapAnywhere);
277 | unsigned int *buf=(unsigned int*)map->getVirtualAddress();
278 | unsigned char *destWalk=(unsigned char*)bmap->getVirtualAddress();
279 | //assumption 1: the system just wants some memory to play with, data start at 0
280 | //assumption 2: each row has 32 byte ahead
281 | //assumption 3: each row has 32 byte at the end
282 | //assumption 4: each row has 32 byte ahead + 128 byte ahead of everything
283 | //assumption 5: each row has 32 byte at the end + 128 byte ahead of everything
284 |
285 | //assumption 3 is correct (32 byte at end of each frame, 128 byte at end of buffer)
286 | IODisplayModeInformation information;
287 | fbuffer->getInformationForDisplayMode(fbuffer->State(), &information);
288 | for(int y=0;y>16;//R
293 | destWalk++;
294 | *destWalk=((*buf)&0xFF00)>>8;//G
295 | destWalk++;
296 | *destWalk=(*buf)&0xFF;//B
297 | destWalk++;
298 | buf++;
299 |
300 | }
301 | buf+=8;
302 | }
303 | map->release();
304 | bmap->release();
305 | mem->release();
306 | return kIOReturnSuccess;
307 | }
308 |
309 | return kIOReturnError;
310 | }
311 |
312 |
--------------------------------------------------------------------------------
/EWProxyFrameBufferClient.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * PSPScreenClient.cpp
3 | * PSPScreenDriver
4 | *
5 | * Created by Enno Welbers on 28.02.09.
6 | * Copyright 2009 __MyCompanyName__. All rights reserved.
7 | *
8 | */
9 | #include
10 | #include
11 | #include
12 | #include "EWProxyFrameBufferClient.h"
13 |
14 | #include "EWProxyFrameBufferFBuffer.h"
15 |
16 | #define super IOUserClient
17 |
18 | OSDefineMetaClassAndStructors(info_ennowelbers_proxyframebuffer_client, IOUserClient)
19 |
20 | #pragma mark Dispatch table
21 | const IOExternalMethodDispatch info_ennowelbers_proxyframebuffer_client::sMethods[kNumberOfMethods] = {
22 | {
23 | (IOExternalMethodAction) &info_ennowelbers_proxyframebuffer_client::sStartFramebuffer,//Action
24 | 1,//number of scalar inputs
25 | 0,//struct input size
26 | 0,//number of scalar outputs
27 | 0,//struct output size
28 | },
29 | {
30 | (IOExternalMethodAction) &info_ennowelbers_proxyframebuffer_client::sStopFramebuffer,
31 | 0,
32 | 0,
33 | 0,
34 | 0,
35 | },
36 | {
37 | (IOExternalMethodAction) &info_ennowelbers_proxyframebuffer_client::sCheckFramebufferState,
38 | 0,
39 | 0,
40 | 0,
41 | 0,
42 | },
43 | {
44 | (IOExternalMethodAction) &info_ennowelbers_proxyframebuffer_client::sUpdateMemory,
45 | 0,
46 | 0,
47 | 0,
48 | 0,
49 | },
50 | {
51 | (IOExternalMethodAction)&info_ennowelbers_proxyframebuffer_client::sGetModeCount,
52 | 0,
53 | 0,
54 | 0,
55 | 0,
56 | },
57 | {
58 | (IOExternalMethodAction)&info_ennowelbers_proxyframebuffer_client::sGetModeInfo,
59 | 1,
60 | 0,
61 | 0,
62 | sizeof(EWProxyFramebufferModeInfo),
63 | },
64 | {
65 | (IOExternalMethodAction)&info_ennowelbers_proxyframebuffer_client::sGetCursorState,
66 | 0,
67 | 0,
68 | 3,
69 | 0,
70 | },
71 | {
72 | (IOExternalMethodAction)&info_ennowelbers_proxyframebuffer_client::sGetCursorResolution,
73 | 0,
74 | 0,
75 | 2,
76 | 0,
77 | },
78 | {
79 | (IOExternalMethodAction)&info_ennowelbers_proxyframebuffer_client::sEnableCursorEvents,
80 | 2,
81 | 0,
82 | 0,
83 | 0,
84 | },
85 | {
86 | (IOExternalMethodAction)&info_ennowelbers_proxyframebuffer_client::sDisableCursorEvents,
87 | 0,
88 | 0,
89 | 0,
90 | 0,
91 | }
92 | };
93 |
94 | #pragma mark dispatcher function
95 | //as we're having function adresses in our dispatch table, all we need is a range check and check the target.
96 | IOReturn info_ennowelbers_proxyframebuffer_client::externalMethod(uint32_t selector, IOExternalMethodArguments* arguments, IOExternalMethodDispatch* dispatch, OSObject *target, void *reference)
97 | {
98 | if(selector < (uint32_t) kNumberOfMethods) {
99 | dispatch=(IOExternalMethodDispatch*)&sMethods[selector];
100 | if(!target)
101 | {
102 | target=this;
103 | }
104 | }
105 | return super::externalMethod(selector, arguments, dispatch, target, reference);
106 | }
107 |
108 | #pragma mark IOUserClient functions
109 | //for these functions, see apple docs.
110 | bool info_ennowelbers_proxyframebuffer_client::initWithTask(task_t owningTask, void* securityToken, UInt32 type, OSDictionary *properties)
111 | {
112 | bool success;
113 |
114 | success=super::initWithTask(owningTask, securityToken, type, properties);
115 |
116 | fTask=owningTask;
117 | fProvider=NULL;
118 | owningFB=NULL;
119 | return success;
120 | }
121 |
122 | bool info_ennowelbers_proxyframebuffer_client::start(IOService *provider)
123 | {
124 | bool success;
125 |
126 | fProvider= OSDynamicCast(info_ennowelbers_proxyframebuffer_driver, provider);
127 | success=(fProvider!=NULL);
128 | if(success) {
129 | success=super::start(provider);
130 | }
131 | return success;
132 | }
133 |
134 | IOReturn info_ennowelbers_proxyframebuffer_client::clientClose()
135 | {
136 | if(owningFB)
137 | {
138 | StopFramebuffer();
139 | }
140 | if(eventEnabled)
141 | {
142 | fProvider->eventClient=NULL;
143 | }
144 | terminate();
145 | return kIOReturnSuccess;
146 | }
147 |
148 | IOReturn info_ennowelbers_proxyframebuffer_client::clientDied()
149 | {
150 | if(owningFB)
151 | {
152 | StopFramebuffer();
153 | }
154 | if(eventEnabled)
155 | {
156 | fProvider->eventClient=NULL;
157 | }
158 | return super::clientDied();
159 | }
160 |
161 | //This one is used to send events to user space.
162 | IOReturn info_ennowelbers_proxyframebuffer_client::registerNotificationPort(mach_port_t port, UInt32 type, UInt32 refCon )
163 | {
164 | eventPort=port;
165 | return kIOReturnSuccess;
166 | }
167 |
168 | #pragma mark static functions
169 | //these functions are part of the "calling chain"
170 | //actually they do ... nothing special. Converting parameters, calling member functions.
171 |
172 | IOReturn info_ennowelbers_proxyframebuffer_client::sStartFramebuffer(info_ennowelbers_proxyframebuffer_client *target, void * reference, IOExternalMethodArguments *arguments)
173 | {
174 | IOReturn ret=target->StartFramebuffer(arguments->scalarInput[0]);
175 | return ret;
176 | }
177 |
178 | IOReturn info_ennowelbers_proxyframebuffer_client::sStopFramebuffer(info_ennowelbers_proxyframebuffer_client *target, void * reference, IOExternalMethodArguments *arguments)
179 | {
180 | IOReturn ret=target->StopFramebuffer();
181 | return ret;
182 | }
183 |
184 | IOReturn info_ennowelbers_proxyframebuffer_client::sCheckFramebufferState(info_ennowelbers_proxyframebuffer_client *target, void *reference, IOExternalMethodArguments *arguments)
185 | {
186 | return target->CheckFramebufferState();
187 | }
188 |
189 | IOReturn info_ennowelbers_proxyframebuffer_client::sUpdateMemory(info_ennowelbers_proxyframebuffer_client* target, void *reference, IOExternalMethodArguments *arguments)
190 | {
191 | return target->UpdateMemory();
192 | }
193 |
194 | IOReturn info_ennowelbers_proxyframebuffer_client::sGetModeCount(info_ennowelbers_proxyframebuffer_client* target, void *reference, IOExternalMethodArguments *arguments)
195 | {
196 | return target->GetModeCount();
197 | }
198 |
199 | IOReturn info_ennowelbers_proxyframebuffer_client::sGetModeInfo(info_ennowelbers_proxyframebuffer_client* target, void *reference, IOExternalMethodArguments *arguments)
200 | {
201 | IOLog("EWProxyFrameBuffer: Client static Get Mode Info!\n");
202 | IOReturn ret= target->GetModeInfo(arguments->scalarInput[0], (EWProxyFramebufferModeInfo*)arguments->structureOutput);
203 | arguments->structureOutputSize=sizeof(EWProxyFramebufferModeInfo);
204 | return ret;
205 | }
206 |
207 | IOReturn info_ennowelbers_proxyframebuffer_client::sGetCursorState(info_ennowelbers_proxyframebuffer_client* target, void *reference, IOExternalMethodArguments *arguments)
208 | {
209 | return target->GetCursorState((int*)&arguments->scalarOutput[0], (int*)&arguments->scalarOutput[1], (bool*)&arguments->scalarOutput[2]);
210 | }
211 |
212 | IOReturn info_ennowelbers_proxyframebuffer_client::sGetCursorResolution(info_ennowelbers_proxyframebuffer_client* target, void *reference, IOExternalMethodArguments *arguments)
213 | {
214 | return target->GetCursorResolution((int*)&arguments->scalarOutput[0], (int*)&arguments->scalarOutput[1]);
215 | }
216 |
217 | IOReturn info_ennowelbers_proxyframebuffer_client::sEnableCursorEvents(info_ennowelbers_proxyframebuffer_client* target, void *reference, IOExternalMethodArguments *arguments)
218 | {
219 | #ifdef __LP64__
220 | return target->EnableCursorEvents((mach_vm_address_t)(arguments->scalarInput[0]), (io_user_reference_t)(arguments->scalarInput[1]));
221 | #else
222 | return target->EnableCursorEvents((void*)(arguments->scalarInput[0]), (void*)(arguments->scalarInput[1]));
223 | #endif
224 | }
225 |
226 | #pragma mark member functions of the call chaing
227 | //these functions access the driver variables and provides results
228 |
229 | IOReturn info_ennowelbers_proxyframebuffer_client::GetCursorState(int *x, int *y, bool *visible)
230 | {
231 | *x=fProvider->fbuffer->cursorX;
232 | *y=fProvider->fbuffer->cursorY;
233 | *visible=fProvider->fbuffer->cursorVisible;
234 | return kIOReturnSuccess;
235 | }
236 |
237 | IOReturn info_ennowelbers_proxyframebuffer_client::GetCursorResolution(int *width, int *height)
238 | {
239 | *width=fProvider->fbuffer->cursorWidth;
240 | *height=fProvider->fbuffer->cursorHeight;
241 | return kIOReturnSuccess;
242 | }
243 |
244 | IOReturn info_ennowelbers_proxyframebuffer_client::StartFramebuffer(int mode)
245 | {
246 | IOReturn ret= fProvider->StartFramebuffer(mode);
247 | if(ret==kIOReturnSuccess)
248 | {
249 | owningFB=true;
250 | }
251 | return ret;
252 | }
253 |
254 | IOReturn info_ennowelbers_proxyframebuffer_client::StopFramebuffer()
255 | {
256 | IOReturn ret= fProvider->StopFramebuffer();
257 | if(ret==kIOReturnSuccess)
258 | {
259 | owningFB=false;
260 | }
261 |
262 | return ret;
263 | }
264 |
265 | IOReturn info_ennowelbers_proxyframebuffer_client::CheckFramebufferState()
266 | {
267 | return fProvider->CheckFramebufferState();
268 | }
269 |
270 | IOReturn info_ennowelbers_proxyframebuffer_client::UpdateMemory()
271 | {
272 | return fProvider->UpdateMemory();
273 | }
274 |
275 | IOReturn info_ennowelbers_proxyframebuffer_client::GetModeCount()
276 | {
277 | return fProvider->getModeCount();
278 | }
279 |
280 | IOReturn info_ennowelbers_proxyframebuffer_client::GetModeInfo(int mode,EWProxyFramebufferModeInfo *info)
281 | {
282 | IOLog("EWProxyFrameBuffer: client->GetModeInfo(%d)\n",mode);
283 | return fProvider->getmodeInfo(mode, info);
284 | }
285 | IOReturn info_ennowelbers_proxyframebuffer_client::clientMemoryForType( UInt32 type, IOOptionBits * options, IOMemoryDescriptor ** memory )
286 | {
287 | IOMemoryDescriptor *mem;
288 | switch(type)
289 | {
290 | case 0:
291 | mem=(IOMemoryDescriptor*)fProvider->buffer;
292 | break;
293 | case 1:
294 | mem=(IOMemoryDescriptor*)fProvider->fbuffer->cursorMem;
295 | break;
296 | }
297 | mem->retain();
298 | if(mem==NULL)
299 | return kIOReturnError;
300 | *memory=mem;
301 | return kIOReturnSuccess;
302 | }
303 |
304 | void info_ennowelbers_proxyframebuffer_client::FireCursorStateChanged()
305 | {
306 | if(eventEnabled)
307 | {
308 | //With the help of a previously registered event we're firing it.
309 | #ifdef __LP64__
310 | io_user_reference_t type[1]={(io_user_reference_t)kEWProxyCursorStateChanged};
311 | sendAsyncResult64(eventFunction, kIOReturnSuccess,type,1);
312 | #else
313 | void *type[1]={(void*)kEWProxyCursorStateChanged};
314 | sendAsyncResult(eventFunction, kIOReturnSuccess, type, 1);
315 | #endif
316 | }
317 | }
318 |
319 | void info_ennowelbers_proxyframebuffer_client::FireCursorImageChanged()
320 | {
321 | if(eventEnabled)
322 | {
323 | #ifdef __LP64__
324 | io_user_reference_t type[1]={(io_user_reference_t)kEWProxyCursorImageChanged};
325 | sendAsyncResult64(eventFunction,kIOReturnSuccess, type,1);
326 | #else
327 | void *type[1]={(void*)kEWProxyCursorImageChanged};
328 | sendAsyncResult(eventFunction,kIOReturnSuccess, type,1);
329 | #endif
330 | }
331 | }
332 |
333 | //registers an event. This is quite fancy from my point of view.
334 | //user client provides a call pointer, a reference and registers an event port (see above)
335 | //these three together form an OSAsyncReference. the SetAsyncReference fills this opaque structure.
336 | //Later on this opaque structure can be used to fire the event.
337 | //I did not yet get the way this works, however in theory you could even transport parameters.
338 | //we're not using them, though.
339 | #ifdef __LP64__
340 | IOReturn info_ennowelbers_proxyframebuffer_client::EnableCursorEvents(mach_vm_address_t call, io_user_reference_t reference)
341 | #else
342 | IOReturn info_ennowelbers_proxyframebuffer_client::EnableCursorEvents(void *call, void *reference)
343 | #endif
344 | {
345 | if(fProvider->eventClient!=NULL)
346 | return kIOReturnBusy;
347 | #ifdef __LP64__
348 | setAsyncReference64(eventFunction,eventPort,call,reference);
349 | #else
350 | setAsyncReference(eventFunction, eventPort, call, reference);
351 | #endif
352 | eventEnabled=true;
353 | fProvider->eventClient=this;
354 | return kIOReturnSuccess;
355 | }
356 |
357 | IOReturn info_ennowelbers_proxyframebuffer_client::sDisableCursorEvents(info_ennowelbers_proxyframebuffer_client* target, void *reference, IOExternalMethodArguments *arguments)
358 | {
359 | return target->DisableCursorEvents();
360 | }
361 |
362 | IOReturn info_ennowelbers_proxyframebuffer_client::DisableCursorEvents()
363 | {
364 | if(eventEnabled==false)
365 | return kIOReturnNotAttached;
366 | eventEnabled=false;
367 | fProvider->eventClient=NULL;
368 | return kIOReturnSuccess;
369 | }
370 |
--------------------------------------------------------------------------------
/IOKit/graphics/IOFramebufferPrivate.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
3 | *
4 | * @APPLE_LICENSE_HEADER_START@
5 | *
6 | * The contents of this file constitute Original Code as defined in and
7 | * are subject to the Apple Public Source License Version 1.1 (the
8 | * "License"). You may not use this file except in compliance with the
9 | * License. Please obtain a copy of the License at
10 | * http://www.apple.com/publicsource and read it before using this file.
11 | *
12 | * This Original Code and all software distributed under the License are
13 | * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 | * License for the specific language governing rights and limitations
18 | * under the License.
19 | *
20 | * @APPLE_LICENSE_HEADER_END@
21 | */
22 | void setupCursor( IOPixelInformation * info );
23 | void stopCursor( void );
24 | IOReturn doSetup( bool full );
25 | void findConsole(void);
26 | IOReturn createSharedCursor( int shmemVersion,
27 | int maxWidth, int maxHeight );
28 | IOReturn setBoundingRect( IOGBounds * bounds );
29 | IOReturn setUserRanges( void );
30 | IOReturn getConnectFlagsForDisplayMode(
31 | IODisplayModeID mode, IOIndex connection, UInt32 * flags );
32 |
33 | IOReturn beginSystemSleep( void * ackRef );
34 |
35 | static inline void StdFBDisplayCursor( IOFramebuffer * inst );
36 | static inline void StdFBRemoveCursor( IOFramebuffer * inst );
37 | static inline void RemoveCursor( IOFramebuffer * inst );
38 | static inline void DisplayCursor( IOFramebuffer * inst );
39 | static inline void SysHideCursor( IOFramebuffer * inst );
40 | static inline void SysShowCursor( IOFramebuffer * inst );
41 | static inline void CheckShield( IOFramebuffer * inst );
42 | inline IOOptionBits _setCursorImage( UInt32 frame );
43 | inline IOReturn _setCursorState( SInt32 x, SInt32 y, bool visible );
44 | static void cursorWork( OSObject * p0, IOInterruptEventSource * evtSrc, int intCount );
45 |
46 | static void StdFBDisplayCursor8P(
47 | IOFramebuffer * inst,
48 | StdFBShmem_t *shmem,
49 | volatile unsigned char *vramPtr,
50 | unsigned int cursStart,
51 | unsigned int vramRow,
52 | unsigned int cursRow,
53 | int width,
54 | int height );
55 |
56 | static void StdFBDisplayCursor8G(
57 | IOFramebuffer * inst,
58 | StdFBShmem_t *shmem,
59 | volatile unsigned char *vramPtr,
60 | unsigned int cursStart,
61 | unsigned int vramRow,
62 | unsigned int cursRow,
63 | int width,
64 | int height );
65 |
66 | static void StdFBDisplayCursor555(
67 | IOFramebuffer * inst,
68 | StdFBShmem_t *shmem,
69 | volatile unsigned short *vramPtr,
70 | unsigned int cursStart,
71 | unsigned int vramRow,
72 | unsigned int cursRow,
73 | int width,
74 | int height );
75 |
76 | static void StdFBDisplayCursor30Axxx(
77 | IOFramebuffer * inst,
78 | StdFBShmem_t *shmem,
79 | volatile unsigned int *vramPtr,
80 | unsigned int cursStart,
81 | unsigned int vramRow,
82 | unsigned int cursRow,
83 | int width,
84 | int height );
85 |
86 | static void StdFBDisplayCursor32Axxx(
87 | IOFramebuffer * inst,
88 | StdFBShmem_t *shmem,
89 | volatile unsigned int *vramPtr,
90 | unsigned int cursStart,
91 | unsigned int vramRow,
92 | unsigned int cursRow,
93 | int width,
94 | int height );
95 |
96 | static void StdFBRemoveCursor8(
97 | IOFramebuffer * inst,
98 | StdFBShmem_t *shmem,
99 | volatile unsigned char *vramPtr,
100 | unsigned int vramRow,
101 | int width,
102 | int height );
103 | static void StdFBRemoveCursor16(
104 | IOFramebuffer * inst,
105 | StdFBShmem_t *shmem,
106 | volatile unsigned short *vramPtr,
107 | unsigned int vramRow,
108 | int width,
109 | int height );
110 |
111 | static void StdFBRemoveCursor32(
112 | IOFramebuffer * inst,
113 | StdFBShmem_t *shmem,
114 | volatile unsigned int *vramPtr,
115 | unsigned int vramRow,
116 | int width,
117 | int height );
118 |
119 | static void deferredMoveCursor(IOFramebuffer * inst);
120 | static void deferredInterrupt( OSObject * owner,
121 | IOInterruptEventSource * evtSrc, int intCount );
122 | static void deferredCLUTSetInterrupt( OSObject * owner,
123 | IOInterruptEventSource * evtSrc, int intCount );
124 | static void deferredSpeedChangeEvent( OSObject * owner,
125 | IOInterruptEventSource * evtSrc, int intCount );
126 |
127 | static IOReturn pmSettingsChange(OSObject *target, const OSSymbol *type,
128 | OSObject *val, uintptr_t refcon);
129 |
130 | static void globalEvent( OSObject * target,
131 | IOInterruptEventSource * evtSrc, int intCount );
132 |
133 | void checkDeferredCLUTSet( void );
134 | void updateCursorForCLUTSet( void );
135 | IOReturn updateGammaTable( UInt32 channelCount, UInt32 dataCount,
136 | UInt32 dataWidth, const void * data );
137 |
138 | static void dpInterruptProc(OSObject * target, void * ref);
139 | static void dpInterrupt(OSObject * owner, IOTimerEventSource * sender);
140 | void dpProcessInterrupt(void);
141 | void dpUpdateConnect(void);
142 |
143 | static void handleVBL(IOFramebuffer * inst, void * ref);
144 | static void writePrefs( OSObject * owner, IOTimerEventSource * sender );
145 | static void connectChangeInterrupt( IOFramebuffer * inst, void * ref );
146 | static void connectChangeDelayedInterrupt( OSObject * owner, IOTimerEventSource * sender );
147 | void checkConnectionChange( bool message = true );
148 | void setNextDependent( IOFramebuffer * dependent );
149 | IOFramebuffer * getNextDependent( void );
150 | void setCaptured( bool isCaptured );
151 | void setDimDisable( bool dimDisable );
152 | bool getDimDisable( void );
153 | IOReturn notifyServer( UInt8 state );
154 | void notifyServerAll( UInt8 state );
155 | IOReturn extEntry(void);
156 | void wakeServerState(UInt8 state);
157 | bool getIsUsable( void );
158 | IOReturn postOpen( void );
159 | static void startThread(bool highPri);
160 | static void sleepWork( void * arg );
161 | static void clamshellWork( thread_call_param_t p0, thread_call_param_t p1 );
162 | IOOptionBits checkPowerWork( void );
163 | IOReturn postWake( IOOptionBits state );
164 | IOReturn deliverDisplayModeDidChangeNotification( void );
165 | static IOReturn systemPowerChange( void * target, void * refCon,
166 | UInt32 messageType, IOService * service,
167 | void * messageArgument, vm_size_t argSize );
168 | static bool clamshellHandler( void * target, void * ref,
169 | IOService * resourceService, IONotifier * notifier );
170 | static void clamshellProbeAction( OSObject * owner, IOTimerEventSource * sender );
171 |
172 | static IOReturn probeAll( IOOptionBits options );
173 |
174 | IOReturn selectTransform( UInt64 newTransform, bool generateChange );
175 | void setTransform( UInt64 newTransform, bool generateChange );
176 | UInt64 getTransform( void );
177 | IOReturn checkMirrorSafe( UInt32 value, IOFramebuffer * other );
178 | void transformLocation(StdFBShmem_t * shmem, IOGPoint * cursorLoc, IOGPoint * transformLoc);
179 | void transformCursor(StdFBShmem_t * shmem, IOIndex frame);
180 |
181 | bool deepFramebuffer( IOPixelInformation * pixelInfo );
182 | bool validFramebuffer( IOPixelInformation * pixelInfo );
183 |
184 | // --
185 |
186 | static IOReturn extCreateSharedCursor(OSObject * target, void * reference, IOExternalMethodArguments * args);
187 | static IOReturn extGetPixelInformation(OSObject * target, void * reference, IOExternalMethodArguments * args);
188 | static IOReturn extGetCurrentDisplayMode(OSObject * target, void * reference, IOExternalMethodArguments * args);
189 | static IOReturn extSetStartupDisplayMode(OSObject * target, void * reference, IOExternalMethodArguments * args);
190 | static IOReturn extSetGammaTable(OSObject * target, void * reference, IOExternalMethodArguments * args);
191 | static IOReturn extGetDisplayModeCount(OSObject * target, void * reference, IOExternalMethodArguments * args);
192 | static IOReturn extGetDisplayModes(OSObject * target, void * reference, IOExternalMethodArguments * args);
193 | static IOReturn extSetDisplayMode(OSObject * target, void * reference, IOExternalMethodArguments * args);
194 | static IOReturn extGetInformationForDisplayMode(OSObject * target, void * reference, IOExternalMethodArguments * args);
195 |
196 | static IOReturn extGetVRAMMapOffset(OSObject * target, void * reference, IOExternalMethodArguments * args);
197 | static IOReturn extSetBounds(OSObject * target, void * reference, IOExternalMethodArguments * args);
198 |
199 | static IOReturn extSetNewCursor(OSObject * target, void * reference, IOExternalMethodArguments * args);
200 | static IOReturn extSetCursorVisible(OSObject * target, void * reference, IOExternalMethodArguments * args);
201 | static IOReturn extSetCursorPosition(OSObject * target, void * reference, IOExternalMethodArguments * args);
202 | static IOReturn extSetColorConvertTable(OSObject * target, void * reference, IOExternalMethodArguments * args);
203 | static IOReturn extSetCLUTWithEntries(OSObject * target, void * reference, IOExternalMethodArguments * args);
204 | static IOReturn extSetAttribute(OSObject * target, void * reference, IOExternalMethodArguments * args);
205 | static IOReturn extGetAttribute(OSObject * target, void * reference, IOExternalMethodArguments * args);
206 | static IOReturn extValidateDetailedTiming(OSObject * target, void * reference, IOExternalMethodArguments * args);
207 | static IOReturn extAcknowledgeNotification(OSObject * target, void * reference, IOExternalMethodArguments * args);
208 |
209 | // --
210 |
211 | IOReturn extSetProperties( OSDictionary * dict );
212 | IOReturn extRegisterNotificationPort(
213 | mach_port_t port,
214 | UInt32 type,
215 | UInt32 refCon );
216 |
217 | public:
218 | static void fbLock( void );
219 | static void fbUnlock( void );
220 |
221 | static void clamshellEnable( SInt32 delta );
222 | static IOOptionBits clamshellState( void );
223 | static IOReturn setPreferences( IOService * props, OSDictionary * prefs );
224 | static OSObject * copyPreferences( void );
225 | OSObject * copyPreference( class IODisplay * display, const OSSymbol * key );
226 | bool getIntegerPreference( IODisplay * display, const OSSymbol * key, UInt32 * value );
227 | bool setPreference( class IODisplay * display, const OSSymbol * key, OSObject * value );
228 | bool setIntegerPreference( IODisplay * display, const OSSymbol * key, UInt32 value );
229 | void getTransformPrefs( IODisplay * display );
230 | IOReturn flushParameters(void);
231 |
232 | protected:
233 |
234 | IOReturn stopDDC1SendCommand(IOIndex bus, IOI2CBusTiming * timing);
235 | void waitForDDCDataLine(IOIndex bus, IOI2CBusTiming * timing, UInt32 waitTime);
236 |
237 | IOReturn readDDCBlock(IOIndex bus, IOI2CBusTiming * timing, UInt8 deviceAddress, UInt8 startAddress, UInt8 * data);
238 | IOReturn i2cReadDDCciData(IOIndex bus, IOI2CBusTiming * timing, UInt8 deviceAddress, UInt8 count, UInt8 *buffer);
239 | IOReturn i2cReadData(IOIndex bus, IOI2CBusTiming * timing, UInt8 deviceAddress, UInt8 count, UInt8 * buffer);
240 | IOReturn i2cWriteData(IOIndex bus, IOI2CBusTiming * timing, UInt8 deviceAddress, UInt8 count, UInt8 * buffer);
241 |
242 | void i2cStart(IOIndex bus, IOI2CBusTiming * timing);
243 | void i2cStop(IOIndex bus, IOI2CBusTiming * timing);
244 | void i2cSendAck(IOIndex bus, IOI2CBusTiming * timing);
245 | void i2cSendNack(IOIndex bus, IOI2CBusTiming * timing);
246 | IOReturn i2cWaitForAck(IOIndex bus, IOI2CBusTiming * timing);
247 | void i2cSendByte(IOIndex bus, IOI2CBusTiming * timing, UInt8 data);
248 | IOReturn i2cReadByte(IOIndex bus, IOI2CBusTiming * timing, UInt8 *data);
249 | IOReturn i2cWaitForBus(IOIndex bus, IOI2CBusTiming * timing);
250 | IOReturn i2cRead(IOIndex bus, IOI2CBusTiming * timing, UInt8 deviceAddress, UInt8 numberOfBytes, UInt8 * data);
251 | IOReturn i2cWrite(IOIndex bus, IOI2CBusTiming * timing, UInt8 deviceAddress, UInt8 numberOfBytes, UInt8 * data);
252 | void i2cSend9Stops(IOIndex bus, IOI2CBusTiming * timing);
253 |
--------------------------------------------------------------------------------
/dist/EWProxyFrameBuffer.kext/Contents/Resources/IOKit/graphics/IOFramebufferPrivate.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
3 | *
4 | * @APPLE_LICENSE_HEADER_START@
5 | *
6 | * The contents of this file constitute Original Code as defined in and
7 | * are subject to the Apple Public Source License Version 1.1 (the
8 | * "License"). You may not use this file except in compliance with the
9 | * License. Please obtain a copy of the License at
10 | * http://www.apple.com/publicsource and read it before using this file.
11 | *
12 | * This Original Code and all software distributed under the License are
13 | * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 | * License for the specific language governing rights and limitations
18 | * under the License.
19 | *
20 | * @APPLE_LICENSE_HEADER_END@
21 | */
22 | void setupCursor( IOPixelInformation * info );
23 | void stopCursor( void );
24 | IOReturn doSetup( bool full );
25 | void findConsole(void);
26 | IOReturn createSharedCursor( int shmemVersion,
27 | int maxWidth, int maxHeight );
28 | IOReturn setBoundingRect( IOGBounds * bounds );
29 | IOReturn setUserRanges( void );
30 | IOReturn getConnectFlagsForDisplayMode(
31 | IODisplayModeID mode, IOIndex connection, UInt32 * flags );
32 |
33 | IOReturn beginSystemSleep( void * ackRef );
34 |
35 | static inline void StdFBDisplayCursor( IOFramebuffer * inst );
36 | static inline void StdFBRemoveCursor( IOFramebuffer * inst );
37 | static inline void RemoveCursor( IOFramebuffer * inst );
38 | static inline void DisplayCursor( IOFramebuffer * inst );
39 | static inline void SysHideCursor( IOFramebuffer * inst );
40 | static inline void SysShowCursor( IOFramebuffer * inst );
41 | static inline void CheckShield( IOFramebuffer * inst );
42 | inline IOOptionBits _setCursorImage( UInt32 frame );
43 | inline IOReturn _setCursorState( SInt32 x, SInt32 y, bool visible );
44 | static void cursorWork( OSObject * p0, IOInterruptEventSource * evtSrc, int intCount );
45 |
46 | static void StdFBDisplayCursor8P(
47 | IOFramebuffer * inst,
48 | StdFBShmem_t *shmem,
49 | volatile unsigned char *vramPtr,
50 | unsigned int cursStart,
51 | unsigned int vramRow,
52 | unsigned int cursRow,
53 | int width,
54 | int height );
55 |
56 | static void StdFBDisplayCursor8G(
57 | IOFramebuffer * inst,
58 | StdFBShmem_t *shmem,
59 | volatile unsigned char *vramPtr,
60 | unsigned int cursStart,
61 | unsigned int vramRow,
62 | unsigned int cursRow,
63 | int width,
64 | int height );
65 |
66 | static void StdFBDisplayCursor555(
67 | IOFramebuffer * inst,
68 | StdFBShmem_t *shmem,
69 | volatile unsigned short *vramPtr,
70 | unsigned int cursStart,
71 | unsigned int vramRow,
72 | unsigned int cursRow,
73 | int width,
74 | int height );
75 |
76 | static void StdFBDisplayCursor30Axxx(
77 | IOFramebuffer * inst,
78 | StdFBShmem_t *shmem,
79 | volatile unsigned int *vramPtr,
80 | unsigned int cursStart,
81 | unsigned int vramRow,
82 | unsigned int cursRow,
83 | int width,
84 | int height );
85 |
86 | static void StdFBDisplayCursor32Axxx(
87 | IOFramebuffer * inst,
88 | StdFBShmem_t *shmem,
89 | volatile unsigned int *vramPtr,
90 | unsigned int cursStart,
91 | unsigned int vramRow,
92 | unsigned int cursRow,
93 | int width,
94 | int height );
95 |
96 | static void StdFBRemoveCursor8(
97 | IOFramebuffer * inst,
98 | StdFBShmem_t *shmem,
99 | volatile unsigned char *vramPtr,
100 | unsigned int vramRow,
101 | int width,
102 | int height );
103 | static void StdFBRemoveCursor16(
104 | IOFramebuffer * inst,
105 | StdFBShmem_t *shmem,
106 | volatile unsigned short *vramPtr,
107 | unsigned int vramRow,
108 | int width,
109 | int height );
110 |
111 | static void StdFBRemoveCursor32(
112 | IOFramebuffer * inst,
113 | StdFBShmem_t *shmem,
114 | volatile unsigned int *vramPtr,
115 | unsigned int vramRow,
116 | int width,
117 | int height );
118 |
119 | static void deferredMoveCursor(IOFramebuffer * inst);
120 | static void deferredInterrupt( OSObject * owner,
121 | IOInterruptEventSource * evtSrc, int intCount );
122 | static void deferredCLUTSetInterrupt( OSObject * owner,
123 | IOInterruptEventSource * evtSrc, int intCount );
124 | static void deferredSpeedChangeEvent( OSObject * owner,
125 | IOInterruptEventSource * evtSrc, int intCount );
126 |
127 | static IOReturn pmSettingsChange(OSObject *target, const OSSymbol *type,
128 | OSObject *val, uintptr_t refcon);
129 |
130 | static void globalEvent( OSObject * target,
131 | IOInterruptEventSource * evtSrc, int intCount );
132 |
133 | void checkDeferredCLUTSet( void );
134 | void updateCursorForCLUTSet( void );
135 | IOReturn updateGammaTable( UInt32 channelCount, UInt32 dataCount,
136 | UInt32 dataWidth, const void * data );
137 |
138 | static void dpInterruptProc(OSObject * target, void * ref);
139 | static void dpInterrupt(OSObject * owner, IOTimerEventSource * sender);
140 | void dpProcessInterrupt(void);
141 | void dpUpdateConnect(void);
142 |
143 | static void handleVBL(IOFramebuffer * inst, void * ref);
144 | static void writePrefs( OSObject * owner, IOTimerEventSource * sender );
145 | static void connectChangeInterrupt( IOFramebuffer * inst, void * ref );
146 | static void connectChangeDelayedInterrupt( OSObject * owner, IOTimerEventSource * sender );
147 | void checkConnectionChange( bool message = true );
148 | void setNextDependent( IOFramebuffer * dependent );
149 | IOFramebuffer * getNextDependent( void );
150 | void setCaptured( bool isCaptured );
151 | void setDimDisable( bool dimDisable );
152 | bool getDimDisable( void );
153 | IOReturn notifyServer( UInt8 state );
154 | void notifyServerAll( UInt8 state );
155 | IOReturn extEntry(void);
156 | void wakeServerState(UInt8 state);
157 | bool getIsUsable( void );
158 | IOReturn postOpen( void );
159 | static void startThread(bool highPri);
160 | static void sleepWork( void * arg );
161 | static void clamshellWork( thread_call_param_t p0, thread_call_param_t p1 );
162 | IOOptionBits checkPowerWork( void );
163 | IOReturn postWake( IOOptionBits state );
164 | IOReturn deliverDisplayModeDidChangeNotification( void );
165 | static IOReturn systemPowerChange( void * target, void * refCon,
166 | UInt32 messageType, IOService * service,
167 | void * messageArgument, vm_size_t argSize );
168 | static bool clamshellHandler( void * target, void * ref,
169 | IOService * resourceService, IONotifier * notifier );
170 | static void clamshellProbeAction( OSObject * owner, IOTimerEventSource * sender );
171 |
172 | static IOReturn probeAll( IOOptionBits options );
173 |
174 | IOReturn selectTransform( UInt64 newTransform, bool generateChange );
175 | void setTransform( UInt64 newTransform, bool generateChange );
176 | UInt64 getTransform( void );
177 | IOReturn checkMirrorSafe( UInt32 value, IOFramebuffer * other );
178 | void transformLocation(StdFBShmem_t * shmem, IOGPoint * cursorLoc, IOGPoint * transformLoc);
179 | void transformCursor(StdFBShmem_t * shmem, IOIndex frame);
180 |
181 | bool deepFramebuffer( IOPixelInformation * pixelInfo );
182 | bool validFramebuffer( IOPixelInformation * pixelInfo );
183 |
184 | // --
185 |
186 | static IOReturn extCreateSharedCursor(OSObject * target, void * reference, IOExternalMethodArguments * args);
187 | static IOReturn extGetPixelInformation(OSObject * target, void * reference, IOExternalMethodArguments * args);
188 | static IOReturn extGetCurrentDisplayMode(OSObject * target, void * reference, IOExternalMethodArguments * args);
189 | static IOReturn extSetStartupDisplayMode(OSObject * target, void * reference, IOExternalMethodArguments * args);
190 | static IOReturn extSetGammaTable(OSObject * target, void * reference, IOExternalMethodArguments * args);
191 | static IOReturn extGetDisplayModeCount(OSObject * target, void * reference, IOExternalMethodArguments * args);
192 | static IOReturn extGetDisplayModes(OSObject * target, void * reference, IOExternalMethodArguments * args);
193 | static IOReturn extSetDisplayMode(OSObject * target, void * reference, IOExternalMethodArguments * args);
194 | static IOReturn extGetInformationForDisplayMode(OSObject * target, void * reference, IOExternalMethodArguments * args);
195 |
196 | static IOReturn extGetVRAMMapOffset(OSObject * target, void * reference, IOExternalMethodArguments * args);
197 | static IOReturn extSetBounds(OSObject * target, void * reference, IOExternalMethodArguments * args);
198 |
199 | static IOReturn extSetNewCursor(OSObject * target, void * reference, IOExternalMethodArguments * args);
200 | static IOReturn extSetCursorVisible(OSObject * target, void * reference, IOExternalMethodArguments * args);
201 | static IOReturn extSetCursorPosition(OSObject * target, void * reference, IOExternalMethodArguments * args);
202 | static IOReturn extSetColorConvertTable(OSObject * target, void * reference, IOExternalMethodArguments * args);
203 | static IOReturn extSetCLUTWithEntries(OSObject * target, void * reference, IOExternalMethodArguments * args);
204 | static IOReturn extSetAttribute(OSObject * target, void * reference, IOExternalMethodArguments * args);
205 | static IOReturn extGetAttribute(OSObject * target, void * reference, IOExternalMethodArguments * args);
206 | static IOReturn extValidateDetailedTiming(OSObject * target, void * reference, IOExternalMethodArguments * args);
207 | static IOReturn extAcknowledgeNotification(OSObject * target, void * reference, IOExternalMethodArguments * args);
208 |
209 | // --
210 |
211 | IOReturn extSetProperties( OSDictionary * dict );
212 | IOReturn extRegisterNotificationPort(
213 | mach_port_t port,
214 | UInt32 type,
215 | UInt32 refCon );
216 |
217 | public:
218 | static void fbLock( void );
219 | static void fbUnlock( void );
220 |
221 | static void clamshellEnable( SInt32 delta );
222 | static IOOptionBits clamshellState( void );
223 | static IOReturn setPreferences( IOService * props, OSDictionary * prefs );
224 | static OSObject * copyPreferences( void );
225 | OSObject * copyPreference( class IODisplay * display, const OSSymbol * key );
226 | bool getIntegerPreference( IODisplay * display, const OSSymbol * key, UInt32 * value );
227 | bool setPreference( class IODisplay * display, const OSSymbol * key, OSObject * value );
228 | bool setIntegerPreference( IODisplay * display, const OSSymbol * key, UInt32 value );
229 | void getTransformPrefs( IODisplay * display );
230 | IOReturn flushParameters(void);
231 |
232 | protected:
233 |
234 | IOReturn stopDDC1SendCommand(IOIndex bus, IOI2CBusTiming * timing);
235 | void waitForDDCDataLine(IOIndex bus, IOI2CBusTiming * timing, UInt32 waitTime);
236 |
237 | IOReturn readDDCBlock(IOIndex bus, IOI2CBusTiming * timing, UInt8 deviceAddress, UInt8 startAddress, UInt8 * data);
238 | IOReturn i2cReadDDCciData(IOIndex bus, IOI2CBusTiming * timing, UInt8 deviceAddress, UInt8 count, UInt8 *buffer);
239 | IOReturn i2cReadData(IOIndex bus, IOI2CBusTiming * timing, UInt8 deviceAddress, UInt8 count, UInt8 * buffer);
240 | IOReturn i2cWriteData(IOIndex bus, IOI2CBusTiming * timing, UInt8 deviceAddress, UInt8 count, UInt8 * buffer);
241 |
242 | void i2cStart(IOIndex bus, IOI2CBusTiming * timing);
243 | void i2cStop(IOIndex bus, IOI2CBusTiming * timing);
244 | void i2cSendAck(IOIndex bus, IOI2CBusTiming * timing);
245 | void i2cSendNack(IOIndex bus, IOI2CBusTiming * timing);
246 | IOReturn i2cWaitForAck(IOIndex bus, IOI2CBusTiming * timing);
247 | void i2cSendByte(IOIndex bus, IOI2CBusTiming * timing, UInt8 data);
248 | IOReturn i2cReadByte(IOIndex bus, IOI2CBusTiming * timing, UInt8 *data);
249 | IOReturn i2cWaitForBus(IOIndex bus, IOI2CBusTiming * timing);
250 | IOReturn i2cRead(IOIndex bus, IOI2CBusTiming * timing, UInt8 deviceAddress, UInt8 numberOfBytes, UInt8 * data);
251 | IOReturn i2cWrite(IOIndex bus, IOI2CBusTiming * timing, UInt8 deviceAddress, UInt8 numberOfBytes, UInt8 * data);
252 | void i2cSend9Stops(IOIndex bus, IOI2CBusTiming * timing);
253 |
--------------------------------------------------------------------------------
/APPLE_LICENSE:
--------------------------------------------------------------------------------
1 | APPLE PUBLIC SOURCE LICENSE
2 | Version 2.0 - August 6, 2003
3 |
4 | Please read this License carefully before downloading this software. By
5 | downloading or using this software, you are agreeing to be bound by the terms
6 | of this License. If you do not or cannot agree to the terms of this License,
7 | please do not download or use the software.
8 |
9 | Apple Note: In January 2007, Apple changed its corporate name from "Apple
10 | Computer, Inc." to "Apple Inc." This change has been reflected below and
11 | copyright years updated, but no other changes have been made to the APSL 2.0.
12 |
13 | 1. General; Definitions. This License applies to any program or other
14 | work which Apple Inc. ("Apple") makes publicly available and which contains a
15 | notice placed by Apple identifying such program or work as "Original Code" and
16 | stating that it is subject to the terms of this Apple Public Source License
17 | version 2.0 ("License"). As used in this License:
18 |
19 | 1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the
20 | grantor of rights, (i) claims of patents that are now or hereafter acquired,
21 | owned by or assigned to Apple and (ii) that cover subject matter contained in
22 | the Original Code, but only to the extent necessary to use, reproduce and/or
23 | distribute the Original Code without infringement; and (b) in the case where
24 | You are the grantor of rights, (i) claims of patents that are now or hereafter
25 | acquired, owned by or assigned to You and (ii) that cover subject matter in
26 | Your Modifications, taken alone or in combination with Original Code.
27 |
28 | 1.2 "Contributor" means any person or entity that creates or contributes to
29 | the creation of Modifications.
30 |
31 | 1.3 "Covered Code" means the Original Code, Modifications, the combination
32 | of Original Code and any Modifications, and/or any respective portions thereof.
33 |
34 | 1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise
35 | make Covered Code available, directly or indirectly, to anyone other than You;
36 | and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way
37 | to provide a service, including but not limited to delivery of content, through
38 | electronic communication with a client other than You.
39 |
40 | 1.5 "Larger Work" means a work which combines Covered Code or portions
41 | thereof with code not governed by the terms of this License.
42 |
43 | 1.6 "Modifications" mean any addition to, deletion from, and/or change to,
44 | the substance and/or structure of the Original Code, any previous
45 | Modifications, the combination of Original Code and any previous Modifications,
46 | and/or any respective portions thereof. When code is released as a series of
47 | files, a Modification is: (a) any addition to or deletion from the contents of
48 | a file containing Covered Code; and/or (b) any new file or other representation
49 | of computer program statements that contains any part of Covered Code.
50 |
51 | 1.7 "Original Code" means (a) the Source Code of a program or other work as
52 | originally made available by Apple under this License, including the Source
53 | Code of any updates or upgrades to such programs or works made available by
54 | Apple under this License, and that has been expressly identified by Apple as
55 | such in the header file(s) of such work; and (b) the object code compiled from
56 | such Source Code and originally made available by Apple under this License
57 |
58 | 1.8 "Source Code" means the human readable form of a program or other work
59 | that is suitable for making modifications to it, including all modules it
60 | contains, plus any associated interface definition files, scripts used to
61 | control compilation and installation of an executable (object code).
62 |
63 | 1.9 "You" or "Your" means an individual or a legal entity exercising rights
64 | under this License. For legal entities, "You" or "Your" includes any entity
65 | which controls, is controlled by, or is under common control with, You, where
66 | "control" means (a) the power, direct or indirect, to cause the direction or
67 | management of such entity, whether by contract or otherwise, or (b) ownership
68 | of fifty percent (50%) or more of the outstanding shares or beneficial
69 | ownership of such entity.
70 |
71 | 2. Permitted Uses; Conditions & Restrictions. Subject to the terms and
72 | conditions of this License, Apple hereby grants You, effective on the date You
73 | accept this License and download the Original Code, a world-wide, royalty-free,
74 | non-exclusive license, to the extent of Apple's Applicable Patent Rights and
75 | copyrights covering the Original Code, to do the following:
76 |
77 | 2.1 Unmodified Code. You may use, reproduce, display, perform, internally
78 | distribute within Your organization, and Externally Deploy verbatim, unmodified
79 | copies of the Original Code, for commercial or non-commercial purposes,
80 | provided that in each instance:
81 |
82 | (a) You must retain and reproduce in all copies of Original Code the
83 | copyright and other proprietary notices and disclaimers of Apple as they appear
84 | in the Original Code, and keep intact all notices in the Original Code that
85 | refer to this License; and
86 |
87 | (b) You must include a copy of this License with every copy of Source Code
88 | of Covered Code and documentation You distribute or Externally Deploy, and You
89 | may not offer or impose any terms on such Source Code that alter or restrict
90 | this License or the recipients' rights hereunder, except as permitted under
91 | Section 6.
92 |
93 | 2.2 Modified Code. You may modify Covered Code and use, reproduce,
94 | display, perform, internally distribute within Your organization, and
95 | Externally Deploy Your Modifications and Covered Code, for commercial or
96 | non-commercial purposes, provided that in each instance You also meet all of
97 | these conditions:
98 |
99 | (a) You must satisfy all the conditions of Section 2.1 with respect to the
100 | Source Code of the Covered Code;
101 |
102 | (b) You must duplicate, to the extent it does not already exist, the notice
103 | in Exhibit A in each file of the Source Code of all Your Modifications, and
104 | cause the modified files to carry prominent notices stating that You changed
105 | the files and the date of any change; and
106 |
107 | (c) If You Externally Deploy Your Modifications, You must make Source Code
108 | of all Your Externally Deployed Modifications either available to those to whom
109 | You have Externally Deployed Your Modifications, or publicly available. Source
110 | Code of Your Externally Deployed Modifications must be released under the terms
111 | set forth in this License, including the license grants set forth in Section 3
112 | below, for as long as you Externally Deploy the Covered Code or twelve (12)
113 | months from the date of initial External Deployment, whichever is longer. You
114 | should preferably distribute the Source Code of Your Externally Deployed
115 | Modifications electronically (e.g. download from a web site).
116 |
117 | 2.3 Distribution of Executable Versions. In addition, if You Externally
118 | Deploy Covered Code (Original Code and/or Modifications) in object code,
119 | executable form only, You must include a prominent notice, in the code itself
120 | as well as in related documentation, stating that Source Code of the Covered
121 | Code is available under the terms of this License with information on how and
122 | where to obtain such Source Code.
123 |
124 | 2.4 Third Party Rights. You expressly acknowledge and agree that although
125 | Apple and each Contributor grants the licenses to their respective portions of
126 | the Covered Code set forth herein, no assurances are provided by Apple or any
127 | Contributor that the Covered Code does not infringe the patent or other
128 | intellectual property rights of any other entity. Apple and each Contributor
129 | disclaim any liability to You for claims brought by any other entity based on
130 | infringement of intellectual property rights or otherwise. As a condition to
131 | exercising the rights and licenses granted hereunder, You hereby assume sole
132 | responsibility to secure any other intellectual property rights needed, if any.
133 | For example, if a third party patent license is required to allow You to
134 | distribute the Covered Code, it is Your responsibility to acquire that license
135 | before distributing the Covered Code.
136 |
137 | 3. Your Grants. In consideration of, and as a condition to, the licenses
138 | granted to You under this License, You hereby grant to any person or entity
139 | receiving or distributing Covered Code under this License a non-exclusive,
140 | royalty-free, perpetual, irrevocable license, under Your Applicable Patent
141 | Rights and other intellectual property rights (other than patent) owned or
142 | controlled by You, to use, reproduce, display, perform, modify, sublicense,
143 | distribute and Externally Deploy Your Modifications of the same scope and
144 | extent as Apple's licenses under Sections 2.1 and 2.2 above.
145 |
146 | 4. Larger Works. You may create a Larger Work by combining Covered Code
147 | with other code not governed by the terms of this License and distribute the
148 | Larger Work as a single product. In each such instance, You must make sure the
149 | requirements of this License are fulfilled for the Covered Code or any portion
150 | thereof.
151 |
152 | 5. Limitations on Patent License. Except as expressly stated in Section
153 | 2, no other patent rights, express or implied, are granted by Apple herein.
154 | Modifications and/or Larger Works may require additional patent licenses from
155 | Apple which Apple may grant in its sole discretion.
156 |
157 | 6. Additional Terms. You may choose to offer, and to charge a fee for,
158 | warranty, support, indemnity or liability obligations and/or other rights
159 | consistent with the scope of the license granted herein ("Additional Terms") to
160 | one or more recipients of Covered Code. However, You may do so only on Your own
161 | behalf and as Your sole responsibility, and not on behalf of Apple or any
162 | Contributor. You must obtain the recipient's agreement that any such Additional
163 | Terms are offered by You alone, and You hereby agree to indemnify, defend and
164 | hold Apple and every Contributor harmless for any liability incurred by or
165 | claims asserted against Apple or such Contributor by reason of any such
166 | Additional Terms.
167 |
168 | 7. Versions of the License. Apple may publish revised and/or new versions
169 | of this License from time to time. Each version will be given a distinguishing
170 | version number. Once Original Code has been published under a particular
171 | version of this License, You may continue to use it under the terms of that
172 | version. You may also choose to use such Original Code under the terms of any
173 | subsequent version of this License published by Apple. No one other than Apple
174 | has the right to modify the terms applicable to Covered Code created under this
175 | License.
176 |
177 | 8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in
178 | part pre-release, untested, or not fully tested works. The Covered Code may
179 | contain errors that could cause failures or loss of data, and may be incomplete
180 | or contain inaccuracies. You expressly acknowledge and agree that use of the
181 | Covered Code, or any portion thereof, is at Your sole and entire risk. THE
182 | COVERED CODE IS PROVIDED "AS IS" AND WITHOUT WARRANTY, UPGRADES OR SUPPORT OF
183 | ANY KIND AND APPLE AND APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE"
184 | FOR THE PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM
185 | ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT NOT
186 | LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF MERCHANTABILITY, OF
187 | SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR PURPOSE, OF ACCURACY, OF
188 | QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. APPLE AND EACH
189 | CONTRIBUTOR DOES NOT WARRANT AGAINST INTERFERENCE WITH YOUR ENJOYMENT OF THE
190 | COVERED CODE, THAT THE FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR
191 | REQUIREMENTS, THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR
192 | ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO ORAL OR
193 | WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE AUTHORIZED
194 | REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY. You acknowledge
195 | that the Covered Code is not intended for use in the operation of nuclear
196 | facilities, aircraft navigation, communication systems, or air traffic control
197 | machines in which case the failure of the Covered Code could lead to death,
198 | personal injury, or severe physical or environmental damage.
199 |
200 | 9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO
201 | EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL, SPECIAL,
202 | INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO THIS LICENSE OR
203 | YOUR USE OR INABILITY TO USE THE COVERED CODE, OR ANY PORTION THEREOF, WHETHER
204 | UNDER A THEORY OF CONTRACT, WARRANTY, TORT (INCLUDING NEGLIGENCE), PRODUCTS
205 | LIABILITY OR OTHERWISE, EVEN IF APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF
206 | THE POSSIBILITY OF SUCH DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL
207 | PURPOSE OF ANY REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF
208 | LIABILITY OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT
209 | APPLY TO YOU. In no event shall Apple's total liability to You for all damages
210 | (other than as may be required by applicable law) under this License exceed the
211 | amount of fifty dollars ($50.00).
212 |
213 | 10. Trademarks. This License does not grant any rights to use the
214 | trademarks or trade names "Apple", "Mac", "Mac OS", "QuickTime", "QuickTime
215 | Streaming Server" or any other trademarks, service marks, logos or trade names
216 | belonging to Apple (collectively "Apple Marks") or to any trademark, service
217 | mark, logo or trade name belonging to any Contributor. You agree not to use
218 | any Apple Marks in or as part of the name of products derived from the Original
219 | Code or to endorse or promote products derived from the Original Code other
220 | than as expressly permitted by and in strict compliance at all times with
221 | Apple's third party trademark usage guidelines which are posted at
222 | http://www.apple.com/legal/guidelinesfor3rdparties.html.
223 |
224 | 11. Ownership. Subject to the licenses granted under this License, each
225 | Contributor retains all rights, title and interest in and to any Modifications
226 | made by such Contributor. Apple retains all rights, title and interest in and
227 | to the Original Code and any Modifications made by or on behalf of Apple
228 | ("Apple Modifications"), and such Apple Modifications will not be automatically
229 | subject to this License. Apple may, at its sole discretion, choose to license
230 | such Apple Modifications under this License, or on different terms from those
231 | contained in this License or may choose not to license them at all.
232 |
233 | 12. Termination.
234 |
235 | 12.1 Termination. This License and the rights granted hereunder will
236 | terminate:
237 |
238 | (a) automatically without notice from Apple if You fail to comply with any
239 | term(s) of this License and fail to cure such breach within 30 days of becoming
240 | aware of such breach;
241 | (b) immediately in the event of the circumstances described in Section
242 | 13.5(b); or
243 | (c) automatically without notice from Apple if You, at any time during the
244 | term of this License, commence an action for patent infringement against Apple;
245 | provided that Apple did not first commence an action for patent infringement
246 | against You in that instance.
247 |
248 | 12.2 Effect of Termination. Upon termination, You agree to immediately stop
249 | any further use, reproduction, modification, sublicensing and distribution of
250 | the Covered Code. All sublicenses to the Covered Code which have been properly
251 | granted prior to termination shall survive any termination of this License.
252 | Provisions which, by their nature, should remain in effect beyond the
253 | termination of this License shall survive, including but not limited to
254 | Sections 3, 5, 8, 9, 10, 11, 12.2 and 13. No party will be liable to any other
255 | for compensation, indemnity or damages of any sort solely as a result of
256 | terminating this License in accordance with its terms, and termination of this
257 | License will be without prejudice to any other right or remedy of any party.
258 |
259 | 13. Miscellaneous.
260 |
261 | 13.1 Government End Users. The Covered Code is a "commercial item" as
262 | defined in FAR 2.101. Government software and technical data rights in the
263 | Covered Code include only those rights customarily provided to the public as
264 | defined in this License. This customary commercial license in technical data
265 | and software is provided in accordance with FAR 12.211 (Technical Data) and
266 | 12.212 (Computer Software) and, for Department of Defense purchases, DFAR
267 | 252.227-7015 (Technical Data -- Commercial Items) and 227.7202-3 (Rights in
268 | Commercial Computer Software or Computer Software Documentation). Accordingly,
269 | all U.S. Government End Users acquire Covered Code with only those rights set
270 | forth herein.
271 |
272 | 13.2 Relationship of Parties. This License will not be construed as
273 | creating an agency, partnership, joint venture or any other form of legal
274 | association between or among You, Apple or any Contributor, and You will not
275 | represent to the contrary, whether expressly, by implication, appearance or
276 | otherwise.
277 |
278 | 13.3 Independent Development. Nothing in this License will impair Apple's
279 | right to acquire, license, develop, have others develop for it, market and/or
280 | distribute technology or products that perform the same or similar functions
281 | as, or otherwise compete with, Modifications, Larger Works, technology or
282 | products that You may develop, produce, market or distribute.
283 |
284 | 13.4 Waiver; Construction. Failure by Apple or any Contributor to enforce
285 | any provision of this License will not be deemed a waiver of future enforcement
286 | of that or any other provision. Any law or regulation which provides that the
287 | language of a contract shall be construed against the drafter will not apply to
288 | this License.
289 |
290 | 13.5 Severability. (a) If for any reason a court of competent jurisdiction
291 | finds any provision of this License, or portion thereof, to be unenforceable,
292 | that provision of the License will be enforced to the maximum extent
293 | permissible so as to effect the economic benefits and intent of the parties,
294 | and the remainder of this License will continue in full force and effect. (b)
295 | Notwithstanding the foregoing, if applicable law prohibits or restricts You
296 | from fully and/or specifically complying with Sections 2 and/or 3 or prevents
297 | the enforceability of either of those Sections, this License will immediately
298 | terminate and You must immediately discontinue any use of the Covered Code and
299 | destroy all copies of it that are in your possession or control.
300 |
301 | 13.6 Dispute Resolution. Any litigation or other dispute resolution between
302 | You and Apple relating to this License shall take place in the Northern
303 | District of California, and You and Apple hereby consent to the personal
304 | jurisdiction of, and venue in, the state and federal courts within that
305 | District with respect to this License. The application of the United Nations
306 | Convention on Contracts for the International Sale of Goods is expressly
307 | excluded.
308 |
309 | 13.7 Entire Agreement; Governing Law. This License constitutes the entire
310 | agreement between the parties with respect to the subject matter hereof. This
311 | License shall be governed by the laws of the United States and the State of
312 | California, except that body of California law concerning conflicts of law.
313 |
314 | Where You are located in the province of Quebec, Canada, the following clause
315 | applies: The parties hereby confirm that they have requested that this License
316 | and all related documents be drafted in English. Les parties ont exigé que le
317 | présent contrat et tous les documents connexes soient rédigés en anglais.
318 |
319 | EXHIBIT A.
320 |
321 | "Portions Copyright (c) 1999-2007 Apple Inc. All Rights Reserved.
322 |
323 | This file contains Original Code and/or Modifications of Original Code as
324 | defined in and that are subject to the Apple Public Source License Version 2.0
325 | (the 'License'). You may not use this file except in compliance with the
326 | License. Please obtain a copy of the License at
327 | http://www.opensource.apple.com/apsl/ and read it before using this file.
328 |
329 | The Original Code and all software distributed under the License are
330 | distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
331 | OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
332 | LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
333 | PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
334 | specific language governing rights and limitations under the License."
335 |
336 |
--------------------------------------------------------------------------------
/EWProxyFrameBufferFBuffer.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * PSPScreenFBuf.cpp
3 | * PSPScreenDriver
4 | *
5 | * Created by Enno Welbers on 28.02.09.
6 | * Copyright 2009 __MyCompanyName__. All rights reserved.
7 | *
8 | */
9 |
10 | #include
11 | #include
12 | #include
13 | #include "EWProxyFrameBufferClient.h"
14 | #include "EWProxyFrameBuffer.h"
15 | #include "EWProxyFrameBufferDriver.h"
16 |
17 | //I didn't have time (yet) to implement an interrupt management
18 | //therefore i rely upon the already available implementation from apple.
19 | //but... you can't fire these interrupts without this macro and the presence
20 | //of a private header (part of the project).
21 | #define IOFRAMEBUFFER_PRIVATE
22 | #include "EWProxyFrameBufferFBuffer.h"
23 | #undef IOFRAMEBUFFER_PRIVATE
24 |
25 | extern "C" {
26 | #include //this is for debugging only
27 | }
28 |
29 | #define kIOPMIsPowerManagedKey "IOPMIsPowerManaged"
30 |
31 | #define super IOFramebuffer
32 |
33 | OSDefineMetaClassAndStructors(info_ennowelbers_proxyframebuffer_fbuffer, IOFramebuffer)
34 |
35 | #pragma mark Functions used by user space
36 | //all these functions are called indirectly due to a running user space application
37 |
38 | IOReturn info_ennowelbers_proxyframebuffer_fbuffer::Connect(int mode)
39 | {
40 | if(connected)
41 | return kIOReturnStillOpen;
42 | else
43 | {
44 | EWProxyFramebufferModeInfo info;
45 | //first we need to get the mode in order to tell OS about it.
46 | int ret=fProvider->getmodeInfo(mode, &info);
47 | if(ret!=kIOReturnSuccess)
48 | return kIOReturnBadArgument;
49 | this->mode=mode;
50 | IOLog("EWProxyFrameBuffer: mode is now %d\n",mode);
51 | //helper variables for disconnect and in order to prepare mode switch without
52 | //disconnecting (i think).
53 | connected=true;
54 | warmup=true;
55 | //this call is the reason for the private header
56 | connectChangeInterrupt(this,0);
57 | return kIOReturnSuccess;
58 | }
59 | }
60 |
61 | IOReturn info_ennowelbers_proxyframebuffer_fbuffer::Disconnect()
62 | {
63 | if(connected)
64 | {
65 | connected=false;
66 | //tell OS that we have no screen.
67 | connectChangeInterrupt(this,0);
68 | return kIOReturnSuccess;
69 | }
70 | else
71 | {
72 | return kIOReturnNotOpen;
73 | }
74 | }
75 |
76 | IOReturn info_ennowelbers_proxyframebuffer_fbuffer::State()
77 | {
78 | if(!connected)
79 | return 0;
80 | else
81 | return mode;
82 | }
83 |
84 | //this function is left behind.
85 | //i wanted the framebuffer to be able to switch resolution from our client
86 | //(not from OS side), but it was not possible. OS ignores resolutions switches
87 | //other than those originating from OS. It is Borg.
88 | void info_ennowelbers_proxyframebuffer_fbuffer::SwitchResolution()
89 | {
90 | if(warmup)
91 | {
92 | handleEvent(kIOFBNotifyDisplayModeWillChange, NULL);
93 | handleEvent(kIOFBNotifyDisplayModeDidChange, NULL);
94 | warmup=false;
95 | }
96 | }
97 |
98 | #pragma mark Framebuffer functions
99 | //This Function is used by OS to fetch driver capabilities.
100 | //The only thing we support is a hardware cursor
101 | IOReturn info_ennowelbers_proxyframebuffer_fbuffer::getAttribute( IOSelect attribute, uintptr_t * value )
102 | {
103 | union myvar
104 | {
105 | IOSelect attribute;
106 | char param[5];
107 | };
108 | myvar var;
109 | var.attribute=attribute;
110 | var.param[4]='\0';
111 | IOLog("EWProxyFrameBuffer: getAttribute(%s).\n",var.param);
112 | IOReturn ret= super::getAttribute(attribute, value);
113 | if(attribute==kIOHardwareCursorAttribute)
114 | {
115 | *value=1;
116 | ret= kIOReturnSuccess;
117 | }
118 | if(value!=NULL)
119 | IOLog("EWProxyFrameBuffer: Value= %x, Ret=%x\n",(unsigned int)*value,ret);
120 | else
121 | IOLog("EWProxyFrameBuffer: Ret=%x\n",ret);
122 | return ret;
123 |
124 | }
125 |
126 | //This Function is used by OS to command the driver.
127 | //the important ones:
128 | //CAPTURE: during bootup at a certain point AQUIRE is set.
129 | // that means that now the OS really starts using the framebuffer
130 | // before the aquire command OS is fetching information.
131 | // and before aquire the framebuffer has to tell that the screen is connected
132 | // otherwise it is ignored (there was no screen during information gathering, so there will never be one...)
133 | //Power: power our virtual hardware on or off
134 | IOReturn info_ennowelbers_proxyframebuffer_fbuffer::setAttribute( IOSelect attribute, uintptr_t value )
135 | {
136 | IOReturn ret=super::setAttribute(attribute, value);
137 | union myvar
138 | {
139 | IOSelect attribute;
140 | char param[5];
141 | };
142 | myvar var;
143 | var.attribute=attribute;
144 | var.param[4]='\0';
145 | if(attribute==kIOCapturedAttribute)
146 | {
147 | if(started==false)
148 | {
149 | started=true;
150 | connectChangeInterrupt(this,0);
151 | }
152 | }
153 | if(attribute==kIOPowerAttribute)
154 | {
155 | handleEvent((value>=1 ? kIOFBNotifyWillPowerOn : kIOFBNotifyWillPowerOff), (void*)TRUE);
156 | handleEvent((value>=1 ? kIOFBNotifyDidPowerOn : kIOFBNotifyDidPowerOff), (void*)TRUE);
157 | ret=kIOReturnSuccess;
158 | }
159 | IOLog("EWProxyFrameBuffer: setAttribute(%s,%x)=%x\n",var.param,(unsigned int)value,ret);
160 | return ret;
161 | }
162 |
163 | //Every framebuffer has (in theory) at least (but not limited to) one connection.
164 | //that is... the thing where you plug in your screen.
165 | //however, documentation tells that "good habit" is to have one framebuffer per screen.
166 | //The *AttributeForConnection functions are used to gather information about / drive a connected screen
167 | //We're not powering any hardware, but we still need to tell "done" upon power changes
168 | //Concerning Probe:
169 | //As far as i recall, whenever a framebuffer tells OS about a screen change, it calls Probe on
170 | //all connections on all framebuffers. When the connection really changed, the framebuffer should tell
171 | //by re-interrupting again. Actually this implementation is not correct, however
172 | //OS understands it. It simply means that whenever a real screen is (dis)connected, our virtual one is
173 | //reconnected. OS can handle it...
174 | //TODO
175 | IOReturn info_ennowelbers_proxyframebuffer_fbuffer::setAttributeForConnection(IOIndex connection, IOSelect attribute, uintptr_t value)
176 | {
177 | if(attribute==kConnectionProbe)
178 | {
179 | IOLog("EWProxyFrameBuffer: Sense!\n");
180 | connectChangeInterrupt(this,0);
181 | // if(interrupts[1]!=NULL)
182 | // {
183 | // interrupts[1](interruptTargets[1],interruptRefs[1]);
184 | // }
185 | return kIOReturnSuccess;
186 | }
187 | if(attribute==kConnectionPower)
188 | {
189 | return kIOReturnSuccess;
190 | }
191 | IOReturn ret=super::setAttributeForConnection(connection,attribute, value);
192 | union myvar
193 | {
194 | IOSelect attribute;
195 | char param[5];
196 | };
197 | myvar var;
198 | var.attribute=attribute;
199 | var.param[4]='\0';
200 | IOLog("EWProxyFrameBuffer: setAttributeForConnection(%d,%s,%x)=%x\n",(int)connection,var.param,(unsigned int)value,(unsigned int)ret);
201 | return ret;
202 |
203 | }
204 |
205 | //There is only one interesting Attribute OS reads for each connection
206 | //The "is there a screen connected?" attribute.
207 | //If we're not aquired, we have to return 1.
208 | //If we're aquired, we have to tell the truth.
209 | //
210 | IOReturn info_ennowelbers_proxyframebuffer_fbuffer::getAttributeForConnection(IOIndex connectIndex, IOSelect attribute, uintptr_t *value)
211 | {
212 | union myvar
213 | {
214 | IOSelect attribute;
215 | char param[5];
216 | };
217 | myvar var;
218 | var.attribute=attribute;
219 | var.param[4]='\0';
220 | IOLog("EWProxyFrameBuffer: getAttributeForConnection(%d,%s).\n",(int)connectIndex,var.param);
221 | if(attribute==kConnectionEnable || attribute==kConnectionCheckEnable)
222 | {
223 | if(value!=NULL)
224 | {
225 | if(connected==false)
226 | *value=0;
227 | else
228 | *value=1;
229 | //if(started==false)
230 | // *value=1;
231 | }
232 | return kIOReturnSuccess;
233 | }
234 | // if(attribute==kConnectionFlags)
235 | // {
236 | // if(value!=NULL)
237 | // *value=0;
238 | // return kIOReturnSuccess;
239 | // }
240 | // if(attribute==kConnectionChanged)
241 | // {
242 | // if(value!=NULL)
243 | // *value=0;
244 | // return kIOReturnSuccess;
245 | // }
246 | IOReturn ret= super::getAttributeForConnection(connectIndex, attribute, value);
247 | if(value!=NULL)
248 | IOLog("EWProxyFrameBuffer: Value= %x, Ret=%x\n",(unsigned int)*value,ret);
249 | else
250 | IOLog("EWProxyFrameBuffer: Ret=%x\n",ret);
251 | return ret;
252 | }
253 |
254 | bool info_ennowelbers_proxyframebuffer_fbuffer::init(OSDictionary *dict)
255 | {
256 | bool res = super::init(dict);
257 | IOLog("EWProxyFrameBuffer: FBINIT\n");
258 | return res;
259 | }
260 |
261 | //OS is greedy. Once a framebuffer is in the Registry, it will not go away.
262 | //so this function only exists to stop the compiler from warning.
263 | void info_ennowelbers_proxyframebuffer_fbuffer::free(void)
264 | {
265 | IOLog("EWProxyFrameBuffer: Free\n");
266 | super::free();
267 | }
268 |
269 | bool info_ennowelbers_proxyframebuffer_fbuffer::start(IOService *provider)
270 | {
271 | bool res=super::start(provider);
272 | //PMinit();
273 | connected=0;
274 | graphicMem=NULL;
275 | started=false;
276 | fProvider=OSDynamicCast(info_ennowelbers_proxyframebuffer_driver,provider);
277 | if(res && fProvider!=NULL)
278 | {
279 | //fProvider->joinPMtree(this);
280 | }
281 | IOLog("EWProxyFrameBuffer: Starting\n");
282 | if(fProvider==NULL)
283 | return false;
284 | return res;
285 | }
286 |
287 | void info_ennowelbers_proxyframebuffer_fbuffer::stop(IOService *provider)
288 | {
289 | super::stop(provider);
290 | if(graphicMem!=NULL)
291 | {
292 | cursorMapping->release();
293 | cursorMem->release();
294 | cursorMem=NULL;
295 | graphicMem->release();
296 | graphicMem=NULL;
297 | }
298 | IOLog("EWProxyFrameBuffer: Stopping\n");
299 | }
300 |
301 | //provides OS with the memory range dependend on our current resolution
302 | IODeviceMemory * info_ennowelbers_proxyframebuffer_fbuffer::getApertureRange(IOPixelAperture aperture)
303 | {
304 | IOLog("EWProxyFrameBuffer: getApertureRange\n");
305 | EWProxyFramebufferModeInfo info;
306 | fProvider->getmodeInfo(mode, &info);
307 | IODeviceMemory *dev=IODeviceMemory::withSubRange((IODeviceMemory*)graphicMem,0,(info.height*(info.width*4+32)+128));
308 | // IODeviceMemory *dev=IODeviceMemory::withRange(graphicPhysVRAM, (fProvider->height*(fProvider->width*4+32)+128));
309 | return dev;
310 | }
311 |
312 | //OS is greedy when it comes to graphic memory. It wants the whole thing.
313 | //and... it releases it, so we're overretaining here
314 | IODeviceMemory * info_ennowelbers_proxyframebuffer_fbuffer::getVRAMRange()
315 | {
316 | IOLog("EWProxyFrameBuffer: getVRAMRange\n");
317 | graphicMem->retain();
318 | return (IODeviceMemory*)graphicMem;
319 | }
320 |
321 |
322 | //this one gets called when OS is ready for our hardware.
323 | //we should to all the hardware initialization stuff in here
324 | //as we're forced to have the graphic mem around all the time
325 | //we're initializing by allocating worst-case-buffers
326 | //and keep them.
327 | //Framebuffer magic: Framebuffers only work when present during boot
328 | // Framebuffers only work when having a screen before aquire()
329 | // Framebuffers only work when having graphic mem
330 | //Remember: this memory is aquired during boot and will be completely gone
331 | // Therefore it's preferred to set a constrained max resolution
332 | // and forbidden to go to higher resolutions than that.
333 | IOReturn info_ennowelbers_proxyframebuffer_fbuffer::enableController()
334 | {
335 | IOLog("EWProxyFrameBuffer: enableController\n");
336 | //I have no idea why we need 32 extra bytes per row and 128 bytes extra, but...
337 | //it only works with these extra buffers
338 | //Size adaption: to increase memory, I provide 1k per line and 1 meg at the end
339 | //this is for ansgar!
340 | //graphicSize=fProvider->getMaxHeight()*(fProvider->getMaxWidth()*4+32)+128;//width*height*4 buffer size, enough space for 4 buffers
341 | graphicSize=fProvider->getMaxHeight()*(fProvider->getMaxWidth()*4+1024)+10490880;//width*height*4 buffer size, enough space for 4 buffers
342 | while( graphicSize % PAGE_SIZE != 0)
343 | {
344 | graphicSize++;
345 | }
346 | mode=1;
347 | // graphicSize=graphicSize*4;
348 | // graphicMem=IODeviceMemory::withRange(graphicPhysVRAM, graphicSize);
349 | // apertureMem=IODeviceMemory::withRange(graphicPhysVRAM,graphicSize/4);
350 | // graphicMem=IOBufferMemoryDescriptor::withOptions(kIODirectionInOut|kIOMemoryKernelUserShared,graphicSize,PAGE_SIZE);
351 | graphicMem=IOBufferMemoryDescriptor::withCapacity(graphicSize, kIODirectionInOut);
352 | //i'm not sure whether we could reduce this size, at least that's a very huge cursor.
353 | cursorMem=IOBufferMemoryDescriptor::withCapacity((320*4+32)*320+128, kIODirectionInOut);//cursor buffer, 320x320 px cursor size maximum;
354 | cursorMapping=cursorMem->map(kIOMapAnywhere);
355 | cursorBuf=(UInt8*)cursorMapping->getVirtualAddress();
356 | IOLog("EWProxyFrameBuffer: controller memory: size=%d bytes\n",graphicSize);
357 | if(graphicMem==NULL)
358 | {
359 | IOLog("EWProxyFrameBuffer: unable to reserve memory!\n");
360 | }
361 | // IOLog("IODeviceMemory: %x\n",(int)apertureMem);
362 | //power management is explained (a bit) in EWProxyFrameBufferDriver
363 | static IOPMPowerState myPowerStates[3];
364 | // getProvider()->joinPMtree(this);
365 | myPowerStates[0].version=1;
366 | myPowerStates[0].capabilityFlags=0;
367 | myPowerStates[0].outputPowerCharacter=0;
368 | myPowerStates[0].inputPowerRequirement=0;
369 | myPowerStates[1].version=1;
370 | myPowerStates[1].capabilityFlags=0;
371 | myPowerStates[1].outputPowerCharacter=0;
372 | myPowerStates[1].inputPowerRequirement=IOPMPowerOn;
373 | myPowerStates[2].version=1;
374 | myPowerStates[2].capabilityFlags=IOPMDeviceUsable;
375 | myPowerStates[2].outputPowerCharacter=IOPMPowerOn;
376 | myPowerStates[2].inputPowerRequirement=IOPMPowerOn;
377 | registerPowerDriver(this, myPowerStates, 3);
378 | temporaryPowerClampOn();
379 | changePowerStateTo(2);
380 | getProvider()->setProperty(kIOPMIsPowerManagedKey, true);
381 | return kIOReturnSuccess;
382 | }
383 |
384 | //as told above, framebuffers could have more than one screen (in theory).
385 | //but... OS doesn't support it. i think. They tell us to return 1.
386 | IOItemCount info_ennowelbers_proxyframebuffer_fbuffer::getConnectionCount()
387 | {
388 | /*if(connected==0)result=0;
389 | else
390 | result=1;*/
391 | IOLog("EWProxyFrameBuffer: GetConnectionCount()=1\n");
392 | return 1;
393 | }
394 |
395 | //This Function is used by OS to get current Display Mode
396 | IOReturn info_ennowelbers_proxyframebuffer_fbuffer::getCurrentDisplayMode(IODisplayModeID * displayMode, IOIndex * depth)
397 | {
398 | IOLog("EWProxyFrameBuffer: getCurrentDisplayMode\n");
399 | if(displayMode==NULL)
400 | return kIOReturnBadArgument;
401 | if(depth==NULL)
402 | return kIOReturnBadArgument;
403 | *displayMode=mode;
404 | *depth=0;
405 | return kIOReturnSuccess;
406 | }
407 |
408 | //OS wants to fill lists and needs the total amount of possible modes
409 | IOItemCount info_ennowelbers_proxyframebuffer_fbuffer::getDisplayModeCount()
410 | {
411 | IOLog("EWProxyFrameBuffer: getDisplayModeCount\n");
412 | return fProvider->getModeCount();
413 | }
414 |
415 | //OS first calls getDisplayModeCount, allocates a buffer and then calls getModes.
416 | //so the pointer is garantueed to be big enough for the number of modes given before.
417 | //the funny thing: a display mode is ... an integer.
418 | //all the other information are transported using getInformationForDisplayMode
419 | IOReturn info_ennowelbers_proxyframebuffer_fbuffer::getDisplayModes(IODisplayModeID * allDisplayModes)
420 | {
421 | IOLog("EWProxyFrameBuffer: getDisplayModes\n");
422 | for(int i=1;i<=fProvider->getModeCount();i++)
423 | {
424 | allDisplayModes[i-1]=i;
425 | }
426 | return kIOReturnSuccess;
427 | }
428 |
429 | //returns details about a given display mode (width, height, refresh rate, flags, amount of possible depths)
430 | //i have no knowledge about those flags. that way they work.
431 | //an extension would be (to prevent OS from switching) to make them visible based on the current mode setting
432 | IOReturn info_ennowelbers_proxyframebuffer_fbuffer::getInformationForDisplayMode(IODisplayModeID displayMode, IODisplayModeInformation *info)
433 | {
434 | IOLog("EWProxyFrameBuffer: getInformationForDisplayMode\n");
435 | EWProxyFramebufferModeInfo pinfo;
436 | IOReturn ret=fProvider->getmodeInfo(displayMode, &pinfo);
437 | if(ret!=kIOReturnSuccess)
438 | return ret;
439 | bzero(info,sizeof(*info));
440 | info->nominalWidth=pinfo.width;
441 | info->nominalHeight=pinfo.height;
442 | info->maxDepthIndex=0;
443 | info->refreshRate=60<<16;
444 | info->flags=kDisplayModeAlwaysShowFlag|kDisplayModeValidFlag|kDisplayModeDefaultFlag;
445 | return kIOReturnSuccess;
446 | }
447 |
448 | //In theory the graphic mem could be in different formats.
449 | //I have no idea about their physical layout in memory.
450 | //The details about this pixel format are ... in our domain.
451 | //After asking us for a name OS asks for details with getPixelInformation.
452 | const char * info_ennowelbers_proxyframebuffer_fbuffer::getPixelFormats()
453 | {
454 | IOLog("EWProxyFrameBuffer: getPixelFormats\n");
455 | static const char * fmts=IO32BitDirectPixels "\0\0";
456 | return fmts;
457 | }
458 |
459 | //this function is deprecated from what i recall
460 | UInt64 info_ennowelbers_proxyframebuffer_fbuffer::getPixelFormatsForDisplayMode(IODisplayModeID displayMode, IOIndex depth)
461 | {
462 | IOLog("EWProxyFrameBuffer: getPixelFormatsForDisplayMode\n");
463 | return 0;
464 | }
465 |
466 | //This function tells OS where in these 32 bits are red, green and blue, how many bits each component we use and how
467 | //many components we really use.
468 | //we could save some space by using a smaller pixel layout, but we need to convert it into a CGImage in user space,
469 | //this is the simplest copy routine.
470 | IOReturn info_ennowelbers_proxyframebuffer_fbuffer::getPixelInformation(IODisplayModeID displayMode, IOIndex depth, IOPixelAperture aperture, IOPixelInformation * pixelInfo)
471 | {
472 | IOLog("EWProxyFrameBuffer: getPixelInformation(mode=%x, depth=%x, aperture=%x)\n",(int)displayMode,(int)depth,(int)aperture);
473 | if(depth!=0)
474 | {
475 | IOLog("EWProxyFrameBuffer: Unsupported!\n");
476 | return kIOReturnUnsupportedMode;
477 | }
478 | else
479 | {
480 | EWProxyFramebufferModeInfo pinfo;
481 | IOReturn ret=fProvider->getmodeInfo(displayMode, &pinfo);
482 | if(ret!=kIOReturnSuccess)
483 | return ret;
484 | bzero(pixelInfo,sizeof(*pixelInfo));
485 | IOLog("EWProxyFrameBuffer: returning for %d x %d\n",pinfo.width,pinfo.height);
486 | pixelInfo->bytesPerRow=pinfo.width*4+32;//32 byte row header??
487 | pixelInfo->bitsPerPixel=32;
488 | pixelInfo->pixelType=kIORGBDirectPixels;
489 | pixelInfo->componentCount=3;
490 | pixelInfo->bitsPerComponent=8;
491 | strlcpy(pixelInfo->pixelFormat, IO32BitDirectPixels, sizeof(pixelInfo->pixelFormat));
492 | pixelInfo->activeWidth=pinfo.width;
493 | pixelInfo->activeHeight=pinfo.height;
494 | pixelInfo->componentMasks[0]=0x00FF0000;
495 | pixelInfo->componentMasks[1]=0x0000FF00;
496 | pixelInfo->componentMasks[2]=0x000000FF;
497 | IOLog("EWProxyFrameBuffer: Pixel Data: bytesPerRow=%d bytesPerPlane=%d bitsPerPixel=%d pixelType=%d components=%d bitsPerComponent=%d pixelformat=%s width=%d height=%d masks(%x,%x,%x)\n",
498 | (int)pixelInfo->bytesPerRow,(int)pixelInfo->bytesPerPlane,(int)pixelInfo->bitsPerPixel,(int)pixelInfo->pixelType,(int)pixelInfo->componentCount, (int)pixelInfo->bitsPerComponent,pixelInfo->pixelFormat,
499 | (int)pixelInfo->activeWidth,(int)pixelInfo->activeHeight,(unsigned int)pixelInfo->componentMasks[0],(unsigned int)pixelInfo->componentMasks[1],(unsigned int)pixelInfo->componentMasks[2]);
500 | }
501 | return kIOReturnSuccess;
502 | }
503 |
504 | //OS uses this function to switch mode
505 | //currently we always return unsupported but we still tell OS that resolution changed
506 | //would be better to only show the mode currently configured.
507 | IOReturn info_ennowelbers_proxyframebuffer_fbuffer::setDisplayMode(IODisplayModeID displayMode, IOIndex depth)
508 | {
509 | IOLog("EWProxyFrameBuffer: setDisplayMode(%x,%d)\n",(unsigned int)displayMode,(int)depth);
510 | if(displayMode<1 || displayMode>fProvider->getModeCount() || depth!=0)
511 | {
512 | IOLog("EWProxyFrameBuffer: unsupported mode!\n");
513 | return kIOReturnUnsupportedMode;
514 | }
515 | if(mode!=displayMode)
516 | {
517 | return kIOReturnUnsupportedMode;
518 | }
519 | mode=displayMode;
520 | handleEvent(kIOFBNotifyDisplayModeWillChange, NULL);
521 | handleEvent(kIOFBNotifyDisplayModeDidChange, NULL);
522 | return kIOReturnSuccess;
523 | }
524 |
525 | //OS uses this function to provide us with a new cursor image
526 | IOReturn info_ennowelbers_proxyframebuffer_fbuffer::setCursorImage(void *img)
527 | {
528 | IOHardwareCursorDescriptor cdesc;
529 | IOHardwareCursorInfo cinfo;
530 |
531 | cdesc.majorVersion=kHardwareCursorDescriptorMajorVersion;
532 | cdesc.minorVersion=kHardwareCursorDescriptorMinorVersion;
533 | cdesc.height=320;
534 | cdesc.width=320;
535 | cdesc.bitDepth=kIO32ARGBPixelFormat;
536 | cdesc.maskBitDepth=0;
537 | cdesc.numColors=0;
538 | cdesc.colorEncodings=NULL;
539 | cdesc.flags=0;
540 | cdesc.supportedSpecialEncodings=0;
541 | memset(cdesc.specialEncodings, 0, sizeof(cdesc.specialEncodings));
542 |
543 | cinfo.majorVersion=kHardwareCursorInfoMajorVersion;
544 | cinfo.minorVersion=kHardwareCursorInfoMinorVersion;
545 | cinfo.colorMap=NULL;
546 | memset(cinfo.reserved, 0, sizeof(cinfo.reserved));
547 | cinfo.hardwareCursorData=cursorBuf;
548 | //the cool thing: as we only get a pointer we have no idea about it's format.
549 | //therefore we define the format we want (see structures above)
550 | //and tell OS (parent class, essentially) to convert it.
551 | //img is our own buffer. We don't even need to copy it into our buffer afterwards.
552 | bool ret=convertCursorImage(img, &cdesc, &cinfo);
553 | IOLog("EWProxyFrameBuffer: convertCursorImage()=%s\n",(ret?"true":"false"));
554 | if(ret)
555 | {
556 | IOLog("EWProxyFrameBuffer: cursor size: %d x %d\n",(int)cinfo.cursorWidth,(int)cinfo.cursorHeight);
557 | cursorWidth=cinfo.cursorWidth;
558 | cursorHeight=cinfo.cursorHeight;
559 | //our user space app can register a few events
560 | //one of those is "cursor changed"
561 | //here we're firing this event.
562 | if(fProvider->eventClient!=NULL)
563 | {
564 | fProvider->eventClient->FireCursorImageChanged();
565 | }
566 | return kIOReturnSuccess;
567 | }
568 | //for step one we always return unsupported. we just want to get the cursor image
569 | return kIOReturnUnsupported;
570 | }
571 |
572 | //using this function OS tells us where the cursor is and whether it's visible or not.
573 | //don't get me wrong, a framebuffer can work without a hardware cursor.
574 | //OS then draws the cursor directly into graphic mem. Not very effective, though.
575 | IOReturn info_ennowelbers_proxyframebuffer_fbuffer::setCursorState(SInt32 x, SInt32 y, bool visible)
576 | {
577 | cursorX=x;
578 | cursorY=y;
579 | cursorVisible=visible;
580 | if(fProvider->eventClient!=NULL)
581 | {
582 | fProvider->eventClient->FireCursorStateChanged();
583 | }
584 | return kIOReturnSuccess;
585 | }
586 |
--------------------------------------------------------------------------------
/EWProxyFrameBuffer.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXAggregateTarget section */
10 | 96614E9C10E93A820066624E /* All */ = {
11 | isa = PBXAggregateTarget;
12 | buildConfigurationList = 96614EB110E93AC50066624E /* Build configuration list for PBXAggregateTarget "All" */;
13 | buildPhases = (
14 | );
15 | dependencies = (
16 | 96614EA010E93A880066624E /* PBXTargetDependency */,
17 | 96614EA210E93A880066624E /* PBXTargetDependency */,
18 | 96614EA410E93A880066624E /* PBXTargetDependency */,
19 | );
20 | name = All;
21 | productName = All;
22 | };
23 | /* End PBXAggregateTarget section */
24 |
25 | /* Begin PBXBuildFile section */
26 | 32D94FC60562CBF700B6AF17 /* EWProxyFrameBufferDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A224C3EFF42367911CA2CB7 /* EWProxyFrameBufferDriver.h */; };
27 | 32D94FC80562CBF700B6AF17 /* EWProxyFramebuffer-InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C167DFE841241C02AAC07 /* EWProxyFramebuffer-InfoPlist.strings */; };
28 | 32D94FCA0562CBF700B6AF17 /* EWProxyFrameBufferDriver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A224C3FFF42367911CA2CB7 /* EWProxyFrameBufferDriver.cpp */; settings = {ATTRIBUTES = (); }; };
29 | 4420CE60234F413300AB9159 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4420CE5E234F413300AB9159 /* Images.xcassets */; };
30 | 4420CE63234F428800AB9159 /* MenuBarApp.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4420CE61234F428800AB9159 /* MenuBarApp.xib */; };
31 | 4420CE65234F42C500AB9159 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4420CE64234F42C500AB9159 /* AppDelegate.m */; };
32 | 96614CC510E91A270066624E /* EWProxyFrameBufferClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 96614CC110E91A270066624E /* EWProxyFrameBufferClient.h */; };
33 | 96614CC610E91A270066624E /* EWProxyFrameBufferClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 96614CC210E91A270066624E /* EWProxyFrameBufferClient.cpp */; };
34 | 96614CC710E91A270066624E /* EWProxyFrameBufferFBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 96614CC310E91A270066624E /* EWProxyFrameBufferFBuffer.h */; };
35 | 96614CC810E91A270066624E /* EWProxyFrameBufferFBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 96614CC410E91A270066624E /* EWProxyFrameBufferFBuffer.cpp */; };
36 | 96614D1B10E91E6D0066624E /* IOKit in Resources */ = {isa = PBXBuildFile; fileRef = 96614D1610E91E6D0066624E /* IOKit */; };
37 | 96614DAD10E92DC40066624E /* EWProxyFrameBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 96614CBE10E919F30066624E /* EWProxyFrameBuffer.h */; settings = {ATTRIBUTES = (Public, ); }; };
38 | 96614DAE10E92DCA0066624E /* EWProxyFrameBuffer.m in Sources */ = {isa = PBXBuildFile; fileRef = 96614D9F10E92D7D0066624E /* EWProxyFrameBuffer.m */; };
39 | 96614DB610E92E050066624E /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96614DB510E92E050066624E /* IOKit.framework */; };
40 | 96614E0B10E9307A0066624E /* EWProxyFrameBufferConnection.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96614DA810E92DB70066624E /* EWProxyFrameBufferConnection.framework */; };
41 | 96614E0F10E9309A0066624E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 96614DFD10E930410066624E /* main.m */; };
42 | 96614E1310E930D00066624E /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96614E1210E930D00066624E /* AppKit.framework */; };
43 | 96614E1510E930D00066624E /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96614E1410E930D00066624E /* Cocoa.framework */; };
44 | 96614E2110E931040066624E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96614E2010E931040066624E /* Foundation.framework */; };
45 | 96614E2B10E931260066624E /* EWProxyFrameBufferConnection.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 96614DA810E92DB70066624E /* EWProxyFrameBufferConnection.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
46 | 96614E7510E933640066624E /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96614DB510E92E050066624E /* IOKit.framework */; };
47 | /* End PBXBuildFile section */
48 |
49 | /* Begin PBXContainerItemProxy section */
50 | 96614E1C10E930D60066624E /* PBXContainerItemProxy */ = {
51 | isa = PBXContainerItemProxy;
52 | containerPortal = 089C1669FE841209C02AAC07 /* Project object */;
53 | proxyType = 1;
54 | remoteGlobalIDString = 96614DA710E92DB70066624E;
55 | remoteInfo = EWProxyFrameBufferConnection;
56 | };
57 | 96614E9F10E93A880066624E /* PBXContainerItemProxy */ = {
58 | isa = PBXContainerItemProxy;
59 | containerPortal = 089C1669FE841209C02AAC07 /* Project object */;
60 | proxyType = 1;
61 | remoteGlobalIDString = 32D94FC30562CBF700B6AF17;
62 | remoteInfo = EWProxyFrameBuffer;
63 | };
64 | 96614EA110E93A880066624E /* PBXContainerItemProxy */ = {
65 | isa = PBXContainerItemProxy;
66 | containerPortal = 089C1669FE841209C02AAC07 /* Project object */;
67 | proxyType = 1;
68 | remoteGlobalIDString = 96614DA710E92DB70066624E;
69 | remoteInfo = EWProxyFrameBufferConnection;
70 | };
71 | 96614EA310E93A880066624E /* PBXContainerItemProxy */ = {
72 | isa = PBXContainerItemProxy;
73 | containerPortal = 089C1669FE841209C02AAC07 /* Project object */;
74 | proxyType = 1;
75 | remoteGlobalIDString = 96614E0410E930720066624E;
76 | remoteInfo = EWProxyframeBufferApp;
77 | };
78 | /* End PBXContainerItemProxy section */
79 |
80 | /* Begin PBXCopyFilesBuildPhase section */
81 | 96614E3210E931340066624E /* Copy Frameworks */ = {
82 | isa = PBXCopyFilesBuildPhase;
83 | buildActionMask = 2147483647;
84 | dstPath = "";
85 | dstSubfolderSpec = 10;
86 | files = (
87 | 96614E2B10E931260066624E /* EWProxyFrameBufferConnection.framework in Copy Frameworks */,
88 | );
89 | name = "Copy Frameworks";
90 | runOnlyForDeploymentPostprocessing = 0;
91 | };
92 | /* End PBXCopyFilesBuildPhase section */
93 |
94 | /* Begin PBXFileReference section */
95 | 089C167EFE841241C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = "English.lproj/EWProxyFramebuffer-InfoPlist.strings"; sourceTree = ""; };
96 | 1A224C3EFF42367911CA2CB7 /* EWProxyFrameBufferDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EWProxyFrameBufferDriver.h; sourceTree = ""; };
97 | 1A224C3FFF42367911CA2CB7 /* EWProxyFrameBufferDriver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EWProxyFrameBufferDriver.cpp; sourceTree = ""; };
98 | 32D94FCF0562CBF700B6AF17 /* EWProxyFramebuffer-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "EWProxyFramebuffer-Info.plist"; sourceTree = ""; };
99 | 32D94FD00562CBF700B6AF17 /* EWProxyFrameBuffer.kext */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = EWProxyFrameBuffer.kext; sourceTree = BUILT_PRODUCTS_DIR; };
100 | 4420CE5F234F413300AB9159 /* English */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = English; path = English.lproj/Images.xcassets; sourceTree = ""; };
101 | 4420CE62234F428800AB9159 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MenuBarApp.xib; sourceTree = ""; };
102 | 4420CE64234F42C500AB9159 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
103 | 4420CE66234F42D800AB9159 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
104 | 8DA8362C06AD9B9200E5AC22 /* Kernel.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Kernel.framework; path = /System/Library/Frameworks/Kernel.framework; sourceTree = ""; };
105 | 96614CBE10E919F30066624E /* EWProxyFrameBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EWProxyFrameBuffer.h; sourceTree = ""; };
106 | 96614CC110E91A270066624E /* EWProxyFrameBufferClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EWProxyFrameBufferClient.h; sourceTree = ""; };
107 | 96614CC210E91A270066624E /* EWProxyFrameBufferClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EWProxyFrameBufferClient.cpp; sourceTree = ""; };
108 | 96614CC310E91A270066624E /* EWProxyFrameBufferFBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EWProxyFrameBufferFBuffer.h; sourceTree = ""; };
109 | 96614CC410E91A270066624E /* EWProxyFrameBufferFBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EWProxyFrameBufferFBuffer.cpp; sourceTree = ""; };
110 | 96614D1610E91E6D0066624E /* IOKit */ = {isa = PBXFileReference; lastKnownFileType = folder; path = IOKit; sourceTree = ""; };
111 | 96614D9F10E92D7D0066624E /* EWProxyFrameBuffer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EWProxyFrameBuffer.m; sourceTree = ""; };
112 | 96614DA810E92DB70066624E /* EWProxyFrameBufferConnection.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = EWProxyFrameBufferConnection.framework; sourceTree = BUILT_PRODUCTS_DIR; };
113 | 96614DA910E92DB70066624E /* EWProxyFrameBufferConnection-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "EWProxyFrameBufferConnection-Info.plist"; sourceTree = ""; };
114 | 96614DB510E92E050066624E /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
115 | 96614DFD10E930410066624E /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
116 | 96614DFE10E9304C0066624E /* EWProxyframeBufferApp-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "EWProxyframeBufferApp-Info.plist"; sourceTree = ""; };
117 | 96614E0510E930720066624E /* EWProxyframeBufferApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = EWProxyframeBufferApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
118 | 96614E1210E930D00066624E /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
119 | 96614E1410E930D00066624E /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
120 | 96614E2010E931040066624E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
121 | 966A60D410F880060054EA7B /* APPLE_LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = APPLE_LICENSE; sourceTree = ""; };
122 | 966A60D510F880060054EA7B /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = ""; };
123 | 966A60D610F880060054EA7B /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = ""; };
124 | /* End PBXFileReference section */
125 |
126 | /* Begin PBXFrameworksBuildPhase section */
127 | 32D94FCB0562CBF700B6AF17 /* Frameworks */ = {
128 | isa = PBXFrameworksBuildPhase;
129 | buildActionMask = 2147483647;
130 | files = (
131 | );
132 | runOnlyForDeploymentPostprocessing = 0;
133 | };
134 | 96614DA610E92DB70066624E /* Frameworks */ = {
135 | isa = PBXFrameworksBuildPhase;
136 | buildActionMask = 2147483647;
137 | files = (
138 | 96614DB610E92E050066624E /* IOKit.framework in Frameworks */,
139 | );
140 | runOnlyForDeploymentPostprocessing = 0;
141 | };
142 | 96614E0310E930720066624E /* Frameworks */ = {
143 | isa = PBXFrameworksBuildPhase;
144 | buildActionMask = 2147483647;
145 | files = (
146 | 96614E0B10E9307A0066624E /* EWProxyFrameBufferConnection.framework in Frameworks */,
147 | 96614E1310E930D00066624E /* AppKit.framework in Frameworks */,
148 | 96614E1510E930D00066624E /* Cocoa.framework in Frameworks */,
149 | 96614E2110E931040066624E /* Foundation.framework in Frameworks */,
150 | 96614E7510E933640066624E /* IOKit.framework in Frameworks */,
151 | );
152 | runOnlyForDeploymentPostprocessing = 0;
153 | };
154 | /* End PBXFrameworksBuildPhase section */
155 |
156 | /* Begin PBXGroup section */
157 | 089C166AFE841209C02AAC07 /* EWProxyFrameBuffer */ = {
158 | isa = PBXGroup;
159 | children = (
160 | 96614DF610E92FEC0066624E /* ProxyFrameBufferApp */,
161 | 96614D1610E91E6D0066624E /* IOKit */,
162 | 96614CBD10E919D90066624E /* Framework */,
163 | 96614C9810E9040C0066624E /* Kext */,
164 | 19C28FB6FE9D52B211CA2CBB /* Products */,
165 | 966A60D410F880060054EA7B /* APPLE_LICENSE */,
166 | 966A60D510F880060054EA7B /* LICENSE */,
167 | 966A60D610F880060054EA7B /* README */,
168 | );
169 | name = EWProxyFrameBuffer;
170 | sourceTree = "";
171 | };
172 | 089C167CFE841241C02AAC07 /* Resources */ = {
173 | isa = PBXGroup;
174 | children = (
175 | 32D94FCF0562CBF700B6AF17 /* EWProxyFramebuffer-Info.plist */,
176 | 089C167DFE841241C02AAC07 /* EWProxyFramebuffer-InfoPlist.strings */,
177 | );
178 | name = Resources;
179 | sourceTree = "";
180 | };
181 | 19C28FB6FE9D52B211CA2CBB /* Products */ = {
182 | isa = PBXGroup;
183 | children = (
184 | 32D94FD00562CBF700B6AF17 /* EWProxyFrameBuffer.kext */,
185 | 96614DA810E92DB70066624E /* EWProxyFrameBufferConnection.framework */,
186 | 96614E0510E930720066624E /* EWProxyframeBufferApp.app */,
187 | );
188 | name = Products;
189 | sourceTree = "";
190 | };
191 | 247142CAFF3F8F9811CA285C /* Source */ = {
192 | isa = PBXGroup;
193 | children = (
194 | 96614CC110E91A270066624E /* EWProxyFrameBufferClient.h */,
195 | 96614CC210E91A270066624E /* EWProxyFrameBufferClient.cpp */,
196 | 96614CC310E91A270066624E /* EWProxyFrameBufferFBuffer.h */,
197 | 96614CC410E91A270066624E /* EWProxyFrameBufferFBuffer.cpp */,
198 | 1A224C3EFF42367911CA2CB7 /* EWProxyFrameBufferDriver.h */,
199 | 1A224C3FFF42367911CA2CB7 /* EWProxyFrameBufferDriver.cpp */,
200 | );
201 | name = Source;
202 | sourceTree = "";
203 | };
204 | 96614C9810E9040C0066624E /* Kext */ = {
205 | isa = PBXGroup;
206 | children = (
207 | 8DA8362C06AD9B9200E5AC22 /* Kernel.framework */,
208 | 247142CAFF3F8F9811CA285C /* Source */,
209 | 089C167CFE841241C02AAC07 /* Resources */,
210 | );
211 | name = Kext;
212 | sourceTree = "";
213 | };
214 | 96614CBD10E919D90066624E /* Framework */ = {
215 | isa = PBXGroup;
216 | children = (
217 | 96614DB510E92E050066624E /* IOKit.framework */,
218 | 96614D9F10E92D7D0066624E /* EWProxyFrameBuffer.m */,
219 | 96614DA910E92DB70066624E /* EWProxyFrameBufferConnection-Info.plist */,
220 | 96614CBE10E919F30066624E /* EWProxyFrameBuffer.h */,
221 | );
222 | name = Framework;
223 | sourceTree = "";
224 | };
225 | 96614DF610E92FEC0066624E /* ProxyFrameBufferApp */ = {
226 | isa = PBXGroup;
227 | children = (
228 | 96614E2010E931040066624E /* Foundation.framework */,
229 | 96614E1210E930D00066624E /* AppKit.framework */,
230 | 96614E1410E930D00066624E /* Cocoa.framework */,
231 | 96614DF810E9300F0066624E /* Classes */,
232 | 96614DF910E930170066624E /* Other Sources */,
233 | 96614DFA10E9301D0066624E /* Resources */,
234 | );
235 | name = ProxyFrameBufferApp;
236 | sourceTree = "";
237 | };
238 | 96614DF810E9300F0066624E /* Classes */ = {
239 | isa = PBXGroup;
240 | children = (
241 | 4420CE64234F42C500AB9159 /* AppDelegate.m */,
242 | 4420CE66234F42D800AB9159 /* AppDelegate.h */,
243 | );
244 | name = Classes;
245 | sourceTree = "";
246 | };
247 | 96614DF910E930170066624E /* Other Sources */ = {
248 | isa = PBXGroup;
249 | children = (
250 | 96614DFD10E930410066624E /* main.m */,
251 | );
252 | name = "Other Sources";
253 | sourceTree = "";
254 | };
255 | 96614DFA10E9301D0066624E /* Resources */ = {
256 | isa = PBXGroup;
257 | children = (
258 | 4420CE61234F428800AB9159 /* MenuBarApp.xib */,
259 | 4420CE5E234F413300AB9159 /* Images.xcassets */,
260 | 96614DFE10E9304C0066624E /* EWProxyframeBufferApp-Info.plist */,
261 | );
262 | name = Resources;
263 | sourceTree = "";
264 | };
265 | /* End PBXGroup section */
266 |
267 | /* Begin PBXHeadersBuildPhase section */
268 | 32D94FC50562CBF700B6AF17 /* Headers */ = {
269 | isa = PBXHeadersBuildPhase;
270 | buildActionMask = 2147483647;
271 | files = (
272 | 32D94FC60562CBF700B6AF17 /* EWProxyFrameBufferDriver.h in Headers */,
273 | 96614CC510E91A270066624E /* EWProxyFrameBufferClient.h in Headers */,
274 | 96614CC710E91A270066624E /* EWProxyFrameBufferFBuffer.h in Headers */,
275 | );
276 | runOnlyForDeploymentPostprocessing = 0;
277 | };
278 | 96614DA310E92DB70066624E /* Headers */ = {
279 | isa = PBXHeadersBuildPhase;
280 | buildActionMask = 2147483647;
281 | files = (
282 | 96614DAD10E92DC40066624E /* EWProxyFrameBuffer.h in Headers */,
283 | );
284 | runOnlyForDeploymentPostprocessing = 0;
285 | };
286 | /* End PBXHeadersBuildPhase section */
287 |
288 | /* Begin PBXNativeTarget section */
289 | 32D94FC30562CBF700B6AF17 /* EWProxyFrameBuffer */ = {
290 | isa = PBXNativeTarget;
291 | buildConfigurationList = 1DEB91D908733DB10010E9CD /* Build configuration list for PBXNativeTarget "EWProxyFrameBuffer" */;
292 | buildPhases = (
293 | 32D94FC50562CBF700B6AF17 /* Headers */,
294 | 32D94FC70562CBF700B6AF17 /* Resources */,
295 | 32D94FC90562CBF700B6AF17 /* Sources */,
296 | 32D94FCB0562CBF700B6AF17 /* Frameworks */,
297 | 32D94FCC0562CBF700B6AF17 /* Rez */,
298 | );
299 | buildRules = (
300 | );
301 | dependencies = (
302 | );
303 | name = EWProxyFrameBuffer;
304 | productInstallPath = "$(SYSTEM_LIBRARY_DIR)/Extensions";
305 | productName = EWProxyFrameBuffer;
306 | productReference = 32D94FD00562CBF700B6AF17 /* EWProxyFrameBuffer.kext */;
307 | productType = "com.apple.product-type.kernel-extension.iokit";
308 | };
309 | 96614DA710E92DB70066624E /* EWProxyFrameBufferConnection */ = {
310 | isa = PBXNativeTarget;
311 | buildConfigurationList = 96614DAC10E92DB80066624E /* Build configuration list for PBXNativeTarget "EWProxyFrameBufferConnection" */;
312 | buildPhases = (
313 | 96614DA310E92DB70066624E /* Headers */,
314 | 96614DA410E92DB70066624E /* Resources */,
315 | 96614DA510E92DB70066624E /* Sources */,
316 | 96614DA610E92DB70066624E /* Frameworks */,
317 | );
318 | buildRules = (
319 | );
320 | dependencies = (
321 | );
322 | name = EWProxyFrameBufferConnection;
323 | productName = EWProxyFrameBufferConnection;
324 | productReference = 96614DA810E92DB70066624E /* EWProxyFrameBufferConnection.framework */;
325 | productType = "com.apple.product-type.framework";
326 | };
327 | 96614E0410E930720066624E /* EWProxyframeBufferApp */ = {
328 | isa = PBXNativeTarget;
329 | buildConfigurationList = 96614E0A10E930740066624E /* Build configuration list for PBXNativeTarget "EWProxyframeBufferApp" */;
330 | buildPhases = (
331 | 96614E0110E930720066624E /* Resources */,
332 | 96614E0210E930720066624E /* Sources */,
333 | 96614E0310E930720066624E /* Frameworks */,
334 | 96614E3210E931340066624E /* Copy Frameworks */,
335 | );
336 | buildRules = (
337 | );
338 | dependencies = (
339 | 96614E1D10E930D60066624E /* PBXTargetDependency */,
340 | );
341 | name = EWProxyframeBufferApp;
342 | productName = EWProxyframeBufferApp;
343 | productReference = 96614E0510E930720066624E /* EWProxyframeBufferApp.app */;
344 | productType = "com.apple.product-type.application";
345 | };
346 | /* End PBXNativeTarget section */
347 |
348 | /* Begin PBXProject section */
349 | 089C1669FE841209C02AAC07 /* Project object */ = {
350 | isa = PBXProject;
351 | attributes = {
352 | LastUpgradeCheck = 1010;
353 | };
354 | buildConfigurationList = 1DEB91DD08733DB10010E9CD /* Build configuration list for PBXProject "EWProxyFrameBuffer" */;
355 | compatibilityVersion = "Xcode 3.2";
356 | developmentRegion = English;
357 | hasScannedForEncodings = 1;
358 | knownRegions = (
359 | en,
360 | English,
361 | );
362 | mainGroup = 089C166AFE841209C02AAC07 /* EWProxyFrameBuffer */;
363 | projectDirPath = "";
364 | projectRoot = "";
365 | targets = (
366 | 32D94FC30562CBF700B6AF17 /* EWProxyFrameBuffer */,
367 | 96614DA710E92DB70066624E /* EWProxyFrameBufferConnection */,
368 | 96614E0410E930720066624E /* EWProxyframeBufferApp */,
369 | 96614E9C10E93A820066624E /* All */,
370 | );
371 | };
372 | /* End PBXProject section */
373 |
374 | /* Begin PBXResourcesBuildPhase section */
375 | 32D94FC70562CBF700B6AF17 /* Resources */ = {
376 | isa = PBXResourcesBuildPhase;
377 | buildActionMask = 2147483647;
378 | files = (
379 | 32D94FC80562CBF700B6AF17 /* EWProxyFramebuffer-InfoPlist.strings in Resources */,
380 | 96614D1B10E91E6D0066624E /* IOKit in Resources */,
381 | );
382 | runOnlyForDeploymentPostprocessing = 0;
383 | };
384 | 96614DA410E92DB70066624E /* Resources */ = {
385 | isa = PBXResourcesBuildPhase;
386 | buildActionMask = 2147483647;
387 | files = (
388 | );
389 | runOnlyForDeploymentPostprocessing = 0;
390 | };
391 | 96614E0110E930720066624E /* Resources */ = {
392 | isa = PBXResourcesBuildPhase;
393 | buildActionMask = 2147483647;
394 | files = (
395 | 4420CE63234F428800AB9159 /* MenuBarApp.xib in Resources */,
396 | 4420CE60234F413300AB9159 /* Images.xcassets in Resources */,
397 | );
398 | runOnlyForDeploymentPostprocessing = 0;
399 | };
400 | /* End PBXResourcesBuildPhase section */
401 |
402 | /* Begin PBXRezBuildPhase section */
403 | 32D94FCC0562CBF700B6AF17 /* Rez */ = {
404 | isa = PBXRezBuildPhase;
405 | buildActionMask = 2147483647;
406 | files = (
407 | );
408 | runOnlyForDeploymentPostprocessing = 0;
409 | };
410 | /* End PBXRezBuildPhase section */
411 |
412 | /* Begin PBXSourcesBuildPhase section */
413 | 32D94FC90562CBF700B6AF17 /* Sources */ = {
414 | isa = PBXSourcesBuildPhase;
415 | buildActionMask = 2147483647;
416 | files = (
417 | 32D94FCA0562CBF700B6AF17 /* EWProxyFrameBufferDriver.cpp in Sources */,
418 | 96614CC610E91A270066624E /* EWProxyFrameBufferClient.cpp in Sources */,
419 | 96614CC810E91A270066624E /* EWProxyFrameBufferFBuffer.cpp in Sources */,
420 | );
421 | runOnlyForDeploymentPostprocessing = 0;
422 | };
423 | 96614DA510E92DB70066624E /* Sources */ = {
424 | isa = PBXSourcesBuildPhase;
425 | buildActionMask = 2147483647;
426 | files = (
427 | 96614DAE10E92DCA0066624E /* EWProxyFrameBuffer.m in Sources */,
428 | );
429 | runOnlyForDeploymentPostprocessing = 0;
430 | };
431 | 96614E0210E930720066624E /* Sources */ = {
432 | isa = PBXSourcesBuildPhase;
433 | buildActionMask = 2147483647;
434 | files = (
435 | 96614E0F10E9309A0066624E /* main.m in Sources */,
436 | 4420CE65234F42C500AB9159 /* AppDelegate.m in Sources */,
437 | );
438 | runOnlyForDeploymentPostprocessing = 0;
439 | };
440 | /* End PBXSourcesBuildPhase section */
441 |
442 | /* Begin PBXTargetDependency section */
443 | 96614E1D10E930D60066624E /* PBXTargetDependency */ = {
444 | isa = PBXTargetDependency;
445 | target = 96614DA710E92DB70066624E /* EWProxyFrameBufferConnection */;
446 | targetProxy = 96614E1C10E930D60066624E /* PBXContainerItemProxy */;
447 | };
448 | 96614EA010E93A880066624E /* PBXTargetDependency */ = {
449 | isa = PBXTargetDependency;
450 | target = 32D94FC30562CBF700B6AF17 /* EWProxyFrameBuffer */;
451 | targetProxy = 96614E9F10E93A880066624E /* PBXContainerItemProxy */;
452 | };
453 | 96614EA210E93A880066624E /* PBXTargetDependency */ = {
454 | isa = PBXTargetDependency;
455 | target = 96614DA710E92DB70066624E /* EWProxyFrameBufferConnection */;
456 | targetProxy = 96614EA110E93A880066624E /* PBXContainerItemProxy */;
457 | };
458 | 96614EA410E93A880066624E /* PBXTargetDependency */ = {
459 | isa = PBXTargetDependency;
460 | target = 96614E0410E930720066624E /* EWProxyframeBufferApp */;
461 | targetProxy = 96614EA310E93A880066624E /* PBXContainerItemProxy */;
462 | };
463 | /* End PBXTargetDependency section */
464 |
465 | /* Begin PBXVariantGroup section */
466 | 089C167DFE841241C02AAC07 /* EWProxyFramebuffer-InfoPlist.strings */ = {
467 | isa = PBXVariantGroup;
468 | children = (
469 | 089C167EFE841241C02AAC07 /* English */,
470 | );
471 | name = "EWProxyFramebuffer-InfoPlist.strings";
472 | sourceTree = "";
473 | };
474 | 4420CE5E234F413300AB9159 /* Images.xcassets */ = {
475 | isa = PBXVariantGroup;
476 | children = (
477 | 4420CE5F234F413300AB9159 /* English */,
478 | );
479 | name = Images.xcassets;
480 | sourceTree = "";
481 | };
482 | 4420CE61234F428800AB9159 /* MenuBarApp.xib */ = {
483 | isa = PBXVariantGroup;
484 | children = (
485 | 4420CE62234F428800AB9159 /* English */,
486 | );
487 | name = MenuBarApp.xib;
488 | sourceTree = "";
489 | };
490 | /* End PBXVariantGroup section */
491 |
492 | /* Begin XCBuildConfiguration section */
493 | 1DEB91DA08733DB10010E9CD /* Debug */ = {
494 | isa = XCBuildConfiguration;
495 | buildSettings = {
496 | ALWAYS_SEARCH_USER_PATHS = NO;
497 | CLANG_ENABLE_OBJC_WEAK = YES;
498 | COPY_PHASE_STRIP = NO;
499 | CURRENT_PROJECT_VERSION = 1.0.0d1;
500 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
501 | GCC_DYNAMIC_NO_PIC = NO;
502 | GCC_MODEL_TUNING = G5;
503 | GCC_OPTIMIZATION_LEVEL = 0;
504 | GCC_VERSION = "";
505 | HEADER_SEARCH_PATHS = "\"$(SRCROOT)\"";
506 | INFOPLIST_FILE = "EWProxyFramebuffer-Info.plist";
507 | MACOSX_DEPLOYMENT_TARGET = 10.6;
508 | MODULE_NAME = com.yourcompany.driver.EWProxyFrameBuffer;
509 | MODULE_VERSION = 1.0.0d1;
510 | ONLY_ACTIVE_ARCH = NO;
511 | PRODUCT_BUNDLE_IDENTIFIER = info.ennowelbers.framebuffer;
512 | PRODUCT_NAME = EWProxyFrameBuffer;
513 | VALID_ARCHS = x86_64;
514 | WRAPPER_EXTENSION = kext;
515 | };
516 | name = Debug;
517 | };
518 | 1DEB91DB08733DB10010E9CD /* Release */ = {
519 | isa = XCBuildConfiguration;
520 | buildSettings = {
521 | ALWAYS_SEARCH_USER_PATHS = NO;
522 | CLANG_ENABLE_OBJC_WEAK = YES;
523 | CURRENT_PROJECT_VERSION = 1.0.0d1;
524 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
525 | GCC_MODEL_TUNING = G5;
526 | GCC_VERSION = "";
527 | HEADER_SEARCH_PATHS = "\"$(SRCROOT)\"";
528 | INFOPLIST_FILE = "EWProxyFramebuffer-Info.plist";
529 | MACOSX_DEPLOYMENT_TARGET = 10.6;
530 | MODULE_NAME = com.yourcompany.driver.EWProxyFrameBuffer;
531 | MODULE_VERSION = 1.0.0d1;
532 | PRODUCT_BUNDLE_IDENTIFIER = info.ennowelbers.framebuffer;
533 | PRODUCT_NAME = EWProxyFrameBuffer;
534 | VALID_ARCHS = x86_64;
535 | WRAPPER_EXTENSION = kext;
536 | };
537 | name = Release;
538 | };
539 | 1DEB91DE08733DB10010E9CD /* Debug */ = {
540 | isa = XCBuildConfiguration;
541 | buildSettings = {
542 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
543 | CLANG_WARN_BOOL_CONVERSION = YES;
544 | CLANG_WARN_COMMA = YES;
545 | CLANG_WARN_CONSTANT_CONVERSION = YES;
546 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
547 | CLANG_WARN_EMPTY_BODY = YES;
548 | CLANG_WARN_ENUM_CONVERSION = YES;
549 | CLANG_WARN_INFINITE_RECURSION = YES;
550 | CLANG_WARN_INT_CONVERSION = YES;
551 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
552 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
553 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
554 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
555 | CLANG_WARN_STRICT_PROTOTYPES = YES;
556 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
557 | CLANG_WARN_UNREACHABLE_CODE = YES;
558 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
559 | ENABLE_STRICT_OBJC_MSGSEND = YES;
560 | ENABLE_TESTABILITY = YES;
561 | GCC_C_LANGUAGE_STANDARD = gnu99;
562 | GCC_NO_COMMON_BLOCKS = YES;
563 | GCC_OPTIMIZATION_LEVEL = 0;
564 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
565 | GCC_WARN_ABOUT_RETURN_TYPE = YES;
566 | GCC_WARN_UNDECLARED_SELECTOR = YES;
567 | GCC_WARN_UNINITIALIZED_AUTOS = YES;
568 | GCC_WARN_UNUSED_FUNCTION = YES;
569 | GCC_WARN_UNUSED_VARIABLE = YES;
570 | ONLY_ACTIVE_ARCH = YES;
571 | SDKROOT = macosx;
572 | };
573 | name = Debug;
574 | };
575 | 1DEB91DF08733DB10010E9CD /* Release */ = {
576 | isa = XCBuildConfiguration;
577 | buildSettings = {
578 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
579 | CLANG_WARN_BOOL_CONVERSION = YES;
580 | CLANG_WARN_COMMA = YES;
581 | CLANG_WARN_CONSTANT_CONVERSION = YES;
582 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
583 | CLANG_WARN_EMPTY_BODY = YES;
584 | CLANG_WARN_ENUM_CONVERSION = YES;
585 | CLANG_WARN_INFINITE_RECURSION = YES;
586 | CLANG_WARN_INT_CONVERSION = YES;
587 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
588 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
589 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
590 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
591 | CLANG_WARN_STRICT_PROTOTYPES = YES;
592 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
593 | CLANG_WARN_UNREACHABLE_CODE = YES;
594 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
595 | ENABLE_STRICT_OBJC_MSGSEND = YES;
596 | GCC_C_LANGUAGE_STANDARD = gnu99;
597 | GCC_NO_COMMON_BLOCKS = YES;
598 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
599 | GCC_WARN_ABOUT_RETURN_TYPE = YES;
600 | GCC_WARN_UNDECLARED_SELECTOR = YES;
601 | GCC_WARN_UNINITIALIZED_AUTOS = YES;
602 | GCC_WARN_UNUSED_FUNCTION = YES;
603 | GCC_WARN_UNUSED_VARIABLE = YES;
604 | SDKROOT = macosx;
605 | };
606 | name = Release;
607 | };
608 | 96614DAA10E92DB80066624E /* Debug */ = {
609 | isa = XCBuildConfiguration;
610 | buildSettings = {
611 | ALWAYS_SEARCH_USER_PATHS = NO;
612 | CLANG_ENABLE_OBJC_WEAK = YES;
613 | COPY_PHASE_STRIP = NO;
614 | DYLIB_COMPATIBILITY_VERSION = 1;
615 | DYLIB_CURRENT_VERSION = 1;
616 | FRAMEWORK_VERSION = A;
617 | GCC_DYNAMIC_NO_PIC = NO;
618 | GCC_MODEL_TUNING = G5;
619 | GCC_OPTIMIZATION_LEVEL = 0;
620 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
621 | GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
622 | INFOPLIST_FILE = "EWProxyFrameBufferConnection-Info.plist";
623 | INSTALL_PATH = "@executable_path/../Frameworks";
624 | MACOSX_DEPLOYMENT_TARGET = 10.14;
625 | ONLY_ACTIVE_ARCH = NO;
626 | OTHER_LDFLAGS = (
627 | "-framework",
628 | Foundation,
629 | "-framework",
630 | AppKit,
631 | );
632 | PRODUCT_BUNDLE_IDENTIFIER = info.ennowelbers.proxyframebuffer.connection;
633 | PRODUCT_NAME = EWProxyFrameBufferConnection;
634 | VALID_ARCHS = "i386 x86_64";
635 | };
636 | name = Debug;
637 | };
638 | 96614DAB10E92DB80066624E /* Release */ = {
639 | isa = XCBuildConfiguration;
640 | buildSettings = {
641 | ALWAYS_SEARCH_USER_PATHS = NO;
642 | CLANG_ENABLE_OBJC_WEAK = YES;
643 | COPY_PHASE_STRIP = YES;
644 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
645 | DYLIB_COMPATIBILITY_VERSION = 1;
646 | DYLIB_CURRENT_VERSION = 1;
647 | FRAMEWORK_VERSION = A;
648 | GCC_MODEL_TUNING = G5;
649 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
650 | GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
651 | INFOPLIST_FILE = "EWProxyFrameBufferConnection-Info.plist";
652 | INSTALL_PATH = "@executable_path/../Frameworks";
653 | MACOSX_DEPLOYMENT_TARGET = 10.14;
654 | OTHER_LDFLAGS = (
655 | "-framework",
656 | Foundation,
657 | "-framework",
658 | AppKit,
659 | );
660 | PRODUCT_BUNDLE_IDENTIFIER = info.ennowelbers.proxyframebuffer.connection;
661 | PRODUCT_NAME = EWProxyFrameBufferConnection;
662 | VALID_ARCHS = "i386 x86_64";
663 | ZERO_LINK = NO;
664 | };
665 | name = Release;
666 | };
667 | 96614E0810E930730066624E /* Debug */ = {
668 | isa = XCBuildConfiguration;
669 | buildSettings = {
670 | ALWAYS_SEARCH_USER_PATHS = NO;
671 | CLANG_ENABLE_OBJC_WEAK = YES;
672 | COPY_PHASE_STRIP = NO;
673 | GCC_DYNAMIC_NO_PIC = NO;
674 | GCC_MODEL_TUNING = G5;
675 | GCC_OPTIMIZATION_LEVEL = 0;
676 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
677 | GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
678 | INFOPLIST_FILE = "EWProxyframeBufferApp-Info.plist";
679 | INSTALL_PATH = "$(HOME)/Applications";
680 | MACOSX_DEPLOYMENT_TARGET = 10.14;
681 | OTHER_LDFLAGS = (
682 | "-framework",
683 | Foundation,
684 | "-framework",
685 | AppKit,
686 | );
687 | PRODUCT_BUNDLE_IDENTIFIER = "com.yourcompany.${PRODUCT_NAME:identifier}";
688 | PRODUCT_NAME = EWProxyframeBufferApp;
689 | };
690 | name = Debug;
691 | };
692 | 96614E0910E930730066624E /* Release */ = {
693 | isa = XCBuildConfiguration;
694 | buildSettings = {
695 | ALWAYS_SEARCH_USER_PATHS = NO;
696 | CLANG_ENABLE_OBJC_WEAK = YES;
697 | COPY_PHASE_STRIP = YES;
698 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
699 | GCC_MODEL_TUNING = G5;
700 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
701 | GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
702 | INFOPLIST_FILE = "EWProxyframeBufferApp-Info.plist";
703 | INSTALL_PATH = "$(HOME)/Applications";
704 | MACOSX_DEPLOYMENT_TARGET = 10.14;
705 | OTHER_LDFLAGS = (
706 | "-framework",
707 | Foundation,
708 | "-framework",
709 | AppKit,
710 | );
711 | PRODUCT_BUNDLE_IDENTIFIER = "com.yourcompany.${PRODUCT_NAME:identifier}";
712 | PRODUCT_NAME = EWProxyframeBufferApp;
713 | ZERO_LINK = NO;
714 | };
715 | name = Release;
716 | };
717 | 96614E9D10E93A820066624E /* Debug */ = {
718 | isa = XCBuildConfiguration;
719 | buildSettings = {
720 | CLANG_ENABLE_OBJC_WEAK = YES;
721 | COPY_PHASE_STRIP = NO;
722 | GCC_DYNAMIC_NO_PIC = NO;
723 | GCC_OPTIMIZATION_LEVEL = 0;
724 | PRODUCT_NAME = All;
725 | };
726 | name = Debug;
727 | };
728 | 96614E9E10E93A820066624E /* Release */ = {
729 | isa = XCBuildConfiguration;
730 | buildSettings = {
731 | CLANG_ENABLE_OBJC_WEAK = YES;
732 | COPY_PHASE_STRIP = YES;
733 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
734 | PRODUCT_NAME = All;
735 | ZERO_LINK = NO;
736 | };
737 | name = Release;
738 | };
739 | /* End XCBuildConfiguration section */
740 |
741 | /* Begin XCConfigurationList section */
742 | 1DEB91D908733DB10010E9CD /* Build configuration list for PBXNativeTarget "EWProxyFrameBuffer" */ = {
743 | isa = XCConfigurationList;
744 | buildConfigurations = (
745 | 1DEB91DA08733DB10010E9CD /* Debug */,
746 | 1DEB91DB08733DB10010E9CD /* Release */,
747 | );
748 | defaultConfigurationIsVisible = 0;
749 | defaultConfigurationName = Release;
750 | };
751 | 1DEB91DD08733DB10010E9CD /* Build configuration list for PBXProject "EWProxyFrameBuffer" */ = {
752 | isa = XCConfigurationList;
753 | buildConfigurations = (
754 | 1DEB91DE08733DB10010E9CD /* Debug */,
755 | 1DEB91DF08733DB10010E9CD /* Release */,
756 | );
757 | defaultConfigurationIsVisible = 0;
758 | defaultConfigurationName = Release;
759 | };
760 | 96614DAC10E92DB80066624E /* Build configuration list for PBXNativeTarget "EWProxyFrameBufferConnection" */ = {
761 | isa = XCConfigurationList;
762 | buildConfigurations = (
763 | 96614DAA10E92DB80066624E /* Debug */,
764 | 96614DAB10E92DB80066624E /* Release */,
765 | );
766 | defaultConfigurationIsVisible = 0;
767 | defaultConfigurationName = Release;
768 | };
769 | 96614E0A10E930740066624E /* Build configuration list for PBXNativeTarget "EWProxyframeBufferApp" */ = {
770 | isa = XCConfigurationList;
771 | buildConfigurations = (
772 | 96614E0810E930730066624E /* Debug */,
773 | 96614E0910E930730066624E /* Release */,
774 | );
775 | defaultConfigurationIsVisible = 0;
776 | defaultConfigurationName = Release;
777 | };
778 | 96614EB110E93AC50066624E /* Build configuration list for PBXAggregateTarget "All" */ = {
779 | isa = XCConfigurationList;
780 | buildConfigurations = (
781 | 96614E9D10E93A820066624E /* Debug */,
782 | 96614E9E10E93A820066624E /* Release */,
783 | );
784 | defaultConfigurationIsVisible = 0;
785 | defaultConfigurationName = Release;
786 | };
787 | /* End XCConfigurationList section */
788 | };
789 | rootObject = 089C1669FE841209C02AAC07 /* Project object */;
790 | }
791 |
--------------------------------------------------------------------------------