pycocoa.oslibs

Package pycocoa :: Module oslibs |
[frames] | no frames]

# Module oslibs

Various ObjC and macOS libraries, signatures, constants, etc.

Note: The macOS `libc.dylib` library (`ctypes.CDLL`) is also installed, but only exported as `Libs.C`.

Version: 25.01.16

Functions
get_lib(name) Find and load a `.dylib` library. |
get_lib_framework(name, services=`'``ApplicationServices``'`, version='') Load a `Frameworks services .framework` library. |
get_libs() Return the `.dylib` libraries loaded so far. |
leaked2() Return the number of memory leaks. |

Variables
| __all__ = `_ALL_LAZY.oslibs`
| NO = `False` ObjC's False (`const c_byte`).
| YES = `True` ObjC's True (`const c_byte`).
| libCF = `<CDLL 'CoreFoundation.framework/CoreFoundation', handl`...``
| libAppKit = `<CDLL 'AppKit.framework/AppKit', handle 7fff95603c`...``
| NSApplicationDidHideNotification = `c_void_p(140704555838160)`
| NSApplicationDidUnhideNotification = `c_void_p(140704555838256)`
| NSDefaultRunLoopMode = `RunLoop_t.in_dll(libAppKit, 'NSDefaultR`...``
| NSEventTrackingRunLoopMode = `RunLoop_t.in_dll(libAppKit, 'NSEv`...``
| NSApplicationPresentationDefault = `0`
| NSApplicationPresentationHideDock = `2`
| NSApplicationPresentationHideMenuBar = `8`
| NSApplicationPresentationDisableProcessSwitching = `32`
| NSApplicationPresentationDisableHideApplication = `256`
| NSApplicationActivationPolicyRegular = `0`
| NSApplicationActivationPolicyAccessory = `1`
| NSApplicationActivationPolicyProhibited = `2`
| NSCancelButton = `0`
| NSFileHandlingPanelCancelButton = `0`
| NSOKButton = `1`
| NSFileHandlingPanelOKButton = `1`
| NSAlphaShiftKeyMask = `65536`
| NSShiftKeyMask = `131072`
| NSControlKeyMask = `262144`
| NSAlternateKeyMask = `524288`
| NSCommandKeyMask = `1048576`
| NSNumericPadKeyMask = `2097152`
| NSHelpKeyMask = `4194304`
| NSFunctionKeyMask = `8388608`
| NSAnyEventMask = `4294967295`
| NSKeyDown = `10`
| NSKeyUp = `11`
| NSFlagsChanged = `12`
| NSApplicationDefined = `15`
| NSUpArrowFunctionKey = `63232`
| NSDownArrowFunctionKey = `63233`
| NSLeftArrowFunctionKey = `63234`
| NSRightArrowFunctionKey = `63235`
| NSF1FunctionKey = `63236`
| NSF19FunctionKey = `63254`
| NSDeleteFunctionKey = `63272`
| NSHomeFunctionKey = `63273`
| NSEndFunctionKey = `63275`
| NSPageUpFunctionKey = `63276`
| NSPageDownFunctionKey = `63277`
| NSClearLineFunctionKey = `63289`
| NSHelpFunctionKey = `63302`
| NSNullCharacter = `0`
| NSStartOfHeadingCharacter = `1`
| NSStartOfTextCharacter = `2`
| NSEnterCharacter = `3`
| NSEndOfTextCharacter = `3`
| NSEndOfTransmitCharacter = `4`
| NSEnquiryCharacter = `5`
| NSAcknowledgeCharacter = `6`
| NSBellCharacter = `7`
| NSBackSpaceCharacter = `8`
| NSTabCharacter = `9`
| NSHorizontalTabCharacter = `9`
| NSNewLineCharacter = `10`
| NSLineFeedCharacter = `10`
| NSVerticalTabCharacter = `11`
| NSFormFeedCharacter = `12`
| NSCarriageReturnCharacter = `13`
| NSShiftOutCharacter = `14`
| NSShiftInCharacter = `15`
| NSDataLineEscapeCharacter = `16`
| NSDeviceControl1Character = `17`
| NSDeviceControl2Character = `18`
| NSDeviceControl3Character = `19`
| NSDeviceControl4Character = `20`
| NSNegativeAcknowledgeCharacter = `21`
| NSSynchronousIdleCharacter = `22`
| NSEndOfTransmitBlockCharacter = `23`
| NSCancelCharacter = `24`
| NSBackTabCharacter = `25`
| NSEndOfMediumCharacter = `25`
| NSSubstituteCharacter = `26`
| NSEscapeCharacter = `27`
| NSFileSeparatorCharacter = `28`
| NSGroupSeparatorCharacter = `29`
| NSRecordSeparatorCharacter = `30`
| NSUnitSeparatorCharacter = `31`
| NSSpaceCharacter = `32`
| NSLineSeparatorCharacter = `8232`
| NSParagraphSeparatorCharacter = `8233`
| NSDeleteCharacter = `127`
| NSBackingStoreRetained = `0`
| NSBackingStoreNonretained = `1`
| NSBackingStoreBuffered = `2`
| NSTableViewGridNone = `0`
| NSTableViewSolidVerticalGridLineMask = `1`
| NSTableViewSolidHorizontalGridLineMask = `2`
| NSTableViewDashedHorizontalGridLineMask = `8`
| NSLeftTextAlignment = `0`
| NSTextAlignmentLeft = `0`
| NSRightTextAlignment = `1`
| NSTextAlignmentRight = `1`
| NSCenterTextAlignment = `2`
| NSTextAlignmentCenter = `2`
| NSJustifiedTextAlignment = `3`
| NSTextAlignmentJustified = `3`
| NSNaturalTextAlignment = `4`
| NSTextAlignmentNatural = `4`
| NSTextWritingDirectionEmbedding = `0`
| NSTextWritingDirectionOverride = `2`
| NSTrackingMouseEnteredAndExited = `1`
| NSTrackingMouseMoved = `2`
| NSTrackingCursorUpdate = `4`
| NSTrackingActiveInActiveApp = `64`
| NSSquareStatusItemLength = `-2`
| NSVariableStatusItemLength = `-1`
| NSWindowStyleMaskTitled = `1`
| NSWindowStyleMaskClosable = `2`
| NSWindowStyleMaskMiniaturizable = `4`
| NSWindowStyleMaskResizable = `8`
| NSWindowStyleMaskUtilityWindow = `16`
| NSWindowStyleMaskUsual = `15`
| NSWindowCloseButton = `0`
| NSWindowMiniaturizeButton = `1`
| NSWindowZoomButton = `2`
| NSWindowToolbarButton = `3`
| NSWindowDocumentIconButton = `4`
| libCG = `<CDLL 'CoreGraphics.framework/CoreGraphics', handle 7f`...``
| kCGImagePropertyGIFDictionary = `c_void_p.in_dll(libCG, 'kCGIma`...``
| kCGImagePropertyGIFDelayTime = `c_void_p.in_dll(libCG, 'kCGImag`...``
| libCT = `<CDLL 'CoreText.framework/CoreText', handle 7fff956002`...``
| NSFontItalicMask = `1`
| NSFontBoldMask = `2`
| NSFontUnboldMask = `4`
| NSFontNonStandardCharacterSetMask = `8`
| NSFontNarrowMask = `16`
| NSFontExpandedMask = `32`
| NSFontCondensedMask = `64`
| NSFontSmallCapsMask = `128`
| NSFontPosterMask = `256`
| NSFontCompressedMask = `512`
| NSFontMonoSpaceMask = `1024`
| NSFontVerticalMask = `2048`
| NSFontUIOptimizedMask = `4096`
| NSFontColorGlyphsMask = `8192`
| NSFontCompositeMask = `16384`
| NSFontUnitalicMask = `16777216`
| NSFontUnknownClass = `0`
| NSFontOldStyleSerifsClass = `268435456`
| NSFontTransitionalSerifsClass = `536870912`
| NSFontModernSerifsClass = `805306368`
| NSFontClarendonSerifsClass = `1073741824`
| NSFontSlabSerifsClass = `1342177280`
| NSFontFreeformSerifsClass = `1879048192`
| NSFontSansSerifClass = `2147483648`
| NSFontOrnamentalsClass = `2415919104`
| NSFontScriptsClass = `2684354560`
| NSFontSymbolicClass = `3221225472`
| NSFontClassMask = `4026531840`
| libFoundation = `<CDLL 'Foundation.framework/Foundation', handl`...``
| libobjc = `<CDLL 'libobjc.dylib', handle 7fff95605e4c at 7fd608`...``
| Libs = `Libs.AppKit=<CDLL 'AppKit.framework/AppKit', handle 7ff`...`` The loaded `macOS` libraries, all `.dylib`.
| Libs.AppKit The 'AppKit.framework/AppKit' library.
| Libs.C The 'libc.dylib' library.
| Libs.CoreFoundation The 'CoreFoundation.framework/CoreFoundation' library.
| Libs.CoreGraphics The 'CoreGraphics.framework/CoreGraphics' library.
| Libs.CoreText The 'CoreText.framework/CoreText' library.
| Libs.Foundation The 'Foundation.framework/Foundation' library.
| Libs.ObjC The 'libobjc.dylib' library.

