Created
March 16, 2021 16:20
-
-
Save w0lfschild/90db263867f469738c01e9e2d937f874 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// coredock.h | |
// Header file for undocumented Dock SPI | |
// | |
// Arranged by Wolfgang Baird | |
// Based on CoreDockPrivate.h from http://www.cocoadev.com/index.pl?DockPrefsPrivate | |
// | |
// Contributors: | |
// Alacatia Labs: Initial version posted at http://www.cocoadev.com/index.pl?DockPrefsPrivate | |
// Tony Arnold: CoreDockGetWorkspacesEnabled, CoreDockSetWorkspacesEnabled, CoreDockSetWorkspacesCount | |
// Steve Voida: CoreDockGetWorkspacesCount | |
// Wolfgang Baird: CoreDockCopyPreferences, CoreDockSetPreferences, CoreDockSetTrashFull, CoreDockIsDockRunning, CoreDockGetRect, CoreDockGetContainerRect | |
// | |
// Changes: | |
// 1.2 - Added on some additional interfaces | |
// 1.1 - Added attribution for Alacatia labs as originator | |
// - Removed unnecessary reliance on CGSPrivate.h | |
// 1.0 - Initial release | |
typedef enum { | |
kCoreDockOrientationIgnore = 0, | |
kCoreDockOrientationTop = 1, | |
kCoreDockOrientationBottom = 2, | |
kCoreDockOrientationLeft = 3, | |
kCoreDockOrientationRight = 4 | |
} CoreDockOrientation; | |
typedef enum { | |
kCoreDockPinningIgnore = 0, | |
kCoreDockPinningStart = 1, | |
kCoreDockPinningMiddle = 2, | |
kCoreDockPinningEnd = 3 | |
} CoreDockPinning; | |
typedef enum { | |
kCoreDockEffectGenie = 1, | |
kCoreDockEffectScale = 2, | |
kCoreDockEffectSuck = 3 | |
} CoreDockEffect; | |
// Tile size ranges from 0.0 to 1.0. | |
extern float CoreDockGetTileSize(void); | |
extern void CoreDockSetTileSize(float tileSize); | |
// If you only want to set one, use 0 for the other. | |
extern void CoreDockGetOrientationAndPinning(CoreDockOrientation *outOrientation, CoreDockPinning *outPinning); | |
extern void CoreDockSetOrientationAndPinning(CoreDockOrientation orientation, CoreDockPinning pinning); | |
extern void CoreDockGetEffect(CoreDockEffect *outEffect); | |
extern void CoreDockSetEffect(CoreDockEffect effect); | |
extern Boolean CoreDockGetAutoHideEnabled(void); | |
extern void CoreDockSetAutoHideEnabled(Boolean flag); | |
extern Boolean CoreDockIsMagnificationEnabled(void); | |
extern void CoreDockSetMagnificationEnabled(Boolean flag); | |
// Magnification ranges from 0.0 to 1.0. | |
extern float CoreDockGetMagnificationSize(void); | |
extern void CoreDockSetMagnificationSize(float newSize); | |
extern Boolean CoreDockIsLaunchAnimationsEnabled(void); | |
extern void CoreDockSetLaunchAnimationsEnabled(Boolean); | |
// This works, but wipes out all of the other spaces prefs. An alternative is to use the ScriptingBridge which works just fine. | |
extern Boolean CoreDockGetWorkspacesEnabled(void); | |
extern void CoreDockSetWorkspacesEnabled(Boolean); | |
extern void CoreDockGetWorkspacesCount(int *rows, int *cols); | |
extern void CoreDockSetWorkspacesCount(int rows, int cols); | |
// Example useage | |
/* | |
CFArrayRef d = CFStringCreateArrayBySeparatingStrings(kCFAllocatorDefault, CFSTR("showRecents,showProcessIndicators,minimizeToApplication"), CFSTR(",")); | |
CFDictionaryRef dic; | |
CoreDockCopyPreferences(d, &dic, nil); | |
*/ | |
extern void CoreDockCopyPreferences(CFArrayRef strings, CFDictionaryRef *dict, CFErrorRef *err); | |
// Only sets three options | |
/* | |
minimizeToApplication 0 or 1 | |
showProcessIndicators 0 or 1 | |
showRecents 0 or 1 | |
*/ | |
extern void CoreDockSetPreferences(CFDictionaryRef preferenceDict); | |
/* | |
Kinda pointless but this works | |
*/ | |
extern void CoreDockSetTrashFull(Boolean flag); // Works but serves no purpose | |
extern Boolean CoreDockIsDockRunning(void); // Works but serves little purpose since the Dock is always running | |
extern void CoreDockGetRect(CGRect *outRect); | |
extern void CoreDockGetContainerRect(CGRect *outRect); // Gives back a very oddly precise and small rect | |
//_CoreDockGetRectAndReason | |
/* | |
Does nothing, probably depreciated | |
*/ | |
extern Boolean CoreDockGetMinimizeInPlace(void); | |
extern void CoreDockSetMinimizeInPlace(Boolean flag); | |
extern Boolean CoreDockIsSpringLoadingEnabled(void); | |
extern void CoreDockSetSpringLoadingEnabled(Boolean flag); | |
extern float CoreDockGetSpringLoadingTime(void); | |
extern void CoreDockSetSpringLoadingTime(float newSize); | |
// | |
extern Boolean CFPreferencesSynchronize(CFStringRef applicationID, CFStringRef userName, CFStringRef hostName); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
CoreDockGetContainerRect no longer works.