Function Details

### get_lib(name) |
Find and load a `.dylib` library. Parameters: `name` - The library base name (`str`). Returns: The library (`ctypes.CDLL`). Note: Private attribute `._name` shows the library path.

### get_lib_framework(name, services=`'``ApplicationServices``'`, version='') |
Load a `Frameworks services .framework` library. Parameters: `name` - Library base name (`str`). `services` - Services framework base name (`str`). `version` - Framework version (`str`), if not 'Current'. Returns: The library (`ctypes.CDLL`). Note: Private attribute `._name` shows the library path. Example: get_lib_framework('PrintCore') get_lib_framework('Metadata', services='CoreServices')

### get_libs() |
Return the `.dylib` libraries loaded so far. Returns: The libraries cached (`Adict`).

### leaked2() |
Return the number of memory leaks. Returns: 2-Tuple (number, size) with the number of memory leaks and total size leaked, in bytes.

Variables Details

  ### libCF Value:
      <CDLL 'CoreFoundation.framework/CoreFoundation', handle 7fff956063c0 a
      t 7fd608680f10>

  ### libAppKit Value:
      <CDLL 'AppKit.framework/AppKit', handle 7fff95603cc8 at 7fd6086924d0>

  ### NSDefaultRunLoopMode Value:
      RunLoop_t.in_dll(libAppKit, 'NSDefaultRunLoopMode')

  ### NSEventTrackingRunLoopMode Value:
      RunLoop_t.in_dll(libAppKit, 'NSEventTrackingRunLoopMode')

  ### libCG Value:
      <CDLL 'CoreGraphics.framework/CoreGraphics', handle 7fff956fc058 at 7f
      d608692a10>

  ### kCGImagePropertyGIFDictionary Value:
      c_void_p.in_dll(libCG, 'kCGImagePropertyGIFDictionary')

  ### kCGImagePropertyGIFDelayTime Value:
      c_void_p.in_dll(libCG, 'kCGImagePropertyGIFDelayTime')

  ### libCT Value:
      <CDLL 'CoreText.framework/CoreText', handle 7fff956002f8 at 7fd60869f7
      10>

  ### libFoundation Value:
      <CDLL 'Foundation.framework/Foundation', handle 7fff956018f0 at 7fd608
      69fcd0>

  ### libobjc Value:
      <CDLL 'libobjc.dylib', handle 7fff95605e4c at 7fd60869fc90>

  ### Libs The loaded `macOS` libraries, all `.dylib`. Value:
      Libs.AppKit=<CDLL 'AppKit.framework/AppKit', handle 7fff95603cc8 at 7f
      d6086924d0>,
          .C=<CDLL 'libc.dylib', handle 7fff956ec788 at 7fd6086809d0>,
          .CoreFoundation=<CDLL 'CoreFoundation.framework/CoreFoundation', h
      andle 7fff956063c0 at 7fd608680f10>,
          .CoreGraphics=<CDLL 'CoreGraphics.framework/CoreGraphics', handle
      7fff956fc058 at 7fd608692a10>,
          .CoreText=<CDLL 'CoreText.framework/CoreText', handle 7fff956002f8
      ...