mirror of https://github.com/python/cpython
Remove the Mac modules
This commit is contained in:
parent
a005b34f14
commit
69a07fbd9b
|
@ -1,86 +0,0 @@
|
|||
|
||||
:mod:`aepack` --- Conversion between Python variables and AppleEvent data containers
|
||||
====================================================================================
|
||||
|
||||
.. module:: aepack
|
||||
:platform: Mac
|
||||
:synopsis: Conversion between Python variables and AppleEvent data containers.
|
||||
.. sectionauthor:: Vincent Marchetti <vincem@en.com>
|
||||
.. moduleauthor:: Jack Jansen
|
||||
|
||||
The :mod:`aepack` module defines functions for converting (packing) Python
|
||||
variables to AppleEvent descriptors and back (unpacking). Within Python the
|
||||
AppleEvent descriptor is handled by Python objects of built-in type
|
||||
:class:`AEDesc`, defined in module :mod:`Carbon.AE`.
|
||||
|
||||
The :mod:`aepack` module defines the following functions:
|
||||
|
||||
|
||||
.. function:: pack(x[, forcetype])
|
||||
|
||||
Returns an :class:`AEDesc` object containing a conversion of Python value x. If
|
||||
*forcetype* is provided it specifies the descriptor type of the result.
|
||||
Otherwise, a default mapping of Python types to Apple Event descriptor types is
|
||||
used, as follows:
|
||||
|
||||
+-----------------+-----------------------------------+
|
||||
| Python type | descriptor type |
|
||||
+=================+===================================+
|
||||
| :class:`FSSpec` | typeFSS |
|
||||
+-----------------+-----------------------------------+
|
||||
| :class:`FSRef` | typeFSRef |
|
||||
+-----------------+-----------------------------------+
|
||||
| :class:`Alias` | typeAlias |
|
||||
+-----------------+-----------------------------------+
|
||||
| integer | typeLong (32 bit integer) |
|
||||
+-----------------+-----------------------------------+
|
||||
| float | typeFloat (64 bit floating point) |
|
||||
+-----------------+-----------------------------------+
|
||||
| string | typeText |
|
||||
+-----------------+-----------------------------------+
|
||||
| unicode | typeUnicodeText |
|
||||
+-----------------+-----------------------------------+
|
||||
| list | typeAEList |
|
||||
+-----------------+-----------------------------------+
|
||||
| dictionary | typeAERecord |
|
||||
+-----------------+-----------------------------------+
|
||||
| instance | *see below* |
|
||||
+-----------------+-----------------------------------+
|
||||
|
||||
If *x* is a Python instance then this function attempts to call an
|
||||
:meth:`__aepack__` method. This method should return an :class:`AEDesc` object.
|
||||
|
||||
If the conversion *x* is not defined above, this function returns the Python
|
||||
string representation of a value (the repr() function) encoded as a text
|
||||
descriptor.
|
||||
|
||||
|
||||
.. function:: unpack(x[, formodulename])
|
||||
|
||||
*x* must be an object of type :class:`AEDesc`. This function returns a Python
|
||||
object representation of the data in the Apple Event descriptor *x*. Simple
|
||||
AppleEvent data types (integer, text, float) are returned as their obvious
|
||||
Python counterparts. Apple Event lists are returned as Python lists, and the
|
||||
list elements are recursively unpacked. Object references (ex. ``line 3 of
|
||||
document 1``) are returned as instances of :class:`aetypes.ObjectSpecifier`,
|
||||
unless ``formodulename`` is specified. AppleEvent descriptors with descriptor
|
||||
type typeFSS are returned as :class:`FSSpec` objects. AppleEvent record
|
||||
descriptors are returned as Python dictionaries, with 4-character string keys
|
||||
and elements recursively unpacked.
|
||||
|
||||
The optional ``formodulename`` argument is used by the stub packages generated
|
||||
by :mod:`gensuitemodule`, and ensures that the OSA classes for object specifiers
|
||||
are looked up in the correct module. This ensures that if, say, the Finder
|
||||
returns an object specifier for a window you get an instance of
|
||||
``Finder.Window`` and not a generic ``aetypes.Window``. The former knows about
|
||||
all the properties and elements a window has in the Finder, while the latter
|
||||
knows no such things.
|
||||
|
||||
|
||||
.. seealso::
|
||||
|
||||
Module :mod:`Carbon.AE`
|
||||
Built-in access to Apple Event Manager routines.
|
||||
|
||||
Module :mod:`aetypes`
|
||||
Python definitions of codes for Apple Event descriptor types.
|
|
@ -1,84 +0,0 @@
|
|||
|
||||
:mod:`aetools` --- OSA client support
|
||||
=====================================
|
||||
|
||||
.. module:: aetools
|
||||
:platform: Mac
|
||||
:synopsis: Basic support for sending Apple Events
|
||||
.. sectionauthor:: Jack Jansen <Jack.Jansen@cwi.nl>
|
||||
.. moduleauthor:: Jack Jansen
|
||||
|
||||
The :mod:`aetools` module contains the basic functionality on which Python
|
||||
AppleScript client support is built. It also imports and re-exports the core
|
||||
functionality of the :mod:`aetypes` and :mod:`aepack` modules. The stub packages
|
||||
generated by :mod:`gensuitemodule` import the relevant portions of
|
||||
:mod:`aetools`, so usually you do not need to import it yourself. The exception
|
||||
to this is when you cannot use a generated suite package and need lower-level
|
||||
access to scripting.
|
||||
|
||||
The :mod:`aetools` module itself uses the AppleEvent support provided by the
|
||||
:mod:`Carbon.AE` module. This has one drawback: you need access to the window
|
||||
manager, see section :ref:`osx-gui-scripts` for details. This restriction may be
|
||||
lifted in future releases.
|
||||
|
||||
The :mod:`aetools` module defines the following functions:
|
||||
|
||||
|
||||
.. function:: packevent(ae, parameters, attributes)
|
||||
|
||||
Stores parameters and attributes in a pre-created ``Carbon.AE.AEDesc`` object.
|
||||
``parameters`` and ``attributes`` are dictionaries mapping 4-character OSA
|
||||
parameter keys to Python objects. The objects are packed using
|
||||
``aepack.pack()``.
|
||||
|
||||
|
||||
.. function:: unpackevent(ae[, formodulename])
|
||||
|
||||
Recursively unpacks a ``Carbon.AE.AEDesc`` event to Python objects. The function
|
||||
returns the parameter dictionary and the attribute dictionary. The
|
||||
``formodulename`` argument is used by generated stub packages to control where
|
||||
AppleScript classes are looked up.
|
||||
|
||||
|
||||
.. function:: keysubst(arguments, keydict)
|
||||
|
||||
Converts a Python keyword argument dictionary ``arguments`` to the format
|
||||
required by ``packevent`` by replacing the keys, which are Python identifiers,
|
||||
by the four-character OSA keys according to the mapping specified in
|
||||
``keydict``. Used by the generated suite packages.
|
||||
|
||||
|
||||
.. function:: enumsubst(arguments, key, edict)
|
||||
|
||||
If the ``arguments`` dictionary contains an entry for ``key`` convert the value
|
||||
for that entry according to dictionary ``edict``. This converts human-readable
|
||||
Python enumeration names to the OSA 4-character codes. Used by the generated
|
||||
suite packages.
|
||||
|
||||
The :mod:`aetools` module defines the following class:
|
||||
|
||||
|
||||
.. class:: TalkTo([signature=None, start=0, timeout=0])
|
||||
|
||||
Base class for the proxy used to talk to an application. ``signature`` overrides
|
||||
the class attribute ``_signature`` (which is usually set by subclasses) and is
|
||||
the 4-char creator code defining the application to talk to. ``start`` can be
|
||||
set to true to enable running the application on class instantiation.
|
||||
``timeout`` can be specified to change the default timeout used while waiting
|
||||
for an AppleEvent reply.
|
||||
|
||||
|
||||
.. method:: TalkTo._start()
|
||||
|
||||
Test whether the application is running, and attempt to start it if not.
|
||||
|
||||
|
||||
.. method:: TalkTo.send(code, subcode[, parameters, attributes])
|
||||
|
||||
Create the AppleEvent ``Carbon.AE.AEDesc`` for the verb with the OSA designation
|
||||
``code, subcode`` (which are the usual 4-character strings), pack the
|
||||
``parameters`` and ``attributes`` into it, send it to the target application,
|
||||
wait for the reply, unpack the reply with ``unpackevent`` and return the reply
|
||||
appleevent, the unpacked return values as a dictionary and the return
|
||||
attributes.
|
||||
|
|
@ -1,148 +0,0 @@
|
|||
|
||||
:mod:`aetypes` --- AppleEvent objects
|
||||
=====================================
|
||||
|
||||
.. module:: aetypes
|
||||
:platform: Mac
|
||||
:synopsis: Python representation of the Apple Event Object Model.
|
||||
.. sectionauthor:: Vincent Marchetti <vincem@en.com>
|
||||
.. moduleauthor:: Jack Jansen
|
||||
|
||||
The :mod:`aetypes` defines classes used to represent Apple Event data
|
||||
descriptors and Apple Event object specifiers.
|
||||
|
||||
Apple Event data is contained in descriptors, and these descriptors are typed.
|
||||
For many descriptors the Python representation is simply the corresponding
|
||||
Python type: ``typeText`` in OSA is a Python string, ``typeFloat`` is a float,
|
||||
etc. For OSA types that have no direct Python counterpart this module declares
|
||||
classes. Packing and unpacking instances of these classes is handled
|
||||
automatically by :mod:`aepack`.
|
||||
|
||||
An object specifier is essentially an address of an object implemented in a
|
||||
Apple Event server. An Apple Event specifier is used as the direct object for an
|
||||
Apple Event or as the argument of an optional parameter. The :mod:`aetypes`
|
||||
module contains the base classes for OSA classes and properties, which are used
|
||||
by the packages generated by :mod:`gensuitemodule` to populate the classes and
|
||||
properties in a given suite.
|
||||
|
||||
For reasons of backward compatibility, and for cases where you need to script an
|
||||
application for which you have not generated the stub package this module also
|
||||
contains object specifiers for a number of common OSA classes such as
|
||||
``Document``, ``Window``, ``Character``, etc.
|
||||
|
||||
The :mod:`AEObjects` module defines the following classes to represent Apple
|
||||
Event descriptor data:
|
||||
|
||||
|
||||
.. class:: Unknown(type, data)
|
||||
|
||||
The representation of OSA descriptor data for which the :mod:`aepack` and
|
||||
:mod:`aetypes` modules have no support, i.e. anything that is not represented by
|
||||
the other classes here and that is not equivalent to a simple Python value.
|
||||
|
||||
|
||||
.. class:: Enum(enum)
|
||||
|
||||
An enumeration value with the given 4-character string value.
|
||||
|
||||
|
||||
.. class:: InsertionLoc(of, pos)
|
||||
|
||||
Position ``pos`` in object ``of``.
|
||||
|
||||
|
||||
.. class:: Boolean(bool)
|
||||
|
||||
A boolean.
|
||||
|
||||
|
||||
.. class:: StyledText(style, text)
|
||||
|
||||
Text with style information (font, face, etc) included.
|
||||
|
||||
|
||||
.. class:: AEText(script, style, text)
|
||||
|
||||
Text with script system and style information included.
|
||||
|
||||
|
||||
.. class:: IntlText(script, language, text)
|
||||
|
||||
Text with script system and language information included.
|
||||
|
||||
|
||||
.. class:: IntlWritingCode(script, language)
|
||||
|
||||
Script system and language information.
|
||||
|
||||
|
||||
.. class:: QDPoint(v, h)
|
||||
|
||||
A quickdraw point.
|
||||
|
||||
|
||||
.. class:: QDRectangle(v0, h0, v1, h1)
|
||||
|
||||
A quickdraw rectangle.
|
||||
|
||||
|
||||
.. class:: RGBColor(r, g, b)
|
||||
|
||||
A color.
|
||||
|
||||
|
||||
.. class:: Type(type)
|
||||
|
||||
An OSA type value with the given 4-character name.
|
||||
|
||||
|
||||
.. class:: Keyword(name)
|
||||
|
||||
An OSA keyword with the given 4-character name.
|
||||
|
||||
|
||||
.. class:: Range(start, stop)
|
||||
|
||||
A range.
|
||||
|
||||
|
||||
.. class:: Ordinal(abso)
|
||||
|
||||
Non-numeric absolute positions, such as ``"firs"``, first, or ``"midd"``,
|
||||
middle.
|
||||
|
||||
|
||||
.. class:: Logical(logc, term)
|
||||
|
||||
The logical expression of applying operator ``logc`` to ``term``.
|
||||
|
||||
|
||||
.. class:: Comparison(obj1, relo, obj2)
|
||||
|
||||
The comparison ``relo`` of ``obj1`` to ``obj2``.
|
||||
|
||||
The following classes are used as base classes by the generated stub packages to
|
||||
represent AppleScript classes and properties in Python:
|
||||
|
||||
|
||||
.. class:: ComponentItem(which[, fr])
|
||||
|
||||
Abstract baseclass for an OSA class. The subclass should set the class attribute
|
||||
``want`` to the 4-character OSA class code. Instances of subclasses of this
|
||||
class are equivalent to AppleScript Object Specifiers. Upon instantiation you
|
||||
should pass a selector in ``which``, and optionally a parent object in ``fr``.
|
||||
|
||||
|
||||
.. class:: NProperty(fr)
|
||||
|
||||
Abstract baseclass for an OSA property. The subclass should set the class
|
||||
attributes ``want`` and ``which`` to designate which property we are talking
|
||||
about. Instances of subclasses of this class are Object Specifiers.
|
||||
|
||||
|
||||
.. class:: ObjectSpecifier(want, form, seld[, fr])
|
||||
|
||||
Base class of ``ComponentItem`` and ``NProperty``, a general OSA Object
|
||||
Specifier. See the Apple Open Scripting Architecture documentation for the
|
||||
parameters. Note that this class is not abstract.
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
|
||||
:mod:`autoGIL` --- Global Interpreter Lock handling in event loops
|
||||
==================================================================
|
||||
|
||||
.. module:: autoGIL
|
||||
:platform: Mac
|
||||
:synopsis: Global Interpreter Lock handling in event loops.
|
||||
.. moduleauthor:: Just van Rossum <just@letterror.com>
|
||||
|
||||
|
||||
The :mod:`autoGIL` module provides a function :func:`installAutoGIL` that
|
||||
automatically locks and unlocks Python's :term:`Global Interpreter Lock` when
|
||||
running an event loop.
|
||||
|
||||
|
||||
.. exception:: AutoGILError
|
||||
|
||||
Raised if the observer callback cannot be installed, for example because the
|
||||
current thread does not have a run loop.
|
||||
|
||||
|
||||
.. function:: installAutoGIL()
|
||||
|
||||
Install an observer callback in the event loop (CFRunLoop) for the current
|
||||
thread, that will lock and unlock the Global Interpreter Lock (GIL) at
|
||||
appropriate times, allowing other Python threads to run while the event loop is
|
||||
idle.
|
||||
|
||||
Availability: OSX 10.1 or later.
|
||||
|
|
@ -7,9 +7,7 @@
|
|||
|
||||
|
||||
This module encodes and decodes files in binhex4 format, a format allowing
|
||||
representation of Macintosh files in ASCII. On the Macintosh, both forks of a
|
||||
file and the finder information are encoded (or decoded), on other platforms
|
||||
only the data fork is handled.
|
||||
representation of Macintosh files in ASCII. Only the data fork is handled.
|
||||
|
||||
The :mod:`binhex` module defines the following functions:
|
||||
|
||||
|
|
|
@ -1,288 +0,0 @@
|
|||
|
||||
.. _toolbox:
|
||||
|
||||
*********************
|
||||
MacOS Toolbox Modules
|
||||
*********************
|
||||
|
||||
There are a set of modules that provide interfaces to various MacOS toolboxes.
|
||||
If applicable the module will define a number of Python objects for the various
|
||||
structures declared by the toolbox, and operations will be implemented as
|
||||
methods of the object. Other operations will be implemented as functions in the
|
||||
module. Not all operations possible in C will also be possible in Python
|
||||
(callbacks are often a problem), and parameters will occasionally be different
|
||||
in Python (input and output buffers, especially). All methods and functions
|
||||
have a :attr:`__doc__` string describing their arguments and return values, and
|
||||
for additional description you are referred to `Inside Macintosh
|
||||
<http://developer.apple.com/documentation/macos8/mac8.html>`_ or similar works.
|
||||
|
||||
These modules all live in a package called :mod:`Carbon`. Despite that name they
|
||||
are not all part of the Carbon framework: CF is really in the CoreFoundation
|
||||
framework and Qt is in the QuickTime framework. The normal use pattern is ::
|
||||
|
||||
from Carbon import AE
|
||||
|
||||
**Warning!** These modules are not yet documented. If you wish to contribute
|
||||
documentation of any of these modules, please get in touch with docs@python.org.
|
||||
|
||||
|
||||
:mod:`Carbon.AE` --- Apple Events
|
||||
=================================
|
||||
|
||||
.. module:: Carbon.AE
|
||||
:platform: Mac
|
||||
:synopsis: Interface to the Apple Events toolbox.
|
||||
|
||||
|
||||
|
||||
:mod:`Carbon.AH` --- Apple Help
|
||||
===============================
|
||||
|
||||
.. module:: Carbon.AH
|
||||
:platform: Mac
|
||||
:synopsis: Interface to the Apple Help manager.
|
||||
|
||||
|
||||
|
||||
:mod:`Carbon.App` --- Appearance Manager
|
||||
========================================
|
||||
|
||||
.. module:: Carbon.App
|
||||
:platform: Mac
|
||||
:synopsis: Interface to the Appearance Manager.
|
||||
|
||||
|
||||
|
||||
:mod:`Carbon.CF` --- Core Foundation
|
||||
====================================
|
||||
|
||||
.. module:: Carbon.CF
|
||||
:platform: Mac
|
||||
:synopsis: Interface to the Core Foundation.
|
||||
|
||||
|
||||
The ``CFBase``, ``CFArray``, ``CFData``, ``CFDictionary``, ``CFString`` and
|
||||
``CFURL`` objects are supported, some only partially.
|
||||
|
||||
|
||||
:mod:`Carbon.CG` --- Core Graphics
|
||||
==================================
|
||||
|
||||
.. module:: Carbon.CG
|
||||
:platform: Mac
|
||||
:synopsis: Interface to Core Graphics.
|
||||
|
||||
|
||||
|
||||
:mod:`Carbon.CarbonEvt` --- Carbon Event Manager
|
||||
================================================
|
||||
|
||||
.. module:: Carbon.CarbonEvt
|
||||
:platform: Mac
|
||||
:synopsis: Interface to the Carbon Event Manager.
|
||||
|
||||
|
||||
|
||||
:mod:`Carbon.Cm` --- Component Manager
|
||||
======================================
|
||||
|
||||
.. module:: Carbon.Cm
|
||||
:platform: Mac
|
||||
:synopsis: Interface to the Component Manager.
|
||||
|
||||
|
||||
|
||||
:mod:`Carbon.Ctl` --- Control Manager
|
||||
=====================================
|
||||
|
||||
.. module:: Carbon.Ctl
|
||||
:platform: Mac
|
||||
:synopsis: Interface to the Control Manager.
|
||||
|
||||
|
||||
|
||||
:mod:`Carbon.Dlg` --- Dialog Manager
|
||||
====================================
|
||||
|
||||
.. module:: Carbon.Dlg
|
||||
:platform: Mac
|
||||
:synopsis: Interface to the Dialog Manager.
|
||||
|
||||
|
||||
|
||||
:mod:`Carbon.Evt` --- Event Manager
|
||||
===================================
|
||||
|
||||
.. module:: Carbon.Evt
|
||||
:platform: Mac
|
||||
:synopsis: Interface to the classic Event Manager.
|
||||
|
||||
|
||||
|
||||
:mod:`Carbon.Fm` --- Font Manager
|
||||
=================================
|
||||
|
||||
.. module:: Carbon.Fm
|
||||
:platform: Mac
|
||||
:synopsis: Interface to the Font Manager.
|
||||
|
||||
|
||||
|
||||
:mod:`Carbon.Folder` --- Folder Manager
|
||||
=======================================
|
||||
|
||||
.. module:: Carbon.Folder
|
||||
:platform: Mac
|
||||
:synopsis: Interface to the Folder Manager.
|
||||
|
||||
|
||||
|
||||
:mod:`Carbon.Help` --- Help Manager
|
||||
===================================
|
||||
|
||||
.. module:: Carbon.Help
|
||||
:platform: Mac
|
||||
:synopsis: Interface to the Carbon Help Manager.
|
||||
|
||||
|
||||
|
||||
:mod:`Carbon.List` --- List Manager
|
||||
===================================
|
||||
|
||||
.. module:: Carbon.List
|
||||
:platform: Mac
|
||||
:synopsis: Interface to the List Manager.
|
||||
|
||||
|
||||
|
||||
:mod:`Carbon.Menu` --- Menu Manager
|
||||
===================================
|
||||
|
||||
.. module:: Carbon.Menu
|
||||
:platform: Mac
|
||||
:synopsis: Interface to the Menu Manager.
|
||||
|
||||
|
||||
|
||||
:mod:`Carbon.Mlte` --- MultiLingual Text Editor
|
||||
===============================================
|
||||
|
||||
.. module:: Carbon.Mlte
|
||||
:platform: Mac
|
||||
:synopsis: Interface to the MultiLingual Text Editor.
|
||||
|
||||
|
||||
|
||||
:mod:`Carbon.Qd` --- QuickDraw
|
||||
==============================
|
||||
|
||||
.. module:: Carbon.Qd
|
||||
:platform: Mac
|
||||
:synopsis: Interface to the QuickDraw toolbox.
|
||||
|
||||
|
||||
|
||||
:mod:`Carbon.Qdoffs` --- QuickDraw Offscreen
|
||||
============================================
|
||||
|
||||
.. module:: Carbon.Qdoffs
|
||||
:platform: Mac
|
||||
:synopsis: Interface to the QuickDraw Offscreen APIs.
|
||||
|
||||
|
||||
|
||||
:mod:`Carbon.Qt` --- QuickTime
|
||||
==============================
|
||||
|
||||
.. module:: Carbon.Qt
|
||||
:platform: Mac
|
||||
:synopsis: Interface to the QuickTime toolbox.
|
||||
|
||||
|
||||
|
||||
:mod:`Carbon.Res` --- Resource Manager and Handles
|
||||
==================================================
|
||||
|
||||
.. module:: Carbon.Res
|
||||
:platform: Mac
|
||||
:synopsis: Interface to the Resource Manager and Handles.
|
||||
|
||||
|
||||
|
||||
:mod:`Carbon.Scrap` --- Scrap Manager
|
||||
=====================================
|
||||
|
||||
.. module:: Carbon.Scrap
|
||||
:platform: Mac
|
||||
:synopsis: The Scrap Manager provides basic services for implementing cut & paste and
|
||||
clipboard operations.
|
||||
|
||||
|
||||
This module is only fully available on MacOS9 and earlier under classic PPC
|
||||
MacPython. Very limited functionality is available under Carbon MacPython.
|
||||
|
||||
.. index:: single: Scrap Manager
|
||||
|
||||
The Scrap Manager supports the simplest form of cut & paste operations on the
|
||||
Macintosh. It can be use for both inter- and intra-application clipboard
|
||||
operations.
|
||||
|
||||
The :mod:`Scrap` module provides low-level access to the functions of the Scrap
|
||||
Manager. It contains the following functions:
|
||||
|
||||
|
||||
.. function:: InfoScrap()
|
||||
|
||||
Return current information about the scrap. The information is encoded as a
|
||||
tuple containing the fields ``(size, handle, count, state, path)``.
|
||||
|
||||
+----------+---------------------------------------------+
|
||||
| Field | Meaning |
|
||||
+==========+=============================================+
|
||||
| *size* | Size of the scrap in bytes. |
|
||||
+----------+---------------------------------------------+
|
||||
| *handle* | Resource object representing the scrap. |
|
||||
+----------+---------------------------------------------+
|
||||
| *count* | Serial number of the scrap contents. |
|
||||
+----------+---------------------------------------------+
|
||||
| *state* | Integer; positive if in memory, ``0`` if on |
|
||||
| | disk, negative if uninitialized. |
|
||||
+----------+---------------------------------------------+
|
||||
| *path* | Filename of the scrap when stored on disk. |
|
||||
+----------+---------------------------------------------+
|
||||
|
||||
|
||||
.. seealso::
|
||||
|
||||
`Scrap Manager <http://developer.apple.com/documentation/mac/MoreToolbox/MoreToolbox-109.html>`_
|
||||
Apple's documentation for the Scrap Manager gives a lot of useful information
|
||||
about using the Scrap Manager in applications.
|
||||
|
||||
|
||||
|
||||
:mod:`Carbon.Snd` --- Sound Manager
|
||||
===================================
|
||||
|
||||
.. module:: Carbon.Snd
|
||||
:platform: Mac
|
||||
:synopsis: Interface to the Sound Manager.
|
||||
|
||||
|
||||
|
||||
:mod:`Carbon.TE` --- TextEdit
|
||||
=============================
|
||||
|
||||
.. module:: Carbon.TE
|
||||
:platform: Mac
|
||||
:synopsis: Interface to TextEdit.
|
||||
|
||||
|
||||
|
||||
:mod:`Carbon.Win` --- Window Manager
|
||||
====================================
|
||||
|
||||
.. module:: Carbon.Win
|
||||
:platform: Mac
|
||||
:synopsis: Interface to the Window Manager.
|
||||
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
|
||||
:mod:`ColorPicker` --- Color selection dialog
|
||||
=============================================
|
||||
|
||||
.. module:: ColorPicker
|
||||
:platform: Mac
|
||||
:synopsis: Interface to the standard color selection dialog.
|
||||
.. moduleauthor:: Just van Rossum <just@letterror.com>
|
||||
.. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org>
|
||||
|
||||
|
||||
The :mod:`ColorPicker` module provides access to the standard color picker
|
||||
dialog.
|
||||
|
||||
|
||||
.. function:: GetColor(prompt, rgb)
|
||||
|
||||
Show a standard color selection dialog and allow the user to select a color.
|
||||
The user is given instruction by the *prompt* string, and the default color is
|
||||
set to *rgb*. *rgb* must be a tuple giving the red, green, and blue components
|
||||
of the color. :func:`GetColor` returns a tuple giving the user's selected color
|
||||
and a flag indicating whether they accepted the selection of cancelled.
|
||||
|
|
@ -1,202 +0,0 @@
|
|||
|
||||
:mod:`EasyDialogs` --- Basic Macintosh dialogs
|
||||
==============================================
|
||||
|
||||
.. module:: EasyDialogs
|
||||
:platform: Mac
|
||||
:synopsis: Basic Macintosh dialogs.
|
||||
|
||||
|
||||
The :mod:`EasyDialogs` module contains some simple dialogs for the Macintosh.
|
||||
All routines take an optional resource ID parameter *id* with which one can
|
||||
override the :const:`DLOG` resource used for the dialog, provided that the
|
||||
dialog items correspond (both type and item number) to those in the default
|
||||
:const:`DLOG` resource. See source code for details.
|
||||
|
||||
The :mod:`EasyDialogs` module defines the following functions:
|
||||
|
||||
|
||||
.. function:: Message(str[, id[, ok]])
|
||||
|
||||
Displays a modal dialog with the message text *str*, which should be at most 255
|
||||
characters long. The button text defaults to "OK", but is set to the string
|
||||
argument *ok* if the latter is supplied. Control is returned when the user
|
||||
clicks the "OK" button.
|
||||
|
||||
|
||||
.. function:: AskString(prompt[, default[, id[, ok[, cancel]]]])
|
||||
|
||||
Asks the user to input a string value via a modal dialog. *prompt* is the prompt
|
||||
message, and the optional *default* supplies the initial value for the string
|
||||
(otherwise ``""`` is used). The text of the "OK" and "Cancel" buttons can be
|
||||
changed with the *ok* and *cancel* arguments. All strings can be at most 255
|
||||
bytes long. :func:`AskString` returns the string entered or :const:`None` in
|
||||
case the user cancelled.
|
||||
|
||||
|
||||
.. function:: AskPassword(prompt[, default[, id[, ok[, cancel]]]])
|
||||
|
||||
Asks the user to input a string value via a modal dialog. Like
|
||||
:func:`AskString`, but with the text shown as bullets. The arguments have the
|
||||
same meaning as for :func:`AskString`.
|
||||
|
||||
|
||||
.. function:: AskYesNoCancel(question[, default[, yes[, no[, cancel[, id]]]]])
|
||||
|
||||
Presents a dialog with prompt *question* and three buttons labelled "Yes", "No",
|
||||
and "Cancel". Returns ``1`` for "Yes", ``0`` for "No" and ``-1`` for "Cancel".
|
||||
The value of *default* (or ``0`` if *default* is not supplied) is returned when
|
||||
the :kbd:`RETURN` key is pressed. The text of the buttons can be changed with
|
||||
the *yes*, *no*, and *cancel* arguments; to prevent a button from appearing,
|
||||
supply ``""`` for the corresponding argument.
|
||||
|
||||
|
||||
.. function:: ProgressBar([title[, maxval[, label[, id]]]])
|
||||
|
||||
Displays a modeless progress-bar dialog. This is the constructor for the
|
||||
:class:`ProgressBar` class described below. *title* is the text string displayed
|
||||
(default "Working..."), *maxval* is the value at which progress is complete
|
||||
(default ``0``, indicating that an indeterminate amount of work remains to be
|
||||
done), and *label* is the text that is displayed above the progress bar itself.
|
||||
|
||||
|
||||
.. function:: GetArgv([optionlist[ commandlist[, addoldfile[, addnewfile[, addfolder[, id]]]]]])
|
||||
|
||||
Displays a dialog which aids the user in constructing a command-line argument
|
||||
list. Returns the list in ``sys.argv`` format, suitable for passing as an
|
||||
argument to :func:`getopt.getopt`. *addoldfile*, *addnewfile*, and *addfolder*
|
||||
are boolean arguments. When nonzero, they enable the user to insert into the
|
||||
command line paths to an existing file, a (possibly) not-yet-existent file, and
|
||||
a folder, respectively. (Note: Option arguments must appear in the command line
|
||||
before file and folder arguments in order to be recognized by
|
||||
:func:`getopt.getopt`.) Arguments containing spaces can be specified by
|
||||
enclosing them within single or double quotes. A :exc:`SystemExit` exception is
|
||||
raised if the user presses the "Cancel" button.
|
||||
|
||||
*optionlist* is a list that determines a popup menu from which the allowed
|
||||
options are selected. Its items can take one of two forms: *optstr* or
|
||||
``(optstr, descr)``. When present, *descr* is a short descriptive string that
|
||||
is displayed in the dialog while this option is selected in the popup menu. The
|
||||
correspondence between *optstr*\s and command-line arguments is:
|
||||
|
||||
+----------------------+------------------------------------------+
|
||||
| *optstr* format | Command-line format |
|
||||
+======================+==========================================+
|
||||
| ``x`` | :option:`-x` (short option) |
|
||||
+----------------------+------------------------------------------+
|
||||
| ``x:`` or ``x=`` | :option:`-x` (short option with value) |
|
||||
+----------------------+------------------------------------------+
|
||||
| ``xyz`` | :option:`--xyz` (long option) |
|
||||
+----------------------+------------------------------------------+
|
||||
| ``xyz:`` or ``xyz=`` | :option:`--xyz` (long option with value) |
|
||||
+----------------------+------------------------------------------+
|
||||
|
||||
*commandlist* is a list of items of the form *cmdstr* or ``(cmdstr, descr)``,
|
||||
where *descr* is as above. The *cmdstr*s will appear in a popup menu. When
|
||||
chosen, the text of *cmdstr* will be appended to the command line as is, except
|
||||
that a trailing ``':'`` or ``'='`` (if present) will be trimmed off.
|
||||
|
||||
|
||||
.. function:: AskFileForOpen( [message] [, typeList] [, defaultLocation] [, defaultOptionFlags] [, location] [, clientName] [, windowTitle] [, actionButtonLabel] [, cancelButtonLabel] [, preferenceKey] [, popupExtension] [, eventProc] [, previewProc] [, filterProc] [, wanted] )
|
||||
|
||||
Post a dialog asking the user for a file to open, and return the file selected
|
||||
or :const:`None` if the user cancelled. *message* is a text message to display,
|
||||
*typeList* is a list of 4-char filetypes allowable, *defaultLocation* is the
|
||||
pathname, :class:`FSSpec` or :class:`FSRef` of the folder to show initially,
|
||||
*location* is the ``(x, y)`` position on the screen where the dialog is shown,
|
||||
*actionButtonLabel* is a string to show instead of "Open" in the OK button,
|
||||
*cancelButtonLabel* is a string to show instead of "Cancel" in the cancel
|
||||
button, *wanted* is the type of value wanted as a return: :class:`str`,
|
||||
:class:`FSSpec`, :class:`FSRef` and subtypes thereof are
|
||||
acceptable.
|
||||
|
||||
.. index:: single: Navigation Services
|
||||
|
||||
For a description of the other arguments please see the Apple Navigation
|
||||
Services documentation and the :mod:`EasyDialogs` source code.
|
||||
|
||||
|
||||
.. function:: AskFileForSave( [message] [, savedFileName] [, defaultLocation] [, defaultOptionFlags] [, location] [, clientName] [, windowTitle] [, actionButtonLabel] [, cancelButtonLabel] [, preferenceKey] [, popupExtension] [, fileType] [, fileCreator] [, eventProc] [, wanted] )
|
||||
|
||||
Post a dialog asking the user for a file to save to, and return the file
|
||||
selected or :const:`None` if the user cancelled. *savedFileName* is the default
|
||||
for the file name to save to (the return value). See :func:`AskFileForOpen` for
|
||||
a description of the other arguments.
|
||||
|
||||
|
||||
.. function:: AskFolder( [message] [, defaultLocation] [, defaultOptionFlags] [, location] [, clientName] [, windowTitle] [, actionButtonLabel] [, cancelButtonLabel] [, preferenceKey] [, popupExtension] [, eventProc] [, filterProc] [, wanted] )
|
||||
|
||||
Post a dialog asking the user to select a folder, and return the folder selected
|
||||
or :const:`None` if the user cancelled. See :func:`AskFileForOpen` for a
|
||||
description of the arguments.
|
||||
|
||||
|
||||
.. seealso::
|
||||
|
||||
`Navigation Services Reference <http://developer.apple.com/documentation/Carbon/Reference/Navigation_Services_Ref/>`_
|
||||
Programmer's reference documentation for the Navigation Services, a part of the
|
||||
Carbon framework.
|
||||
|
||||
|
||||
.. _progressbar-objects:
|
||||
|
||||
ProgressBar Objects
|
||||
-------------------
|
||||
|
||||
:class:`ProgressBar` objects provide support for modeless progress-bar dialogs.
|
||||
Both determinate (thermometer style) and indeterminate (barber-pole style)
|
||||
progress bars are supported. The bar will be determinate if its maximum value
|
||||
is greater than zero; otherwise it will be indeterminate.
|
||||
|
||||
The dialog is displayed immediately after creation. If the dialog's "Cancel"
|
||||
button is pressed, or if :kbd:`Cmd-.` or :kbd:`ESC` is typed, the dialog window
|
||||
is hidden and :exc:`KeyboardInterrupt` is raised (but note that this response
|
||||
does not occur until the progress bar is next updated, typically via a call to
|
||||
:meth:`inc` or :meth:`set`). Otherwise, the bar remains visible until the
|
||||
:class:`ProgressBar` object is discarded.
|
||||
|
||||
:class:`ProgressBar` objects possess the following attributes and methods:
|
||||
|
||||
|
||||
.. attribute:: ProgressBar.curval
|
||||
|
||||
The current value (of type integer) of the progress bar. The
|
||||
normal access methods coerce :attr:`curval` between ``0`` and :attr:`maxval`.
|
||||
This attribute should not be altered directly.
|
||||
|
||||
|
||||
.. attribute:: ProgressBar.maxval
|
||||
|
||||
The maximum value (of type integer) of the progress bar; the
|
||||
progress bar (thermometer style) is full when :attr:`curval` equals
|
||||
:attr:`maxval`. If :attr:`maxval` is ``0``, the bar will be indeterminate
|
||||
(barber-pole). This attribute should not be altered directly.
|
||||
|
||||
|
||||
.. method:: ProgressBar.title([newstr])
|
||||
|
||||
Sets the text in the title bar of the progress dialog to *newstr*.
|
||||
|
||||
|
||||
.. method:: ProgressBar.label([newstr])
|
||||
|
||||
Sets the text in the progress box of the progress dialog to *newstr*.
|
||||
|
||||
|
||||
.. method:: ProgressBar.set(value[, max])
|
||||
|
||||
Sets the progress bar's :attr:`curval` to *value*, and also :attr:`maxval` to
|
||||
*max* if the latter is provided. *value* is first coerced between 0 and
|
||||
:attr:`maxval`. The thermometer bar is updated to reflect the changes,
|
||||
including a change from indeterminate to determinate or vice versa.
|
||||
|
||||
|
||||
.. method:: ProgressBar.inc([n])
|
||||
|
||||
Increments the progress bar's :attr:`curval` by *n*, or by ``1`` if *n* is not
|
||||
provided. (Note that *n* may be negative, in which case the effect is a
|
||||
decrement.) The progress bar is updated to reflect the change. If the bar is
|
||||
indeterminate, this causes one "spin" of the barber pole. The resulting
|
||||
:attr:`curval` is coerced between 0 and :attr:`maxval` if incrementing causes it
|
||||
to fall outside this range.
|
||||
|
|
@ -1,335 +0,0 @@
|
|||
|
||||
:mod:`FrameWork` --- Interactive application framework
|
||||
======================================================
|
||||
|
||||
.. module:: FrameWork
|
||||
:platform: Mac
|
||||
:synopsis: Interactive application framework.
|
||||
|
||||
|
||||
The :mod:`FrameWork` module contains classes that together provide a framework
|
||||
for an interactive Macintosh application. The programmer builds an application
|
||||
by creating subclasses that override various methods of the bases classes,
|
||||
thereby implementing the functionality wanted. Overriding functionality can
|
||||
often be done on various different levels, i.e. to handle clicks in a single
|
||||
dialog window in a non-standard way it is not necessary to override the complete
|
||||
event handling.
|
||||
|
||||
Work on the :mod:`FrameWork` has pretty much stopped, now that :mod:`PyObjC` is
|
||||
available for full Cocoa access from Python, and the documentation describes
|
||||
only the most important functionality, and not in the most logical manner at
|
||||
that. Examine the source or the examples for more details. The following are
|
||||
some comments posted on the MacPython newsgroup about the strengths and
|
||||
limitations of :mod:`FrameWork`:
|
||||
|
||||
|
||||
.. epigraph::
|
||||
|
||||
The strong point of :mod:`FrameWork` is that it allows you to break into the
|
||||
control-flow at many different places. :mod:`W`, for instance, uses a different
|
||||
way to enable/disable menus and that plugs right in leaving the rest intact.
|
||||
The weak points of :mod:`FrameWork` are that it has no abstract command
|
||||
interface (but that shouldn't be difficult), that its dialog support is minimal
|
||||
and that its control/toolbar support is non-existent.
|
||||
|
||||
The :mod:`FrameWork` module defines the following functions:
|
||||
|
||||
|
||||
.. function:: Application()
|
||||
|
||||
An object representing the complete application. See below for a description of
|
||||
the methods. The default :meth:`__init__` routine creates an empty window
|
||||
dictionary and a menu bar with an apple menu.
|
||||
|
||||
|
||||
.. function:: MenuBar()
|
||||
|
||||
An object representing the menubar. This object is usually not created by the
|
||||
user.
|
||||
|
||||
|
||||
.. function:: Menu(bar, title[, after])
|
||||
|
||||
An object representing a menu. Upon creation you pass the ``MenuBar`` the menu
|
||||
appears in, the *title* string and a position (1-based) *after* where the menu
|
||||
should appear (default: at the end).
|
||||
|
||||
|
||||
.. function:: MenuItem(menu, title[, shortcut, callback])
|
||||
|
||||
Create a menu item object. The arguments are the menu to create, the item title
|
||||
string and optionally the keyboard shortcut and a callback routine. The callback
|
||||
is called with the arguments menu-id, item number within menu (1-based), current
|
||||
front window and the event record.
|
||||
|
||||
Instead of a callable object the callback can also be a string. In this case
|
||||
menu selection causes the lookup of a method in the topmost window and the
|
||||
application. The method name is the callback string with ``'domenu_'``
|
||||
prepended.
|
||||
|
||||
Calling the ``MenuBar`` :meth:`fixmenudimstate` method sets the correct dimming
|
||||
for all menu items based on the current front window.
|
||||
|
||||
|
||||
.. function:: Separator(menu)
|
||||
|
||||
Add a separator to the end of a menu.
|
||||
|
||||
|
||||
.. function:: SubMenu(menu, label)
|
||||
|
||||
Create a submenu named *label* under menu *menu*. The menu object is returned.
|
||||
|
||||
|
||||
.. function:: Window(parent)
|
||||
|
||||
Creates a (modeless) window. *Parent* is the application object to which the
|
||||
window belongs. The window is not displayed until later.
|
||||
|
||||
|
||||
.. function:: DialogWindow(parent)
|
||||
|
||||
Creates a modeless dialog window.
|
||||
|
||||
|
||||
.. function:: windowbounds(width, height)
|
||||
|
||||
Return a ``(left, top, right, bottom)`` tuple suitable for creation of a window
|
||||
of given width and height. The window will be staggered with respect to previous
|
||||
windows, and an attempt is made to keep the whole window on-screen. However, the
|
||||
window will however always be the exact size given, so parts may be offscreen.
|
||||
|
||||
|
||||
.. function:: setwatchcursor()
|
||||
|
||||
Set the mouse cursor to a watch.
|
||||
|
||||
|
||||
.. function:: setarrowcursor()
|
||||
|
||||
Set the mouse cursor to an arrow.
|
||||
|
||||
|
||||
.. _application-objects:
|
||||
|
||||
Application Objects
|
||||
-------------------
|
||||
|
||||
Application objects have the following methods, among others:
|
||||
|
||||
|
||||
.. method:: Application.makeusermenus()
|
||||
|
||||
Override this method if you need menus in your application. Append the menus to
|
||||
the attribute :attr:`menubar`.
|
||||
|
||||
|
||||
.. method:: Application.getabouttext()
|
||||
|
||||
Override this method to return a text string describing your application.
|
||||
Alternatively, override the :meth:`do_about` method for more elaborate "about"
|
||||
messages.
|
||||
|
||||
|
||||
.. method:: Application.mainloop([mask[, wait]])
|
||||
|
||||
This routine is the main event loop, call it to set your application rolling.
|
||||
*Mask* is the mask of events you want to handle, *wait* is the number of ticks
|
||||
you want to leave to other concurrent application (default 0, which is probably
|
||||
not a good idea). While raising *self* to exit the mainloop is still supported
|
||||
it is not recommended: call ``self._quit()`` instead.
|
||||
|
||||
The event loop is split into many small parts, each of which can be overridden.
|
||||
The default methods take care of dispatching events to windows and dialogs,
|
||||
handling drags and resizes, Apple Events, events for non-FrameWork windows, etc.
|
||||
|
||||
In general, all event handlers should return ``1`` if the event is fully handled
|
||||
and ``0`` otherwise (because the front window was not a FrameWork window, for
|
||||
instance). This is needed so that update events and such can be passed on to
|
||||
other windows like the Sioux console window. Calling :func:`MacOS.HandleEvent`
|
||||
is not allowed within *our_dispatch* or its callees, since this may result in an
|
||||
infinite loop if the code is called through the Python inner-loop event handler.
|
||||
|
||||
|
||||
.. method:: Application.asyncevents(onoff)
|
||||
|
||||
Call this method with a nonzero parameter to enable asynchronous event handling.
|
||||
This will tell the inner interpreter loop to call the application event handler
|
||||
*async_dispatch* whenever events are available. This will cause FrameWork window
|
||||
updates and the user interface to remain working during long computations, but
|
||||
will slow the interpreter down and may cause surprising results in non-reentrant
|
||||
code (such as FrameWork itself). By default *async_dispatch* will immediately
|
||||
call *our_dispatch* but you may override this to handle only certain events
|
||||
asynchronously. Events you do not handle will be passed to Sioux and such.
|
||||
|
||||
The old on/off value is returned.
|
||||
|
||||
|
||||
.. method:: Application._quit()
|
||||
|
||||
Terminate the running :meth:`mainloop` call at the next convenient moment.
|
||||
|
||||
|
||||
.. method:: Application.do_char(c, event)
|
||||
|
||||
The user typed character *c*. The complete details of the event can be found in
|
||||
the *event* structure. This method can also be provided in a ``Window`` object,
|
||||
which overrides the application-wide handler if the window is frontmost.
|
||||
|
||||
|
||||
.. method:: Application.do_dialogevent(event)
|
||||
|
||||
Called early in the event loop to handle modeless dialog events. The default
|
||||
method simply dispatches the event to the relevant dialog (not through the
|
||||
``DialogWindow`` object involved). Override if you need special handling of
|
||||
dialog events (keyboard shortcuts, etc).
|
||||
|
||||
|
||||
.. method:: Application.idle(event)
|
||||
|
||||
Called by the main event loop when no events are available. The null-event is
|
||||
passed (so you can look at mouse position, etc).
|
||||
|
||||
|
||||
.. _window-objects:
|
||||
|
||||
Window Objects
|
||||
--------------
|
||||
|
||||
Window objects have the following methods, among others:
|
||||
|
||||
|
||||
.. method:: Window.open()
|
||||
|
||||
Override this method to open a window. Store the MacOS window-id in
|
||||
:attr:`self.wid` and call the :meth:`do_postopen` method to register the window
|
||||
with the parent application.
|
||||
|
||||
|
||||
.. method:: Window.close()
|
||||
|
||||
Override this method to do any special processing on window close. Call the
|
||||
:meth:`do_postclose` method to cleanup the parent state.
|
||||
|
||||
|
||||
.. method:: Window.do_postresize(width, height, macoswindowid)
|
||||
|
||||
Called after the window is resized. Override if more needs to be done than
|
||||
calling ``InvalRect``.
|
||||
|
||||
|
||||
.. method:: Window.do_contentclick(local, modifiers, event)
|
||||
|
||||
The user clicked in the content part of a window. The arguments are the
|
||||
coordinates (window-relative), the key modifiers and the raw event.
|
||||
|
||||
|
||||
.. method:: Window.do_update(macoswindowid, event)
|
||||
|
||||
An update event for the window was received. Redraw the window.
|
||||
|
||||
|
||||
.. method:: Window.do_activate(activate, event)
|
||||
|
||||
The window was activated (``activate == 1``) or deactivated (``activate == 0``).
|
||||
Handle things like focus highlighting, etc.
|
||||
|
||||
|
||||
.. _controlswindow-object:
|
||||
|
||||
ControlsWindow Object
|
||||
---------------------
|
||||
|
||||
ControlsWindow objects have the following methods besides those of ``Window``
|
||||
objects:
|
||||
|
||||
|
||||
.. method:: ControlsWindow.do_controlhit(window, control, pcode, event)
|
||||
|
||||
Part *pcode* of control *control* was hit by the user. Tracking and such has
|
||||
already been taken care of.
|
||||
|
||||
|
||||
.. _scrolledwindow-object:
|
||||
|
||||
ScrolledWindow Object
|
||||
---------------------
|
||||
|
||||
ScrolledWindow objects are ControlsWindow objects with the following extra
|
||||
methods:
|
||||
|
||||
|
||||
.. method:: ScrolledWindow.scrollbars([wantx[, wanty]])
|
||||
|
||||
Create (or destroy) horizontal and vertical scrollbars. The arguments specify
|
||||
which you want (default: both). The scrollbars always have minimum ``0`` and
|
||||
maximum ``32767``.
|
||||
|
||||
|
||||
.. method:: ScrolledWindow.getscrollbarvalues()
|
||||
|
||||
You must supply this method. It should return a tuple ``(x, y)`` giving the
|
||||
current position of the scrollbars (between ``0`` and ``32767``). You can return
|
||||
``None`` for either to indicate the whole document is visible in that direction.
|
||||
|
||||
|
||||
.. method:: ScrolledWindow.updatescrollbars()
|
||||
|
||||
Call this method when the document has changed. It will call
|
||||
:meth:`getscrollbarvalues` and update the scrollbars.
|
||||
|
||||
|
||||
.. method:: ScrolledWindow.scrollbar_callback(which, what, value)
|
||||
|
||||
Supplied by you and called after user interaction. *which* will be ``'x'`` or
|
||||
``'y'``, *what* will be ``'-'``, ``'--'``, ``'set'``, ``'++'`` or ``'+'``. For
|
||||
``'set'``, *value* will contain the new scrollbar position.
|
||||
|
||||
|
||||
.. method:: ScrolledWindow.scalebarvalues(absmin, absmax, curmin, curmax)
|
||||
|
||||
Auxiliary method to help you calculate values to return from
|
||||
:meth:`getscrollbarvalues`. You pass document minimum and maximum value and
|
||||
topmost (leftmost) and bottommost (rightmost) visible values and it returns the
|
||||
correct number or ``None``.
|
||||
|
||||
|
||||
.. method:: ScrolledWindow.do_activate(onoff, event)
|
||||
|
||||
Takes care of dimming/highlighting scrollbars when a window becomes frontmost.
|
||||
If you override this method, call this one at the end of your method.
|
||||
|
||||
|
||||
.. method:: ScrolledWindow.do_postresize(width, height, window)
|
||||
|
||||
Moves scrollbars to the correct position. Call this method initially if you
|
||||
override it.
|
||||
|
||||
|
||||
.. method:: ScrolledWindow.do_controlhit(window, control, pcode, event)
|
||||
|
||||
Handles scrollbar interaction. If you override it call this method first, a
|
||||
nonzero return value indicates the hit was in the scrollbars and has been
|
||||
handled.
|
||||
|
||||
|
||||
.. _dialogwindow-objects:
|
||||
|
||||
DialogWindow Objects
|
||||
--------------------
|
||||
|
||||
DialogWindow objects have the following methods besides those of ``Window``
|
||||
objects:
|
||||
|
||||
|
||||
.. method:: DialogWindow.open(resid)
|
||||
|
||||
Create the dialog window, from the DLOG resource with id *resid*. The dialog
|
||||
object is stored in :attr:`self.wid`.
|
||||
|
||||
|
||||
.. method:: DialogWindow.do_itemhit(item, event)
|
||||
|
||||
Item number *item* was hit. You are responsible for redrawing toggle buttons,
|
||||
etc.
|
||||
|
|
@ -1,119 +0,0 @@
|
|||
|
||||
:mod:`ic` --- Access to the Mac OS X Internet Config
|
||||
====================================================
|
||||
|
||||
.. module:: ic
|
||||
:platform: Mac
|
||||
:synopsis: Access to the Mac OS X Internet Config.
|
||||
|
||||
|
||||
This module provides access to various internet-related preferences set through
|
||||
:program:`System Preferences` or the :program:`Finder`.
|
||||
|
||||
.. index:: module: icglue
|
||||
|
||||
There is a low-level companion module :mod:`icglue` which provides the basic
|
||||
Internet Config access functionality. This low-level module is not documented,
|
||||
but the docstrings of the routines document the parameters and the routine names
|
||||
are the same as for the Pascal or C API to Internet Config, so the standard IC
|
||||
programmers' documentation can be used if this module is needed.
|
||||
|
||||
The :mod:`ic` module defines the :exc:`error` exception and symbolic names for
|
||||
all error codes Internet Config can produce; see the source for details.
|
||||
|
||||
|
||||
.. exception:: error
|
||||
|
||||
Exception raised on errors in the :mod:`ic` module.
|
||||
|
||||
The :mod:`ic` module defines the following class and function:
|
||||
|
||||
|
||||
.. class:: IC([signature[, ic]])
|
||||
|
||||
Create an Internet Config object. The signature is a 4-character creator code of
|
||||
the current application (default ``'Pyth'``) which may influence some of ICs
|
||||
settings. The optional *ic* argument is a low-level ``icglue.icinstance``
|
||||
created beforehand, this may be useful if you want to get preferences from a
|
||||
different config file, etc.
|
||||
|
||||
|
||||
.. function:: launchurl(url[, hint])
|
||||
parseurl(data[, start[, end[, hint]]])
|
||||
mapfile(file)
|
||||
maptypecreator(type, creator[, filename])
|
||||
settypecreator(file)
|
||||
|
||||
These functions are "shortcuts" to the methods of the same name, described
|
||||
below.
|
||||
|
||||
|
||||
IC Objects
|
||||
----------
|
||||
|
||||
:class:`IC` objects have a mapping interface, hence to obtain the mail address
|
||||
you simply get ``ic['MailAddress']``. Assignment also works, and changes the
|
||||
option in the configuration file.
|
||||
|
||||
The module knows about various datatypes, and converts the internal IC
|
||||
representation to a "logical" Python data structure. Running the :mod:`ic`
|
||||
module standalone will run a test program that lists all keys and values in your
|
||||
IC database, this will have to serve as documentation.
|
||||
|
||||
If the module does not know how to represent the data it returns an instance of
|
||||
the ``ICOpaqueData`` type, with the raw data in its :attr:`data` attribute.
|
||||
Objects of this type are also acceptable values for assignment.
|
||||
|
||||
Besides the dictionary interface, :class:`IC` objects have the following
|
||||
methods:
|
||||
|
||||
|
||||
.. method:: IC.launchurl(url[, hint])
|
||||
|
||||
Parse the given URL, launch the correct application and pass it the URL. The
|
||||
optional *hint* can be a scheme name such as ``'mailto:'``, in which case
|
||||
incomplete URLs are completed with this scheme. If *hint* is not provided,
|
||||
incomplete URLs are invalid.
|
||||
|
||||
|
||||
.. method:: IC.parseurl(data[, start[, end[, hint]]])
|
||||
|
||||
Find an URL somewhere in *data* and return start position, end position and the
|
||||
URL. The optional *start* and *end* can be used to limit the search, so for
|
||||
instance if a user clicks in a long text field you can pass the whole text field
|
||||
and the click-position in *start* and this routine will return the whole URL in
|
||||
which the user clicked. As above, *hint* is an optional scheme used to complete
|
||||
incomplete URLs.
|
||||
|
||||
|
||||
.. method:: IC.mapfile(file)
|
||||
|
||||
Return the mapping entry for the given *file*, which can be passed as either a
|
||||
filename or an :func:`FSSpec` result, and which need not exist.
|
||||
|
||||
The mapping entry is returned as a tuple ``(version, type, creator, postcreator,
|
||||
flags, extension, appname, postappname, mimetype, entryname)``, where *version*
|
||||
is the entry version number, *type* is the 4-character filetype, *creator* is
|
||||
the 4-character creator type, *postcreator* is the 4-character creator code of
|
||||
an optional application to post-process the file after downloading, *flags* are
|
||||
various bits specifying whether to transfer in binary or ascii and such,
|
||||
*extension* is the filename extension for this file type, *appname* is the
|
||||
printable name of the application to which this file belongs, *postappname* is
|
||||
the name of the postprocessing application, *mimetype* is the MIME type of this
|
||||
file and *entryname* is the name of this entry.
|
||||
|
||||
|
||||
.. method:: IC.maptypecreator(type, creator[, filename])
|
||||
|
||||
Return the mapping entry for files with given 4-character *type* and *creator*
|
||||
codes. The optional *filename* may be specified to further help finding the
|
||||
correct entry (if the creator code is ``'????'``, for instance).
|
||||
|
||||
The mapping entry is returned in the same format as for *mapfile*.
|
||||
|
||||
|
||||
.. method:: IC.settypecreator(file)
|
||||
|
||||
Given an existing *file*, specified either as a filename or as an :func:`FSSpec`
|
||||
result, set its creator and type correctly based on its extension. The finder
|
||||
is told about the change, so the finder icon will be updated quickly.
|
|
@ -73,6 +73,4 @@ the `Python Package Index <http://pypi.python.org/pypi>`_.
|
|||
misc.rst
|
||||
windows.rst
|
||||
unix.rst
|
||||
mac.rst
|
||||
macosa.rst
|
||||
undoc.rst
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
.. _mac-specific-services:
|
||||
|
||||
*************************
|
||||
MacOS X specific services
|
||||
*************************
|
||||
|
||||
This chapter describes modules that are only available on the Mac OS X platform.
|
||||
|
||||
See the chapters :ref:`mac-scripting` and :ref:`undoc-mac-modules` for more
|
||||
modules, and the HOWTO :ref:`using-on-mac` for a general introduction to
|
||||
Mac-specific Python programming.
|
||||
|
||||
|
||||
.. toctree::
|
||||
|
||||
ic.rst
|
||||
macos.rst
|
||||
macostools.rst
|
||||
easydialogs.rst
|
||||
framework.rst
|
||||
autogil.rst
|
||||
carbon.rst
|
||||
colorpicker.rst
|
|
@ -1,93 +0,0 @@
|
|||
|
||||
:mod:`MacOS` --- Access to Mac OS interpreter features
|
||||
======================================================
|
||||
|
||||
.. module:: MacOS
|
||||
:platform: Mac
|
||||
:synopsis: Access to Mac OS-specific interpreter features.
|
||||
|
||||
|
||||
This module provides access to MacOS specific functionality in the Python
|
||||
interpreter, such as how the interpreter eventloop functions and the like. Use
|
||||
with care.
|
||||
|
||||
Note the capitalization of the module name; this is a historical artifact.
|
||||
|
||||
|
||||
.. data:: runtimemodel
|
||||
|
||||
Always ``'macho'``.
|
||||
|
||||
|
||||
.. data:: linkmodel
|
||||
|
||||
The way the interpreter has been linked. As extension modules may be
|
||||
incompatible between linking models, packages could use this information to give
|
||||
more decent error messages. The value is one of ``'static'`` for a statically
|
||||
linked Python, ``'framework'`` for Python in a Mac OS X framework, ``'shared'``
|
||||
for Python in a standard Unix shared library. Older Pythons could also have the
|
||||
value ``'cfm'`` for Mac OS 9-compatible Python.
|
||||
|
||||
|
||||
.. exception:: Error
|
||||
|
||||
.. index:: module: macerrors
|
||||
|
||||
This exception is raised on MacOS generated errors, either from functions in
|
||||
this module or from other mac-specific modules like the toolbox interfaces. The
|
||||
arguments are the integer error code (the :cdata:`OSErr` value) and a textual
|
||||
description of the error code. Symbolic names for all known error codes are
|
||||
defined in the standard module :mod:`macerrors`.
|
||||
|
||||
|
||||
.. function:: GetErrorString(errno)
|
||||
|
||||
Return the textual description of MacOS error code *errno*.
|
||||
|
||||
|
||||
.. function:: DebugStr(message [, object])
|
||||
|
||||
On Mac OS X the string is simply printed to stderr (on older Mac OS systems more
|
||||
elaborate functionality was available), but it provides a convenient location to
|
||||
attach a breakpoint in a low-level debugger like :program:`gdb`.
|
||||
|
||||
|
||||
.. function:: SysBeep()
|
||||
|
||||
Ring the bell.
|
||||
|
||||
|
||||
.. function:: GetTicks()
|
||||
|
||||
Get the number of clock ticks (1/60th of a second) since system boot.
|
||||
|
||||
|
||||
.. function:: GetCreatorAndType(file)
|
||||
|
||||
Return the file creator and file type as two four-character strings. The *file*
|
||||
parameter can be a pathname or an ``FSSpec`` or ``FSRef`` object.
|
||||
|
||||
|
||||
.. function:: SetCreatorAndType(file, creator, type)
|
||||
|
||||
Set the file creator and file type. The *file* parameter can be a pathname or an
|
||||
``FSSpec`` or ``FSRef`` object. *creator* and *type* must be four character
|
||||
strings.
|
||||
|
||||
|
||||
.. function:: openrf(name [, mode])
|
||||
|
||||
Open the resource fork of a file. Arguments are the same as for the built-in
|
||||
function :func:`open`. The object returned has file-like semantics, but it is
|
||||
not a Python file object, so there may be subtle differences.
|
||||
|
||||
|
||||
.. function:: WMAvailable()
|
||||
|
||||
Checks whether the current process has access to the window manager. The method
|
||||
will return ``False`` if the window manager is not available, for instance when
|
||||
running on Mac OS X Server or when logged in via ssh, or when the current
|
||||
interpreter is not running from a fullblown application bundle. A script runs
|
||||
from an application bundle either when it has been started with
|
||||
:program:`pythonw` instead of :program:`python` or when running as an applet.
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
|
||||
.. _mac-scripting:
|
||||
|
||||
*********************
|
||||
MacPython OSA Modules
|
||||
*********************
|
||||
|
||||
This chapter describes the current implementation of the Open Scripting
|
||||
Architecure (OSA, also commonly referred to as AppleScript) for Python, allowing
|
||||
you to control scriptable applications from your Python program, and with a
|
||||
fairly pythonic interface. Development on this set of modules has stopped, and a
|
||||
replacement is expected for Python 2.5.
|
||||
|
||||
For a description of the various components of AppleScript and OSA, and to get
|
||||
an understanding of the architecture and terminology, you should read Apple's
|
||||
documentation. The "Applescript Language Guide" explains the conceptual model
|
||||
and the terminology, and documents the standard suite. The "Open Scripting
|
||||
Architecture" document explains how to use OSA from an application programmers
|
||||
point of view. In the Apple Help Viewer these books are located in the Developer
|
||||
Documentation, Core Technologies section.
|
||||
|
||||
As an example of scripting an application, the following piece of AppleScript
|
||||
will get the name of the frontmost :program:`Finder` window and print it::
|
||||
|
||||
tell application "Finder"
|
||||
get name of window 1
|
||||
end tell
|
||||
|
||||
In Python, the following code fragment will do the same::
|
||||
|
||||
import Finder
|
||||
|
||||
f = Finder.Finder()
|
||||
print(f.get(f.window(1).name))
|
||||
|
||||
As distributed the Python library includes packages that implement the standard
|
||||
suites, plus packages that interface to a small number of common applications.
|
||||
|
||||
To send AppleEvents to an application you must first create the Python package
|
||||
interfacing to the terminology of the application (what :program:`Script Editor`
|
||||
calls the "Dictionary"). This can be done from within the :program:`PythonIDE`
|
||||
or by running the :file:`gensuitemodule.py` module as a standalone program from
|
||||
the command line.
|
||||
|
||||
The generated output is a package with a number of modules, one for every suite
|
||||
used in the program plus an :mod:`__init__` module to glue it all together. The
|
||||
Python inheritance graph follows the AppleScript inheritance graph, so if a
|
||||
program's dictionary specifies that it includes support for the Standard Suite,
|
||||
but extends one or two verbs with extra arguments then the output suite will
|
||||
contain a module :mod:`Standard_Suite` that imports and re-exports everything
|
||||
from :mod:`StdSuites.Standard_Suite` but overrides the methods that have extra
|
||||
functionality. The output of :mod:`gensuitemodule` is pretty readable, and
|
||||
contains the documentation that was in the original AppleScript dictionary in
|
||||
Python docstrings, so reading it is a good source of documentation.
|
||||
|
||||
The output package implements a main class with the same name as the package
|
||||
which contains all the AppleScript verbs as methods, with the direct object as
|
||||
the first argument and all optional parameters as keyword arguments. AppleScript
|
||||
classes are also implemented as Python classes, as are comparisons and all the
|
||||
other thingies.
|
||||
|
||||
The main Python class implementing the verbs also allows access to the
|
||||
properties and elements declared in the AppleScript class "application". In the
|
||||
current release that is as far as the object orientation goes, so in the example
|
||||
above we need to use ``f.get(f.window(1).name)`` instead of the more Pythonic
|
||||
``f.window(1).name.get()``.
|
||||
|
||||
If an AppleScript identifier is not a Python identifier the name is mangled
|
||||
according to a small number of rules:
|
||||
|
||||
* spaces are replaced with underscores
|
||||
|
||||
* other non-alphanumeric characters are replaced with ``_xx_`` where ``xx`` is
|
||||
the hexadecimal character value
|
||||
|
||||
* any Python reserved word gets an underscore appended
|
||||
|
||||
Python also has support for creating scriptable applications in Python, but The
|
||||
following modules are relevant to MacPython AppleScript support:
|
||||
|
||||
.. toctree::
|
||||
|
||||
gensuitemodule.rst
|
||||
aetools.rst
|
||||
aepack.rst
|
||||
aetypes.rst
|
||||
miniaeframe.rst
|
||||
|
||||
|
||||
In addition, support modules have been pre-generated for :mod:`Finder`,
|
||||
:mod:`Terminal`, :mod:`Explorer`, :mod:`Netscape`, :mod:`CodeWarrior`,
|
||||
:mod:`SystemEvents` and :mod:`StdSuites`.
|
|
@ -1,115 +0,0 @@
|
|||
|
||||
:mod:`macostools` --- Convenience routines for file manipulation
|
||||
================================================================
|
||||
|
||||
.. module:: macostools
|
||||
:platform: Mac
|
||||
:synopsis: Convenience routines for file manipulation.
|
||||
|
||||
|
||||
This module contains some convenience routines for file-manipulation on the
|
||||
Macintosh. All file parameters can be specified as pathnames, :class:`FSRef` or
|
||||
:class:`FSSpec` objects. This module expects a filesystem which supports forked
|
||||
files, so it should not be used on UFS partitions.
|
||||
|
||||
The :mod:`macostools` module defines the following functions:
|
||||
|
||||
|
||||
.. function:: copy(src, dst[, createpath[, copytimes]])
|
||||
|
||||
Copy file *src* to *dst*. If *createpath* is non-zero the folders leading to
|
||||
*dst* are created if necessary. The method copies data and resource fork and
|
||||
some finder information (creator, type, flags) and optionally the creation,
|
||||
modification and backup times (default is to copy them). Custom icons, comments
|
||||
and icon position are not copied.
|
||||
|
||||
|
||||
.. function:: copytree(src, dst)
|
||||
|
||||
Recursively copy a file tree from *src* to *dst*, creating folders as needed.
|
||||
*src* and *dst* should be specified as pathnames.
|
||||
|
||||
|
||||
.. function:: mkalias(src, dst)
|
||||
|
||||
Create a finder alias *dst* pointing to *src*.
|
||||
|
||||
|
||||
.. function:: touched(dst)
|
||||
|
||||
Tell the finder that some bits of finder-information such as creator or type for
|
||||
file *dst* has changed. The file can be specified by pathname or fsspec. This
|
||||
call should tell the finder to redraw the files icon.
|
||||
|
||||
.. deprecated:: 2.6
|
||||
The function is a no-op on OS X.
|
||||
|
||||
|
||||
.. data:: BUFSIZ
|
||||
|
||||
The buffer size for ``copy``, default 1 megabyte.
|
||||
|
||||
Note that the process of creating finder aliases is not specified in the Apple
|
||||
documentation. Hence, aliases created with :func:`mkalias` could conceivably
|
||||
have incompatible behaviour in some cases.
|
||||
|
||||
|
||||
:mod:`findertools` --- The :program:`finder`'s Apple Events interface
|
||||
=====================================================================
|
||||
|
||||
.. module:: findertools
|
||||
:platform: Mac
|
||||
:synopsis: Wrappers around the finder's Apple Events interface.
|
||||
|
||||
|
||||
.. index:: single: AppleEvents
|
||||
|
||||
This module contains routines that give Python programs access to some
|
||||
functionality provided by the finder. They are implemented as wrappers around
|
||||
the AppleEvent interface to the finder.
|
||||
|
||||
All file and folder parameters can be specified either as full pathnames, or as
|
||||
:class:`FSRef` or :class:`FSSpec` objects.
|
||||
|
||||
The :mod:`findertools` module defines the following functions:
|
||||
|
||||
|
||||
.. function:: launch(file)
|
||||
|
||||
Tell the finder to launch *file*. What launching means depends on the file:
|
||||
applications are started, folders are opened and documents are opened in the
|
||||
correct application.
|
||||
|
||||
|
||||
.. function:: Print(file)
|
||||
|
||||
Tell the finder to print a file. The behaviour is identical to selecting the
|
||||
file and using the print command in the finder's file menu.
|
||||
|
||||
|
||||
.. function:: copy(file, destdir)
|
||||
|
||||
Tell the finder to copy a file or folder *file* to folder *destdir*. The
|
||||
function returns an :class:`Alias` object pointing to the new file.
|
||||
|
||||
|
||||
.. function:: move(file, destdir)
|
||||
|
||||
Tell the finder to move a file or folder *file* to folder *destdir*. The
|
||||
function returns an :class:`Alias` object pointing to the new file.
|
||||
|
||||
|
||||
.. function:: sleep()
|
||||
|
||||
Tell the finder to put the Macintosh to sleep, if your machine supports it.
|
||||
|
||||
|
||||
.. function:: restart()
|
||||
|
||||
Tell the finder to perform an orderly restart of the machine.
|
||||
|
||||
|
||||
.. function:: shutdown()
|
||||
|
||||
Tell the finder to perform an orderly shutdown of the machine.
|
||||
|
|
@ -65,19 +65,6 @@ This module defines the following functions:
|
|||
Return *rootObject* as a plist-formatted string.
|
||||
|
||||
|
||||
|
||||
.. function:: readPlistFromResource(path[, restype='plst'[, resid=0]])
|
||||
|
||||
Read a plist from the resource with type *restype* from the resource fork of
|
||||
*path*. Availability: MacOS X.
|
||||
|
||||
|
||||
.. function:: writePlistToResource(rootObject, path[, restype='plst'[, resid=0]])
|
||||
|
||||
Write *rootObject* as a resource with type *restype* to the resource fork of
|
||||
*path*. Availability: MacOS X.
|
||||
|
||||
|
||||
The following class is available:
|
||||
|
||||
.. class:: Data(data)
|
||||
|
|
|
@ -37,104 +37,6 @@ Multimedia
|
|||
:mod:`sunaudio`
|
||||
--- Interpret Sun audio headers (may become obsolete or a tool/demo).
|
||||
|
||||
|
||||
.. _undoc-mac-modules:
|
||||
|
||||
Undocumented Mac OS modules
|
||||
===========================
|
||||
|
||||
|
||||
:mod:`applesingle` --- AppleSingle decoder
|
||||
------------------------------------------
|
||||
|
||||
.. module:: applesingle
|
||||
:platform: Mac
|
||||
:synopsis: Rudimentary decoder for AppleSingle format files.
|
||||
|
||||
|
||||
:mod:`icopen` --- Internet Config replacement for :meth:`open`
|
||||
--------------------------------------------------------------
|
||||
|
||||
.. module:: icopen
|
||||
:platform: Mac
|
||||
:synopsis: Internet Config replacement for open().
|
||||
|
||||
|
||||
Importing :mod:`icopen` will replace the builtin :meth:`open` with a version
|
||||
that uses Internet Config to set file type and creator for new files.
|
||||
|
||||
|
||||
:mod:`macerrors` --- Mac OS Errors
|
||||
----------------------------------
|
||||
|
||||
.. module:: macerrors
|
||||
:platform: Mac
|
||||
:synopsis: Constant definitions for many Mac OS error codes.
|
||||
|
||||
|
||||
:mod:`macerrors` contains constant definitions for many Mac OS error codes.
|
||||
|
||||
|
||||
:mod:`macresource` --- Locate script resources
|
||||
----------------------------------------------
|
||||
|
||||
.. module:: macresource
|
||||
:platform: Mac
|
||||
:synopsis: Locate script resources.
|
||||
|
||||
|
||||
:mod:`macresource` helps scripts finding their resources, such as dialogs and
|
||||
menus, without requiring special case code for when the script is run under
|
||||
MacPython, as a MacPython applet or under OSX Python.
|
||||
|
||||
|
||||
:mod:`Nav` --- NavServices calls
|
||||
--------------------------------
|
||||
|
||||
.. module:: Nav
|
||||
:platform: Mac
|
||||
:synopsis: Interface to Navigation Services.
|
||||
|
||||
|
||||
A low-level interface to Navigation Services.
|
||||
|
||||
|
||||
:mod:`PixMapWrapper` --- Wrapper for PixMap objects
|
||||
---------------------------------------------------
|
||||
|
||||
.. module:: PixMapWrapper
|
||||
:platform: Mac
|
||||
:synopsis: Wrapper for PixMap objects.
|
||||
|
||||
|
||||
:mod:`PixMapWrapper` wraps a PixMap object with a Python object that allows
|
||||
access to the fields by name. It also has methods to convert to and from
|
||||
:mod:`PIL` images.
|
||||
|
||||
|
||||
:mod:`videoreader` --- Read QuickTime movies
|
||||
--------------------------------------------
|
||||
|
||||
.. module:: videoreader
|
||||
:platform: Mac
|
||||
:synopsis: Read QuickTime movies frame by frame for further processing.
|
||||
|
||||
|
||||
:mod:`videoreader` reads and decodes QuickTime movies and passes a stream of
|
||||
images to your program. It also provides some support for audio tracks.
|
||||
|
||||
|
||||
:mod:`W` --- Widgets built on :mod:`FrameWork`
|
||||
----------------------------------------------
|
||||
|
||||
.. module:: W
|
||||
:platform: Mac
|
||||
:synopsis: Widgets for the Mac, built on top of FrameWork.
|
||||
|
||||
|
||||
The :mod:`W` widgets are used extensively in the :program:`IDE`.
|
||||
|
||||
|
||||
.. _obsolete-modules:
|
||||
|
||||
Obsolete
|
||||
|
|
|
@ -12,9 +12,6 @@ Python on a Macintosh running Mac OS X is in principle very similar to Python on
|
|||
any other Unix platform, but there are a number of additional features such as
|
||||
the IDE and the Package Manager that are worth pointing out.
|
||||
|
||||
The Mac-specific modules are documented in :ref:`mac-specific-services`.
|
||||
|
||||
|
||||
.. _getting-osx:
|
||||
|
||||
Getting and Installing MacPython
|
||||
|
|
|
@ -43,68 +43,39 @@ RUNCHAR = b"\x90"
|
|||
#
|
||||
# This code is no longer byte-order dependent
|
||||
|
||||
#
|
||||
# Workarounds for non-mac machines.
|
||||
try:
|
||||
from Carbon.File import FSSpec, FInfo
|
||||
from MacOS import openrf
|
||||
|
||||
def getfileinfo(name):
|
||||
finfo = FSSpec(name).FSpGetFInfo()
|
||||
dir, file = os.path.split(name)
|
||||
# XXX Get resource/data sizes
|
||||
fp = io.open(name, 'rb')
|
||||
fp.seek(0, 2)
|
||||
dlen = fp.tell()
|
||||
fp = openrf(name, '*rb')
|
||||
fp.seek(0, 2)
|
||||
rlen = fp.tell()
|
||||
return file, finfo, dlen, rlen
|
||||
class FInfo:
|
||||
def __init__(self):
|
||||
self.Type = '????'
|
||||
self.Creator = '????'
|
||||
self.Flags = 0
|
||||
|
||||
def openrsrc(name, *mode):
|
||||
if not mode:
|
||||
mode = '*rb'
|
||||
else:
|
||||
mode = '*' + mode[0]
|
||||
return openrf(name, mode)
|
||||
def getfileinfo(name):
|
||||
finfo = FInfo()
|
||||
fp = io.open(name, 'rb')
|
||||
# Quick check for textfile
|
||||
data = fp.read(512)
|
||||
if 0 not in data:
|
||||
finfo.Type = 'TEXT'
|
||||
fp.seek(0, 2)
|
||||
dsize = fp.tell()
|
||||
fp.close()
|
||||
dir, file = os.path.split(name)
|
||||
file = file.replace(':', '-', 1)
|
||||
return file, finfo, dsize, 0
|
||||
|
||||
except ImportError:
|
||||
#
|
||||
# Glue code for non-macintosh usage
|
||||
#
|
||||
class openrsrc:
|
||||
def __init__(self, *args):
|
||||
pass
|
||||
|
||||
class FInfo:
|
||||
def __init__(self):
|
||||
self.Type = '????'
|
||||
self.Creator = '????'
|
||||
self.Flags = 0
|
||||
def read(self, *args):
|
||||
return b''
|
||||
|
||||
def getfileinfo(name):
|
||||
finfo = FInfo()
|
||||
fp = io.open(name, 'rb')
|
||||
# Quick check for textfile
|
||||
data = fp.read(512)
|
||||
if 0 not in data:
|
||||
finfo.Type = 'TEXT'
|
||||
fp.seek(0, 2)
|
||||
dsize = fp.tell()
|
||||
fp.close()
|
||||
dir, file = os.path.split(name)
|
||||
file = file.replace(':', '-', 1)
|
||||
return file, finfo, dsize, 0
|
||||
def write(self, *args):
|
||||
pass
|
||||
|
||||
class openrsrc:
|
||||
def __init__(self, *args):
|
||||
pass
|
||||
|
||||
def read(self, *args):
|
||||
return b''
|
||||
|
||||
def write(self, *args):
|
||||
pass
|
||||
|
||||
def close(self):
|
||||
pass
|
||||
def close(self):
|
||||
pass
|
||||
|
||||
class _Hqxcoderengine:
|
||||
"""Write data to the coder in 3-byte chunks"""
|
||||
|
|
|
@ -1,121 +0,0 @@
|
|||
QSIZE = 100000
|
||||
error='Audio_mac.error'
|
||||
|
||||
class Play_Audio_mac:
|
||||
|
||||
def __init__(self, qsize=QSIZE):
|
||||
self._chan = None
|
||||
self._qsize = qsize
|
||||
self._outrate = 22254
|
||||
self._sampwidth = 1
|
||||
self._nchannels = 1
|
||||
self._gc = []
|
||||
self._usercallback = None
|
||||
|
||||
def __del__(self):
|
||||
self.stop()
|
||||
self._usercallback = None
|
||||
|
||||
def wait(self):
|
||||
import time
|
||||
while self.getfilled():
|
||||
time.sleep(0.1)
|
||||
self._chan = None
|
||||
self._gc = []
|
||||
|
||||
def stop(self, quietNow = 1):
|
||||
##chan = self._chan
|
||||
self._chan = None
|
||||
##chan.SndDisposeChannel(1)
|
||||
self._gc = []
|
||||
|
||||
def setoutrate(self, outrate):
|
||||
self._outrate = outrate
|
||||
|
||||
def setsampwidth(self, sampwidth):
|
||||
self._sampwidth = sampwidth
|
||||
|
||||
def setnchannels(self, nchannels):
|
||||
self._nchannels = nchannels
|
||||
|
||||
def writeframes(self, data):
|
||||
import time
|
||||
from Carbon.Sound import bufferCmd, callBackCmd, extSH
|
||||
import struct
|
||||
import MacOS
|
||||
if not self._chan:
|
||||
from Carbon import Snd
|
||||
self._chan = Snd.SndNewChannel(5, 0, self._callback)
|
||||
nframes = len(data) / self._nchannels / self._sampwidth
|
||||
if len(data) != nframes * self._nchannels * self._sampwidth:
|
||||
raise error('data is not a whole number of frames')
|
||||
while self._gc and \
|
||||
self.getfilled() + nframes > \
|
||||
self._qsize / self._nchannels / self._sampwidth:
|
||||
time.sleep(0.1)
|
||||
if self._sampwidth == 1:
|
||||
import audioop
|
||||
data = audioop.add(data, '\x80'*len(data), 1)
|
||||
h1 = struct.pack('llHhllbbl',
|
||||
id(data)+MacOS.string_id_to_buffer,
|
||||
self._nchannels,
|
||||
self._outrate, 0,
|
||||
0,
|
||||
0,
|
||||
extSH,
|
||||
60,
|
||||
nframes)
|
||||
h2 = 22*'\0'
|
||||
h3 = struct.pack('hhlll',
|
||||
self._sampwidth*8,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0)
|
||||
header = h1+h2+h3
|
||||
self._gc.append((header, data))
|
||||
self._chan.SndDoCommand((bufferCmd, 0, header), 0)
|
||||
self._chan.SndDoCommand((callBackCmd, 0, 0), 0)
|
||||
|
||||
def _callback(self, *args):
|
||||
del self._gc[0]
|
||||
if self._usercallback:
|
||||
self._usercallback()
|
||||
|
||||
def setcallback(self, callback):
|
||||
self._usercallback = callback
|
||||
|
||||
def getfilled(self):
|
||||
filled = 0
|
||||
for header, data in self._gc:
|
||||
filled = filled + len(data)
|
||||
return filled / self._nchannels / self._sampwidth
|
||||
|
||||
def getfillable(self):
|
||||
return (self._qsize / self._nchannels / self._sampwidth) - self.getfilled()
|
||||
|
||||
def ulaw2lin(self, data):
|
||||
import audioop
|
||||
return audioop.ulaw2lin(data, 2)
|
||||
|
||||
def test():
|
||||
import aifc
|
||||
import EasyDialogs
|
||||
fn = EasyDialogs.AskFileForOpen(message="Select an AIFF soundfile", typeList=("AIFF",))
|
||||
if not fn: return
|
||||
af = aifc.open(fn, 'r')
|
||||
print(af.getparams())
|
||||
p = Play_Audio_mac()
|
||||
p.setoutrate(af.getframerate())
|
||||
p.setsampwidth(af.getsampwidth())
|
||||
p.setnchannels(af.getnchannels())
|
||||
BUFSIZ = 10000
|
||||
while 1:
|
||||
data = af.readframes(BUFSIZ)
|
||||
if not data: break
|
||||
p.writeframes(data)
|
||||
print('wrote', len(data), 'space', p.getfillable())
|
||||
p.wait()
|
||||
|
||||
if __name__ == '__main__':
|
||||
test()
|
|
@ -1 +0,0 @@
|
|||
from _AE import *
|
|
@ -1 +0,0 @@
|
|||
from _AH import *
|
|
@ -1 +0,0 @@
|
|||
from _Alias import *
|
|
@ -1,18 +0,0 @@
|
|||
# Generated from 'Aliases.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
true = True
|
||||
false = False
|
||||
rAliasType = FOUR_CHAR_CODE('alis')
|
||||
kARMMountVol = 0x00000001
|
||||
kARMNoUI = 0x00000002
|
||||
kARMMultVols = 0x00000008
|
||||
kARMSearch = 0x00000100
|
||||
kARMSearchMore = 0x00000200
|
||||
kARMSearchRelFirst = 0x00000400
|
||||
asiZoneName = -3
|
||||
asiServerName = -2
|
||||
asiVolumeName = -1
|
||||
asiAliasName = 0
|
||||
asiParentName = 1
|
||||
kResolveAliasFileNoUI = 0x00000001
|
|
@ -1 +0,0 @@
|
|||
from _App import *
|
|
@ -1,648 +0,0 @@
|
|||
# Generated from 'Appearance.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
kAppearanceEventClass = FOUR_CHAR_CODE('appr')
|
||||
kAEAppearanceChanged = FOUR_CHAR_CODE('thme')
|
||||
kAESystemFontChanged = FOUR_CHAR_CODE('sysf')
|
||||
kAESmallSystemFontChanged = FOUR_CHAR_CODE('ssfn')
|
||||
kAEViewsFontChanged = FOUR_CHAR_CODE('vfnt')
|
||||
kThemeDataFileType = FOUR_CHAR_CODE('thme')
|
||||
kThemePlatinumFileType = FOUR_CHAR_CODE('pltn')
|
||||
kThemeCustomThemesFileType = FOUR_CHAR_CODE('scen')
|
||||
kThemeSoundTrackFileType = FOUR_CHAR_CODE('tsnd')
|
||||
kThemeBrushDialogBackgroundActive = 1
|
||||
kThemeBrushDialogBackgroundInactive = 2
|
||||
kThemeBrushAlertBackgroundActive = 3
|
||||
kThemeBrushAlertBackgroundInactive = 4
|
||||
kThemeBrushModelessDialogBackgroundActive = 5
|
||||
kThemeBrushModelessDialogBackgroundInactive = 6
|
||||
kThemeBrushUtilityWindowBackgroundActive = 7
|
||||
kThemeBrushUtilityWindowBackgroundInactive = 8
|
||||
kThemeBrushListViewSortColumnBackground = 9
|
||||
kThemeBrushListViewBackground = 10
|
||||
kThemeBrushIconLabelBackground = 11
|
||||
kThemeBrushListViewSeparator = 12
|
||||
kThemeBrushChasingArrows = 13
|
||||
kThemeBrushDragHilite = 14
|
||||
kThemeBrushDocumentWindowBackground = 15
|
||||
kThemeBrushFinderWindowBackground = 16
|
||||
kThemeBrushScrollBarDelimiterActive = 17
|
||||
kThemeBrushScrollBarDelimiterInactive = 18
|
||||
kThemeBrushFocusHighlight = 19
|
||||
kThemeBrushPopupArrowActive = 20
|
||||
kThemeBrushPopupArrowPressed = 21
|
||||
kThemeBrushPopupArrowInactive = 22
|
||||
kThemeBrushAppleGuideCoachmark = 23
|
||||
kThemeBrushIconLabelBackgroundSelected = 24
|
||||
kThemeBrushStaticAreaFill = 25
|
||||
kThemeBrushActiveAreaFill = 26
|
||||
kThemeBrushButtonFrameActive = 27
|
||||
kThemeBrushButtonFrameInactive = 28
|
||||
kThemeBrushButtonFaceActive = 29
|
||||
kThemeBrushButtonFaceInactive = 30
|
||||
kThemeBrushButtonFacePressed = 31
|
||||
kThemeBrushButtonActiveDarkShadow = 32
|
||||
kThemeBrushButtonActiveDarkHighlight = 33
|
||||
kThemeBrushButtonActiveLightShadow = 34
|
||||
kThemeBrushButtonActiveLightHighlight = 35
|
||||
kThemeBrushButtonInactiveDarkShadow = 36
|
||||
kThemeBrushButtonInactiveDarkHighlight = 37
|
||||
kThemeBrushButtonInactiveLightShadow = 38
|
||||
kThemeBrushButtonInactiveLightHighlight = 39
|
||||
kThemeBrushButtonPressedDarkShadow = 40
|
||||
kThemeBrushButtonPressedDarkHighlight = 41
|
||||
kThemeBrushButtonPressedLightShadow = 42
|
||||
kThemeBrushButtonPressedLightHighlight = 43
|
||||
kThemeBrushBevelActiveLight = 44
|
||||
kThemeBrushBevelActiveDark = 45
|
||||
kThemeBrushBevelInactiveLight = 46
|
||||
kThemeBrushBevelInactiveDark = 47
|
||||
kThemeBrushNotificationWindowBackground = 48
|
||||
kThemeBrushMovableModalBackground = 49
|
||||
kThemeBrushSheetBackgroundOpaque = 50
|
||||
kThemeBrushDrawerBackground = 51
|
||||
kThemeBrushToolbarBackground = 52
|
||||
kThemeBrushSheetBackgroundTransparent = 53
|
||||
kThemeBrushMenuBackground = 54
|
||||
kThemeBrushMenuBackgroundSelected = 55
|
||||
kThemeBrushSheetBackground = kThemeBrushSheetBackgroundOpaque
|
||||
kThemeBrushBlack = -1
|
||||
kThemeBrushWhite = -2
|
||||
kThemeBrushPrimaryHighlightColor = -3
|
||||
kThemeBrushSecondaryHighlightColor = -4
|
||||
kThemeTextColorDialogActive = 1
|
||||
kThemeTextColorDialogInactive = 2
|
||||
kThemeTextColorAlertActive = 3
|
||||
kThemeTextColorAlertInactive = 4
|
||||
kThemeTextColorModelessDialogActive = 5
|
||||
kThemeTextColorModelessDialogInactive = 6
|
||||
kThemeTextColorWindowHeaderActive = 7
|
||||
kThemeTextColorWindowHeaderInactive = 8
|
||||
kThemeTextColorPlacardActive = 9
|
||||
kThemeTextColorPlacardInactive = 10
|
||||
kThemeTextColorPlacardPressed = 11
|
||||
kThemeTextColorPushButtonActive = 12
|
||||
kThemeTextColorPushButtonInactive = 13
|
||||
kThemeTextColorPushButtonPressed = 14
|
||||
kThemeTextColorBevelButtonActive = 15
|
||||
kThemeTextColorBevelButtonInactive = 16
|
||||
kThemeTextColorBevelButtonPressed = 17
|
||||
kThemeTextColorPopupButtonActive = 18
|
||||
kThemeTextColorPopupButtonInactive = 19
|
||||
kThemeTextColorPopupButtonPressed = 20
|
||||
kThemeTextColorIconLabel = 21
|
||||
kThemeTextColorListView = 22
|
||||
kThemeTextColorDocumentWindowTitleActive = 23
|
||||
kThemeTextColorDocumentWindowTitleInactive = 24
|
||||
kThemeTextColorMovableModalWindowTitleActive = 25
|
||||
kThemeTextColorMovableModalWindowTitleInactive = 26
|
||||
kThemeTextColorUtilityWindowTitleActive = 27
|
||||
kThemeTextColorUtilityWindowTitleInactive = 28
|
||||
kThemeTextColorPopupWindowTitleActive = 29
|
||||
kThemeTextColorPopupWindowTitleInactive = 30
|
||||
kThemeTextColorRootMenuActive = 31
|
||||
kThemeTextColorRootMenuSelected = 32
|
||||
kThemeTextColorRootMenuDisabled = 33
|
||||
kThemeTextColorMenuItemActive = 34
|
||||
kThemeTextColorMenuItemSelected = 35
|
||||
kThemeTextColorMenuItemDisabled = 36
|
||||
kThemeTextColorPopupLabelActive = 37
|
||||
kThemeTextColorPopupLabelInactive = 38
|
||||
kThemeTextColorTabFrontActive = 39
|
||||
kThemeTextColorTabNonFrontActive = 40
|
||||
kThemeTextColorTabNonFrontPressed = 41
|
||||
kThemeTextColorTabFrontInactive = 42
|
||||
kThemeTextColorTabNonFrontInactive = 43
|
||||
kThemeTextColorIconLabelSelected = 44
|
||||
kThemeTextColorBevelButtonStickyActive = 45
|
||||
kThemeTextColorBevelButtonStickyInactive = 46
|
||||
kThemeTextColorNotification = 47
|
||||
kThemeTextColorBlack = -1
|
||||
kThemeTextColorWhite = -2
|
||||
kThemeStateInactive = 0
|
||||
kThemeStateActive = 1
|
||||
kThemeStatePressed = 2
|
||||
kThemeStateRollover = 6
|
||||
kThemeStateUnavailable = 7
|
||||
kThemeStateUnavailableInactive = 8
|
||||
kThemeStateDisabled = 0
|
||||
kThemeStatePressedUp = 2
|
||||
kThemeStatePressedDown = 3
|
||||
kThemeArrowCursor = 0
|
||||
kThemeCopyArrowCursor = 1
|
||||
kThemeAliasArrowCursor = 2
|
||||
kThemeContextualMenuArrowCursor = 3
|
||||
kThemeIBeamCursor = 4
|
||||
kThemeCrossCursor = 5
|
||||
kThemePlusCursor = 6
|
||||
kThemeWatchCursor = 7
|
||||
kThemeClosedHandCursor = 8
|
||||
kThemeOpenHandCursor = 9
|
||||
kThemePointingHandCursor = 10
|
||||
kThemeCountingUpHandCursor = 11
|
||||
kThemeCountingDownHandCursor = 12
|
||||
kThemeCountingUpAndDownHandCursor = 13
|
||||
kThemeSpinningCursor = 14
|
||||
kThemeResizeLeftCursor = 15
|
||||
kThemeResizeRightCursor = 16
|
||||
kThemeResizeLeftRightCursor = 17
|
||||
kThemeMenuBarNormal = 0
|
||||
kThemeMenuBarSelected = 1
|
||||
kThemeMenuSquareMenuBar = (1 << 0)
|
||||
kThemeMenuActive = 0
|
||||
kThemeMenuSelected = 1
|
||||
kThemeMenuDisabled = 3
|
||||
kThemeMenuTypePullDown = 0
|
||||
kThemeMenuTypePopUp = 1
|
||||
kThemeMenuTypeHierarchical = 2
|
||||
kThemeMenuTypeInactive = 0x0100
|
||||
kThemeMenuItemPlain = 0
|
||||
kThemeMenuItemHierarchical = 1
|
||||
kThemeMenuItemScrollUpArrow = 2
|
||||
kThemeMenuItemScrollDownArrow = 3
|
||||
kThemeMenuItemAtTop = 0x0100
|
||||
kThemeMenuItemAtBottom = 0x0200
|
||||
kThemeMenuItemHierBackground = 0x0400
|
||||
kThemeMenuItemPopUpBackground = 0x0800
|
||||
kThemeMenuItemHasIcon = 0x8000
|
||||
kThemeMenuItemNoBackground = 0x4000
|
||||
kThemeBackgroundTabPane = 1
|
||||
kThemeBackgroundPlacard = 2
|
||||
kThemeBackgroundWindowHeader = 3
|
||||
kThemeBackgroundListViewWindowHeader = 4
|
||||
kThemeBackgroundSecondaryGroupBox = 5
|
||||
kThemeNameTag = FOUR_CHAR_CODE('name')
|
||||
kThemeVariantNameTag = FOUR_CHAR_CODE('varn')
|
||||
kThemeVariantBaseTintTag = FOUR_CHAR_CODE('tint')
|
||||
kThemeHighlightColorTag = FOUR_CHAR_CODE('hcol')
|
||||
kThemeScrollBarArrowStyleTag = FOUR_CHAR_CODE('sbar')
|
||||
kThemeScrollBarThumbStyleTag = FOUR_CHAR_CODE('sbth')
|
||||
kThemeSoundsEnabledTag = FOUR_CHAR_CODE('snds')
|
||||
kThemeDblClickCollapseTag = FOUR_CHAR_CODE('coll')
|
||||
kThemeAppearanceFileNameTag = FOUR_CHAR_CODE('thme')
|
||||
kThemeSystemFontTag = FOUR_CHAR_CODE('lgsf')
|
||||
kThemeSmallSystemFontTag = FOUR_CHAR_CODE('smsf')
|
||||
kThemeViewsFontTag = FOUR_CHAR_CODE('vfnt')
|
||||
kThemeViewsFontSizeTag = FOUR_CHAR_CODE('vfsz')
|
||||
kThemeDesktopPatternNameTag = FOUR_CHAR_CODE('patn')
|
||||
kThemeDesktopPatternTag = FOUR_CHAR_CODE('patt')
|
||||
kThemeDesktopPictureNameTag = FOUR_CHAR_CODE('dpnm')
|
||||
kThemeDesktopPictureAliasTag = FOUR_CHAR_CODE('dpal')
|
||||
kThemeDesktopPictureAlignmentTag = FOUR_CHAR_CODE('dpan')
|
||||
kThemeHighlightColorNameTag = FOUR_CHAR_CODE('hcnm')
|
||||
kThemeExamplePictureIDTag = FOUR_CHAR_CODE('epic')
|
||||
kThemeSoundTrackNameTag = FOUR_CHAR_CODE('sndt')
|
||||
kThemeSoundMaskTag = FOUR_CHAR_CODE('smsk')
|
||||
kThemeUserDefinedTag = FOUR_CHAR_CODE('user')
|
||||
kThemeSmoothFontEnabledTag = FOUR_CHAR_CODE('smoo')
|
||||
kThemeSmoothFontMinSizeTag = FOUR_CHAR_CODE('smos')
|
||||
kTiledOnScreen = 1
|
||||
kCenterOnScreen = 2
|
||||
kFitToScreen = 3
|
||||
kFillScreen = 4
|
||||
kUseBestGuess = 5
|
||||
kThemeCheckBoxClassicX = 0
|
||||
kThemeCheckBoxCheckMark = 1
|
||||
kThemeScrollBarArrowsSingle = 0
|
||||
kThemeScrollBarArrowsLowerRight = 1
|
||||
kThemeScrollBarThumbNormal = 0
|
||||
kThemeScrollBarThumbProportional = 1
|
||||
kThemeSystemFont = 0
|
||||
kThemeSmallSystemFont = 1
|
||||
kThemeSmallEmphasizedSystemFont = 2
|
||||
kThemeViewsFont = 3
|
||||
kThemeEmphasizedSystemFont = 4
|
||||
kThemeApplicationFont = 5
|
||||
kThemeLabelFont = 6
|
||||
kThemeMenuTitleFont = 100
|
||||
kThemeMenuItemFont = 101
|
||||
kThemeMenuItemMarkFont = 102
|
||||
kThemeMenuItemCmdKeyFont = 103
|
||||
kThemeWindowTitleFont = 104
|
||||
kThemePushButtonFont = 105
|
||||
kThemeUtilityWindowTitleFont = 106
|
||||
kThemeAlertHeaderFont = 107
|
||||
kThemeCurrentPortFont = 200
|
||||
kThemeTabNonFront = 0
|
||||
kThemeTabNonFrontPressed = 1
|
||||
kThemeTabNonFrontInactive = 2
|
||||
kThemeTabFront = 3
|
||||
kThemeTabFrontInactive = 4
|
||||
kThemeTabNonFrontUnavailable = 5
|
||||
kThemeTabFrontUnavailable = 6
|
||||
kThemeTabNorth = 0
|
||||
kThemeTabSouth = 1
|
||||
kThemeTabEast = 2
|
||||
kThemeTabWest = 3
|
||||
kThemeSmallTabHeight = 16
|
||||
kThemeLargeTabHeight = 21
|
||||
kThemeTabPaneOverlap = 3
|
||||
kThemeSmallTabHeightMax = 19
|
||||
kThemeLargeTabHeightMax = 24
|
||||
kThemeMediumScrollBar = 0
|
||||
kThemeSmallScrollBar = 1
|
||||
kThemeMediumSlider = 2
|
||||
kThemeMediumProgressBar = 3
|
||||
kThemeMediumIndeterminateBar = 4
|
||||
kThemeRelevanceBar = 5
|
||||
kThemeSmallSlider = 6
|
||||
kThemeLargeProgressBar = 7
|
||||
kThemeLargeIndeterminateBar = 8
|
||||
kThemeTrackActive = 0
|
||||
kThemeTrackDisabled = 1
|
||||
kThemeTrackNothingToScroll = 2
|
||||
kThemeTrackInactive = 3
|
||||
kThemeLeftOutsideArrowPressed = 0x01
|
||||
kThemeLeftInsideArrowPressed = 0x02
|
||||
kThemeLeftTrackPressed = 0x04
|
||||
kThemeThumbPressed = 0x08
|
||||
kThemeRightTrackPressed = 0x10
|
||||
kThemeRightInsideArrowPressed = 0x20
|
||||
kThemeRightOutsideArrowPressed = 0x40
|
||||
kThemeTopOutsideArrowPressed = kThemeLeftOutsideArrowPressed
|
||||
kThemeTopInsideArrowPressed = kThemeLeftInsideArrowPressed
|
||||
kThemeTopTrackPressed = kThemeLeftTrackPressed
|
||||
kThemeBottomTrackPressed = kThemeRightTrackPressed
|
||||
kThemeBottomInsideArrowPressed = kThemeRightInsideArrowPressed
|
||||
kThemeBottomOutsideArrowPressed = kThemeRightOutsideArrowPressed
|
||||
kThemeThumbPlain = 0
|
||||
kThemeThumbUpward = 1
|
||||
kThemeThumbDownward = 2
|
||||
kThemeTrackHorizontal = (1 << 0)
|
||||
kThemeTrackRightToLeft = (1 << 1)
|
||||
kThemeTrackShowThumb = (1 << 2)
|
||||
kThemeTrackThumbRgnIsNotGhost = (1 << 3)
|
||||
kThemeTrackNoScrollBarArrows = (1 << 4)
|
||||
kThemeWindowHasGrow = (1 << 0)
|
||||
kThemeWindowHasHorizontalZoom = (1 << 3)
|
||||
kThemeWindowHasVerticalZoom = (1 << 4)
|
||||
kThemeWindowHasFullZoom = kThemeWindowHasHorizontalZoom + kThemeWindowHasVerticalZoom
|
||||
kThemeWindowHasCloseBox = (1 << 5)
|
||||
kThemeWindowHasCollapseBox = (1 << 6)
|
||||
kThemeWindowHasTitleText = (1 << 7)
|
||||
kThemeWindowIsCollapsed = (1 << 8)
|
||||
kThemeWindowHasDirty = (1 << 9)
|
||||
kThemeDocumentWindow = 0
|
||||
kThemeDialogWindow = 1
|
||||
kThemeMovableDialogWindow = 2
|
||||
kThemeAlertWindow = 3
|
||||
kThemeMovableAlertWindow = 4
|
||||
kThemePlainDialogWindow = 5
|
||||
kThemeShadowDialogWindow = 6
|
||||
kThemePopupWindow = 7
|
||||
kThemeUtilityWindow = 8
|
||||
kThemeUtilitySideWindow = 9
|
||||
kThemeSheetWindow = 10
|
||||
kThemeDrawerWindow = 11
|
||||
kThemeWidgetCloseBox = 0
|
||||
kThemeWidgetZoomBox = 1
|
||||
kThemeWidgetCollapseBox = 2
|
||||
kThemeWidgetDirtyCloseBox = 6
|
||||
kThemeArrowLeft = 0
|
||||
kThemeArrowDown = 1
|
||||
kThemeArrowRight = 2
|
||||
kThemeArrowUp = 3
|
||||
kThemeArrow3pt = 0
|
||||
kThemeArrow5pt = 1
|
||||
kThemeArrow7pt = 2
|
||||
kThemeArrow9pt = 3
|
||||
kThemeGrowLeft = (1 << 0)
|
||||
kThemeGrowRight = (1 << 1)
|
||||
kThemeGrowUp = (1 << 2)
|
||||
kThemeGrowDown = (1 << 3)
|
||||
kThemePushButton = 0
|
||||
kThemeCheckBox = 1
|
||||
kThemeRadioButton = 2
|
||||
kThemeBevelButton = 3
|
||||
kThemeArrowButton = 4
|
||||
kThemePopupButton = 5
|
||||
kThemeDisclosureButton = 6
|
||||
kThemeIncDecButton = 7
|
||||
kThemeSmallBevelButton = 8
|
||||
kThemeMediumBevelButton = 3
|
||||
kThemeLargeBevelButton = 9
|
||||
kThemeListHeaderButton = 10
|
||||
kThemeRoundButton = 11
|
||||
kThemeLargeRoundButton = 12
|
||||
kThemeSmallCheckBox = 13
|
||||
kThemeSmallRadioButton = 14
|
||||
kThemeRoundedBevelButton = 15
|
||||
kThemeNormalCheckBox = kThemeCheckBox
|
||||
kThemeNormalRadioButton = kThemeRadioButton
|
||||
kThemeButtonOff = 0
|
||||
kThemeButtonOn = 1
|
||||
kThemeButtonMixed = 2
|
||||
kThemeDisclosureRight = 0
|
||||
kThemeDisclosureDown = 1
|
||||
kThemeDisclosureLeft = 2
|
||||
kThemeAdornmentNone = 0
|
||||
kThemeAdornmentDefault = (1 << 0)
|
||||
kThemeAdornmentFocus = (1 << 2)
|
||||
kThemeAdornmentRightToLeft = (1 << 4)
|
||||
kThemeAdornmentDrawIndicatorOnly = (1 << 5)
|
||||
kThemeAdornmentHeaderButtonLeftNeighborSelected = (1 << 6)
|
||||
kThemeAdornmentHeaderButtonRightNeighborSelected = (1 << 7)
|
||||
kThemeAdornmentHeaderButtonSortUp = (1 << 8)
|
||||
kThemeAdornmentHeaderMenuButton = (1 << 9)
|
||||
kThemeAdornmentHeaderButtonNoShadow = (1 << 10)
|
||||
kThemeAdornmentHeaderButtonShadowOnly = (1 << 11)
|
||||
kThemeAdornmentNoShadow = kThemeAdornmentHeaderButtonNoShadow
|
||||
kThemeAdornmentShadowOnly = kThemeAdornmentHeaderButtonShadowOnly
|
||||
kThemeAdornmentArrowLeftArrow = (1 << 6)
|
||||
kThemeAdornmentArrowDownArrow = (1 << 7)
|
||||
kThemeAdornmentArrowDoubleArrow = (1 << 8)
|
||||
kThemeAdornmentArrowUpArrow = (1 << 9)
|
||||
kThemeNoSounds = 0
|
||||
kThemeWindowSoundsMask = (1 << 0)
|
||||
kThemeMenuSoundsMask = (1 << 1)
|
||||
kThemeControlSoundsMask = (1 << 2)
|
||||
kThemeFinderSoundsMask = (1 << 3)
|
||||
kThemeDragSoundNone = 0
|
||||
kThemeDragSoundMoveWindow = FOUR_CHAR_CODE('wmov')
|
||||
kThemeDragSoundGrowWindow = FOUR_CHAR_CODE('wgro')
|
||||
kThemeDragSoundMoveUtilWindow = FOUR_CHAR_CODE('umov')
|
||||
kThemeDragSoundGrowUtilWindow = FOUR_CHAR_CODE('ugro')
|
||||
kThemeDragSoundMoveDialog = FOUR_CHAR_CODE('dmov')
|
||||
kThemeDragSoundMoveAlert = FOUR_CHAR_CODE('amov')
|
||||
kThemeDragSoundMoveIcon = FOUR_CHAR_CODE('imov')
|
||||
kThemeDragSoundSliderThumb = FOUR_CHAR_CODE('slth')
|
||||
kThemeDragSoundSliderGhost = FOUR_CHAR_CODE('slgh')
|
||||
kThemeDragSoundScrollBarThumb = FOUR_CHAR_CODE('sbth')
|
||||
kThemeDragSoundScrollBarGhost = FOUR_CHAR_CODE('sbgh')
|
||||
kThemeDragSoundScrollBarArrowDecreasing = FOUR_CHAR_CODE('sbad')
|
||||
kThemeDragSoundScrollBarArrowIncreasing = FOUR_CHAR_CODE('sbai')
|
||||
kThemeDragSoundDragging = FOUR_CHAR_CODE('drag')
|
||||
kThemeSoundNone = 0
|
||||
kThemeSoundMenuOpen = FOUR_CHAR_CODE('mnuo')
|
||||
kThemeSoundMenuClose = FOUR_CHAR_CODE('mnuc')
|
||||
kThemeSoundMenuItemHilite = FOUR_CHAR_CODE('mnui')
|
||||
kThemeSoundMenuItemRelease = FOUR_CHAR_CODE('mnus')
|
||||
kThemeSoundWindowClosePress = FOUR_CHAR_CODE('wclp')
|
||||
kThemeSoundWindowCloseEnter = FOUR_CHAR_CODE('wcle')
|
||||
kThemeSoundWindowCloseExit = FOUR_CHAR_CODE('wclx')
|
||||
kThemeSoundWindowCloseRelease = FOUR_CHAR_CODE('wclr')
|
||||
kThemeSoundWindowZoomPress = FOUR_CHAR_CODE('wzmp')
|
||||
kThemeSoundWindowZoomEnter = FOUR_CHAR_CODE('wzme')
|
||||
kThemeSoundWindowZoomExit = FOUR_CHAR_CODE('wzmx')
|
||||
kThemeSoundWindowZoomRelease = FOUR_CHAR_CODE('wzmr')
|
||||
kThemeSoundWindowCollapsePress = FOUR_CHAR_CODE('wcop')
|
||||
kThemeSoundWindowCollapseEnter = FOUR_CHAR_CODE('wcoe')
|
||||
kThemeSoundWindowCollapseExit = FOUR_CHAR_CODE('wcox')
|
||||
kThemeSoundWindowCollapseRelease = FOUR_CHAR_CODE('wcor')
|
||||
kThemeSoundWindowDragBoundary = FOUR_CHAR_CODE('wdbd')
|
||||
kThemeSoundUtilWinClosePress = FOUR_CHAR_CODE('uclp')
|
||||
kThemeSoundUtilWinCloseEnter = FOUR_CHAR_CODE('ucle')
|
||||
kThemeSoundUtilWinCloseExit = FOUR_CHAR_CODE('uclx')
|
||||
kThemeSoundUtilWinCloseRelease = FOUR_CHAR_CODE('uclr')
|
||||
kThemeSoundUtilWinZoomPress = FOUR_CHAR_CODE('uzmp')
|
||||
kThemeSoundUtilWinZoomEnter = FOUR_CHAR_CODE('uzme')
|
||||
kThemeSoundUtilWinZoomExit = FOUR_CHAR_CODE('uzmx')
|
||||
kThemeSoundUtilWinZoomRelease = FOUR_CHAR_CODE('uzmr')
|
||||
kThemeSoundUtilWinCollapsePress = FOUR_CHAR_CODE('ucop')
|
||||
kThemeSoundUtilWinCollapseEnter = FOUR_CHAR_CODE('ucoe')
|
||||
kThemeSoundUtilWinCollapseExit = FOUR_CHAR_CODE('ucox')
|
||||
kThemeSoundUtilWinCollapseRelease = FOUR_CHAR_CODE('ucor')
|
||||
kThemeSoundUtilWinDragBoundary = FOUR_CHAR_CODE('udbd')
|
||||
kThemeSoundWindowOpen = FOUR_CHAR_CODE('wopn')
|
||||
kThemeSoundWindowClose = FOUR_CHAR_CODE('wcls')
|
||||
kThemeSoundWindowZoomIn = FOUR_CHAR_CODE('wzmi')
|
||||
kThemeSoundWindowZoomOut = FOUR_CHAR_CODE('wzmo')
|
||||
kThemeSoundWindowCollapseUp = FOUR_CHAR_CODE('wcol')
|
||||
kThemeSoundWindowCollapseDown = FOUR_CHAR_CODE('wexp')
|
||||
kThemeSoundWindowActivate = FOUR_CHAR_CODE('wact')
|
||||
kThemeSoundUtilWindowOpen = FOUR_CHAR_CODE('uopn')
|
||||
kThemeSoundUtilWindowClose = FOUR_CHAR_CODE('ucls')
|
||||
kThemeSoundUtilWindowZoomIn = FOUR_CHAR_CODE('uzmi')
|
||||
kThemeSoundUtilWindowZoomOut = FOUR_CHAR_CODE('uzmo')
|
||||
kThemeSoundUtilWindowCollapseUp = FOUR_CHAR_CODE('ucol')
|
||||
kThemeSoundUtilWindowCollapseDown = FOUR_CHAR_CODE('uexp')
|
||||
kThemeSoundUtilWindowActivate = FOUR_CHAR_CODE('uact')
|
||||
kThemeSoundDialogOpen = FOUR_CHAR_CODE('dopn')
|
||||
kThemeSoundDialogClose = FOUR_CHAR_CODE('dlgc')
|
||||
kThemeSoundAlertOpen = FOUR_CHAR_CODE('aopn')
|
||||
kThemeSoundAlertClose = FOUR_CHAR_CODE('altc')
|
||||
kThemeSoundPopupWindowOpen = FOUR_CHAR_CODE('pwop')
|
||||
kThemeSoundPopupWindowClose = FOUR_CHAR_CODE('pwcl')
|
||||
kThemeSoundButtonPress = FOUR_CHAR_CODE('btnp')
|
||||
kThemeSoundButtonEnter = FOUR_CHAR_CODE('btne')
|
||||
kThemeSoundButtonExit = FOUR_CHAR_CODE('btnx')
|
||||
kThemeSoundButtonRelease = FOUR_CHAR_CODE('btnr')
|
||||
kThemeSoundDefaultButtonPress = FOUR_CHAR_CODE('dbtp')
|
||||
kThemeSoundDefaultButtonEnter = FOUR_CHAR_CODE('dbte')
|
||||
kThemeSoundDefaultButtonExit = FOUR_CHAR_CODE('dbtx')
|
||||
kThemeSoundDefaultButtonRelease = FOUR_CHAR_CODE('dbtr')
|
||||
kThemeSoundCancelButtonPress = FOUR_CHAR_CODE('cbtp')
|
||||
kThemeSoundCancelButtonEnter = FOUR_CHAR_CODE('cbte')
|
||||
kThemeSoundCancelButtonExit = FOUR_CHAR_CODE('cbtx')
|
||||
kThemeSoundCancelButtonRelease = FOUR_CHAR_CODE('cbtr')
|
||||
kThemeSoundCheckboxPress = FOUR_CHAR_CODE('chkp')
|
||||
kThemeSoundCheckboxEnter = FOUR_CHAR_CODE('chke')
|
||||
kThemeSoundCheckboxExit = FOUR_CHAR_CODE('chkx')
|
||||
kThemeSoundCheckboxRelease = FOUR_CHAR_CODE('chkr')
|
||||
kThemeSoundRadioPress = FOUR_CHAR_CODE('radp')
|
||||
kThemeSoundRadioEnter = FOUR_CHAR_CODE('rade')
|
||||
kThemeSoundRadioExit = FOUR_CHAR_CODE('radx')
|
||||
kThemeSoundRadioRelease = FOUR_CHAR_CODE('radr')
|
||||
kThemeSoundScrollArrowPress = FOUR_CHAR_CODE('sbap')
|
||||
kThemeSoundScrollArrowEnter = FOUR_CHAR_CODE('sbae')
|
||||
kThemeSoundScrollArrowExit = FOUR_CHAR_CODE('sbax')
|
||||
kThemeSoundScrollArrowRelease = FOUR_CHAR_CODE('sbar')
|
||||
kThemeSoundScrollEndOfTrack = FOUR_CHAR_CODE('sbte')
|
||||
kThemeSoundScrollTrackPress = FOUR_CHAR_CODE('sbtp')
|
||||
kThemeSoundSliderEndOfTrack = FOUR_CHAR_CODE('slte')
|
||||
kThemeSoundSliderTrackPress = FOUR_CHAR_CODE('sltp')
|
||||
kThemeSoundBalloonOpen = FOUR_CHAR_CODE('blno')
|
||||
kThemeSoundBalloonClose = FOUR_CHAR_CODE('blnc')
|
||||
kThemeSoundBevelPress = FOUR_CHAR_CODE('bevp')
|
||||
kThemeSoundBevelEnter = FOUR_CHAR_CODE('beve')
|
||||
kThemeSoundBevelExit = FOUR_CHAR_CODE('bevx')
|
||||
kThemeSoundBevelRelease = FOUR_CHAR_CODE('bevr')
|
||||
kThemeSoundLittleArrowUpPress = FOUR_CHAR_CODE('laup')
|
||||
kThemeSoundLittleArrowDnPress = FOUR_CHAR_CODE('ladp')
|
||||
kThemeSoundLittleArrowEnter = FOUR_CHAR_CODE('lare')
|
||||
kThemeSoundLittleArrowExit = FOUR_CHAR_CODE('larx')
|
||||
kThemeSoundLittleArrowUpRelease = FOUR_CHAR_CODE('laur')
|
||||
kThemeSoundLittleArrowDnRelease = FOUR_CHAR_CODE('ladr')
|
||||
kThemeSoundPopupPress = FOUR_CHAR_CODE('popp')
|
||||
kThemeSoundPopupEnter = FOUR_CHAR_CODE('pope')
|
||||
kThemeSoundPopupExit = FOUR_CHAR_CODE('popx')
|
||||
kThemeSoundPopupRelease = FOUR_CHAR_CODE('popr')
|
||||
kThemeSoundDisclosurePress = FOUR_CHAR_CODE('dscp')
|
||||
kThemeSoundDisclosureEnter = FOUR_CHAR_CODE('dsce')
|
||||
kThemeSoundDisclosureExit = FOUR_CHAR_CODE('dscx')
|
||||
kThemeSoundDisclosureRelease = FOUR_CHAR_CODE('dscr')
|
||||
kThemeSoundTabPressed = FOUR_CHAR_CODE('tabp')
|
||||
kThemeSoundTabEnter = FOUR_CHAR_CODE('tabe')
|
||||
kThemeSoundTabExit = FOUR_CHAR_CODE('tabx')
|
||||
kThemeSoundTabRelease = FOUR_CHAR_CODE('tabr')
|
||||
kThemeSoundDragTargetHilite = FOUR_CHAR_CODE('dthi')
|
||||
kThemeSoundDragTargetUnhilite = FOUR_CHAR_CODE('dtuh')
|
||||
kThemeSoundDragTargetDrop = FOUR_CHAR_CODE('dtdr')
|
||||
kThemeSoundEmptyTrash = FOUR_CHAR_CODE('ftrs')
|
||||
kThemeSoundSelectItem = FOUR_CHAR_CODE('fsel')
|
||||
kThemeSoundNewItem = FOUR_CHAR_CODE('fnew')
|
||||
kThemeSoundReceiveDrop = FOUR_CHAR_CODE('fdrp')
|
||||
kThemeSoundCopyDone = FOUR_CHAR_CODE('fcpd')
|
||||
kThemeSoundResolveAlias = FOUR_CHAR_CODE('fral')
|
||||
kThemeSoundLaunchApp = FOUR_CHAR_CODE('flap')
|
||||
kThemeSoundDiskInsert = FOUR_CHAR_CODE('dski')
|
||||
kThemeSoundDiskEject = FOUR_CHAR_CODE('dske')
|
||||
kThemeSoundFinderDragOnIcon = FOUR_CHAR_CODE('fdon')
|
||||
kThemeSoundFinderDragOffIcon = FOUR_CHAR_CODE('fdof')
|
||||
kThemePopupTabNormalPosition = 0
|
||||
kThemePopupTabCenterOnWindow = 1
|
||||
kThemePopupTabCenterOnOffset = 2
|
||||
kThemeMetricScrollBarWidth = 0
|
||||
kThemeMetricSmallScrollBarWidth = 1
|
||||
kThemeMetricCheckBoxHeight = 2
|
||||
kThemeMetricRadioButtonHeight = 3
|
||||
kThemeMetricEditTextWhitespace = 4
|
||||
kThemeMetricEditTextFrameOutset = 5
|
||||
kThemeMetricListBoxFrameOutset = 6
|
||||
kThemeMetricFocusRectOutset = 7
|
||||
kThemeMetricImageWellThickness = 8
|
||||
kThemeMetricScrollBarOverlap = 9
|
||||
kThemeMetricLargeTabHeight = 10
|
||||
kThemeMetricLargeTabCapsWidth = 11
|
||||
kThemeMetricTabFrameOverlap = 12
|
||||
kThemeMetricTabIndentOrStyle = 13
|
||||
kThemeMetricTabOverlap = 14
|
||||
kThemeMetricSmallTabHeight = 15
|
||||
kThemeMetricSmallTabCapsWidth = 16
|
||||
kThemeMetricDisclosureButtonHeight = 17
|
||||
kThemeMetricRoundButtonSize = 18
|
||||
kThemeMetricPushButtonHeight = 19
|
||||
kThemeMetricListHeaderHeight = 20
|
||||
kThemeMetricSmallCheckBoxHeight = 21
|
||||
kThemeMetricDisclosureButtonWidth = 22
|
||||
kThemeMetricSmallDisclosureButtonHeight = 23
|
||||
kThemeMetricSmallDisclosureButtonWidth = 24
|
||||
kThemeMetricDisclosureTriangleHeight = 25
|
||||
kThemeMetricDisclosureTriangleWidth = 26
|
||||
kThemeMetricLittleArrowsHeight = 27
|
||||
kThemeMetricLittleArrowsWidth = 28
|
||||
kThemeMetricPaneSplitterHeight = 29
|
||||
kThemeMetricPopupButtonHeight = 30
|
||||
kThemeMetricSmallPopupButtonHeight = 31
|
||||
kThemeMetricLargeProgressBarThickness = 32
|
||||
kThemeMetricPullDownHeight = 33
|
||||
kThemeMetricSmallPullDownHeight = 34
|
||||
kThemeMetricSmallPushButtonHeight = 35
|
||||
kThemeMetricSmallRadioButtonHeight = 36
|
||||
kThemeMetricRelevanceIndicatorHeight = 37
|
||||
kThemeMetricResizeControlHeight = 38
|
||||
kThemeMetricSmallResizeControlHeight = 39
|
||||
kThemeMetricLargeRoundButtonSize = 40
|
||||
kThemeMetricHSliderHeight = 41
|
||||
kThemeMetricHSliderTickHeight = 42
|
||||
kThemeMetricSmallHSliderHeight = 43
|
||||
kThemeMetricSmallHSliderTickHeight = 44
|
||||
kThemeMetricVSliderWidth = 45
|
||||
kThemeMetricVSliderTickWidth = 46
|
||||
kThemeMetricSmallVSliderWidth = 47
|
||||
kThemeMetricSmallVSliderTickWidth = 48
|
||||
kThemeMetricTitleBarControlsHeight = 49
|
||||
kThemeMetricCheckBoxWidth = 50
|
||||
kThemeMetricSmallCheckBoxWidth = 51
|
||||
kThemeMetricRadioButtonWidth = 52
|
||||
kThemeMetricSmallRadioButtonWidth = 53
|
||||
kThemeMetricSmallHSliderMinThumbWidth = 54
|
||||
kThemeMetricSmallVSliderMinThumbHeight = 55
|
||||
kThemeMetricSmallHSliderTickOffset = 56
|
||||
kThemeMetricSmallVSliderTickOffset = 57
|
||||
kThemeMetricNormalProgressBarThickness = 58
|
||||
kThemeMetricProgressBarShadowOutset = 59
|
||||
kThemeMetricSmallProgressBarShadowOutset = 60
|
||||
kThemeMetricPrimaryGroupBoxContentInset = 61
|
||||
kThemeMetricSecondaryGroupBoxContentInset = 62
|
||||
kThemeMetricMenuMarkColumnWidth = 63
|
||||
kThemeMetricMenuExcludedMarkColumnWidth = 64
|
||||
kThemeMetricMenuMarkIndent = 65
|
||||
kThemeMetricMenuTextLeadingEdgeMargin = 66
|
||||
kThemeMetricMenuTextTrailingEdgeMargin = 67
|
||||
kThemeMetricMenuIndentWidth = 68
|
||||
kThemeMetricMenuIconTrailingEdgeMargin = 69
|
||||
# appearanceBadBrushIndexErr = themeInvalidBrushErr
|
||||
# appearanceProcessRegisteredErr = themeProcessRegisteredErr
|
||||
# appearanceProcessNotRegisteredErr = themeProcessNotRegisteredErr
|
||||
# appearanceBadTextColorIndexErr = themeBadTextColorErr
|
||||
# appearanceThemeHasNoAccents = themeHasNoAccentsErr
|
||||
# appearanceBadCursorIndexErr = themeBadCursorIndexErr
|
||||
kThemeActiveDialogBackgroundBrush = kThemeBrushDialogBackgroundActive
|
||||
kThemeInactiveDialogBackgroundBrush = kThemeBrushDialogBackgroundInactive
|
||||
kThemeActiveAlertBackgroundBrush = kThemeBrushAlertBackgroundActive
|
||||
kThemeInactiveAlertBackgroundBrush = kThemeBrushAlertBackgroundInactive
|
||||
kThemeActiveModelessDialogBackgroundBrush = kThemeBrushModelessDialogBackgroundActive
|
||||
kThemeInactiveModelessDialogBackgroundBrush = kThemeBrushModelessDialogBackgroundInactive
|
||||
kThemeActiveUtilityWindowBackgroundBrush = kThemeBrushUtilityWindowBackgroundActive
|
||||
kThemeInactiveUtilityWindowBackgroundBrush = kThemeBrushUtilityWindowBackgroundInactive
|
||||
kThemeListViewSortColumnBackgroundBrush = kThemeBrushListViewSortColumnBackground
|
||||
kThemeListViewBackgroundBrush = kThemeBrushListViewBackground
|
||||
kThemeIconLabelBackgroundBrush = kThemeBrushIconLabelBackground
|
||||
kThemeListViewSeparatorBrush = kThemeBrushListViewSeparator
|
||||
kThemeChasingArrowsBrush = kThemeBrushChasingArrows
|
||||
kThemeDragHiliteBrush = kThemeBrushDragHilite
|
||||
kThemeDocumentWindowBackgroundBrush = kThemeBrushDocumentWindowBackground
|
||||
kThemeFinderWindowBackgroundBrush = kThemeBrushFinderWindowBackground
|
||||
kThemeActiveScrollBarDelimiterBrush = kThemeBrushScrollBarDelimiterActive
|
||||
kThemeInactiveScrollBarDelimiterBrush = kThemeBrushScrollBarDelimiterInactive
|
||||
kThemeFocusHighlightBrush = kThemeBrushFocusHighlight
|
||||
kThemeActivePopupArrowBrush = kThemeBrushPopupArrowActive
|
||||
kThemePressedPopupArrowBrush = kThemeBrushPopupArrowPressed
|
||||
kThemeInactivePopupArrowBrush = kThemeBrushPopupArrowInactive
|
||||
kThemeAppleGuideCoachmarkBrush = kThemeBrushAppleGuideCoachmark
|
||||
kThemeActiveDialogTextColor = kThemeTextColorDialogActive
|
||||
kThemeInactiveDialogTextColor = kThemeTextColorDialogInactive
|
||||
kThemeActiveAlertTextColor = kThemeTextColorAlertActive
|
||||
kThemeInactiveAlertTextColor = kThemeTextColorAlertInactive
|
||||
kThemeActiveModelessDialogTextColor = kThemeTextColorModelessDialogActive
|
||||
kThemeInactiveModelessDialogTextColor = kThemeTextColorModelessDialogInactive
|
||||
kThemeActiveWindowHeaderTextColor = kThemeTextColorWindowHeaderActive
|
||||
kThemeInactiveWindowHeaderTextColor = kThemeTextColorWindowHeaderInactive
|
||||
kThemeActivePlacardTextColor = kThemeTextColorPlacardActive
|
||||
kThemeInactivePlacardTextColor = kThemeTextColorPlacardInactive
|
||||
kThemePressedPlacardTextColor = kThemeTextColorPlacardPressed
|
||||
kThemeActivePushButtonTextColor = kThemeTextColorPushButtonActive
|
||||
kThemeInactivePushButtonTextColor = kThemeTextColorPushButtonInactive
|
||||
kThemePressedPushButtonTextColor = kThemeTextColorPushButtonPressed
|
||||
kThemeActiveBevelButtonTextColor = kThemeTextColorBevelButtonActive
|
||||
kThemeInactiveBevelButtonTextColor = kThemeTextColorBevelButtonInactive
|
||||
kThemePressedBevelButtonTextColor = kThemeTextColorBevelButtonPressed
|
||||
kThemeActivePopupButtonTextColor = kThemeTextColorPopupButtonActive
|
||||
kThemeInactivePopupButtonTextColor = kThemeTextColorPopupButtonInactive
|
||||
kThemePressedPopupButtonTextColor = kThemeTextColorPopupButtonPressed
|
||||
kThemeIconLabelTextColor = kThemeTextColorIconLabel
|
||||
kThemeListViewTextColor = kThemeTextColorListView
|
||||
kThemeActiveDocumentWindowTitleTextColor = kThemeTextColorDocumentWindowTitleActive
|
||||
kThemeInactiveDocumentWindowTitleTextColor = kThemeTextColorDocumentWindowTitleInactive
|
||||
kThemeActiveMovableModalWindowTitleTextColor = kThemeTextColorMovableModalWindowTitleActive
|
||||
kThemeInactiveMovableModalWindowTitleTextColor = kThemeTextColorMovableModalWindowTitleInactive
|
||||
kThemeActiveUtilityWindowTitleTextColor = kThemeTextColorUtilityWindowTitleActive
|
||||
kThemeInactiveUtilityWindowTitleTextColor = kThemeTextColorUtilityWindowTitleInactive
|
||||
kThemeActivePopupWindowTitleColor = kThemeTextColorPopupWindowTitleActive
|
||||
kThemeInactivePopupWindowTitleColor = kThemeTextColorPopupWindowTitleInactive
|
||||
kThemeActiveRootMenuTextColor = kThemeTextColorRootMenuActive
|
||||
kThemeSelectedRootMenuTextColor = kThemeTextColorRootMenuSelected
|
||||
kThemeDisabledRootMenuTextColor = kThemeTextColorRootMenuDisabled
|
||||
kThemeActiveMenuItemTextColor = kThemeTextColorMenuItemActive
|
||||
kThemeSelectedMenuItemTextColor = kThemeTextColorMenuItemSelected
|
||||
kThemeDisabledMenuItemTextColor = kThemeTextColorMenuItemDisabled
|
||||
kThemeActivePopupLabelTextColor = kThemeTextColorPopupLabelActive
|
||||
kThemeInactivePopupLabelTextColor = kThemeTextColorPopupLabelInactive
|
||||
kAEThemeSwitch = kAEAppearanceChanged
|
||||
kThemeNoAdornment = kThemeAdornmentNone
|
||||
kThemeDefaultAdornment = kThemeAdornmentDefault
|
||||
kThemeFocusAdornment = kThemeAdornmentFocus
|
||||
kThemeRightToLeftAdornment = kThemeAdornmentRightToLeft
|
||||
kThemeDrawIndicatorOnly = kThemeAdornmentDrawIndicatorOnly
|
||||
kThemeBrushPassiveAreaFill = kThemeBrushStaticAreaFill
|
||||
kThemeMetricCheckBoxGlyphHeight = kThemeMetricCheckBoxHeight
|
||||
kThemeMetricRadioButtonGlyphHeight = kThemeMetricRadioButtonHeight
|
||||
kThemeMetricDisclosureButtonSize = kThemeMetricDisclosureButtonHeight
|
||||
kThemeMetricBestListHeaderHeight = kThemeMetricListHeaderHeight
|
||||
kThemeMetricSmallProgressBarThickness = kThemeMetricNormalProgressBarThickness
|
||||
kThemeMetricProgressBarThickness = kThemeMetricLargeProgressBarThickness
|
||||
kThemeScrollBar = kThemeMediumScrollBar
|
||||
kThemeSlider = kThemeMediumSlider
|
||||
kThemeProgressBar = kThemeMediumProgressBar
|
||||
kThemeIndeterminateBar = kThemeMediumIndeterminateBar
|
|
@ -1,961 +0,0 @@
|
|||
# Generated from 'AEDataModel.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x.encode("latin-1")
|
||||
typeApplicationBundleID = FOUR_CHAR_CODE('bund')
|
||||
typeBoolean = FOUR_CHAR_CODE('bool')
|
||||
typeChar = FOUR_CHAR_CODE('TEXT')
|
||||
typeSInt16 = FOUR_CHAR_CODE('shor')
|
||||
typeSInt32 = FOUR_CHAR_CODE('long')
|
||||
typeUInt32 = FOUR_CHAR_CODE('magn')
|
||||
typeSInt64 = FOUR_CHAR_CODE('comp')
|
||||
typeIEEE32BitFloatingPoint = FOUR_CHAR_CODE('sing')
|
||||
typeIEEE64BitFloatingPoint = FOUR_CHAR_CODE('doub')
|
||||
type128BitFloatingPoint = FOUR_CHAR_CODE('ldbl')
|
||||
typeDecimalStruct = FOUR_CHAR_CODE('decm')
|
||||
typeSMInt = typeSInt16
|
||||
typeShortInteger = typeSInt16
|
||||
typeInteger = typeSInt32
|
||||
typeLongInteger = typeSInt32
|
||||
typeMagnitude = typeUInt32
|
||||
typeComp = typeSInt64
|
||||
typeSMFloat = typeIEEE32BitFloatingPoint
|
||||
typeShortFloat = typeIEEE32BitFloatingPoint
|
||||
typeFloat = typeIEEE64BitFloatingPoint
|
||||
typeLongFloat = typeIEEE64BitFloatingPoint
|
||||
typeExtended = FOUR_CHAR_CODE('exte')
|
||||
typeAEList = FOUR_CHAR_CODE('list')
|
||||
typeAERecord = FOUR_CHAR_CODE('reco')
|
||||
typeAppleEvent = FOUR_CHAR_CODE('aevt')
|
||||
typeEventRecord = FOUR_CHAR_CODE('evrc')
|
||||
typeTrue = FOUR_CHAR_CODE('true')
|
||||
typeFalse = FOUR_CHAR_CODE('fals')
|
||||
typeAlias = FOUR_CHAR_CODE('alis')
|
||||
typeEnumerated = FOUR_CHAR_CODE('enum')
|
||||
typeType = FOUR_CHAR_CODE('type')
|
||||
typeAppParameters = FOUR_CHAR_CODE('appa')
|
||||
typeProperty = FOUR_CHAR_CODE('prop')
|
||||
typeFSS = FOUR_CHAR_CODE('fss ')
|
||||
typeFSRef = FOUR_CHAR_CODE('fsrf')
|
||||
typeFileURL = FOUR_CHAR_CODE('furl')
|
||||
typeKeyword = FOUR_CHAR_CODE('keyw')
|
||||
typeSectionH = FOUR_CHAR_CODE('sect')
|
||||
typeWildCard = FOUR_CHAR_CODE('****')
|
||||
typeApplSignature = FOUR_CHAR_CODE('sign')
|
||||
typeQDRectangle = FOUR_CHAR_CODE('qdrt')
|
||||
typeFixed = FOUR_CHAR_CODE('fixd')
|
||||
typeProcessSerialNumber = FOUR_CHAR_CODE('psn ')
|
||||
typeApplicationURL = FOUR_CHAR_CODE('aprl')
|
||||
typeNull = FOUR_CHAR_CODE('null')
|
||||
typeSessionID = FOUR_CHAR_CODE('ssid')
|
||||
typeTargetID = FOUR_CHAR_CODE('targ')
|
||||
typeDispatcherID = FOUR_CHAR_CODE('dspt')
|
||||
keyTransactionIDAttr = FOUR_CHAR_CODE('tran')
|
||||
keyReturnIDAttr = FOUR_CHAR_CODE('rtid')
|
||||
keyEventClassAttr = FOUR_CHAR_CODE('evcl')
|
||||
keyEventIDAttr = FOUR_CHAR_CODE('evid')
|
||||
keyAddressAttr = FOUR_CHAR_CODE('addr')
|
||||
keyOptionalKeywordAttr = FOUR_CHAR_CODE('optk')
|
||||
keyTimeoutAttr = FOUR_CHAR_CODE('timo')
|
||||
keyInteractLevelAttr = FOUR_CHAR_CODE('inte')
|
||||
keyEventSourceAttr = FOUR_CHAR_CODE('esrc')
|
||||
keyMissedKeywordAttr = FOUR_CHAR_CODE('miss')
|
||||
keyOriginalAddressAttr = FOUR_CHAR_CODE('from')
|
||||
keyAcceptTimeoutAttr = FOUR_CHAR_CODE('actm')
|
||||
kAEDescListFactorNone = 0
|
||||
kAEDescListFactorType = 4
|
||||
kAEDescListFactorTypeAndSize = 8
|
||||
kAutoGenerateReturnID = -1
|
||||
kAnyTransactionID = 0
|
||||
kAEDataArray = 0
|
||||
kAEPackedArray = 1
|
||||
kAEDescArray = 3
|
||||
kAEKeyDescArray = 4
|
||||
kAEHandleArray = 2
|
||||
kAENormalPriority = 0x00000000
|
||||
kAEHighPriority = 0x00000001
|
||||
kAENoReply = 0x00000001
|
||||
kAEQueueReply = 0x00000002
|
||||
kAEWaitReply = 0x00000003
|
||||
kAEDontReconnect = 0x00000080
|
||||
kAEWantReceipt = 0x00000200
|
||||
kAENeverInteract = 0x00000010
|
||||
kAECanInteract = 0x00000020
|
||||
kAEAlwaysInteract = 0x00000030
|
||||
kAECanSwitchLayer = 0x00000040
|
||||
kAEDontRecord = 0x00001000
|
||||
kAEDontExecute = 0x00002000
|
||||
kAEProcessNonReplyEvents = 0x00008000
|
||||
kAEDefaultTimeout = -1
|
||||
kNoTimeOut = -2
|
||||
kAEInteractWithSelf = 0
|
||||
kAEInteractWithLocal = 1
|
||||
kAEInteractWithAll = 2
|
||||
kAEDoNotIgnoreHandler = 0x00000000
|
||||
kAEIgnoreAppPhacHandler = 0x00000001
|
||||
kAEIgnoreAppEventHandler = 0x00000002
|
||||
kAEIgnoreSysPhacHandler = 0x00000004
|
||||
kAEIgnoreSysEventHandler = 0x00000008
|
||||
kAEIngoreBuiltInEventHandler = 0x00000010
|
||||
# kAEDontDisposeOnResume = (long)0x80000000
|
||||
kAENoDispatch = 0
|
||||
# kAEUseStandardDispatch = (long)0xFFFFFFFF
|
||||
keyDirectObject = FOUR_CHAR_CODE('----')
|
||||
keyErrorNumber = FOUR_CHAR_CODE('errn')
|
||||
keyErrorString = FOUR_CHAR_CODE('errs')
|
||||
keyProcessSerialNumber = FOUR_CHAR_CODE('psn ')
|
||||
keyPreDispatch = FOUR_CHAR_CODE('phac')
|
||||
keySelectProc = FOUR_CHAR_CODE('selh')
|
||||
keyAERecorderCount = FOUR_CHAR_CODE('recr')
|
||||
keyAEVersion = FOUR_CHAR_CODE('vers')
|
||||
kCoreEventClass = FOUR_CHAR_CODE('aevt')
|
||||
kAEOpenApplication = FOUR_CHAR_CODE('oapp')
|
||||
kAEOpenDocuments = FOUR_CHAR_CODE('odoc')
|
||||
kAEPrintDocuments = FOUR_CHAR_CODE('pdoc')
|
||||
kAEQuitApplication = FOUR_CHAR_CODE('quit')
|
||||
kAEAnswer = FOUR_CHAR_CODE('ansr')
|
||||
kAEApplicationDied = FOUR_CHAR_CODE('obit')
|
||||
kAEShowPreferences = FOUR_CHAR_CODE('pref')
|
||||
kAEStartRecording = FOUR_CHAR_CODE('reca')
|
||||
kAEStopRecording = FOUR_CHAR_CODE('recc')
|
||||
kAENotifyStartRecording = FOUR_CHAR_CODE('rec1')
|
||||
kAENotifyStopRecording = FOUR_CHAR_CODE('rec0')
|
||||
kAENotifyRecording = FOUR_CHAR_CODE('recr')
|
||||
kAEUnknownSource = 0
|
||||
kAEDirectCall = 1
|
||||
kAESameProcess = 2
|
||||
kAELocalProcess = 3
|
||||
kAERemoteProcess = 4
|
||||
cAEList = FOUR_CHAR_CODE('list')
|
||||
cApplication = FOUR_CHAR_CODE('capp')
|
||||
cArc = FOUR_CHAR_CODE('carc')
|
||||
cBoolean = FOUR_CHAR_CODE('bool')
|
||||
cCell = FOUR_CHAR_CODE('ccel')
|
||||
cChar = FOUR_CHAR_CODE('cha ')
|
||||
cColorTable = FOUR_CHAR_CODE('clrt')
|
||||
cColumn = FOUR_CHAR_CODE('ccol')
|
||||
cDocument = FOUR_CHAR_CODE('docu')
|
||||
cDrawingArea = FOUR_CHAR_CODE('cdrw')
|
||||
cEnumeration = FOUR_CHAR_CODE('enum')
|
||||
cFile = FOUR_CHAR_CODE('file')
|
||||
cFixed = FOUR_CHAR_CODE('fixd')
|
||||
cFixedPoint = FOUR_CHAR_CODE('fpnt')
|
||||
cFixedRectangle = FOUR_CHAR_CODE('frct')
|
||||
cGraphicLine = FOUR_CHAR_CODE('glin')
|
||||
cGraphicObject = FOUR_CHAR_CODE('cgob')
|
||||
cGraphicShape = FOUR_CHAR_CODE('cgsh')
|
||||
cGraphicText = FOUR_CHAR_CODE('cgtx')
|
||||
cGroupedGraphic = FOUR_CHAR_CODE('cpic')
|
||||
cInsertionLoc = FOUR_CHAR_CODE('insl')
|
||||
cInsertionPoint = FOUR_CHAR_CODE('cins')
|
||||
cIntlText = FOUR_CHAR_CODE('itxt')
|
||||
cIntlWritingCode = FOUR_CHAR_CODE('intl')
|
||||
cItem = FOUR_CHAR_CODE('citm')
|
||||
cLine = FOUR_CHAR_CODE('clin')
|
||||
cLongDateTime = FOUR_CHAR_CODE('ldt ')
|
||||
cLongFixed = FOUR_CHAR_CODE('lfxd')
|
||||
cLongFixedPoint = FOUR_CHAR_CODE('lfpt')
|
||||
cLongFixedRectangle = FOUR_CHAR_CODE('lfrc')
|
||||
cLongInteger = FOUR_CHAR_CODE('long')
|
||||
cLongPoint = FOUR_CHAR_CODE('lpnt')
|
||||
cLongRectangle = FOUR_CHAR_CODE('lrct')
|
||||
cMachineLoc = FOUR_CHAR_CODE('mLoc')
|
||||
cMenu = FOUR_CHAR_CODE('cmnu')
|
||||
cMenuItem = FOUR_CHAR_CODE('cmen')
|
||||
cObject = FOUR_CHAR_CODE('cobj')
|
||||
cObjectSpecifier = FOUR_CHAR_CODE('obj ')
|
||||
cOpenableObject = FOUR_CHAR_CODE('coob')
|
||||
cOval = FOUR_CHAR_CODE('covl')
|
||||
cParagraph = FOUR_CHAR_CODE('cpar')
|
||||
cPICT = FOUR_CHAR_CODE('PICT')
|
||||
cPixel = FOUR_CHAR_CODE('cpxl')
|
||||
cPixelMap = FOUR_CHAR_CODE('cpix')
|
||||
cPolygon = FOUR_CHAR_CODE('cpgn')
|
||||
cProperty = FOUR_CHAR_CODE('prop')
|
||||
cQDPoint = FOUR_CHAR_CODE('QDpt')
|
||||
cQDRectangle = FOUR_CHAR_CODE('qdrt')
|
||||
cRectangle = FOUR_CHAR_CODE('crec')
|
||||
cRGBColor = FOUR_CHAR_CODE('cRGB')
|
||||
cRotation = FOUR_CHAR_CODE('trot')
|
||||
cRoundedRectangle = FOUR_CHAR_CODE('crrc')
|
||||
cRow = FOUR_CHAR_CODE('crow')
|
||||
cSelection = FOUR_CHAR_CODE('csel')
|
||||
cShortInteger = FOUR_CHAR_CODE('shor')
|
||||
cTable = FOUR_CHAR_CODE('ctbl')
|
||||
cText = FOUR_CHAR_CODE('ctxt')
|
||||
cTextFlow = FOUR_CHAR_CODE('cflo')
|
||||
cTextStyles = FOUR_CHAR_CODE('tsty')
|
||||
cType = FOUR_CHAR_CODE('type')
|
||||
cVersion = FOUR_CHAR_CODE('vers')
|
||||
cWindow = FOUR_CHAR_CODE('cwin')
|
||||
cWord = FOUR_CHAR_CODE('cwor')
|
||||
enumArrows = FOUR_CHAR_CODE('arro')
|
||||
enumJustification = FOUR_CHAR_CODE('just')
|
||||
enumKeyForm = FOUR_CHAR_CODE('kfrm')
|
||||
enumPosition = FOUR_CHAR_CODE('posi')
|
||||
enumProtection = FOUR_CHAR_CODE('prtn')
|
||||
enumQuality = FOUR_CHAR_CODE('qual')
|
||||
enumSaveOptions = FOUR_CHAR_CODE('savo')
|
||||
enumStyle = FOUR_CHAR_CODE('styl')
|
||||
enumTransferMode = FOUR_CHAR_CODE('tran')
|
||||
formUniqueID = FOUR_CHAR_CODE('ID ')
|
||||
kAEAbout = FOUR_CHAR_CODE('abou')
|
||||
kAEAfter = FOUR_CHAR_CODE('afte')
|
||||
kAEAliasSelection = FOUR_CHAR_CODE('sali')
|
||||
kAEAllCaps = FOUR_CHAR_CODE('alcp')
|
||||
kAEArrowAtEnd = FOUR_CHAR_CODE('aren')
|
||||
kAEArrowAtStart = FOUR_CHAR_CODE('arst')
|
||||
kAEArrowBothEnds = FOUR_CHAR_CODE('arbo')
|
||||
kAEAsk = FOUR_CHAR_CODE('ask ')
|
||||
kAEBefore = FOUR_CHAR_CODE('befo')
|
||||
kAEBeginning = FOUR_CHAR_CODE('bgng')
|
||||
kAEBeginsWith = FOUR_CHAR_CODE('bgwt')
|
||||
kAEBeginTransaction = FOUR_CHAR_CODE('begi')
|
||||
kAEBold = FOUR_CHAR_CODE('bold')
|
||||
kAECaseSensEquals = FOUR_CHAR_CODE('cseq')
|
||||
kAECentered = FOUR_CHAR_CODE('cent')
|
||||
kAEChangeView = FOUR_CHAR_CODE('view')
|
||||
kAEClone = FOUR_CHAR_CODE('clon')
|
||||
kAEClose = FOUR_CHAR_CODE('clos')
|
||||
kAECondensed = FOUR_CHAR_CODE('cond')
|
||||
kAEContains = FOUR_CHAR_CODE('cont')
|
||||
kAECopy = FOUR_CHAR_CODE('copy')
|
||||
kAECoreSuite = FOUR_CHAR_CODE('core')
|
||||
kAECountElements = FOUR_CHAR_CODE('cnte')
|
||||
kAECreateElement = FOUR_CHAR_CODE('crel')
|
||||
kAECreatePublisher = FOUR_CHAR_CODE('cpub')
|
||||
kAECut = FOUR_CHAR_CODE('cut ')
|
||||
kAEDelete = FOUR_CHAR_CODE('delo')
|
||||
kAEDoObjectsExist = FOUR_CHAR_CODE('doex')
|
||||
kAEDoScript = FOUR_CHAR_CODE('dosc')
|
||||
kAEDrag = FOUR_CHAR_CODE('drag')
|
||||
kAEDuplicateSelection = FOUR_CHAR_CODE('sdup')
|
||||
kAEEditGraphic = FOUR_CHAR_CODE('edit')
|
||||
kAEEmptyTrash = FOUR_CHAR_CODE('empt')
|
||||
kAEEnd = FOUR_CHAR_CODE('end ')
|
||||
kAEEndsWith = FOUR_CHAR_CODE('ends')
|
||||
kAEEndTransaction = FOUR_CHAR_CODE('endt')
|
||||
kAEEquals = FOUR_CHAR_CODE('= ')
|
||||
kAEExpanded = FOUR_CHAR_CODE('pexp')
|
||||
kAEFast = FOUR_CHAR_CODE('fast')
|
||||
kAEFinderEvents = FOUR_CHAR_CODE('FNDR')
|
||||
kAEFormulaProtect = FOUR_CHAR_CODE('fpro')
|
||||
kAEFullyJustified = FOUR_CHAR_CODE('full')
|
||||
kAEGetClassInfo = FOUR_CHAR_CODE('qobj')
|
||||
kAEGetData = FOUR_CHAR_CODE('getd')
|
||||
kAEGetDataSize = FOUR_CHAR_CODE('dsiz')
|
||||
kAEGetEventInfo = FOUR_CHAR_CODE('gtei')
|
||||
kAEGetInfoSelection = FOUR_CHAR_CODE('sinf')
|
||||
kAEGetPrivilegeSelection = FOUR_CHAR_CODE('sprv')
|
||||
kAEGetSuiteInfo = FOUR_CHAR_CODE('gtsi')
|
||||
kAEGreaterThan = FOUR_CHAR_CODE('> ')
|
||||
kAEGreaterThanEquals = FOUR_CHAR_CODE('>= ')
|
||||
kAEGrow = FOUR_CHAR_CODE('grow')
|
||||
kAEHidden = FOUR_CHAR_CODE('hidn')
|
||||
kAEHiQuality = FOUR_CHAR_CODE('hiqu')
|
||||
kAEImageGraphic = FOUR_CHAR_CODE('imgr')
|
||||
kAEIsUniform = FOUR_CHAR_CODE('isun')
|
||||
kAEItalic = FOUR_CHAR_CODE('ital')
|
||||
kAELeftJustified = FOUR_CHAR_CODE('left')
|
||||
kAELessThan = FOUR_CHAR_CODE('< ')
|
||||
kAELessThanEquals = FOUR_CHAR_CODE('<= ')
|
||||
kAELowercase = FOUR_CHAR_CODE('lowc')
|
||||
kAEMakeObjectsVisible = FOUR_CHAR_CODE('mvis')
|
||||
kAEMiscStandards = FOUR_CHAR_CODE('misc')
|
||||
kAEModifiable = FOUR_CHAR_CODE('modf')
|
||||
kAEMove = FOUR_CHAR_CODE('move')
|
||||
kAENo = FOUR_CHAR_CODE('no ')
|
||||
kAENoArrow = FOUR_CHAR_CODE('arno')
|
||||
kAENonmodifiable = FOUR_CHAR_CODE('nmod')
|
||||
kAEOpen = FOUR_CHAR_CODE('odoc')
|
||||
kAEOpenSelection = FOUR_CHAR_CODE('sope')
|
||||
kAEOutline = FOUR_CHAR_CODE('outl')
|
||||
kAEPageSetup = FOUR_CHAR_CODE('pgsu')
|
||||
kAEPaste = FOUR_CHAR_CODE('past')
|
||||
kAEPlain = FOUR_CHAR_CODE('plan')
|
||||
kAEPrint = FOUR_CHAR_CODE('pdoc')
|
||||
kAEPrintSelection = FOUR_CHAR_CODE('spri')
|
||||
kAEPrintWindow = FOUR_CHAR_CODE('pwin')
|
||||
kAEPutAwaySelection = FOUR_CHAR_CODE('sput')
|
||||
kAEQDAddOver = FOUR_CHAR_CODE('addo')
|
||||
kAEQDAddPin = FOUR_CHAR_CODE('addp')
|
||||
kAEQDAdMax = FOUR_CHAR_CODE('admx')
|
||||
kAEQDAdMin = FOUR_CHAR_CODE('admn')
|
||||
kAEQDBic = FOUR_CHAR_CODE('bic ')
|
||||
kAEQDBlend = FOUR_CHAR_CODE('blnd')
|
||||
kAEQDCopy = FOUR_CHAR_CODE('cpy ')
|
||||
kAEQDNotBic = FOUR_CHAR_CODE('nbic')
|
||||
kAEQDNotCopy = FOUR_CHAR_CODE('ncpy')
|
||||
kAEQDNotOr = FOUR_CHAR_CODE('ntor')
|
||||
kAEQDNotXor = FOUR_CHAR_CODE('nxor')
|
||||
kAEQDOr = FOUR_CHAR_CODE('or ')
|
||||
kAEQDSubOver = FOUR_CHAR_CODE('subo')
|
||||
kAEQDSubPin = FOUR_CHAR_CODE('subp')
|
||||
kAEQDSupplementalSuite = FOUR_CHAR_CODE('qdsp')
|
||||
kAEQDXor = FOUR_CHAR_CODE('xor ')
|
||||
kAEQuickdrawSuite = FOUR_CHAR_CODE('qdrw')
|
||||
kAEQuitAll = FOUR_CHAR_CODE('quia')
|
||||
kAERedo = FOUR_CHAR_CODE('redo')
|
||||
kAERegular = FOUR_CHAR_CODE('regl')
|
||||
kAEReopenApplication = FOUR_CHAR_CODE('rapp')
|
||||
kAEReplace = FOUR_CHAR_CODE('rplc')
|
||||
kAERequiredSuite = FOUR_CHAR_CODE('reqd')
|
||||
kAERestart = FOUR_CHAR_CODE('rest')
|
||||
kAERevealSelection = FOUR_CHAR_CODE('srev')
|
||||
kAERevert = FOUR_CHAR_CODE('rvrt')
|
||||
kAERightJustified = FOUR_CHAR_CODE('rght')
|
||||
kAESave = FOUR_CHAR_CODE('save')
|
||||
kAESelect = FOUR_CHAR_CODE('slct')
|
||||
kAESetData = FOUR_CHAR_CODE('setd')
|
||||
kAESetPosition = FOUR_CHAR_CODE('posn')
|
||||
kAEShadow = FOUR_CHAR_CODE('shad')
|
||||
kAEShowClipboard = FOUR_CHAR_CODE('shcl')
|
||||
kAEShutDown = FOUR_CHAR_CODE('shut')
|
||||
kAESleep = FOUR_CHAR_CODE('slep')
|
||||
kAESmallCaps = FOUR_CHAR_CODE('smcp')
|
||||
kAESpecialClassProperties = FOUR_CHAR_CODE('c@#!')
|
||||
kAEStrikethrough = FOUR_CHAR_CODE('strk')
|
||||
kAESubscript = FOUR_CHAR_CODE('sbsc')
|
||||
kAESuperscript = FOUR_CHAR_CODE('spsc')
|
||||
kAETableSuite = FOUR_CHAR_CODE('tbls')
|
||||
kAETextSuite = FOUR_CHAR_CODE('TEXT')
|
||||
kAETransactionTerminated = FOUR_CHAR_CODE('ttrm')
|
||||
kAEUnderline = FOUR_CHAR_CODE('undl')
|
||||
kAEUndo = FOUR_CHAR_CODE('undo')
|
||||
kAEWholeWordEquals = FOUR_CHAR_CODE('wweq')
|
||||
kAEYes = FOUR_CHAR_CODE('yes ')
|
||||
kAEZoom = FOUR_CHAR_CODE('zoom')
|
||||
kAEMouseClass = FOUR_CHAR_CODE('mous')
|
||||
kAEDown = FOUR_CHAR_CODE('down')
|
||||
kAEUp = FOUR_CHAR_CODE('up ')
|
||||
kAEMoved = FOUR_CHAR_CODE('move')
|
||||
kAEStoppedMoving = FOUR_CHAR_CODE('stop')
|
||||
kAEWindowClass = FOUR_CHAR_CODE('wind')
|
||||
kAEUpdate = FOUR_CHAR_CODE('updt')
|
||||
kAEActivate = FOUR_CHAR_CODE('actv')
|
||||
kAEDeactivate = FOUR_CHAR_CODE('dact')
|
||||
kAECommandClass = FOUR_CHAR_CODE('cmnd')
|
||||
kAEKeyClass = FOUR_CHAR_CODE('keyc')
|
||||
kAERawKey = FOUR_CHAR_CODE('rkey')
|
||||
kAEVirtualKey = FOUR_CHAR_CODE('keyc')
|
||||
kAENavigationKey = FOUR_CHAR_CODE('nave')
|
||||
kAEAutoDown = FOUR_CHAR_CODE('auto')
|
||||
kAEApplicationClass = FOUR_CHAR_CODE('appl')
|
||||
kAESuspend = FOUR_CHAR_CODE('susp')
|
||||
kAEResume = FOUR_CHAR_CODE('rsme')
|
||||
kAEDiskEvent = FOUR_CHAR_CODE('disk')
|
||||
kAENullEvent = FOUR_CHAR_CODE('null')
|
||||
kAEWakeUpEvent = FOUR_CHAR_CODE('wake')
|
||||
kAEScrapEvent = FOUR_CHAR_CODE('scrp')
|
||||
kAEHighLevel = FOUR_CHAR_CODE('high')
|
||||
keyAEAngle = FOUR_CHAR_CODE('kang')
|
||||
keyAEArcAngle = FOUR_CHAR_CODE('parc')
|
||||
keyAEBaseAddr = FOUR_CHAR_CODE('badd')
|
||||
keyAEBestType = FOUR_CHAR_CODE('pbst')
|
||||
keyAEBgndColor = FOUR_CHAR_CODE('kbcl')
|
||||
keyAEBgndPattern = FOUR_CHAR_CODE('kbpt')
|
||||
keyAEBounds = FOUR_CHAR_CODE('pbnd')
|
||||
keyAECellList = FOUR_CHAR_CODE('kclt')
|
||||
keyAEClassID = FOUR_CHAR_CODE('clID')
|
||||
keyAEColor = FOUR_CHAR_CODE('colr')
|
||||
keyAEColorTable = FOUR_CHAR_CODE('cltb')
|
||||
keyAECurveHeight = FOUR_CHAR_CODE('kchd')
|
||||
keyAECurveWidth = FOUR_CHAR_CODE('kcwd')
|
||||
keyAEDashStyle = FOUR_CHAR_CODE('pdst')
|
||||
keyAEData = FOUR_CHAR_CODE('data')
|
||||
keyAEDefaultType = FOUR_CHAR_CODE('deft')
|
||||
keyAEDefinitionRect = FOUR_CHAR_CODE('pdrt')
|
||||
keyAEDescType = FOUR_CHAR_CODE('dstp')
|
||||
keyAEDestination = FOUR_CHAR_CODE('dest')
|
||||
keyAEDoAntiAlias = FOUR_CHAR_CODE('anta')
|
||||
keyAEDoDithered = FOUR_CHAR_CODE('gdit')
|
||||
keyAEDoRotate = FOUR_CHAR_CODE('kdrt')
|
||||
keyAEDoScale = FOUR_CHAR_CODE('ksca')
|
||||
keyAEDoTranslate = FOUR_CHAR_CODE('ktra')
|
||||
keyAEEditionFileLoc = FOUR_CHAR_CODE('eloc')
|
||||
keyAEElements = FOUR_CHAR_CODE('elms')
|
||||
keyAEEndPoint = FOUR_CHAR_CODE('pend')
|
||||
keyAEEventClass = FOUR_CHAR_CODE('evcl')
|
||||
keyAEEventID = FOUR_CHAR_CODE('evti')
|
||||
keyAEFile = FOUR_CHAR_CODE('kfil')
|
||||
keyAEFileType = FOUR_CHAR_CODE('fltp')
|
||||
keyAEFillColor = FOUR_CHAR_CODE('flcl')
|
||||
keyAEFillPattern = FOUR_CHAR_CODE('flpt')
|
||||
keyAEFlipHorizontal = FOUR_CHAR_CODE('kfho')
|
||||
keyAEFlipVertical = FOUR_CHAR_CODE('kfvt')
|
||||
keyAEFont = FOUR_CHAR_CODE('font')
|
||||
keyAEFormula = FOUR_CHAR_CODE('pfor')
|
||||
keyAEGraphicObjects = FOUR_CHAR_CODE('gobs')
|
||||
keyAEID = FOUR_CHAR_CODE('ID ')
|
||||
keyAEImageQuality = FOUR_CHAR_CODE('gqua')
|
||||
keyAEInsertHere = FOUR_CHAR_CODE('insh')
|
||||
keyAEKeyForms = FOUR_CHAR_CODE('keyf')
|
||||
keyAEKeyword = FOUR_CHAR_CODE('kywd')
|
||||
keyAELevel = FOUR_CHAR_CODE('levl')
|
||||
keyAELineArrow = FOUR_CHAR_CODE('arro')
|
||||
keyAEName = FOUR_CHAR_CODE('pnam')
|
||||
keyAENewElementLoc = FOUR_CHAR_CODE('pnel')
|
||||
keyAEObject = FOUR_CHAR_CODE('kobj')
|
||||
keyAEObjectClass = FOUR_CHAR_CODE('kocl')
|
||||
keyAEOffStyles = FOUR_CHAR_CODE('ofst')
|
||||
keyAEOnStyles = FOUR_CHAR_CODE('onst')
|
||||
keyAEParameters = FOUR_CHAR_CODE('prms')
|
||||
keyAEParamFlags = FOUR_CHAR_CODE('pmfg')
|
||||
keyAEPenColor = FOUR_CHAR_CODE('ppcl')
|
||||
keyAEPenPattern = FOUR_CHAR_CODE('pppa')
|
||||
keyAEPenWidth = FOUR_CHAR_CODE('ppwd')
|
||||
keyAEPixelDepth = FOUR_CHAR_CODE('pdpt')
|
||||
keyAEPixMapMinus = FOUR_CHAR_CODE('kpmm')
|
||||
keyAEPMTable = FOUR_CHAR_CODE('kpmt')
|
||||
keyAEPointList = FOUR_CHAR_CODE('ptlt')
|
||||
keyAEPointSize = FOUR_CHAR_CODE('ptsz')
|
||||
keyAEPosition = FOUR_CHAR_CODE('kpos')
|
||||
keyAEPropData = FOUR_CHAR_CODE('prdt')
|
||||
keyAEProperties = FOUR_CHAR_CODE('qpro')
|
||||
keyAEProperty = FOUR_CHAR_CODE('kprp')
|
||||
keyAEPropFlags = FOUR_CHAR_CODE('prfg')
|
||||
keyAEPropID = FOUR_CHAR_CODE('prop')
|
||||
keyAEProtection = FOUR_CHAR_CODE('ppro')
|
||||
keyAERenderAs = FOUR_CHAR_CODE('kren')
|
||||
keyAERequestedType = FOUR_CHAR_CODE('rtyp')
|
||||
keyAEResult = FOUR_CHAR_CODE('----')
|
||||
keyAEResultInfo = FOUR_CHAR_CODE('rsin')
|
||||
keyAERotation = FOUR_CHAR_CODE('prot')
|
||||
keyAERotPoint = FOUR_CHAR_CODE('krtp')
|
||||
keyAERowList = FOUR_CHAR_CODE('krls')
|
||||
keyAESaveOptions = FOUR_CHAR_CODE('savo')
|
||||
keyAEScale = FOUR_CHAR_CODE('pscl')
|
||||
keyAEScriptTag = FOUR_CHAR_CODE('psct')
|
||||
keyAEShowWhere = FOUR_CHAR_CODE('show')
|
||||
keyAEStartAngle = FOUR_CHAR_CODE('pang')
|
||||
keyAEStartPoint = FOUR_CHAR_CODE('pstp')
|
||||
keyAEStyles = FOUR_CHAR_CODE('ksty')
|
||||
keyAESuiteID = FOUR_CHAR_CODE('suit')
|
||||
keyAEText = FOUR_CHAR_CODE('ktxt')
|
||||
keyAETextColor = FOUR_CHAR_CODE('ptxc')
|
||||
keyAETextFont = FOUR_CHAR_CODE('ptxf')
|
||||
keyAETextPointSize = FOUR_CHAR_CODE('ptps')
|
||||
keyAETextStyles = FOUR_CHAR_CODE('txst')
|
||||
keyAETextLineHeight = FOUR_CHAR_CODE('ktlh')
|
||||
keyAETextLineAscent = FOUR_CHAR_CODE('ktas')
|
||||
keyAETheText = FOUR_CHAR_CODE('thtx')
|
||||
keyAETransferMode = FOUR_CHAR_CODE('pptm')
|
||||
keyAETranslation = FOUR_CHAR_CODE('ptrs')
|
||||
keyAETryAsStructGraf = FOUR_CHAR_CODE('toog')
|
||||
keyAEUniformStyles = FOUR_CHAR_CODE('ustl')
|
||||
keyAEUpdateOn = FOUR_CHAR_CODE('pupd')
|
||||
keyAEUserTerm = FOUR_CHAR_CODE('utrm')
|
||||
keyAEWindow = FOUR_CHAR_CODE('wndw')
|
||||
keyAEWritingCode = FOUR_CHAR_CODE('wrcd')
|
||||
keyMiscellaneous = FOUR_CHAR_CODE('fmsc')
|
||||
keySelection = FOUR_CHAR_CODE('fsel')
|
||||
keyWindow = FOUR_CHAR_CODE('kwnd')
|
||||
keyWhen = FOUR_CHAR_CODE('when')
|
||||
keyWhere = FOUR_CHAR_CODE('wher')
|
||||
keyModifiers = FOUR_CHAR_CODE('mods')
|
||||
keyKey = FOUR_CHAR_CODE('key ')
|
||||
keyKeyCode = FOUR_CHAR_CODE('code')
|
||||
keyKeyboard = FOUR_CHAR_CODE('keyb')
|
||||
keyDriveNumber = FOUR_CHAR_CODE('drv#')
|
||||
keyErrorCode = FOUR_CHAR_CODE('err#')
|
||||
keyHighLevelClass = FOUR_CHAR_CODE('hcls')
|
||||
keyHighLevelID = FOUR_CHAR_CODE('hid ')
|
||||
pArcAngle = FOUR_CHAR_CODE('parc')
|
||||
pBackgroundColor = FOUR_CHAR_CODE('pbcl')
|
||||
pBackgroundPattern = FOUR_CHAR_CODE('pbpt')
|
||||
pBestType = FOUR_CHAR_CODE('pbst')
|
||||
pBounds = FOUR_CHAR_CODE('pbnd')
|
||||
pClass = FOUR_CHAR_CODE('pcls')
|
||||
pClipboard = FOUR_CHAR_CODE('pcli')
|
||||
pColor = FOUR_CHAR_CODE('colr')
|
||||
pColorTable = FOUR_CHAR_CODE('cltb')
|
||||
pContents = FOUR_CHAR_CODE('pcnt')
|
||||
pCornerCurveHeight = FOUR_CHAR_CODE('pchd')
|
||||
pCornerCurveWidth = FOUR_CHAR_CODE('pcwd')
|
||||
pDashStyle = FOUR_CHAR_CODE('pdst')
|
||||
pDefaultType = FOUR_CHAR_CODE('deft')
|
||||
pDefinitionRect = FOUR_CHAR_CODE('pdrt')
|
||||
pEnabled = FOUR_CHAR_CODE('enbl')
|
||||
pEndPoint = FOUR_CHAR_CODE('pend')
|
||||
pFillColor = FOUR_CHAR_CODE('flcl')
|
||||
pFillPattern = FOUR_CHAR_CODE('flpt')
|
||||
pFont = FOUR_CHAR_CODE('font')
|
||||
pFormula = FOUR_CHAR_CODE('pfor')
|
||||
pGraphicObjects = FOUR_CHAR_CODE('gobs')
|
||||
pHasCloseBox = FOUR_CHAR_CODE('hclb')
|
||||
pHasTitleBar = FOUR_CHAR_CODE('ptit')
|
||||
pID = FOUR_CHAR_CODE('ID ')
|
||||
pIndex = FOUR_CHAR_CODE('pidx')
|
||||
pInsertionLoc = FOUR_CHAR_CODE('pins')
|
||||
pIsFloating = FOUR_CHAR_CODE('isfl')
|
||||
pIsFrontProcess = FOUR_CHAR_CODE('pisf')
|
||||
pIsModal = FOUR_CHAR_CODE('pmod')
|
||||
pIsModified = FOUR_CHAR_CODE('imod')
|
||||
pIsResizable = FOUR_CHAR_CODE('prsz')
|
||||
pIsStationeryPad = FOUR_CHAR_CODE('pspd')
|
||||
pIsZoomable = FOUR_CHAR_CODE('iszm')
|
||||
pIsZoomed = FOUR_CHAR_CODE('pzum')
|
||||
pItemNumber = FOUR_CHAR_CODE('itmn')
|
||||
pJustification = FOUR_CHAR_CODE('pjst')
|
||||
pLineArrow = FOUR_CHAR_CODE('arro')
|
||||
pMenuID = FOUR_CHAR_CODE('mnid')
|
||||
pName = FOUR_CHAR_CODE('pnam')
|
||||
pNewElementLoc = FOUR_CHAR_CODE('pnel')
|
||||
pPenColor = FOUR_CHAR_CODE('ppcl')
|
||||
pPenPattern = FOUR_CHAR_CODE('pppa')
|
||||
pPenWidth = FOUR_CHAR_CODE('ppwd')
|
||||
pPixelDepth = FOUR_CHAR_CODE('pdpt')
|
||||
pPointList = FOUR_CHAR_CODE('ptlt')
|
||||
pPointSize = FOUR_CHAR_CODE('ptsz')
|
||||
pProtection = FOUR_CHAR_CODE('ppro')
|
||||
pRotation = FOUR_CHAR_CODE('prot')
|
||||
pScale = FOUR_CHAR_CODE('pscl')
|
||||
pScript = FOUR_CHAR_CODE('scpt')
|
||||
pScriptTag = FOUR_CHAR_CODE('psct')
|
||||
pSelected = FOUR_CHAR_CODE('selc')
|
||||
pSelection = FOUR_CHAR_CODE('sele')
|
||||
pStartAngle = FOUR_CHAR_CODE('pang')
|
||||
pStartPoint = FOUR_CHAR_CODE('pstp')
|
||||
pTextColor = FOUR_CHAR_CODE('ptxc')
|
||||
pTextFont = FOUR_CHAR_CODE('ptxf')
|
||||
pTextItemDelimiters = FOUR_CHAR_CODE('txdl')
|
||||
pTextPointSize = FOUR_CHAR_CODE('ptps')
|
||||
pTextStyles = FOUR_CHAR_CODE('txst')
|
||||
pTransferMode = FOUR_CHAR_CODE('pptm')
|
||||
pTranslation = FOUR_CHAR_CODE('ptrs')
|
||||
pUniformStyles = FOUR_CHAR_CODE('ustl')
|
||||
pUpdateOn = FOUR_CHAR_CODE('pupd')
|
||||
pUserSelection = FOUR_CHAR_CODE('pusl')
|
||||
pVersion = FOUR_CHAR_CODE('vers')
|
||||
pVisible = FOUR_CHAR_CODE('pvis')
|
||||
typeAEText = FOUR_CHAR_CODE('tTXT')
|
||||
typeArc = FOUR_CHAR_CODE('carc')
|
||||
typeBest = FOUR_CHAR_CODE('best')
|
||||
typeCell = FOUR_CHAR_CODE('ccel')
|
||||
typeClassInfo = FOUR_CHAR_CODE('gcli')
|
||||
typeColorTable = FOUR_CHAR_CODE('clrt')
|
||||
typeColumn = FOUR_CHAR_CODE('ccol')
|
||||
typeDashStyle = FOUR_CHAR_CODE('tdas')
|
||||
typeData = FOUR_CHAR_CODE('tdta')
|
||||
typeDrawingArea = FOUR_CHAR_CODE('cdrw')
|
||||
typeElemInfo = FOUR_CHAR_CODE('elin')
|
||||
typeEnumeration = FOUR_CHAR_CODE('enum')
|
||||
typeEPS = FOUR_CHAR_CODE('EPS ')
|
||||
typeEventInfo = FOUR_CHAR_CODE('evin')
|
||||
typeFinderWindow = FOUR_CHAR_CODE('fwin')
|
||||
typeFixedPoint = FOUR_CHAR_CODE('fpnt')
|
||||
typeFixedRectangle = FOUR_CHAR_CODE('frct')
|
||||
typeGraphicLine = FOUR_CHAR_CODE('glin')
|
||||
typeGraphicText = FOUR_CHAR_CODE('cgtx')
|
||||
typeGroupedGraphic = FOUR_CHAR_CODE('cpic')
|
||||
typeInsertionLoc = FOUR_CHAR_CODE('insl')
|
||||
typeIntlText = FOUR_CHAR_CODE('itxt')
|
||||
typeIntlWritingCode = FOUR_CHAR_CODE('intl')
|
||||
typeLongDateTime = FOUR_CHAR_CODE('ldt ')
|
||||
typeLongFixed = FOUR_CHAR_CODE('lfxd')
|
||||
typeLongFixedPoint = FOUR_CHAR_CODE('lfpt')
|
||||
typeLongFixedRectangle = FOUR_CHAR_CODE('lfrc')
|
||||
typeLongPoint = FOUR_CHAR_CODE('lpnt')
|
||||
typeLongRectangle = FOUR_CHAR_CODE('lrct')
|
||||
typeMachineLoc = FOUR_CHAR_CODE('mLoc')
|
||||
typeOval = FOUR_CHAR_CODE('covl')
|
||||
typeParamInfo = FOUR_CHAR_CODE('pmin')
|
||||
typePict = FOUR_CHAR_CODE('PICT')
|
||||
typePixelMap = FOUR_CHAR_CODE('cpix')
|
||||
typePixMapMinus = FOUR_CHAR_CODE('tpmm')
|
||||
typePolygon = FOUR_CHAR_CODE('cpgn')
|
||||
typePropInfo = FOUR_CHAR_CODE('pinf')
|
||||
typePtr = FOUR_CHAR_CODE('ptr ')
|
||||
typeQDPoint = FOUR_CHAR_CODE('QDpt')
|
||||
typeQDRegion = FOUR_CHAR_CODE('Qrgn')
|
||||
typeRectangle = FOUR_CHAR_CODE('crec')
|
||||
typeRGB16 = FOUR_CHAR_CODE('tr16')
|
||||
typeRGB96 = FOUR_CHAR_CODE('tr96')
|
||||
typeRGBColor = FOUR_CHAR_CODE('cRGB')
|
||||
typeRotation = FOUR_CHAR_CODE('trot')
|
||||
typeRoundedRectangle = FOUR_CHAR_CODE('crrc')
|
||||
typeRow = FOUR_CHAR_CODE('crow')
|
||||
typeScrapStyles = FOUR_CHAR_CODE('styl')
|
||||
typeScript = FOUR_CHAR_CODE('scpt')
|
||||
typeStyledText = FOUR_CHAR_CODE('STXT')
|
||||
typeSuiteInfo = FOUR_CHAR_CODE('suin')
|
||||
typeTable = FOUR_CHAR_CODE('ctbl')
|
||||
typeTextStyles = FOUR_CHAR_CODE('tsty')
|
||||
typeTIFF = FOUR_CHAR_CODE('TIFF')
|
||||
typeVersion = FOUR_CHAR_CODE('vers')
|
||||
kAEMenuClass = FOUR_CHAR_CODE('menu')
|
||||
kAEMenuSelect = FOUR_CHAR_CODE('mhit')
|
||||
kAEMouseDown = FOUR_CHAR_CODE('mdwn')
|
||||
kAEMouseDownInBack = FOUR_CHAR_CODE('mdbk')
|
||||
kAEKeyDown = FOUR_CHAR_CODE('kdwn')
|
||||
kAEResized = FOUR_CHAR_CODE('rsiz')
|
||||
kAEPromise = FOUR_CHAR_CODE('prom')
|
||||
keyMenuID = FOUR_CHAR_CODE('mid ')
|
||||
keyMenuItem = FOUR_CHAR_CODE('mitm')
|
||||
keyCloseAllWindows = FOUR_CHAR_CODE('caw ')
|
||||
keyOriginalBounds = FOUR_CHAR_CODE('obnd')
|
||||
keyNewBounds = FOUR_CHAR_CODE('nbnd')
|
||||
keyLocalWhere = FOUR_CHAR_CODE('lwhr')
|
||||
typeHIMenu = FOUR_CHAR_CODE('mobj')
|
||||
typeHIWindow = FOUR_CHAR_CODE('wobj')
|
||||
kBySmallIcon = 0
|
||||
kByIconView = 1
|
||||
kByNameView = 2
|
||||
kByDateView = 3
|
||||
kBySizeView = 4
|
||||
kByKindView = 5
|
||||
kByCommentView = 6
|
||||
kByLabelView = 7
|
||||
kByVersionView = 8
|
||||
kAEInfo = 11
|
||||
kAEMain = 0
|
||||
kAESharing = 13
|
||||
kAEZoomIn = 7
|
||||
kAEZoomOut = 8
|
||||
kTextServiceClass = FOUR_CHAR_CODE('tsvc')
|
||||
kUpdateActiveInputArea = FOUR_CHAR_CODE('updt')
|
||||
kShowHideInputWindow = FOUR_CHAR_CODE('shiw')
|
||||
kPos2Offset = FOUR_CHAR_CODE('p2st')
|
||||
kOffset2Pos = FOUR_CHAR_CODE('st2p')
|
||||
kUnicodeNotFromInputMethod = FOUR_CHAR_CODE('unim')
|
||||
kGetSelectedText = FOUR_CHAR_CODE('gtxt')
|
||||
keyAETSMDocumentRefcon = FOUR_CHAR_CODE('refc')
|
||||
keyAEServerInstance = FOUR_CHAR_CODE('srvi')
|
||||
keyAETheData = FOUR_CHAR_CODE('kdat')
|
||||
keyAEFixLength = FOUR_CHAR_CODE('fixl')
|
||||
keyAEUpdateRange = FOUR_CHAR_CODE('udng')
|
||||
keyAECurrentPoint = FOUR_CHAR_CODE('cpos')
|
||||
keyAEBufferSize = FOUR_CHAR_CODE('buff')
|
||||
keyAEMoveView = FOUR_CHAR_CODE('mvvw')
|
||||
keyAENextBody = FOUR_CHAR_CODE('nxbd')
|
||||
keyAETSMScriptTag = FOUR_CHAR_CODE('sclg')
|
||||
keyAETSMTextFont = FOUR_CHAR_CODE('ktxf')
|
||||
keyAETSMTextFMFont = FOUR_CHAR_CODE('ktxm')
|
||||
keyAETSMTextPointSize = FOUR_CHAR_CODE('ktps')
|
||||
keyAETSMEventRecord = FOUR_CHAR_CODE('tevt')
|
||||
keyAETSMEventRef = FOUR_CHAR_CODE('tevr')
|
||||
keyAETextServiceEncoding = FOUR_CHAR_CODE('tsen')
|
||||
keyAETextServiceMacEncoding = FOUR_CHAR_CODE('tmen')
|
||||
typeTextRange = FOUR_CHAR_CODE('txrn')
|
||||
typeComponentInstance = FOUR_CHAR_CODE('cmpi')
|
||||
typeOffsetArray = FOUR_CHAR_CODE('ofay')
|
||||
typeTextRangeArray = FOUR_CHAR_CODE('tray')
|
||||
typeLowLevelEventRecord = FOUR_CHAR_CODE('evtr')
|
||||
typeEventRef = FOUR_CHAR_CODE('evrf')
|
||||
typeText = typeChar
|
||||
kTSMOutsideOfBody = 1
|
||||
kTSMInsideOfBody = 2
|
||||
kTSMInsideOfActiveInputArea = 3
|
||||
kNextBody = 1
|
||||
kPreviousBody = 2
|
||||
kCaretPosition = 1
|
||||
kRawText = 2
|
||||
kSelectedRawText = 3
|
||||
kConvertedText = 4
|
||||
kSelectedConvertedText = 5
|
||||
kBlockFillText = 6
|
||||
kOutlineText = 7
|
||||
kSelectedText = 8
|
||||
keyAEHiliteRange = FOUR_CHAR_CODE('hrng')
|
||||
keyAEPinRange = FOUR_CHAR_CODE('pnrg')
|
||||
keyAEClauseOffsets = FOUR_CHAR_CODE('clau')
|
||||
keyAEOffset = FOUR_CHAR_CODE('ofst')
|
||||
keyAEPoint = FOUR_CHAR_CODE('gpos')
|
||||
keyAELeftSide = FOUR_CHAR_CODE('klef')
|
||||
keyAERegionClass = FOUR_CHAR_CODE('rgnc')
|
||||
keyAEDragging = FOUR_CHAR_CODE('bool')
|
||||
keyAELeadingEdge = keyAELeftSide
|
||||
typeUnicodeText = FOUR_CHAR_CODE('utxt')
|
||||
typeStyledUnicodeText = FOUR_CHAR_CODE('sutx')
|
||||
typeEncodedString = FOUR_CHAR_CODE('encs')
|
||||
typeCString = FOUR_CHAR_CODE('cstr')
|
||||
typePString = FOUR_CHAR_CODE('pstr')
|
||||
typeMeters = FOUR_CHAR_CODE('metr')
|
||||
typeInches = FOUR_CHAR_CODE('inch')
|
||||
typeFeet = FOUR_CHAR_CODE('feet')
|
||||
typeYards = FOUR_CHAR_CODE('yard')
|
||||
typeMiles = FOUR_CHAR_CODE('mile')
|
||||
typeKilometers = FOUR_CHAR_CODE('kmtr')
|
||||
typeCentimeters = FOUR_CHAR_CODE('cmtr')
|
||||
typeSquareMeters = FOUR_CHAR_CODE('sqrm')
|
||||
typeSquareFeet = FOUR_CHAR_CODE('sqft')
|
||||
typeSquareYards = FOUR_CHAR_CODE('sqyd')
|
||||
typeSquareMiles = FOUR_CHAR_CODE('sqmi')
|
||||
typeSquareKilometers = FOUR_CHAR_CODE('sqkm')
|
||||
typeLiters = FOUR_CHAR_CODE('litr')
|
||||
typeQuarts = FOUR_CHAR_CODE('qrts')
|
||||
typeGallons = FOUR_CHAR_CODE('galn')
|
||||
typeCubicMeters = FOUR_CHAR_CODE('cmet')
|
||||
typeCubicFeet = FOUR_CHAR_CODE('cfet')
|
||||
typeCubicInches = FOUR_CHAR_CODE('cuin')
|
||||
typeCubicCentimeter = FOUR_CHAR_CODE('ccmt')
|
||||
typeCubicYards = FOUR_CHAR_CODE('cyrd')
|
||||
typeKilograms = FOUR_CHAR_CODE('kgrm')
|
||||
typeGrams = FOUR_CHAR_CODE('gram')
|
||||
typeOunces = FOUR_CHAR_CODE('ozs ')
|
||||
typePounds = FOUR_CHAR_CODE('lbs ')
|
||||
typeDegreesC = FOUR_CHAR_CODE('degc')
|
||||
typeDegreesF = FOUR_CHAR_CODE('degf')
|
||||
typeDegreesK = FOUR_CHAR_CODE('degk')
|
||||
kFAServerApp = FOUR_CHAR_CODE('ssrv')
|
||||
kDoFolderActionEvent = FOUR_CHAR_CODE('fola')
|
||||
kFolderActionCode = FOUR_CHAR_CODE('actn')
|
||||
kFolderOpenedEvent = FOUR_CHAR_CODE('fopn')
|
||||
kFolderClosedEvent = FOUR_CHAR_CODE('fclo')
|
||||
kFolderWindowMovedEvent = FOUR_CHAR_CODE('fsiz')
|
||||
kFolderItemsAddedEvent = FOUR_CHAR_CODE('fget')
|
||||
kFolderItemsRemovedEvent = FOUR_CHAR_CODE('flos')
|
||||
kItemList = FOUR_CHAR_CODE('flst')
|
||||
kNewSizeParameter = FOUR_CHAR_CODE('fnsz')
|
||||
kFASuiteCode = FOUR_CHAR_CODE('faco')
|
||||
kFAAttachCommand = FOUR_CHAR_CODE('atfa')
|
||||
kFARemoveCommand = FOUR_CHAR_CODE('rmfa')
|
||||
kFAEditCommand = FOUR_CHAR_CODE('edfa')
|
||||
kFAFileParam = FOUR_CHAR_CODE('faal')
|
||||
kFAIndexParam = FOUR_CHAR_CODE('indx')
|
||||
kAEInternetSuite = FOUR_CHAR_CODE('gurl')
|
||||
kAEISWebStarSuite = FOUR_CHAR_CODE('WWW\xbd')
|
||||
kAEISGetURL = FOUR_CHAR_CODE('gurl')
|
||||
KAEISHandleCGI = FOUR_CHAR_CODE('sdoc')
|
||||
cURL = FOUR_CHAR_CODE('url ')
|
||||
cInternetAddress = FOUR_CHAR_CODE('IPAD')
|
||||
cHTML = FOUR_CHAR_CODE('html')
|
||||
cFTPItem = FOUR_CHAR_CODE('ftp ')
|
||||
kAEISHTTPSearchArgs = FOUR_CHAR_CODE('kfor')
|
||||
kAEISPostArgs = FOUR_CHAR_CODE('post')
|
||||
kAEISMethod = FOUR_CHAR_CODE('meth')
|
||||
kAEISClientAddress = FOUR_CHAR_CODE('addr')
|
||||
kAEISUserName = FOUR_CHAR_CODE('user')
|
||||
kAEISPassword = FOUR_CHAR_CODE('pass')
|
||||
kAEISFromUser = FOUR_CHAR_CODE('frmu')
|
||||
kAEISServerName = FOUR_CHAR_CODE('svnm')
|
||||
kAEISServerPort = FOUR_CHAR_CODE('svpt')
|
||||
kAEISScriptName = FOUR_CHAR_CODE('scnm')
|
||||
kAEISContentType = FOUR_CHAR_CODE('ctyp')
|
||||
kAEISReferrer = FOUR_CHAR_CODE('refr')
|
||||
kAEISUserAgent = FOUR_CHAR_CODE('Agnt')
|
||||
kAEISAction = FOUR_CHAR_CODE('Kact')
|
||||
kAEISActionPath = FOUR_CHAR_CODE('Kapt')
|
||||
kAEISClientIP = FOUR_CHAR_CODE('Kcip')
|
||||
kAEISFullRequest = FOUR_CHAR_CODE('Kfrq')
|
||||
pScheme = FOUR_CHAR_CODE('pusc')
|
||||
pHost = FOUR_CHAR_CODE('HOST')
|
||||
pPath = FOUR_CHAR_CODE('FTPc')
|
||||
pUserName = FOUR_CHAR_CODE('RAun')
|
||||
pUserPassword = FOUR_CHAR_CODE('RApw')
|
||||
pDNSForm = FOUR_CHAR_CODE('pDNS')
|
||||
pURL = FOUR_CHAR_CODE('pURL')
|
||||
pTextEncoding = FOUR_CHAR_CODE('ptxe')
|
||||
pFTPKind = FOUR_CHAR_CODE('kind')
|
||||
eScheme = FOUR_CHAR_CODE('esch')
|
||||
eurlHTTP = FOUR_CHAR_CODE('http')
|
||||
eurlHTTPS = FOUR_CHAR_CODE('htps')
|
||||
eurlFTP = FOUR_CHAR_CODE('ftp ')
|
||||
eurlMail = FOUR_CHAR_CODE('mail')
|
||||
eurlFile = FOUR_CHAR_CODE('file')
|
||||
eurlGopher = FOUR_CHAR_CODE('gphr')
|
||||
eurlTelnet = FOUR_CHAR_CODE('tlnt')
|
||||
eurlNews = FOUR_CHAR_CODE('news')
|
||||
eurlSNews = FOUR_CHAR_CODE('snws')
|
||||
eurlNNTP = FOUR_CHAR_CODE('nntp')
|
||||
eurlMessage = FOUR_CHAR_CODE('mess')
|
||||
eurlMailbox = FOUR_CHAR_CODE('mbox')
|
||||
eurlMulti = FOUR_CHAR_CODE('mult')
|
||||
eurlLaunch = FOUR_CHAR_CODE('laun')
|
||||
eurlAFP = FOUR_CHAR_CODE('afp ')
|
||||
eurlAT = FOUR_CHAR_CODE('at ')
|
||||
eurlEPPC = FOUR_CHAR_CODE('eppc')
|
||||
eurlRTSP = FOUR_CHAR_CODE('rtsp')
|
||||
eurlIMAP = FOUR_CHAR_CODE('imap')
|
||||
eurlNFS = FOUR_CHAR_CODE('unfs')
|
||||
eurlPOP = FOUR_CHAR_CODE('upop')
|
||||
eurlLDAP = FOUR_CHAR_CODE('uldp')
|
||||
eurlUnknown = FOUR_CHAR_CODE('url?')
|
||||
kConnSuite = FOUR_CHAR_CODE('macc')
|
||||
cDevSpec = FOUR_CHAR_CODE('cdev')
|
||||
cAddressSpec = FOUR_CHAR_CODE('cadr')
|
||||
cADBAddress = FOUR_CHAR_CODE('cadb')
|
||||
cAppleTalkAddress = FOUR_CHAR_CODE('cat ')
|
||||
cBusAddress = FOUR_CHAR_CODE('cbus')
|
||||
cEthernetAddress = FOUR_CHAR_CODE('cen ')
|
||||
cFireWireAddress = FOUR_CHAR_CODE('cfw ')
|
||||
cIPAddress = FOUR_CHAR_CODE('cip ')
|
||||
cLocalTalkAddress = FOUR_CHAR_CODE('clt ')
|
||||
cSCSIAddress = FOUR_CHAR_CODE('cscs')
|
||||
cTokenRingAddress = FOUR_CHAR_CODE('ctok')
|
||||
cUSBAddress = FOUR_CHAR_CODE('cusb')
|
||||
pDeviceType = FOUR_CHAR_CODE('pdvt')
|
||||
pDeviceAddress = FOUR_CHAR_CODE('pdva')
|
||||
pConduit = FOUR_CHAR_CODE('pcon')
|
||||
pProtocol = FOUR_CHAR_CODE('pprt')
|
||||
pATMachine = FOUR_CHAR_CODE('patm')
|
||||
pATZone = FOUR_CHAR_CODE('patz')
|
||||
pATType = FOUR_CHAR_CODE('patt')
|
||||
pDottedDecimal = FOUR_CHAR_CODE('pipd')
|
||||
pDNS = FOUR_CHAR_CODE('pdns')
|
||||
pPort = FOUR_CHAR_CODE('ppor')
|
||||
pNetwork = FOUR_CHAR_CODE('pnet')
|
||||
pNode = FOUR_CHAR_CODE('pnod')
|
||||
pSocket = FOUR_CHAR_CODE('psoc')
|
||||
pSCSIBus = FOUR_CHAR_CODE('pscb')
|
||||
pSCSILUN = FOUR_CHAR_CODE('pslu')
|
||||
eDeviceType = FOUR_CHAR_CODE('edvt')
|
||||
eAddressSpec = FOUR_CHAR_CODE('eads')
|
||||
eConduit = FOUR_CHAR_CODE('econ')
|
||||
eProtocol = FOUR_CHAR_CODE('epro')
|
||||
eADB = FOUR_CHAR_CODE('eadb')
|
||||
eAnalogAudio = FOUR_CHAR_CODE('epau')
|
||||
eAppleTalk = FOUR_CHAR_CODE('epat')
|
||||
eAudioLineIn = FOUR_CHAR_CODE('ecai')
|
||||
eAudioLineOut = FOUR_CHAR_CODE('ecal')
|
||||
eAudioOut = FOUR_CHAR_CODE('ecao')
|
||||
eBus = FOUR_CHAR_CODE('ebus')
|
||||
eCDROM = FOUR_CHAR_CODE('ecd ')
|
||||
eCommSlot = FOUR_CHAR_CODE('eccm')
|
||||
eDigitalAudio = FOUR_CHAR_CODE('epda')
|
||||
eDisplay = FOUR_CHAR_CODE('edds')
|
||||
eDVD = FOUR_CHAR_CODE('edvd')
|
||||
eEthernet = FOUR_CHAR_CODE('ecen')
|
||||
eFireWire = FOUR_CHAR_CODE('ecfw')
|
||||
eFloppy = FOUR_CHAR_CODE('efd ')
|
||||
eHD = FOUR_CHAR_CODE('ehd ')
|
||||
eInfrared = FOUR_CHAR_CODE('ecir')
|
||||
eIP = FOUR_CHAR_CODE('epip')
|
||||
eIrDA = FOUR_CHAR_CODE('epir')
|
||||
eIRTalk = FOUR_CHAR_CODE('epit')
|
||||
eKeyboard = FOUR_CHAR_CODE('ekbd')
|
||||
eLCD = FOUR_CHAR_CODE('edlc')
|
||||
eLocalTalk = FOUR_CHAR_CODE('eclt')
|
||||
eMacIP = FOUR_CHAR_CODE('epmi')
|
||||
eMacVideo = FOUR_CHAR_CODE('epmv')
|
||||
eMicrophone = FOUR_CHAR_CODE('ecmi')
|
||||
eModemPort = FOUR_CHAR_CODE('ecmp')
|
||||
eModemPrinterPort = FOUR_CHAR_CODE('empp')
|
||||
eModem = FOUR_CHAR_CODE('edmm')
|
||||
eMonitorOut = FOUR_CHAR_CODE('ecmn')
|
||||
eMouse = FOUR_CHAR_CODE('emou')
|
||||
eNuBusCard = FOUR_CHAR_CODE('ednb')
|
||||
eNuBus = FOUR_CHAR_CODE('enub')
|
||||
ePCcard = FOUR_CHAR_CODE('ecpc')
|
||||
ePCIbus = FOUR_CHAR_CODE('ecpi')
|
||||
ePCIcard = FOUR_CHAR_CODE('edpi')
|
||||
ePDSslot = FOUR_CHAR_CODE('ecpd')
|
||||
ePDScard = FOUR_CHAR_CODE('epds')
|
||||
ePointingDevice = FOUR_CHAR_CODE('edpd')
|
||||
ePostScript = FOUR_CHAR_CODE('epps')
|
||||
ePPP = FOUR_CHAR_CODE('eppp')
|
||||
ePrinterPort = FOUR_CHAR_CODE('ecpp')
|
||||
ePrinter = FOUR_CHAR_CODE('edpr')
|
||||
eSvideo = FOUR_CHAR_CODE('epsv')
|
||||
eSCSI = FOUR_CHAR_CODE('ecsc')
|
||||
eSerial = FOUR_CHAR_CODE('epsr')
|
||||
eSpeakers = FOUR_CHAR_CODE('edsp')
|
||||
eStorageDevice = FOUR_CHAR_CODE('edst')
|
||||
eSVGA = FOUR_CHAR_CODE('epsg')
|
||||
eTokenRing = FOUR_CHAR_CODE('etok')
|
||||
eTrackball = FOUR_CHAR_CODE('etrk')
|
||||
eTrackpad = FOUR_CHAR_CODE('edtp')
|
||||
eUSB = FOUR_CHAR_CODE('ecus')
|
||||
eVideoIn = FOUR_CHAR_CODE('ecvi')
|
||||
eVideoMonitor = FOUR_CHAR_CODE('edvm')
|
||||
eVideoOut = FOUR_CHAR_CODE('ecvo')
|
||||
cKeystroke = FOUR_CHAR_CODE('kprs')
|
||||
pKeystrokeKey = FOUR_CHAR_CODE('kMsg')
|
||||
pModifiers = FOUR_CHAR_CODE('kMod')
|
||||
pKeyKind = FOUR_CHAR_CODE('kknd')
|
||||
eModifiers = FOUR_CHAR_CODE('eMds')
|
||||
eOptionDown = FOUR_CHAR_CODE('Kopt')
|
||||
eCommandDown = FOUR_CHAR_CODE('Kcmd')
|
||||
eControlDown = FOUR_CHAR_CODE('Kctl')
|
||||
eShiftDown = FOUR_CHAR_CODE('Ksft')
|
||||
eCapsLockDown = FOUR_CHAR_CODE('Kclk')
|
||||
eKeyKind = FOUR_CHAR_CODE('ekst')
|
||||
eEscapeKey = 0x6B733500
|
||||
eDeleteKey = 0x6B733300
|
||||
eTabKey = 0x6B733000
|
||||
eReturnKey = 0x6B732400
|
||||
eClearKey = 0x6B734700
|
||||
eEnterKey = 0x6B734C00
|
||||
eUpArrowKey = 0x6B737E00
|
||||
eDownArrowKey = 0x6B737D00
|
||||
eLeftArrowKey = 0x6B737B00
|
||||
eRightArrowKey = 0x6B737C00
|
||||
eHelpKey = 0x6B737200
|
||||
eHomeKey = 0x6B737300
|
||||
ePageUpKey = 0x6B737400
|
||||
ePageDownKey = 0x6B737900
|
||||
eForwardDelKey = 0x6B737500
|
||||
eEndKey = 0x6B737700
|
||||
eF1Key = 0x6B737A00
|
||||
eF2Key = 0x6B737800
|
||||
eF3Key = 0x6B736300
|
||||
eF4Key = 0x6B737600
|
||||
eF5Key = 0x6B736000
|
||||
eF6Key = 0x6B736100
|
||||
eF7Key = 0x6B736200
|
||||
eF8Key = 0x6B736400
|
||||
eF9Key = 0x6B736500
|
||||
eF10Key = 0x6B736D00
|
||||
eF11Key = 0x6B736700
|
||||
eF12Key = 0x6B736F00
|
||||
eF13Key = 0x6B736900
|
||||
eF14Key = 0x6B736B00
|
||||
eF15Key = 0x6B737100
|
||||
kAEAND = FOUR_CHAR_CODE('AND ')
|
||||
kAEOR = FOUR_CHAR_CODE('OR ')
|
||||
kAENOT = FOUR_CHAR_CODE('NOT ')
|
||||
kAEFirst = FOUR_CHAR_CODE('firs')
|
||||
kAELast = FOUR_CHAR_CODE('last')
|
||||
kAEMiddle = FOUR_CHAR_CODE('midd')
|
||||
kAEAny = FOUR_CHAR_CODE('any ')
|
||||
kAEAll = FOUR_CHAR_CODE('all ')
|
||||
kAENext = FOUR_CHAR_CODE('next')
|
||||
kAEPrevious = FOUR_CHAR_CODE('prev')
|
||||
keyAECompOperator = FOUR_CHAR_CODE('relo')
|
||||
keyAELogicalTerms = FOUR_CHAR_CODE('term')
|
||||
keyAELogicalOperator = FOUR_CHAR_CODE('logc')
|
||||
keyAEObject1 = FOUR_CHAR_CODE('obj1')
|
||||
keyAEObject2 = FOUR_CHAR_CODE('obj2')
|
||||
keyAEDesiredClass = FOUR_CHAR_CODE('want')
|
||||
keyAEContainer = FOUR_CHAR_CODE('from')
|
||||
keyAEKeyForm = FOUR_CHAR_CODE('form')
|
||||
keyAEKeyData = FOUR_CHAR_CODE('seld')
|
||||
keyAERangeStart = FOUR_CHAR_CODE('star')
|
||||
keyAERangeStop = FOUR_CHAR_CODE('stop')
|
||||
keyDisposeTokenProc = FOUR_CHAR_CODE('xtok')
|
||||
keyAECompareProc = FOUR_CHAR_CODE('cmpr')
|
||||
keyAECountProc = FOUR_CHAR_CODE('cont')
|
||||
keyAEMarkTokenProc = FOUR_CHAR_CODE('mkid')
|
||||
keyAEMarkProc = FOUR_CHAR_CODE('mark')
|
||||
keyAEAdjustMarksProc = FOUR_CHAR_CODE('adjm')
|
||||
keyAEGetErrDescProc = FOUR_CHAR_CODE('indc')
|
||||
formAbsolutePosition = FOUR_CHAR_CODE('indx')
|
||||
formRelativePosition = FOUR_CHAR_CODE('rele')
|
||||
formTest = FOUR_CHAR_CODE('test')
|
||||
formRange = FOUR_CHAR_CODE('rang')
|
||||
formPropertyID = FOUR_CHAR_CODE('prop')
|
||||
formName = FOUR_CHAR_CODE('name')
|
||||
typeObjectSpecifier = FOUR_CHAR_CODE('obj ')
|
||||
typeObjectBeingExamined = FOUR_CHAR_CODE('exmn')
|
||||
typeCurrentContainer = FOUR_CHAR_CODE('ccnt')
|
||||
typeToken = FOUR_CHAR_CODE('toke')
|
||||
typeRelativeDescriptor = FOUR_CHAR_CODE('rel ')
|
||||
typeAbsoluteOrdinal = FOUR_CHAR_CODE('abso')
|
||||
typeIndexDescriptor = FOUR_CHAR_CODE('inde')
|
||||
typeRangeDescriptor = FOUR_CHAR_CODE('rang')
|
||||
typeLogicalDescriptor = FOUR_CHAR_CODE('logi')
|
||||
typeCompDescriptor = FOUR_CHAR_CODE('cmpd')
|
||||
typeOSLTokenList = FOUR_CHAR_CODE('ostl')
|
||||
kAEIDoMinimum = 0x0000
|
||||
kAEIDoWhose = 0x0001
|
||||
kAEIDoMarking = 0x0004
|
||||
kAEPassSubDescs = 0x0008
|
||||
kAEResolveNestedLists = 0x0010
|
||||
kAEHandleSimpleRanges = 0x0020
|
||||
kAEUseRelativeIterators = 0x0040
|
||||
typeWhoseDescriptor = FOUR_CHAR_CODE('whos')
|
||||
formWhose = FOUR_CHAR_CODE('whos')
|
||||
typeWhoseRange = FOUR_CHAR_CODE('wrng')
|
||||
keyAEWhoseRangeStart = FOUR_CHAR_CODE('wstr')
|
||||
keyAEWhoseRangeStop = FOUR_CHAR_CODE('wstp')
|
||||
keyAEIndex = FOUR_CHAR_CODE('kidx')
|
||||
keyAETest = FOUR_CHAR_CODE('ktst')
|
|
@ -1,6 +0,0 @@
|
|||
# Generated from 'AppleHelp.h'
|
||||
|
||||
kAHInternalErr = -10790
|
||||
kAHInternetConfigPrefErr = -10791
|
||||
kAHTOCTypeUser = 0
|
||||
kAHTOCTypeDeveloper = 1
|
|
@ -1 +0,0 @@
|
|||
from _CF import *
|
|
@ -1 +0,0 @@
|
|||
from _CG import *
|
|
@ -1,451 +0,0 @@
|
|||
# Generated from 'CarbonEvents.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
false = 0
|
||||
true = 1
|
||||
keyAEEventClass = FOUR_CHAR_CODE('evcl')
|
||||
keyAEEventID = FOUR_CHAR_CODE('evti')
|
||||
eventAlreadyPostedErr = -9860
|
||||
eventTargetBusyErr = -9861
|
||||
eventClassInvalidErr = -9862
|
||||
eventClassIncorrectErr = -9864
|
||||
eventHandlerAlreadyInstalledErr = -9866
|
||||
eventInternalErr = -9868
|
||||
eventKindIncorrectErr = -9869
|
||||
eventParameterNotFoundErr = -9870
|
||||
eventNotHandledErr = -9874
|
||||
eventLoopTimedOutErr = -9875
|
||||
eventLoopQuitErr = -9876
|
||||
eventNotInQueueErr = -9877
|
||||
eventHotKeyExistsErr = -9878
|
||||
eventHotKeyInvalidErr = -9879
|
||||
kEventPriorityLow = 0
|
||||
kEventPriorityStandard = 1
|
||||
kEventPriorityHigh = 2
|
||||
kEventLeaveInQueue = false
|
||||
kEventRemoveFromQueue = true
|
||||
kTrackMouseLocationOptionDontConsumeMouseUp = (1 << 0)
|
||||
kMouseTrackingMouseDown = 1
|
||||
kMouseTrackingMouseUp = 2
|
||||
kMouseTrackingMouseExited = 3
|
||||
kMouseTrackingMouseEntered = 4
|
||||
kMouseTrackingMouseDragged = 5
|
||||
kMouseTrackingKeyModifiersChanged = 6
|
||||
kMouseTrackingUserCancelled = 7
|
||||
kMouseTrackingTimedOut = 8
|
||||
kMouseTrackingMouseMoved = 9
|
||||
kEventAttributeNone = 0
|
||||
kEventAttributeUserEvent = (1 << 0)
|
||||
kEventClassMouse = FOUR_CHAR_CODE('mous')
|
||||
kEventClassKeyboard = FOUR_CHAR_CODE('keyb')
|
||||
kEventClassTextInput = FOUR_CHAR_CODE('text')
|
||||
kEventClassApplication = FOUR_CHAR_CODE('appl')
|
||||
kEventClassAppleEvent = FOUR_CHAR_CODE('eppc')
|
||||
kEventClassMenu = FOUR_CHAR_CODE('menu')
|
||||
kEventClassWindow = FOUR_CHAR_CODE('wind')
|
||||
kEventClassControl = FOUR_CHAR_CODE('cntl')
|
||||
kEventClassCommand = FOUR_CHAR_CODE('cmds')
|
||||
kEventClassTablet = FOUR_CHAR_CODE('tblt')
|
||||
kEventClassVolume = FOUR_CHAR_CODE('vol ')
|
||||
kEventClassAppearance = FOUR_CHAR_CODE('appm')
|
||||
kEventClassService = FOUR_CHAR_CODE('serv')
|
||||
kEventMouseDown = 1
|
||||
kEventMouseUp = 2
|
||||
kEventMouseMoved = 5
|
||||
kEventMouseDragged = 6
|
||||
kEventMouseWheelMoved = 10
|
||||
kEventMouseButtonPrimary = 1
|
||||
kEventMouseButtonSecondary = 2
|
||||
kEventMouseButtonTertiary = 3
|
||||
kEventMouseWheelAxisX = 0
|
||||
kEventMouseWheelAxisY = 1
|
||||
kEventTextInputUpdateActiveInputArea = 1
|
||||
kEventTextInputUnicodeForKeyEvent = 2
|
||||
kEventTextInputOffsetToPos = 3
|
||||
kEventTextInputPosToOffset = 4
|
||||
kEventTextInputShowHideBottomWindow = 5
|
||||
kEventTextInputGetSelectedText = 6
|
||||
kEventRawKeyDown = 1
|
||||
kEventRawKeyRepeat = 2
|
||||
kEventRawKeyUp = 3
|
||||
kEventRawKeyModifiersChanged = 4
|
||||
kEventHotKeyPressed = 5
|
||||
kEventHotKeyReleased = 6
|
||||
kEventKeyModifierNumLockBit = 16
|
||||
kEventKeyModifierFnBit = 17
|
||||
kEventKeyModifierNumLockMask = 1 << kEventKeyModifierNumLockBit
|
||||
kEventKeyModifierFnMask = 1 << kEventKeyModifierFnBit
|
||||
kEventAppActivated = 1
|
||||
kEventAppDeactivated = 2
|
||||
kEventAppQuit = 3
|
||||
kEventAppLaunchNotification = 4
|
||||
kEventAppLaunched = 5
|
||||
kEventAppTerminated = 6
|
||||
kEventAppFrontSwitched = 7
|
||||
kEventAppGetDockTileMenu = 20
|
||||
kEventAppleEvent = 1
|
||||
kEventWindowUpdate = 1
|
||||
kEventWindowDrawContent = 2
|
||||
kEventWindowActivated = 5
|
||||
kEventWindowDeactivated = 6
|
||||
kEventWindowGetClickActivation = 7
|
||||
kEventWindowShowing = 22
|
||||
kEventWindowHiding = 23
|
||||
kEventWindowShown = 24
|
||||
kEventWindowHidden = 25
|
||||
kEventWindowCollapsing = 86
|
||||
kEventWindowCollapsed = 67
|
||||
kEventWindowExpanding = 87
|
||||
kEventWindowExpanded = 70
|
||||
kEventWindowZoomed = 76
|
||||
kEventWindowBoundsChanging = 26
|
||||
kEventWindowBoundsChanged = 27
|
||||
kEventWindowResizeStarted = 28
|
||||
kEventWindowResizeCompleted = 29
|
||||
kEventWindowDragStarted = 30
|
||||
kEventWindowDragCompleted = 31
|
||||
kEventWindowClosed = 73
|
||||
kWindowBoundsChangeUserDrag = (1 << 0)
|
||||
kWindowBoundsChangeUserResize = (1 << 1)
|
||||
kWindowBoundsChangeSizeChanged = (1 << 2)
|
||||
kWindowBoundsChangeOriginChanged = (1 << 3)
|
||||
kWindowBoundsChangeZoom = (1 << 4)
|
||||
kEventWindowClickDragRgn = 32
|
||||
kEventWindowClickResizeRgn = 33
|
||||
kEventWindowClickCollapseRgn = 34
|
||||
kEventWindowClickCloseRgn = 35
|
||||
kEventWindowClickZoomRgn = 36
|
||||
kEventWindowClickContentRgn = 37
|
||||
kEventWindowClickProxyIconRgn = 38
|
||||
kEventWindowClickToolbarButtonRgn = 41
|
||||
kEventWindowClickStructureRgn = 42
|
||||
kEventWindowCursorChange = 40
|
||||
kEventWindowCollapse = 66
|
||||
kEventWindowCollapseAll = 68
|
||||
kEventWindowExpand = 69
|
||||
kEventWindowExpandAll = 71
|
||||
kEventWindowClose = 72
|
||||
kEventWindowCloseAll = 74
|
||||
kEventWindowZoom = 75
|
||||
kEventWindowZoomAll = 77
|
||||
kEventWindowContextualMenuSelect = 78
|
||||
kEventWindowPathSelect = 79
|
||||
kEventWindowGetIdealSize = 80
|
||||
kEventWindowGetMinimumSize = 81
|
||||
kEventWindowGetMaximumSize = 82
|
||||
kEventWindowConstrain = 83
|
||||
kEventWindowHandleContentClick = 85
|
||||
kEventWindowProxyBeginDrag = 128
|
||||
kEventWindowProxyEndDrag = 129
|
||||
kEventWindowToolbarSwitchMode = 150
|
||||
kDockChangedUser = 1
|
||||
kDockChangedOrientation = 2
|
||||
kDockChangedAutohide = 3
|
||||
kDockChangedDisplay = 4
|
||||
kDockChangedItems = 5
|
||||
kDockChangedUnknown = 6
|
||||
kEventWindowFocusAcquired = 200
|
||||
kEventWindowFocusRelinquish = 201
|
||||
kEventWindowDrawFrame = 1000
|
||||
kEventWindowDrawPart = 1001
|
||||
kEventWindowGetRegion = 1002
|
||||
kEventWindowHitTest = 1003
|
||||
kEventWindowInit = 1004
|
||||
kEventWindowDispose = 1005
|
||||
kEventWindowDragHilite = 1006
|
||||
kEventWindowModified = 1007
|
||||
kEventWindowSetupProxyDragImage = 1008
|
||||
kEventWindowStateChanged = 1009
|
||||
kEventWindowMeasureTitle = 1010
|
||||
kEventWindowDrawGrowBox = 1011
|
||||
kEventWindowGetGrowImageRegion = 1012
|
||||
kEventWindowPaint = 1013
|
||||
kEventMenuBeginTracking = 1
|
||||
kEventMenuEndTracking = 2
|
||||
kEventMenuChangeTrackingMode = 3
|
||||
kEventMenuOpening = 4
|
||||
kEventMenuClosed = 5
|
||||
kEventMenuTargetItem = 6
|
||||
kEventMenuMatchKey = 7
|
||||
kEventMenuEnableItems = 8
|
||||
kEventMenuPopulate = 9
|
||||
kEventMenuMeasureItemWidth = 100
|
||||
kEventMenuMeasureItemHeight = 101
|
||||
kEventMenuDrawItem = 102
|
||||
kEventMenuDrawItemContent = 103
|
||||
kEventMenuDispose = 1001
|
||||
kMenuContextMenuBar = 1 << 0
|
||||
kMenuContextPullDown = 1 << 8
|
||||
kMenuContextPopUp = 1 << 9
|
||||
kMenuContextSubmenu = 1 << 10
|
||||
kMenuContextMenuBarTracking = 1 << 16
|
||||
kMenuContextPopUpTracking = 1 << 17
|
||||
kMenuContextKeyMatching = 1 << 18
|
||||
kMenuContextMenuEnabling = 1 << 19
|
||||
kMenuContextCommandIDSearch = 1 << 20
|
||||
kEventProcessCommand = 1
|
||||
kEventCommandProcess = 1
|
||||
kEventCommandUpdateStatus = 2
|
||||
kHICommandOK = FOUR_CHAR_CODE('ok ')
|
||||
kHICommandCancel = FOUR_CHAR_CODE('not!')
|
||||
kHICommandQuit = FOUR_CHAR_CODE('quit')
|
||||
kHICommandUndo = FOUR_CHAR_CODE('undo')
|
||||
kHICommandRedo = FOUR_CHAR_CODE('redo')
|
||||
kHICommandCut = FOUR_CHAR_CODE('cut ')
|
||||
kHICommandCopy = FOUR_CHAR_CODE('copy')
|
||||
kHICommandPaste = FOUR_CHAR_CODE('past')
|
||||
kHICommandClear = FOUR_CHAR_CODE('clea')
|
||||
kHICommandSelectAll = FOUR_CHAR_CODE('sall')
|
||||
kHICommandHide = FOUR_CHAR_CODE('hide')
|
||||
kHICommandHideOthers = FOUR_CHAR_CODE('hido')
|
||||
kHICommandShowAll = FOUR_CHAR_CODE('shal')
|
||||
kHICommandPreferences = FOUR_CHAR_CODE('pref')
|
||||
kHICommandZoomWindow = FOUR_CHAR_CODE('zoom')
|
||||
kHICommandMinimizeWindow = FOUR_CHAR_CODE('mini')
|
||||
kHICommandMinimizeAll = FOUR_CHAR_CODE('mina')
|
||||
kHICommandMaximizeWindow = FOUR_CHAR_CODE('maxi')
|
||||
kHICommandMaximizeAll = FOUR_CHAR_CODE('maxa')
|
||||
kHICommandArrangeInFront = FOUR_CHAR_CODE('frnt')
|
||||
kHICommandBringAllToFront = FOUR_CHAR_CODE('bfrt')
|
||||
kHICommandWindowListSeparator = FOUR_CHAR_CODE('wldv')
|
||||
kHICommandWindowListTerminator = FOUR_CHAR_CODE('wlst')
|
||||
kHICommandSelectWindow = FOUR_CHAR_CODE('swin')
|
||||
kHICommandAbout = FOUR_CHAR_CODE('abou')
|
||||
kHICommandNew = FOUR_CHAR_CODE('new ')
|
||||
kHICommandOpen = FOUR_CHAR_CODE('open')
|
||||
kHICommandClose = FOUR_CHAR_CODE('clos')
|
||||
kHICommandSave = FOUR_CHAR_CODE('save')
|
||||
kHICommandSaveAs = FOUR_CHAR_CODE('svas')
|
||||
kHICommandRevert = FOUR_CHAR_CODE('rvrt')
|
||||
kHICommandPrint = FOUR_CHAR_CODE('prnt')
|
||||
kHICommandPageSetup = FOUR_CHAR_CODE('page')
|
||||
kHICommandAppHelp = FOUR_CHAR_CODE('ahlp')
|
||||
kHICommandFromMenu = (1 << 0)
|
||||
kHICommandFromControl = (1 << 1)
|
||||
kHICommandFromWindow = (1 << 2)
|
||||
kEventControlInitialize = 1000
|
||||
kEventControlDispose = 1001
|
||||
kEventControlGetOptimalBounds = 1003
|
||||
kEventControlDefInitialize = kEventControlInitialize
|
||||
kEventControlDefDispose = kEventControlDispose
|
||||
kEventControlHit = 1
|
||||
kEventControlSimulateHit = 2
|
||||
kEventControlHitTest = 3
|
||||
kEventControlDraw = 4
|
||||
kEventControlApplyBackground = 5
|
||||
kEventControlApplyTextColor = 6
|
||||
kEventControlSetFocusPart = 7
|
||||
kEventControlGetFocusPart = 8
|
||||
kEventControlActivate = 9
|
||||
kEventControlDeactivate = 10
|
||||
kEventControlSetCursor = 11
|
||||
kEventControlContextualMenuClick = 12
|
||||
kEventControlClick = 13
|
||||
kEventControlTrack = 51
|
||||
kEventControlGetScrollToHereStartPoint = 52
|
||||
kEventControlGetIndicatorDragConstraint = 53
|
||||
kEventControlIndicatorMoved = 54
|
||||
kEventControlGhostingFinished = 55
|
||||
kEventControlGetActionProcPart = 56
|
||||
kEventControlGetPartRegion = 101
|
||||
kEventControlGetPartBounds = 102
|
||||
kEventControlSetData = 103
|
||||
kEventControlGetData = 104
|
||||
kEventControlValueFieldChanged = 151
|
||||
kEventControlAddedSubControl = 152
|
||||
kEventControlRemovingSubControl = 153
|
||||
kEventControlBoundsChanged = 154
|
||||
kEventControlOwningWindowChanged = 159
|
||||
kEventControlArbitraryMessage = 201
|
||||
kControlBoundsChangeSizeChanged = (1 << 2)
|
||||
kControlBoundsChangePositionChanged = (1 << 3)
|
||||
kEventTabletPoint = 1
|
||||
kEventTabletProximity = 2
|
||||
kEventTabletPointer = 1
|
||||
kEventVolumeMounted = 1
|
||||
kEventVolumeUnmounted = 2
|
||||
typeFSVolumeRefNum = FOUR_CHAR_CODE('voln')
|
||||
kEventAppearanceScrollBarVariantChanged = 1
|
||||
kEventServiceCopy = 1
|
||||
kEventServicePaste = 2
|
||||
kEventServiceGetTypes = 3
|
||||
kEventServicePerform = 4
|
||||
kEventParamDirectObject = FOUR_CHAR_CODE('----')
|
||||
kEventParamPostTarget = FOUR_CHAR_CODE('ptrg')
|
||||
typeEventTargetRef = FOUR_CHAR_CODE('etrg')
|
||||
kEventParamWindowRef = FOUR_CHAR_CODE('wind')
|
||||
kEventParamGrafPort = FOUR_CHAR_CODE('graf')
|
||||
kEventParamDragRef = FOUR_CHAR_CODE('drag')
|
||||
kEventParamMenuRef = FOUR_CHAR_CODE('menu')
|
||||
kEventParamEventRef = FOUR_CHAR_CODE('evnt')
|
||||
kEventParamControlRef = FOUR_CHAR_CODE('ctrl')
|
||||
kEventParamRgnHandle = FOUR_CHAR_CODE('rgnh')
|
||||
kEventParamEnabled = FOUR_CHAR_CODE('enab')
|
||||
kEventParamDimensions = FOUR_CHAR_CODE('dims')
|
||||
kEventParamAvailableBounds = FOUR_CHAR_CODE('avlb')
|
||||
kEventParamAEEventID = keyAEEventID
|
||||
kEventParamAEEventClass = keyAEEventClass
|
||||
kEventParamCGContextRef = FOUR_CHAR_CODE('cntx')
|
||||
kEventParamDeviceDepth = FOUR_CHAR_CODE('devd')
|
||||
kEventParamDeviceColor = FOUR_CHAR_CODE('devc')
|
||||
typeWindowRef = FOUR_CHAR_CODE('wind')
|
||||
typeGrafPtr = FOUR_CHAR_CODE('graf')
|
||||
typeGWorldPtr = FOUR_CHAR_CODE('gwld')
|
||||
typeDragRef = FOUR_CHAR_CODE('drag')
|
||||
typeMenuRef = FOUR_CHAR_CODE('menu')
|
||||
typeControlRef = FOUR_CHAR_CODE('ctrl')
|
||||
typeCollection = FOUR_CHAR_CODE('cltn')
|
||||
typeQDRgnHandle = FOUR_CHAR_CODE('rgnh')
|
||||
typeOSStatus = FOUR_CHAR_CODE('osst')
|
||||
typeCFStringRef = FOUR_CHAR_CODE('cfst')
|
||||
typeCFIndex = FOUR_CHAR_CODE('cfix')
|
||||
typeCFTypeRef = FOUR_CHAR_CODE('cfty')
|
||||
typeCGContextRef = FOUR_CHAR_CODE('cntx')
|
||||
typeHIPoint = FOUR_CHAR_CODE('hipt')
|
||||
typeHISize = FOUR_CHAR_CODE('hisz')
|
||||
typeHIRect = FOUR_CHAR_CODE('hirc')
|
||||
kEventParamMouseLocation = FOUR_CHAR_CODE('mloc')
|
||||
kEventParamMouseButton = FOUR_CHAR_CODE('mbtn')
|
||||
kEventParamClickCount = FOUR_CHAR_CODE('ccnt')
|
||||
kEventParamMouseWheelAxis = FOUR_CHAR_CODE('mwax')
|
||||
kEventParamMouseWheelDelta = FOUR_CHAR_CODE('mwdl')
|
||||
kEventParamMouseDelta = FOUR_CHAR_CODE('mdta')
|
||||
kEventParamMouseChord = FOUR_CHAR_CODE('chor')
|
||||
kEventParamTabletEventType = FOUR_CHAR_CODE('tblt')
|
||||
typeMouseButton = FOUR_CHAR_CODE('mbtn')
|
||||
typeMouseWheelAxis = FOUR_CHAR_CODE('mwax')
|
||||
kEventParamKeyCode = FOUR_CHAR_CODE('kcod')
|
||||
kEventParamKeyMacCharCodes = FOUR_CHAR_CODE('kchr')
|
||||
kEventParamKeyModifiers = FOUR_CHAR_CODE('kmod')
|
||||
kEventParamKeyUnicodes = FOUR_CHAR_CODE('kuni')
|
||||
kEventParamKeyboardType = FOUR_CHAR_CODE('kbdt')
|
||||
typeEventHotKeyID = FOUR_CHAR_CODE('hkid')
|
||||
kEventParamTextInputSendRefCon = FOUR_CHAR_CODE('tsrc')
|
||||
kEventParamTextInputSendComponentInstance = FOUR_CHAR_CODE('tsci')
|
||||
kEventParamTextInputSendSLRec = FOUR_CHAR_CODE('tssl')
|
||||
kEventParamTextInputReplySLRec = FOUR_CHAR_CODE('trsl')
|
||||
kEventParamTextInputSendText = FOUR_CHAR_CODE('tstx')
|
||||
kEventParamTextInputReplyText = FOUR_CHAR_CODE('trtx')
|
||||
kEventParamTextInputSendUpdateRng = FOUR_CHAR_CODE('tsup')
|
||||
kEventParamTextInputSendHiliteRng = FOUR_CHAR_CODE('tshi')
|
||||
kEventParamTextInputSendClauseRng = FOUR_CHAR_CODE('tscl')
|
||||
kEventParamTextInputSendPinRng = FOUR_CHAR_CODE('tspn')
|
||||
kEventParamTextInputSendFixLen = FOUR_CHAR_CODE('tsfx')
|
||||
kEventParamTextInputSendLeadingEdge = FOUR_CHAR_CODE('tsle')
|
||||
kEventParamTextInputReplyLeadingEdge = FOUR_CHAR_CODE('trle')
|
||||
kEventParamTextInputSendTextOffset = FOUR_CHAR_CODE('tsto')
|
||||
kEventParamTextInputReplyTextOffset = FOUR_CHAR_CODE('trto')
|
||||
kEventParamTextInputReplyRegionClass = FOUR_CHAR_CODE('trrg')
|
||||
kEventParamTextInputSendCurrentPoint = FOUR_CHAR_CODE('tscp')
|
||||
kEventParamTextInputSendDraggingMode = FOUR_CHAR_CODE('tsdm')
|
||||
kEventParamTextInputReplyPoint = FOUR_CHAR_CODE('trpt')
|
||||
kEventParamTextInputReplyFont = FOUR_CHAR_CODE('trft')
|
||||
kEventParamTextInputReplyFMFont = FOUR_CHAR_CODE('trfm')
|
||||
kEventParamTextInputReplyPointSize = FOUR_CHAR_CODE('trpz')
|
||||
kEventParamTextInputReplyLineHeight = FOUR_CHAR_CODE('trlh')
|
||||
kEventParamTextInputReplyLineAscent = FOUR_CHAR_CODE('trla')
|
||||
kEventParamTextInputReplyTextAngle = FOUR_CHAR_CODE('trta')
|
||||
kEventParamTextInputSendShowHide = FOUR_CHAR_CODE('tssh')
|
||||
kEventParamTextInputReplyShowHide = FOUR_CHAR_CODE('trsh')
|
||||
kEventParamTextInputSendKeyboardEvent = FOUR_CHAR_CODE('tske')
|
||||
kEventParamTextInputSendTextServiceEncoding = FOUR_CHAR_CODE('tsse')
|
||||
kEventParamTextInputSendTextServiceMacEncoding = FOUR_CHAR_CODE('tssm')
|
||||
kEventParamHICommand = FOUR_CHAR_CODE('hcmd')
|
||||
typeHICommand = FOUR_CHAR_CODE('hcmd')
|
||||
kEventParamWindowFeatures = FOUR_CHAR_CODE('wftr')
|
||||
kEventParamWindowDefPart = FOUR_CHAR_CODE('wdpc')
|
||||
kEventParamCurrentBounds = FOUR_CHAR_CODE('crct')
|
||||
kEventParamOriginalBounds = FOUR_CHAR_CODE('orct')
|
||||
kEventParamPreviousBounds = FOUR_CHAR_CODE('prct')
|
||||
kEventParamClickActivation = FOUR_CHAR_CODE('clac')
|
||||
kEventParamWindowRegionCode = FOUR_CHAR_CODE('wshp')
|
||||
kEventParamWindowDragHiliteFlag = FOUR_CHAR_CODE('wdhf')
|
||||
kEventParamWindowModifiedFlag = FOUR_CHAR_CODE('wmff')
|
||||
kEventParamWindowProxyGWorldPtr = FOUR_CHAR_CODE('wpgw')
|
||||
kEventParamWindowProxyImageRgn = FOUR_CHAR_CODE('wpir')
|
||||
kEventParamWindowProxyOutlineRgn = FOUR_CHAR_CODE('wpor')
|
||||
kEventParamWindowStateChangedFlags = FOUR_CHAR_CODE('wscf')
|
||||
kEventParamWindowTitleFullWidth = FOUR_CHAR_CODE('wtfw')
|
||||
kEventParamWindowTitleTextWidth = FOUR_CHAR_CODE('wttw')
|
||||
kEventParamWindowGrowRect = FOUR_CHAR_CODE('grct')
|
||||
kEventParamAttributes = FOUR_CHAR_CODE('attr')
|
||||
kEventParamDockChangedReason = FOUR_CHAR_CODE('dcrs')
|
||||
kEventParamPreviousDockRect = FOUR_CHAR_CODE('pdrc')
|
||||
kEventParamCurrentDockRect = FOUR_CHAR_CODE('cdrc')
|
||||
typeWindowRegionCode = FOUR_CHAR_CODE('wshp')
|
||||
typeWindowDefPartCode = FOUR_CHAR_CODE('wdpt')
|
||||
typeClickActivationResult = FOUR_CHAR_CODE('clac')
|
||||
kEventParamControlPart = FOUR_CHAR_CODE('cprt')
|
||||
kEventParamInitCollection = FOUR_CHAR_CODE('icol')
|
||||
kEventParamControlMessage = FOUR_CHAR_CODE('cmsg')
|
||||
kEventParamControlParam = FOUR_CHAR_CODE('cprm')
|
||||
kEventParamControlResult = FOUR_CHAR_CODE('crsl')
|
||||
kEventParamControlRegion = FOUR_CHAR_CODE('crgn')
|
||||
kEventParamControlAction = FOUR_CHAR_CODE('caup')
|
||||
kEventParamControlIndicatorDragConstraint = FOUR_CHAR_CODE('cidc')
|
||||
kEventParamControlIndicatorRegion = FOUR_CHAR_CODE('cirn')
|
||||
kEventParamControlIsGhosting = FOUR_CHAR_CODE('cgst')
|
||||
kEventParamControlIndicatorOffset = FOUR_CHAR_CODE('ciof')
|
||||
kEventParamControlClickActivationResult = FOUR_CHAR_CODE('ccar')
|
||||
kEventParamControlSubControl = FOUR_CHAR_CODE('csub')
|
||||
kEventParamControlOptimalBounds = FOUR_CHAR_CODE('cobn')
|
||||
kEventParamControlOptimalBaselineOffset = FOUR_CHAR_CODE('cobo')
|
||||
kEventParamControlDataTag = FOUR_CHAR_CODE('cdtg')
|
||||
kEventParamControlDataBuffer = FOUR_CHAR_CODE('cdbf')
|
||||
kEventParamControlDataBufferSize = FOUR_CHAR_CODE('cdbs')
|
||||
kEventParamControlDrawDepth = FOUR_CHAR_CODE('cddp')
|
||||
kEventParamControlDrawInColor = FOUR_CHAR_CODE('cdic')
|
||||
kEventParamControlFeatures = FOUR_CHAR_CODE('cftr')
|
||||
kEventParamControlPartBounds = FOUR_CHAR_CODE('cpbd')
|
||||
kEventParamControlOriginalOwningWindow = FOUR_CHAR_CODE('coow')
|
||||
kEventParamControlCurrentOwningWindow = FOUR_CHAR_CODE('ccow')
|
||||
typeControlActionUPP = FOUR_CHAR_CODE('caup')
|
||||
typeIndicatorDragConstraint = FOUR_CHAR_CODE('cidc')
|
||||
typeControlPartCode = FOUR_CHAR_CODE('cprt')
|
||||
kEventParamCurrentMenuTrackingMode = FOUR_CHAR_CODE('cmtm')
|
||||
kEventParamNewMenuTrackingMode = FOUR_CHAR_CODE('nmtm')
|
||||
kEventParamMenuFirstOpen = FOUR_CHAR_CODE('1sto')
|
||||
kEventParamMenuItemIndex = FOUR_CHAR_CODE('item')
|
||||
kEventParamMenuCommand = FOUR_CHAR_CODE('mcmd')
|
||||
kEventParamEnableMenuForKeyEvent = FOUR_CHAR_CODE('fork')
|
||||
kEventParamMenuEventOptions = FOUR_CHAR_CODE('meop')
|
||||
kEventParamMenuContext = FOUR_CHAR_CODE('mctx')
|
||||
kEventParamMenuItemBounds = FOUR_CHAR_CODE('mitb')
|
||||
kEventParamMenuMarkBounds = FOUR_CHAR_CODE('mmkb')
|
||||
kEventParamMenuIconBounds = FOUR_CHAR_CODE('micb')
|
||||
kEventParamMenuTextBounds = FOUR_CHAR_CODE('mtxb')
|
||||
kEventParamMenuTextBaseline = FOUR_CHAR_CODE('mtbl')
|
||||
kEventParamMenuCommandKeyBounds = FOUR_CHAR_CODE('mcmb')
|
||||
kEventParamMenuVirtualTop = FOUR_CHAR_CODE('mvrt')
|
||||
kEventParamMenuVirtualBottom = FOUR_CHAR_CODE('mvrb')
|
||||
kEventParamMenuDrawState = FOUR_CHAR_CODE('mdrs')
|
||||
kEventParamMenuItemType = FOUR_CHAR_CODE('mitp')
|
||||
kEventParamMenuItemWidth = FOUR_CHAR_CODE('mitw')
|
||||
kEventParamMenuItemHeight = FOUR_CHAR_CODE('mith')
|
||||
typeMenuItemIndex = FOUR_CHAR_CODE('midx')
|
||||
typeMenuCommand = FOUR_CHAR_CODE('mcmd')
|
||||
typeMenuTrackingMode = FOUR_CHAR_CODE('mtmd')
|
||||
typeMenuEventOptions = FOUR_CHAR_CODE('meop')
|
||||
typeThemeMenuState = FOUR_CHAR_CODE('tmns')
|
||||
typeThemeMenuItemType = FOUR_CHAR_CODE('tmit')
|
||||
kEventParamProcessID = FOUR_CHAR_CODE('psn ')
|
||||
kEventParamLaunchRefCon = FOUR_CHAR_CODE('lref')
|
||||
kEventParamLaunchErr = FOUR_CHAR_CODE('err ')
|
||||
kEventParamTabletPointRec = FOUR_CHAR_CODE('tbrc')
|
||||
kEventParamTabletProximityRec = FOUR_CHAR_CODE('tbpx')
|
||||
typeTabletPointRec = FOUR_CHAR_CODE('tbrc')
|
||||
typeTabletProximityRec = FOUR_CHAR_CODE('tbpx')
|
||||
kEventParamTabletPointerRec = FOUR_CHAR_CODE('tbrc')
|
||||
typeTabletPointerRec = FOUR_CHAR_CODE('tbrc')
|
||||
kEventParamNewScrollBarVariant = FOUR_CHAR_CODE('nsbv')
|
||||
kEventParamScrapRef = FOUR_CHAR_CODE('scrp')
|
||||
kEventParamServiceCopyTypes = FOUR_CHAR_CODE('svsd')
|
||||
kEventParamServicePasteTypes = FOUR_CHAR_CODE('svpt')
|
||||
kEventParamServiceMessageName = FOUR_CHAR_CODE('svmg')
|
||||
kEventParamServiceUserData = FOUR_CHAR_CODE('svud')
|
||||
typeScrapRef = FOUR_CHAR_CODE('scrp')
|
||||
typeCFMutableArrayRef = FOUR_CHAR_CODE('cfma')
|
||||
# sHandler = NewEventHandlerUPP( x )
|
||||
kMouseTrackingMousePressed = kMouseTrackingMouseDown
|
||||
kMouseTrackingMouseReleased = kMouseTrackingMouseUp
|
|
@ -1 +0,0 @@
|
|||
from _CarbonEvt import *
|
|
@ -1 +0,0 @@
|
|||
from _Cm import *
|
|
@ -1,62 +0,0 @@
|
|||
# Generated from 'Components.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
kAppleManufacturer = FOUR_CHAR_CODE('appl')
|
||||
kComponentResourceType = FOUR_CHAR_CODE('thng')
|
||||
kComponentAliasResourceType = FOUR_CHAR_CODE('thga')
|
||||
kAnyComponentType = 0
|
||||
kAnyComponentSubType = 0
|
||||
kAnyComponentManufacturer = 0
|
||||
kAnyComponentFlagsMask = 0
|
||||
cmpIsMissing = 1 << 29
|
||||
cmpWantsRegisterMessage = 1 << 31
|
||||
kComponentOpenSelect = -1
|
||||
kComponentCloseSelect = -2
|
||||
kComponentCanDoSelect = -3
|
||||
kComponentVersionSelect = -4
|
||||
kComponentRegisterSelect = -5
|
||||
kComponentTargetSelect = -6
|
||||
kComponentUnregisterSelect = -7
|
||||
kComponentGetMPWorkFunctionSelect = -8
|
||||
kComponentExecuteWiredActionSelect = -9
|
||||
kComponentGetPublicResourceSelect = -10
|
||||
componentDoAutoVersion = (1 << 0)
|
||||
componentWantsUnregister = (1 << 1)
|
||||
componentAutoVersionIncludeFlags = (1 << 2)
|
||||
componentHasMultiplePlatforms = (1 << 3)
|
||||
componentLoadResident = (1 << 4)
|
||||
defaultComponentIdentical = 0
|
||||
defaultComponentAnyFlags = 1
|
||||
defaultComponentAnyManufacturer = 2
|
||||
defaultComponentAnySubType = 4
|
||||
defaultComponentAnyFlagsAnyManufacturer = (defaultComponentAnyFlags + defaultComponentAnyManufacturer)
|
||||
defaultComponentAnyFlagsAnyManufacturerAnySubType = (defaultComponentAnyFlags + defaultComponentAnyManufacturer + defaultComponentAnySubType)
|
||||
registerComponentGlobal = 1
|
||||
registerComponentNoDuplicates = 2
|
||||
registerComponentAfterExisting = 4
|
||||
registerComponentAliasesOnly = 8
|
||||
platform68k = 1
|
||||
platformPowerPC = 2
|
||||
platformInterpreted = 3
|
||||
platformWin32 = 4
|
||||
platformPowerPCNativeEntryPoint = 5
|
||||
mpWorkFlagDoWork = (1 << 0)
|
||||
mpWorkFlagDoCompletion = (1 << 1)
|
||||
mpWorkFlagCopyWorkBlock = (1 << 2)
|
||||
mpWorkFlagDontBlock = (1 << 3)
|
||||
mpWorkFlagGetProcessorCount = (1 << 4)
|
||||
mpWorkFlagGetIsRunning = (1 << 6)
|
||||
cmpAliasNoFlags = 0
|
||||
cmpAliasOnlyThisFile = 1
|
||||
uppComponentFunctionImplementedProcInfo = 0x000002F0
|
||||
uppGetComponentVersionProcInfo = 0x000000F0
|
||||
uppComponentSetTargetProcInfo = 0x000003F0
|
||||
uppCallComponentOpenProcInfo = 0x000003F0
|
||||
uppCallComponentCloseProcInfo = 0x000003F0
|
||||
uppCallComponentCanDoProcInfo = 0x000002F0
|
||||
uppCallComponentVersionProcInfo = 0x000000F0
|
||||
uppCallComponentRegisterProcInfo = 0x000000F0
|
||||
uppCallComponentTargetProcInfo = 0x000003F0
|
||||
uppCallComponentUnregisterProcInfo = 0x000000F0
|
||||
uppCallComponentGetMPWorkFunctionProcInfo = 0x00000FF0
|
||||
uppCallComponentGetPublicResourceProcInfo = 0x00003BF0
|
|
@ -1,56 +0,0 @@
|
|||
# Accessor functions for control properties
|
||||
|
||||
from Carbon.Controls import *
|
||||
import struct
|
||||
|
||||
# These needn't go through this module, but are here for completeness
|
||||
def SetControlData_Handle(control, part, selector, data):
|
||||
control.SetControlData_Handle(part, selector, data)
|
||||
|
||||
def GetControlData_Handle(control, part, selector):
|
||||
return control.GetControlData_Handle(part, selector)
|
||||
|
||||
_accessdict = {
|
||||
kControlPopupButtonMenuHandleTag: (SetControlData_Handle, GetControlData_Handle),
|
||||
}
|
||||
|
||||
_codingdict = {
|
||||
kControlPushButtonDefaultTag : ("b", None, None),
|
||||
|
||||
kControlEditTextTextTag: (None, None, None),
|
||||
kControlEditTextPasswordTag: (None, None, None),
|
||||
|
||||
kControlPopupButtonMenuIDTag: ("h", None, None),
|
||||
|
||||
kControlListBoxDoubleClickTag: ("b", None, None),
|
||||
}
|
||||
|
||||
def SetControlData(control, part, selector, data):
|
||||
if _accessdict.has_key(selector):
|
||||
setfunc, getfunc = _accessdict[selector]
|
||||
setfunc(control, part, selector, data)
|
||||
return
|
||||
if not _codingdict.has_key(selector):
|
||||
raise KeyError('Unknown control selector', selector)
|
||||
structfmt, coder, decoder = _codingdict[selector]
|
||||
if coder:
|
||||
data = coder(data)
|
||||
if structfmt:
|
||||
data = struct.pack(structfmt, data)
|
||||
control.SetControlData(part, selector, data)
|
||||
|
||||
def GetControlData(control, part, selector):
|
||||
if _accessdict.has_key(selector):
|
||||
setfunc, getfunc = _accessdict[selector]
|
||||
return getfunc(control, part, selector, data)
|
||||
if not _codingdict.has_key(selector):
|
||||
raise KeyError('Unknown control selector', selector)
|
||||
structfmt, coder, decoder = _codingdict[selector]
|
||||
data = control.GetControlData(part, selector)
|
||||
if structfmt:
|
||||
data = struct.unpack(structfmt, data)
|
||||
if decoder:
|
||||
data = decoder(data)
|
||||
if type(data) == type(()) and len(data) == 1:
|
||||
data = data[0]
|
||||
return data
|
|
@ -1,668 +0,0 @@
|
|||
# Generated from 'Controls.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
from Carbon.TextEdit import *
|
||||
from Carbon.QuickDraw import *
|
||||
from Carbon.Dragconst import *
|
||||
from Carbon.CarbonEvents import *
|
||||
from Carbon.Appearance import *
|
||||
kDataBrowserItemAnyState = -1
|
||||
kControlBevelButtonCenterPopupGlyphTag = -1
|
||||
kDataBrowserClientPropertyFlagsMask = 0xFF000000
|
||||
|
||||
kControlDefProcType = FOUR_CHAR_CODE('CDEF')
|
||||
kControlTemplateResourceType = FOUR_CHAR_CODE('CNTL')
|
||||
kControlColorTableResourceType = FOUR_CHAR_CODE('cctb')
|
||||
kControlDefProcResourceType = FOUR_CHAR_CODE('CDEF')
|
||||
controlNotifyNothing = FOUR_CHAR_CODE('nada')
|
||||
controlNotifyClick = FOUR_CHAR_CODE('clik')
|
||||
controlNotifyFocus = FOUR_CHAR_CODE('focu')
|
||||
controlNotifyKey = FOUR_CHAR_CODE('key ')
|
||||
kControlCanAutoInvalidate = 1 << 0
|
||||
staticTextProc = 256
|
||||
editTextProc = 272
|
||||
iconProc = 288
|
||||
userItemProc = 304
|
||||
pictItemProc = 320
|
||||
cFrameColor = 0
|
||||
cBodyColor = 1
|
||||
cTextColor = 2
|
||||
cThumbColor = 3
|
||||
kNumberCtlCTabEntries = 4
|
||||
kControlNoVariant = 0
|
||||
kControlUsesOwningWindowsFontVariant = 1 << 3
|
||||
kControlNoPart = 0
|
||||
kControlIndicatorPart = 129
|
||||
kControlDisabledPart = 254
|
||||
kControlInactivePart = 255
|
||||
kControlEntireControl = 0
|
||||
kControlStructureMetaPart = -1
|
||||
kControlContentMetaPart = -2
|
||||
kControlFocusNoPart = 0
|
||||
kControlFocusNextPart = -1
|
||||
kControlFocusPrevPart = -2
|
||||
kControlCollectionTagBounds = FOUR_CHAR_CODE('boun')
|
||||
kControlCollectionTagValue = FOUR_CHAR_CODE('valu')
|
||||
kControlCollectionTagMinimum = FOUR_CHAR_CODE('min ')
|
||||
kControlCollectionTagMaximum = FOUR_CHAR_CODE('max ')
|
||||
kControlCollectionTagViewSize = FOUR_CHAR_CODE('view')
|
||||
kControlCollectionTagVisibility = FOUR_CHAR_CODE('visi')
|
||||
kControlCollectionTagRefCon = FOUR_CHAR_CODE('refc')
|
||||
kControlCollectionTagTitle = FOUR_CHAR_CODE('titl')
|
||||
kControlCollectionTagUnicodeTitle = FOUR_CHAR_CODE('uttl')
|
||||
kControlCollectionTagIDSignature = FOUR_CHAR_CODE('idsi')
|
||||
kControlCollectionTagIDID = FOUR_CHAR_CODE('idid')
|
||||
kControlCollectionTagCommand = FOUR_CHAR_CODE('cmd ')
|
||||
kControlCollectionTagVarCode = FOUR_CHAR_CODE('varc')
|
||||
kControlContentTextOnly = 0
|
||||
kControlNoContent = 0
|
||||
kControlContentIconSuiteRes = 1
|
||||
kControlContentCIconRes = 2
|
||||
kControlContentPictRes = 3
|
||||
kControlContentICONRes = 4
|
||||
kControlContentIconSuiteHandle = 129
|
||||
kControlContentCIconHandle = 130
|
||||
kControlContentPictHandle = 131
|
||||
kControlContentIconRef = 132
|
||||
kControlContentICON = 133
|
||||
kControlKeyScriptBehaviorAllowAnyScript = FOUR_CHAR_CODE('any ')
|
||||
kControlKeyScriptBehaviorPrefersRoman = FOUR_CHAR_CODE('prmn')
|
||||
kControlKeyScriptBehaviorRequiresRoman = FOUR_CHAR_CODE('rrmn')
|
||||
kControlFontBigSystemFont = -1
|
||||
kControlFontSmallSystemFont = -2
|
||||
kControlFontSmallBoldSystemFont = -3
|
||||
kControlFontViewSystemFont = -4
|
||||
kControlUseFontMask = 0x0001
|
||||
kControlUseFaceMask = 0x0002
|
||||
kControlUseSizeMask = 0x0004
|
||||
kControlUseForeColorMask = 0x0008
|
||||
kControlUseBackColorMask = 0x0010
|
||||
kControlUseModeMask = 0x0020
|
||||
kControlUseJustMask = 0x0040
|
||||
kControlUseAllMask = 0x00FF
|
||||
kControlAddFontSizeMask = 0x0100
|
||||
kControlAddToMetaFontMask = 0x0200
|
||||
kControlUseThemeFontIDMask = 0x0080
|
||||
kDoNotActivateAndIgnoreClick = 0
|
||||
kDoNotActivateAndHandleClick = 1
|
||||
kActivateAndIgnoreClick = 2
|
||||
kActivateAndHandleClick = 3
|
||||
kControlFontStyleTag = FOUR_CHAR_CODE('font')
|
||||
kControlKeyFilterTag = FOUR_CHAR_CODE('fltr')
|
||||
kControlKindTag = FOUR_CHAR_CODE('kind')
|
||||
kControlSizeTag = FOUR_CHAR_CODE('size')
|
||||
kControlSupportsGhosting = 1 << 0
|
||||
kControlSupportsEmbedding = 1 << 1
|
||||
kControlSupportsFocus = 1 << 2
|
||||
kControlWantsIdle = 1 << 3
|
||||
kControlWantsActivate = 1 << 4
|
||||
kControlHandlesTracking = 1 << 5
|
||||
kControlSupportsDataAccess = 1 << 6
|
||||
kControlHasSpecialBackground = 1 << 7
|
||||
kControlGetsFocusOnClick = 1 << 8
|
||||
kControlSupportsCalcBestRect = 1 << 9
|
||||
kControlSupportsLiveFeedback = 1 << 10
|
||||
kControlHasRadioBehavior = 1 << 11
|
||||
kControlSupportsDragAndDrop = 1 << 12
|
||||
kControlAutoToggles = 1 << 14
|
||||
kControlSupportsGetRegion = 1 << 17
|
||||
kControlSupportsFlattening = 1 << 19
|
||||
kControlSupportsSetCursor = 1 << 20
|
||||
kControlSupportsContextualMenus = 1 << 21
|
||||
kControlSupportsClickActivation = 1 << 22
|
||||
kControlIdlesWithTimer = 1 << 23
|
||||
drawCntl = 0
|
||||
testCntl = 1
|
||||
calcCRgns = 2
|
||||
initCntl = 3
|
||||
dispCntl = 4
|
||||
posCntl = 5
|
||||
thumbCntl = 6
|
||||
dragCntl = 7
|
||||
autoTrack = 8
|
||||
calcCntlRgn = 10
|
||||
calcThumbRgn = 11
|
||||
drawThumbOutline = 12
|
||||
kControlMsgDrawGhost = 13
|
||||
kControlMsgCalcBestRect = 14
|
||||
kControlMsgHandleTracking = 15
|
||||
kControlMsgFocus = 16
|
||||
kControlMsgKeyDown = 17
|
||||
kControlMsgIdle = 18
|
||||
kControlMsgGetFeatures = 19
|
||||
kControlMsgSetData = 20
|
||||
kControlMsgGetData = 21
|
||||
kControlMsgActivate = 22
|
||||
kControlMsgSetUpBackground = 23
|
||||
kControlMsgCalcValueFromPos = 26
|
||||
kControlMsgTestNewMsgSupport = 27
|
||||
kControlMsgSubValueChanged = 25
|
||||
kControlMsgSubControlAdded = 28
|
||||
kControlMsgSubControlRemoved = 29
|
||||
kControlMsgApplyTextColor = 30
|
||||
kControlMsgGetRegion = 31
|
||||
kControlMsgFlatten = 32
|
||||
kControlMsgSetCursor = 33
|
||||
kControlMsgDragEnter = 38
|
||||
kControlMsgDragLeave = 39
|
||||
kControlMsgDragWithin = 40
|
||||
kControlMsgDragReceive = 41
|
||||
kControlMsgDisplayDebugInfo = 46
|
||||
kControlMsgContextualMenuClick = 47
|
||||
kControlMsgGetClickActivation = 48
|
||||
kControlSizeNormal = 0
|
||||
kControlSizeSmall = 1
|
||||
kControlSizeLarge = 2
|
||||
kControlSizeAuto = 0xFFFF
|
||||
kDrawControlEntireControl = 0
|
||||
kDrawControlIndicatorOnly = 129
|
||||
kDragControlEntireControl = 0
|
||||
kDragControlIndicator = 1
|
||||
kControlSupportsNewMessages = FOUR_CHAR_CODE(' ok ')
|
||||
kControlKeyFilterBlockKey = 0
|
||||
kControlKeyFilterPassKey = 1
|
||||
noConstraint = kNoConstraint
|
||||
hAxisOnly = 1
|
||||
vAxisOnly = 2
|
||||
kControlDefProcPtr = 0
|
||||
kControlDefObjectClass = 1
|
||||
kControlKindSignatureApple = FOUR_CHAR_CODE('appl')
|
||||
kControlPropertyPersistent = 0x00000001
|
||||
kDragTrackingEnterControl = 2
|
||||
kDragTrackingInControl = 3
|
||||
kDragTrackingLeaveControl = 4
|
||||
useWFont = kControlUsesOwningWindowsFontVariant
|
||||
inThumb = kControlIndicatorPart
|
||||
kNoHiliteControlPart = kControlNoPart
|
||||
kInIndicatorControlPart = kControlIndicatorPart
|
||||
kReservedControlPart = kControlDisabledPart
|
||||
kControlInactiveControlPart = kControlInactivePart
|
||||
kControlTabListResType = FOUR_CHAR_CODE('tab#')
|
||||
kControlListDescResType = FOUR_CHAR_CODE('ldes')
|
||||
kControlCheckBoxUncheckedValue = 0
|
||||
kControlCheckBoxCheckedValue = 1
|
||||
kControlCheckBoxMixedValue = 2
|
||||
kControlRadioButtonUncheckedValue = 0
|
||||
kControlRadioButtonCheckedValue = 1
|
||||
kControlRadioButtonMixedValue = 2
|
||||
popupFixedWidth = 1 << 0
|
||||
popupVariableWidth = 1 << 1
|
||||
popupUseAddResMenu = 1 << 2
|
||||
popupUseWFont = 1 << 3
|
||||
popupTitleBold = 1 << 8
|
||||
popupTitleItalic = 1 << 9
|
||||
popupTitleUnderline = 1 << 10
|
||||
popupTitleOutline = 1 << 11
|
||||
popupTitleShadow = 1 << 12
|
||||
popupTitleCondense = 1 << 13
|
||||
popupTitleExtend = 1 << 14
|
||||
popupTitleNoStyle = 1 << 15
|
||||
popupTitleLeftJust = 0x00000000
|
||||
popupTitleCenterJust = 0x00000001
|
||||
popupTitleRightJust = 0x000000FF
|
||||
pushButProc = 0
|
||||
checkBoxProc = 1
|
||||
radioButProc = 2
|
||||
scrollBarProc = 16
|
||||
popupMenuProc = 1008
|
||||
kControlLabelPart = 1
|
||||
kControlMenuPart = 2
|
||||
kControlTrianglePart = 4
|
||||
kControlEditTextPart = 5
|
||||
kControlPicturePart = 6
|
||||
kControlIconPart = 7
|
||||
kControlClockPart = 8
|
||||
kControlListBoxPart = 24
|
||||
kControlListBoxDoubleClickPart = 25
|
||||
kControlImageWellPart = 26
|
||||
kControlRadioGroupPart = 27
|
||||
kControlButtonPart = 10
|
||||
kControlCheckBoxPart = 11
|
||||
kControlRadioButtonPart = 11
|
||||
kControlUpButtonPart = 20
|
||||
kControlDownButtonPart = 21
|
||||
kControlPageUpPart = 22
|
||||
kControlPageDownPart = 23
|
||||
kControlClockHourDayPart = 9
|
||||
kControlClockMinuteMonthPart = 10
|
||||
kControlClockSecondYearPart = 11
|
||||
kControlClockAMPMPart = 12
|
||||
kControlDataBrowserPart = 24
|
||||
kControlDataBrowserDraggedPart = 25
|
||||
kControlBevelButtonSmallBevelProc = 32
|
||||
kControlBevelButtonNormalBevelProc = 33
|
||||
kControlBevelButtonLargeBevelProc = 34
|
||||
kControlBevelButtonSmallBevelVariant = 0
|
||||
kControlBevelButtonNormalBevelVariant = (1 << 0)
|
||||
kControlBevelButtonLargeBevelVariant = (1 << 1)
|
||||
kControlBevelButtonMenuOnRightVariant = (1 << 2)
|
||||
kControlBevelButtonSmallBevel = 0
|
||||
kControlBevelButtonNormalBevel = 1
|
||||
kControlBevelButtonLargeBevel = 2
|
||||
kControlBehaviorPushbutton = 0
|
||||
kControlBehaviorToggles = 0x0100
|
||||
kControlBehaviorSticky = 0x0200
|
||||
kControlBehaviorSingleValueMenu = 0
|
||||
kControlBehaviorMultiValueMenu = 0x4000
|
||||
kControlBehaviorOffsetContents = 0x8000
|
||||
kControlBehaviorCommandMenu = 0x2000
|
||||
kControlBevelButtonMenuOnBottom = 0
|
||||
kControlBevelButtonMenuOnRight = (1 << 2)
|
||||
kControlKindBevelButton = FOUR_CHAR_CODE('bevl')
|
||||
kControlBevelButtonAlignSysDirection = -1
|
||||
kControlBevelButtonAlignCenter = 0
|
||||
kControlBevelButtonAlignLeft = 1
|
||||
kControlBevelButtonAlignRight = 2
|
||||
kControlBevelButtonAlignTop = 3
|
||||
kControlBevelButtonAlignBottom = 4
|
||||
kControlBevelButtonAlignTopLeft = 5
|
||||
kControlBevelButtonAlignBottomLeft = 6
|
||||
kControlBevelButtonAlignTopRight = 7
|
||||
kControlBevelButtonAlignBottomRight = 8
|
||||
kControlBevelButtonAlignTextSysDirection = teFlushDefault
|
||||
kControlBevelButtonAlignTextCenter = teCenter
|
||||
kControlBevelButtonAlignTextFlushRight = teFlushRight
|
||||
kControlBevelButtonAlignTextFlushLeft = teFlushLeft
|
||||
kControlBevelButtonPlaceSysDirection = -1
|
||||
kControlBevelButtonPlaceNormally = 0
|
||||
kControlBevelButtonPlaceToRightOfGraphic = 1
|
||||
kControlBevelButtonPlaceToLeftOfGraphic = 2
|
||||
kControlBevelButtonPlaceBelowGraphic = 3
|
||||
kControlBevelButtonPlaceAboveGraphic = 4
|
||||
kControlBevelButtonContentTag = FOUR_CHAR_CODE('cont')
|
||||
kControlBevelButtonTransformTag = FOUR_CHAR_CODE('tran')
|
||||
kControlBevelButtonTextAlignTag = FOUR_CHAR_CODE('tali')
|
||||
kControlBevelButtonTextOffsetTag = FOUR_CHAR_CODE('toff')
|
||||
kControlBevelButtonGraphicAlignTag = FOUR_CHAR_CODE('gali')
|
||||
kControlBevelButtonGraphicOffsetTag = FOUR_CHAR_CODE('goff')
|
||||
kControlBevelButtonTextPlaceTag = FOUR_CHAR_CODE('tplc')
|
||||
kControlBevelButtonMenuValueTag = FOUR_CHAR_CODE('mval')
|
||||
kControlBevelButtonMenuHandleTag = FOUR_CHAR_CODE('mhnd')
|
||||
kControlBevelButtonMenuRefTag = FOUR_CHAR_CODE('mhnd')
|
||||
# kControlBevelButtonCenterPopupGlyphTag = FOUR_CHAR_CODE('pglc')
|
||||
kControlBevelButtonLastMenuTag = FOUR_CHAR_CODE('lmnu')
|
||||
kControlBevelButtonMenuDelayTag = FOUR_CHAR_CODE('mdly')
|
||||
kControlBevelButtonScaleIconTag = FOUR_CHAR_CODE('scal')
|
||||
kControlBevelButtonOwnedMenuRefTag = FOUR_CHAR_CODE('omrf')
|
||||
kControlBevelButtonKindTag = FOUR_CHAR_CODE('bebk')
|
||||
kControlSliderProc = 48
|
||||
kControlSliderLiveFeedback = (1 << 0)
|
||||
kControlSliderHasTickMarks = (1 << 1)
|
||||
kControlSliderReverseDirection = (1 << 2)
|
||||
kControlSliderNonDirectional = (1 << 3)
|
||||
kControlSliderPointsDownOrRight = 0
|
||||
kControlSliderPointsUpOrLeft = 1
|
||||
kControlSliderDoesNotPoint = 2
|
||||
kControlKindSlider = FOUR_CHAR_CODE('sldr')
|
||||
kControlTriangleProc = 64
|
||||
kControlTriangleLeftFacingProc = 65
|
||||
kControlTriangleAutoToggleProc = 66
|
||||
kControlTriangleLeftFacingAutoToggleProc = 67
|
||||
kControlDisclosureTrianglePointDefault = 0
|
||||
kControlDisclosureTrianglePointRight = 1
|
||||
kControlDisclosureTrianglePointLeft = 2
|
||||
kControlKindDisclosureTriangle = FOUR_CHAR_CODE('dist')
|
||||
kControlTriangleLastValueTag = FOUR_CHAR_CODE('last')
|
||||
kControlProgressBarProc = 80
|
||||
kControlRelevanceBarProc = 81
|
||||
kControlKindProgressBar = FOUR_CHAR_CODE('prgb')
|
||||
kControlKindRelevanceBar = FOUR_CHAR_CODE('relb')
|
||||
kControlProgressBarIndeterminateTag = FOUR_CHAR_CODE('inde')
|
||||
kControlProgressBarAnimatingTag = FOUR_CHAR_CODE('anim')
|
||||
kControlLittleArrowsProc = 96
|
||||
kControlKindLittleArrows = FOUR_CHAR_CODE('larr')
|
||||
kControlChasingArrowsProc = 112
|
||||
kControlKindChasingArrows = FOUR_CHAR_CODE('carr')
|
||||
kControlChasingArrowsAnimatingTag = FOUR_CHAR_CODE('anim')
|
||||
kControlTabLargeProc = 128
|
||||
kControlTabSmallProc = 129
|
||||
kControlTabLargeNorthProc = 128
|
||||
kControlTabSmallNorthProc = 129
|
||||
kControlTabLargeSouthProc = 130
|
||||
kControlTabSmallSouthProc = 131
|
||||
kControlTabLargeEastProc = 132
|
||||
kControlTabSmallEastProc = 133
|
||||
kControlTabLargeWestProc = 134
|
||||
kControlTabSmallWestProc = 135
|
||||
kControlTabDirectionNorth = 0
|
||||
kControlTabDirectionSouth = 1
|
||||
kControlTabDirectionEast = 2
|
||||
kControlTabDirectionWest = 3
|
||||
kControlTabSizeLarge = kControlSizeNormal
|
||||
kControlTabSizeSmall = kControlSizeSmall
|
||||
kControlKindTabs = FOUR_CHAR_CODE('tabs')
|
||||
kControlTabContentRectTag = FOUR_CHAR_CODE('rect')
|
||||
kControlTabEnabledFlagTag = FOUR_CHAR_CODE('enab')
|
||||
kControlTabFontStyleTag = kControlFontStyleTag
|
||||
kControlTabInfoTag = FOUR_CHAR_CODE('tabi')
|
||||
kControlTabImageContentTag = FOUR_CHAR_CODE('cont')
|
||||
kControlTabInfoVersionZero = 0
|
||||
kControlTabInfoVersionOne = 1
|
||||
kControlSeparatorLineProc = 144
|
||||
kControlKindSeparator = FOUR_CHAR_CODE('sepa')
|
||||
kControlGroupBoxTextTitleProc = 160
|
||||
kControlGroupBoxCheckBoxProc = 161
|
||||
kControlGroupBoxPopupButtonProc = 162
|
||||
kControlGroupBoxSecondaryTextTitleProc = 164
|
||||
kControlGroupBoxSecondaryCheckBoxProc = 165
|
||||
kControlGroupBoxSecondaryPopupButtonProc = 166
|
||||
kControlKindGroupBox = FOUR_CHAR_CODE('grpb')
|
||||
kControlKindCheckGroupBox = FOUR_CHAR_CODE('cgrp')
|
||||
kControlKindPopupGroupBox = FOUR_CHAR_CODE('pgrp')
|
||||
kControlGroupBoxMenuHandleTag = FOUR_CHAR_CODE('mhan')
|
||||
kControlGroupBoxMenuRefTag = FOUR_CHAR_CODE('mhan')
|
||||
kControlGroupBoxFontStyleTag = kControlFontStyleTag
|
||||
kControlGroupBoxTitleRectTag = FOUR_CHAR_CODE('trec')
|
||||
kControlImageWellProc = 176
|
||||
kControlKindImageWell = FOUR_CHAR_CODE('well')
|
||||
kControlImageWellContentTag = FOUR_CHAR_CODE('cont')
|
||||
kControlImageWellTransformTag = FOUR_CHAR_CODE('tran')
|
||||
kControlImageWellIsDragDestinationTag = FOUR_CHAR_CODE('drag')
|
||||
kControlPopupArrowEastProc = 192
|
||||
kControlPopupArrowWestProc = 193
|
||||
kControlPopupArrowNorthProc = 194
|
||||
kControlPopupArrowSouthProc = 195
|
||||
kControlPopupArrowSmallEastProc = 196
|
||||
kControlPopupArrowSmallWestProc = 197
|
||||
kControlPopupArrowSmallNorthProc = 198
|
||||
kControlPopupArrowSmallSouthProc = 199
|
||||
kControlPopupArrowOrientationEast = 0
|
||||
kControlPopupArrowOrientationWest = 1
|
||||
kControlPopupArrowOrientationNorth = 2
|
||||
kControlPopupArrowOrientationSouth = 3
|
||||
kControlPopupArrowSizeNormal = 0
|
||||
kControlPopupArrowSizeSmall = 1
|
||||
kControlKindPopupArrow = FOUR_CHAR_CODE('parr')
|
||||
kControlPlacardProc = 224
|
||||
kControlKindPlacard = FOUR_CHAR_CODE('plac')
|
||||
kControlClockTimeProc = 240
|
||||
kControlClockTimeSecondsProc = 241
|
||||
kControlClockDateProc = 242
|
||||
kControlClockMonthYearProc = 243
|
||||
kControlClockTypeHourMinute = 0
|
||||
kControlClockTypeHourMinuteSecond = 1
|
||||
kControlClockTypeMonthDayYear = 2
|
||||
kControlClockTypeMonthYear = 3
|
||||
kControlClockFlagStandard = 0
|
||||
kControlClockNoFlags = 0
|
||||
kControlClockFlagDisplayOnly = 1
|
||||
kControlClockIsDisplayOnly = 1
|
||||
kControlClockFlagLive = 2
|
||||
kControlClockIsLive = 2
|
||||
kControlKindClock = FOUR_CHAR_CODE('clck')
|
||||
kControlClockLongDateTag = FOUR_CHAR_CODE('date')
|
||||
kControlClockFontStyleTag = kControlFontStyleTag
|
||||
kControlClockAnimatingTag = FOUR_CHAR_CODE('anim')
|
||||
kControlUserPaneProc = 256
|
||||
kControlKindUserPane = FOUR_CHAR_CODE('upan')
|
||||
kControlUserItemDrawProcTag = FOUR_CHAR_CODE('uidp')
|
||||
kControlUserPaneDrawProcTag = FOUR_CHAR_CODE('draw')
|
||||
kControlUserPaneHitTestProcTag = FOUR_CHAR_CODE('hitt')
|
||||
kControlUserPaneTrackingProcTag = FOUR_CHAR_CODE('trak')
|
||||
kControlUserPaneIdleProcTag = FOUR_CHAR_CODE('idle')
|
||||
kControlUserPaneKeyDownProcTag = FOUR_CHAR_CODE('keyd')
|
||||
kControlUserPaneActivateProcTag = FOUR_CHAR_CODE('acti')
|
||||
kControlUserPaneFocusProcTag = FOUR_CHAR_CODE('foci')
|
||||
kControlUserPaneBackgroundProcTag = FOUR_CHAR_CODE('back')
|
||||
kControlEditTextProc = 272
|
||||
kControlEditTextPasswordProc = 274
|
||||
kControlEditTextInlineInputProc = 276
|
||||
kControlKindEditText = FOUR_CHAR_CODE('etxt')
|
||||
kControlEditTextStyleTag = kControlFontStyleTag
|
||||
kControlEditTextTextTag = FOUR_CHAR_CODE('text')
|
||||
kControlEditTextTEHandleTag = FOUR_CHAR_CODE('than')
|
||||
kControlEditTextKeyFilterTag = kControlKeyFilterTag
|
||||
kControlEditTextSelectionTag = FOUR_CHAR_CODE('sele')
|
||||
kControlEditTextPasswordTag = FOUR_CHAR_CODE('pass')
|
||||
kControlEditTextKeyScriptBehaviorTag = FOUR_CHAR_CODE('kscr')
|
||||
kControlEditTextLockedTag = FOUR_CHAR_CODE('lock')
|
||||
kControlEditTextFixedTextTag = FOUR_CHAR_CODE('ftxt')
|
||||
kControlEditTextValidationProcTag = FOUR_CHAR_CODE('vali')
|
||||
kControlEditTextInlinePreUpdateProcTag = FOUR_CHAR_CODE('prup')
|
||||
kControlEditTextInlinePostUpdateProcTag = FOUR_CHAR_CODE('poup')
|
||||
kControlEditTextCFStringTag = FOUR_CHAR_CODE('cfst')
|
||||
kControlEditTextPasswordCFStringTag = FOUR_CHAR_CODE('pwcf')
|
||||
kControlStaticTextProc = 288
|
||||
kControlKindStaticText = FOUR_CHAR_CODE('stxt')
|
||||
kControlStaticTextStyleTag = kControlFontStyleTag
|
||||
kControlStaticTextTextTag = FOUR_CHAR_CODE('text')
|
||||
kControlStaticTextTextHeightTag = FOUR_CHAR_CODE('thei')
|
||||
kControlStaticTextTruncTag = FOUR_CHAR_CODE('trun')
|
||||
kControlStaticTextCFStringTag = FOUR_CHAR_CODE('cfst')
|
||||
kControlPictureProc = 304
|
||||
kControlPictureNoTrackProc = 305
|
||||
kControlKindPicture = FOUR_CHAR_CODE('pict')
|
||||
kControlPictureHandleTag = FOUR_CHAR_CODE('pich')
|
||||
kControlIconProc = 320
|
||||
kControlIconNoTrackProc = 321
|
||||
kControlIconSuiteProc = 322
|
||||
kControlIconSuiteNoTrackProc = 323
|
||||
kControlIconRefProc = 324
|
||||
kControlIconRefNoTrackProc = 325
|
||||
kControlKindIcon = FOUR_CHAR_CODE('icon')
|
||||
kControlIconTransformTag = FOUR_CHAR_CODE('trfm')
|
||||
kControlIconAlignmentTag = FOUR_CHAR_CODE('algn')
|
||||
kControlIconResourceIDTag = FOUR_CHAR_CODE('ires')
|
||||
kControlIconContentTag = FOUR_CHAR_CODE('cont')
|
||||
kControlWindowHeaderProc = 336
|
||||
kControlWindowListViewHeaderProc = 337
|
||||
kControlKindWindowHeader = FOUR_CHAR_CODE('whed')
|
||||
kControlListBoxProc = 352
|
||||
kControlListBoxAutoSizeProc = 353
|
||||
kControlKindListBox = FOUR_CHAR_CODE('lbox')
|
||||
kControlListBoxListHandleTag = FOUR_CHAR_CODE('lhan')
|
||||
kControlListBoxKeyFilterTag = kControlKeyFilterTag
|
||||
kControlListBoxFontStyleTag = kControlFontStyleTag
|
||||
kControlListBoxDoubleClickTag = FOUR_CHAR_CODE('dblc')
|
||||
kControlListBoxLDEFTag = FOUR_CHAR_CODE('ldef')
|
||||
kControlPushButtonProc = 368
|
||||
kControlCheckBoxProc = 369
|
||||
kControlRadioButtonProc = 370
|
||||
kControlPushButLeftIconProc = 374
|
||||
kControlPushButRightIconProc = 375
|
||||
kControlCheckBoxAutoToggleProc = 371
|
||||
kControlRadioButtonAutoToggleProc = 372
|
||||
kControlPushButtonIconOnLeft = 6
|
||||
kControlPushButtonIconOnRight = 7
|
||||
kControlKindPushButton = FOUR_CHAR_CODE('push')
|
||||
kControlKindPushIconButton = FOUR_CHAR_CODE('picn')
|
||||
kControlKindRadioButton = FOUR_CHAR_CODE('rdio')
|
||||
kControlKindCheckBox = FOUR_CHAR_CODE('cbox')
|
||||
kControlPushButtonDefaultTag = FOUR_CHAR_CODE('dflt')
|
||||
kControlPushButtonCancelTag = FOUR_CHAR_CODE('cncl')
|
||||
kControlScrollBarProc = 384
|
||||
kControlScrollBarLiveProc = 386
|
||||
kControlKindScrollBar = FOUR_CHAR_CODE('sbar')
|
||||
kControlScrollBarShowsArrowsTag = FOUR_CHAR_CODE('arro')
|
||||
kControlPopupButtonProc = 400
|
||||
kControlPopupFixedWidthVariant = 1 << 0
|
||||
kControlPopupVariableWidthVariant = 1 << 1
|
||||
kControlPopupUseAddResMenuVariant = 1 << 2
|
||||
kControlPopupUseWFontVariant = kControlUsesOwningWindowsFontVariant
|
||||
kControlKindPopupButton = FOUR_CHAR_CODE('popb')
|
||||
kControlPopupButtonMenuHandleTag = FOUR_CHAR_CODE('mhan')
|
||||
kControlPopupButtonMenuRefTag = FOUR_CHAR_CODE('mhan')
|
||||
kControlPopupButtonMenuIDTag = FOUR_CHAR_CODE('mnid')
|
||||
kControlPopupButtonExtraHeightTag = FOUR_CHAR_CODE('exht')
|
||||
kControlPopupButtonOwnedMenuRefTag = FOUR_CHAR_CODE('omrf')
|
||||
kControlPopupButtonCheckCurrentTag = FOUR_CHAR_CODE('chck')
|
||||
kControlRadioGroupProc = 416
|
||||
kControlKindRadioGroup = FOUR_CHAR_CODE('rgrp')
|
||||
kControlScrollTextBoxProc = 432
|
||||
kControlScrollTextBoxAutoScrollProc = 433
|
||||
kControlKindScrollingTextBox = FOUR_CHAR_CODE('stbx')
|
||||
kControlScrollTextBoxDelayBeforeAutoScrollTag = FOUR_CHAR_CODE('stdl')
|
||||
kControlScrollTextBoxDelayBetweenAutoScrollTag = FOUR_CHAR_CODE('scdl')
|
||||
kControlScrollTextBoxAutoScrollAmountTag = FOUR_CHAR_CODE('samt')
|
||||
kControlScrollTextBoxContentsTag = FOUR_CHAR_CODE('tres')
|
||||
kControlScrollTextBoxAnimatingTag = FOUR_CHAR_CODE('anim')
|
||||
kControlKindDisclosureButton = FOUR_CHAR_CODE('disb')
|
||||
kControlDisclosureButtonClosed = 0
|
||||
kControlDisclosureButtonDisclosed = 1
|
||||
kControlRoundButtonNormalSize = kControlSizeNormal
|
||||
kControlRoundButtonLargeSize = kControlSizeLarge
|
||||
kControlRoundButtonContentTag = FOUR_CHAR_CODE('cont')
|
||||
kControlRoundButtonSizeTag = kControlSizeTag
|
||||
kControlKindRoundButton = FOUR_CHAR_CODE('rndb')
|
||||
kControlKindDataBrowser = FOUR_CHAR_CODE('datb')
|
||||
errDataBrowserNotConfigured = -4970
|
||||
errDataBrowserItemNotFound = -4971
|
||||
errDataBrowserItemNotAdded = -4975
|
||||
errDataBrowserPropertyNotFound = -4972
|
||||
errDataBrowserInvalidPropertyPart = -4973
|
||||
errDataBrowserInvalidPropertyData = -4974
|
||||
errDataBrowserPropertyNotSupported = -4979
|
||||
kControlDataBrowserIncludesFrameAndFocusTag = FOUR_CHAR_CODE('brdr')
|
||||
kControlDataBrowserKeyFilterTag = kControlEditTextKeyFilterTag
|
||||
kControlDataBrowserEditTextKeyFilterTag = kControlDataBrowserKeyFilterTag
|
||||
kControlDataBrowserEditTextValidationProcTag = kControlEditTextValidationProcTag
|
||||
kDataBrowserNoView = 0x3F3F3F3F
|
||||
kDataBrowserListView = FOUR_CHAR_CODE('lstv')
|
||||
kDataBrowserColumnView = FOUR_CHAR_CODE('clmv')
|
||||
kDataBrowserDragSelect = 1 << 0
|
||||
kDataBrowserSelectOnlyOne = 1 << 1
|
||||
kDataBrowserResetSelection = 1 << 2
|
||||
kDataBrowserCmdTogglesSelection = 1 << 3
|
||||
kDataBrowserNoDisjointSelection = 1 << 4
|
||||
kDataBrowserAlwaysExtendSelection = 1 << 5
|
||||
kDataBrowserNeverEmptySelectionSet = 1 << 6
|
||||
kDataBrowserOrderUndefined = 0
|
||||
kDataBrowserOrderIncreasing = 1
|
||||
kDataBrowserOrderDecreasing = 2
|
||||
kDataBrowserNoItem = 0
|
||||
kDataBrowserItemNoState = 0
|
||||
# kDataBrowserItemAnyState = (unsigned long)(-1)
|
||||
kDataBrowserItemIsSelected = 1 << 0
|
||||
kDataBrowserContainerIsOpen = 1 << 1
|
||||
kDataBrowserItemIsDragTarget = 1 << 2
|
||||
kDataBrowserRevealOnly = 0
|
||||
kDataBrowserRevealAndCenterInView = 1 << 0
|
||||
kDataBrowserRevealWithoutSelecting = 1 << 1
|
||||
kDataBrowserItemsAdd = 0
|
||||
kDataBrowserItemsAssign = 1
|
||||
kDataBrowserItemsToggle = 2
|
||||
kDataBrowserItemsRemove = 3
|
||||
kDataBrowserSelectionAnchorUp = 0
|
||||
kDataBrowserSelectionAnchorDown = 1
|
||||
kDataBrowserSelectionAnchorLeft = 2
|
||||
kDataBrowserSelectionAnchorRight = 3
|
||||
kDataBrowserEditMsgUndo = kHICommandUndo
|
||||
kDataBrowserEditMsgRedo = kHICommandRedo
|
||||
kDataBrowserEditMsgCut = kHICommandCut
|
||||
kDataBrowserEditMsgCopy = kHICommandCopy
|
||||
kDataBrowserEditMsgPaste = kHICommandPaste
|
||||
kDataBrowserEditMsgClear = kHICommandClear
|
||||
kDataBrowserEditMsgSelectAll = kHICommandSelectAll
|
||||
kDataBrowserItemAdded = 1
|
||||
kDataBrowserItemRemoved = 2
|
||||
kDataBrowserEditStarted = 3
|
||||
kDataBrowserEditStopped = 4
|
||||
kDataBrowserItemSelected = 5
|
||||
kDataBrowserItemDeselected = 6
|
||||
kDataBrowserItemDoubleClicked = 7
|
||||
kDataBrowserContainerOpened = 8
|
||||
kDataBrowserContainerClosing = 9
|
||||
kDataBrowserContainerClosed = 10
|
||||
kDataBrowserContainerSorting = 11
|
||||
kDataBrowserContainerSorted = 12
|
||||
kDataBrowserUserToggledContainer = 16
|
||||
kDataBrowserTargetChanged = 15
|
||||
kDataBrowserUserStateChanged = 13
|
||||
kDataBrowserSelectionSetChanged = 14
|
||||
kDataBrowserItemNoProperty = 0
|
||||
kDataBrowserItemIsActiveProperty = 1
|
||||
kDataBrowserItemIsSelectableProperty = 2
|
||||
kDataBrowserItemIsEditableProperty = 3
|
||||
kDataBrowserItemIsContainerProperty = 4
|
||||
kDataBrowserContainerIsOpenableProperty = 5
|
||||
kDataBrowserContainerIsClosableProperty = 6
|
||||
kDataBrowserContainerIsSortableProperty = 7
|
||||
kDataBrowserItemSelfIdentityProperty = 8
|
||||
kDataBrowserContainerAliasIDProperty = 9
|
||||
kDataBrowserColumnViewPreviewProperty = 10
|
||||
kDataBrowserItemParentContainerProperty = 11
|
||||
kDataBrowserCustomType = 0x3F3F3F3F
|
||||
kDataBrowserIconType = FOUR_CHAR_CODE('icnr')
|
||||
kDataBrowserTextType = FOUR_CHAR_CODE('text')
|
||||
kDataBrowserDateTimeType = FOUR_CHAR_CODE('date')
|
||||
kDataBrowserSliderType = FOUR_CHAR_CODE('sldr')
|
||||
kDataBrowserCheckboxType = FOUR_CHAR_CODE('chbx')
|
||||
kDataBrowserProgressBarType = FOUR_CHAR_CODE('prog')
|
||||
kDataBrowserRelevanceRankType = FOUR_CHAR_CODE('rank')
|
||||
kDataBrowserPopupMenuType = FOUR_CHAR_CODE('menu')
|
||||
kDataBrowserIconAndTextType = FOUR_CHAR_CODE('ticn')
|
||||
kDataBrowserPropertyEnclosingPart = 0
|
||||
kDataBrowserPropertyContentPart = FOUR_CHAR_CODE('----')
|
||||
kDataBrowserPropertyDisclosurePart = FOUR_CHAR_CODE('disc')
|
||||
kDataBrowserPropertyTextPart = kDataBrowserTextType
|
||||
kDataBrowserPropertyIconPart = kDataBrowserIconType
|
||||
kDataBrowserPropertySliderPart = kDataBrowserSliderType
|
||||
kDataBrowserPropertyCheckboxPart = kDataBrowserCheckboxType
|
||||
kDataBrowserPropertyProgressBarPart = kDataBrowserProgressBarType
|
||||
kDataBrowserPropertyRelevanceRankPart = kDataBrowserRelevanceRankType
|
||||
kDataBrowserUniversalPropertyFlagsMask = 0xFF
|
||||
kDataBrowserPropertyIsMutable = 1 << 0
|
||||
kDataBrowserDefaultPropertyFlags = 0 << 0
|
||||
kDataBrowserUniversalPropertyFlags = kDataBrowserUniversalPropertyFlagsMask
|
||||
kDataBrowserPropertyIsEditable = kDataBrowserPropertyIsMutable
|
||||
kDataBrowserPropertyFlagsOffset = 8
|
||||
kDataBrowserPropertyFlagsMask = 0xFF << kDataBrowserPropertyFlagsOffset
|
||||
kDataBrowserCheckboxTriState = 1 << kDataBrowserPropertyFlagsOffset
|
||||
kDataBrowserDateTimeRelative = 1 << (kDataBrowserPropertyFlagsOffset)
|
||||
kDataBrowserDateTimeDateOnly = 1 << (kDataBrowserPropertyFlagsOffset + 1)
|
||||
kDataBrowserDateTimeTimeOnly = 1 << (kDataBrowserPropertyFlagsOffset + 2)
|
||||
kDataBrowserDateTimeSecondsToo = 1 << (kDataBrowserPropertyFlagsOffset + 3)
|
||||
kDataBrowserSliderPlainThumb = kThemeThumbPlain << kDataBrowserPropertyFlagsOffset
|
||||
kDataBrowserSliderUpwardThumb = kThemeThumbUpward << kDataBrowserPropertyFlagsOffset
|
||||
kDataBrowserSliderDownwardThumb = kThemeThumbDownward << kDataBrowserPropertyFlagsOffset
|
||||
kDataBrowserDoNotTruncateText = 3 << kDataBrowserPropertyFlagsOffset
|
||||
kDataBrowserTruncateTextAtEnd = 2 << kDataBrowserPropertyFlagsOffset
|
||||
kDataBrowserTruncateTextMiddle = 0 << kDataBrowserPropertyFlagsOffset
|
||||
kDataBrowserTruncateTextAtStart = 1 << kDataBrowserPropertyFlagsOffset
|
||||
kDataBrowserPropertyModificationFlags = kDataBrowserPropertyFlagsMask
|
||||
kDataBrowserRelativeDateTime = kDataBrowserDateTimeRelative
|
||||
kDataBrowserViewSpecificFlagsOffset = 16
|
||||
kDataBrowserViewSpecificFlagsMask = 0xFF << kDataBrowserViewSpecificFlagsOffset
|
||||
kDataBrowserViewSpecificPropertyFlags = kDataBrowserViewSpecificFlagsMask
|
||||
kDataBrowserClientPropertyFlagsOffset = 24
|
||||
# kDataBrowserClientPropertyFlagsMask = (unsigned long)(0xFF << kDataBrowserClientPropertyFlagsOffset)
|
||||
kDataBrowserLatestCallbacks = 0
|
||||
kDataBrowserContentHit = 1
|
||||
kDataBrowserNothingHit = 0
|
||||
kDataBrowserStopTracking = -1
|
||||
kDataBrowserLatestCustomCallbacks = 0
|
||||
kDataBrowserTableViewMinimalHilite = 0
|
||||
kDataBrowserTableViewFillHilite = 1
|
||||
kDataBrowserTableViewSelectionColumn = 1 << kDataBrowserViewSpecificFlagsOffset
|
||||
kDataBrowserTableViewLastColumn = -1
|
||||
kDataBrowserListViewMovableColumn = 1 << (kDataBrowserViewSpecificFlagsOffset + 1)
|
||||
kDataBrowserListViewSortableColumn = 1 << (kDataBrowserViewSpecificFlagsOffset + 2)
|
||||
kDataBrowserListViewSelectionColumn = kDataBrowserTableViewSelectionColumn
|
||||
kDataBrowserListViewDefaultColumnFlags = kDataBrowserListViewMovableColumn + kDataBrowserListViewSortableColumn
|
||||
kDataBrowserListViewLatestHeaderDesc = 0
|
||||
kDataBrowserListViewAppendColumn = kDataBrowserTableViewLastColumn
|
||||
kControlEditUnicodeTextPostUpdateProcTag = FOUR_CHAR_CODE('upup')
|
||||
kControlEditUnicodeTextProc = 912
|
||||
kControlEditUnicodeTextPasswordProc = 914
|
||||
kControlKindEditUnicodeText = FOUR_CHAR_CODE('eutx')
|
||||
kControlCheckboxUncheckedValue = kControlCheckBoxUncheckedValue
|
||||
kControlCheckboxCheckedValue = kControlCheckBoxCheckedValue
|
||||
kControlCheckboxMixedValue = kControlCheckBoxMixedValue
|
||||
inLabel = kControlLabelPart
|
||||
inMenu = kControlMenuPart
|
||||
inTriangle = kControlTrianglePart
|
||||
inButton = kControlButtonPart
|
||||
inCheckBox = kControlCheckBoxPart
|
||||
inUpButton = kControlUpButtonPart
|
||||
inDownButton = kControlDownButtonPart
|
||||
inPageUp = kControlPageUpPart
|
||||
inPageDown = kControlPageDownPart
|
||||
kInLabelControlPart = kControlLabelPart
|
||||
kInMenuControlPart = kControlMenuPart
|
||||
kInTriangleControlPart = kControlTrianglePart
|
||||
kInButtonControlPart = kControlButtonPart
|
||||
kInCheckBoxControlPart = kControlCheckBoxPart
|
||||
kInUpButtonControlPart = kControlUpButtonPart
|
||||
kInDownButtonControlPart = kControlDownButtonPart
|
||||
kInPageUpControlPart = kControlPageUpPart
|
||||
kInPageDownControlPart = kControlPageDownPart
|
|
@ -1,28 +0,0 @@
|
|||
# Generated from 'CFBase.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
kCFCompareLessThan = -1
|
||||
kCFCompareEqualTo = 0
|
||||
kCFCompareGreaterThan = 1
|
||||
kCFNotFound = -1
|
||||
kCFPropertyListImmutable = 0
|
||||
kCFPropertyListMutableContainers = 1
|
||||
kCFPropertyListMutableContainersAndLeaves = 2
|
||||
# kCFStringEncodingInvalidId = (long)0xFFFFFFFF
|
||||
kCFStringEncodingMacRoman = 0
|
||||
kCFStringEncodingWindowsLatin1 = 0x0500
|
||||
kCFStringEncodingISOLatin1 = 0x0201
|
||||
kCFStringEncodingNextStepLatin = 0x0B01
|
||||
kCFStringEncodingASCII = 0x0600
|
||||
kCFStringEncodingUnicode = 0x0100
|
||||
kCFStringEncodingUTF8 = 0x08000100
|
||||
kCFStringEncodingNonLossyASCII = 0x0BFF
|
||||
kCFCompareCaseInsensitive = 1
|
||||
kCFCompareBackwards = 4
|
||||
kCFCompareAnchored = 8
|
||||
kCFCompareNonliteral = 16
|
||||
kCFCompareLocalized = 32
|
||||
kCFCompareNumerically = 64
|
||||
kCFURLPOSIXPathStyle = 0
|
||||
kCFURLHFSPathStyle = 1
|
||||
kCFURLWindowsPathStyle = 2
|
|
@ -1,28 +0,0 @@
|
|||
# Generated from 'CGContext.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
kCGLineJoinMiter = 0
|
||||
kCGLineJoinRound = 1
|
||||
kCGLineJoinBevel = 2
|
||||
kCGLineCapButt = 0
|
||||
kCGLineCapRound = 1
|
||||
kCGLineCapSquare = 2
|
||||
kCGPathFill = 0
|
||||
kCGPathEOFill = 1
|
||||
kCGPathStroke = 2
|
||||
kCGPathFillStroke = 3
|
||||
kCGPathEOFillStroke = 4
|
||||
kCGTextFill = 0
|
||||
kCGTextStroke = 1
|
||||
kCGTextFillStroke = 2
|
||||
kCGTextInvisible = 3
|
||||
kCGTextFillClip = 4
|
||||
kCGTextStrokeClip = 5
|
||||
kCGTextFillStrokeClip = 6
|
||||
kCGTextClip = 7
|
||||
kCGEncodingFontSpecific = 0
|
||||
kCGEncodingMacRoman = 1
|
||||
kCGInterpolationDefault = 0
|
||||
kCGInterpolationNone = 1
|
||||
kCGInterpolationLow = 2
|
||||
kCGInterpolationHigh = 3
|
|
@ -1 +0,0 @@
|
|||
from _Ctl import *
|
|
@ -1,79 +0,0 @@
|
|||
# Generated from 'Dialogs.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
kControlDialogItem = 4
|
||||
kButtonDialogItem = kControlDialogItem | 0
|
||||
kCheckBoxDialogItem = kControlDialogItem | 1
|
||||
kRadioButtonDialogItem = kControlDialogItem | 2
|
||||
kResourceControlDialogItem = kControlDialogItem | 3
|
||||
kStaticTextDialogItem = 8
|
||||
kEditTextDialogItem = 16
|
||||
kIconDialogItem = 32
|
||||
kPictureDialogItem = 64
|
||||
kUserDialogItem = 0
|
||||
kHelpDialogItem = 1
|
||||
kItemDisableBit = 128
|
||||
ctrlItem = 4
|
||||
btnCtrl = 0
|
||||
chkCtrl = 1
|
||||
radCtrl = 2
|
||||
resCtrl = 3
|
||||
statText = 8
|
||||
editText = 16
|
||||
iconItem = 32
|
||||
picItem = 64
|
||||
userItem = 0
|
||||
itemDisable = 128
|
||||
kStdOkItemIndex = 1
|
||||
kStdCancelItemIndex = 2
|
||||
ok = kStdOkItemIndex
|
||||
cancel = kStdCancelItemIndex
|
||||
kStopIcon = 0
|
||||
kNoteIcon = 1
|
||||
kCautionIcon = 2
|
||||
stopIcon = kStopIcon
|
||||
noteIcon = kNoteIcon
|
||||
cautionIcon = kCautionIcon
|
||||
kOkItemIndex = 1
|
||||
kCancelItemIndex = 2
|
||||
overlayDITL = 0
|
||||
appendDITLRight = 1
|
||||
appendDITLBottom = 2
|
||||
kAlertStopAlert = 0
|
||||
kAlertNoteAlert = 1
|
||||
kAlertCautionAlert = 2
|
||||
kAlertPlainAlert = 3
|
||||
kAlertDefaultOKText = -1
|
||||
kAlertDefaultCancelText = -1
|
||||
kAlertDefaultOtherText = -1
|
||||
kAlertStdAlertOKButton = 1
|
||||
kAlertStdAlertCancelButton = 2
|
||||
kAlertStdAlertOtherButton = 3
|
||||
kAlertStdAlertHelpButton = 4
|
||||
kDialogFlagsUseThemeBackground = (1 << 0)
|
||||
kDialogFlagsUseControlHierarchy = (1 << 1)
|
||||
kDialogFlagsHandleMovableModal = (1 << 2)
|
||||
kDialogFlagsUseThemeControls = (1 << 3)
|
||||
kAlertFlagsUseThemeBackground = (1 << 0)
|
||||
kAlertFlagsUseControlHierarchy = (1 << 1)
|
||||
kAlertFlagsAlertIsMovable = (1 << 2)
|
||||
kAlertFlagsUseThemeControls = (1 << 3)
|
||||
kDialogFontNoFontStyle = 0
|
||||
kDialogFontUseFontMask = 0x0001
|
||||
kDialogFontUseFaceMask = 0x0002
|
||||
kDialogFontUseSizeMask = 0x0004
|
||||
kDialogFontUseForeColorMask = 0x0008
|
||||
kDialogFontUseBackColorMask = 0x0010
|
||||
kDialogFontUseModeMask = 0x0020
|
||||
kDialogFontUseJustMask = 0x0040
|
||||
kDialogFontUseAllMask = 0x00FF
|
||||
kDialogFontAddFontSizeMask = 0x0100
|
||||
kDialogFontUseFontNameMask = 0x0200
|
||||
kDialogFontAddToMetaFontMask = 0x0400
|
||||
kDialogFontUseThemeFontIDMask = 0x0080
|
||||
kHICommandOther = FOUR_CHAR_CODE('othr')
|
||||
kStdCFStringAlertVersionOne = 1
|
||||
kStdAlertDoNotDisposeSheet = 1 << 0
|
||||
kStdAlertDoNotAnimateOnDefault = 1 << 1
|
||||
kStdAlertDoNotAnimateOnCancel = 1 << 2
|
||||
kStdAlertDoNotAnimateOnOther = 1 << 3
|
|
@ -1 +0,0 @@
|
|||
from _Dlg import *
|
|
@ -1 +0,0 @@
|
|||
from _Drag import *
|
|
@ -1,86 +0,0 @@
|
|||
# Generated from 'Drag.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
from Carbon.TextEdit import *
|
||||
from Carbon.QuickDraw import *
|
||||
fkDragActionAll = -1
|
||||
|
||||
|
||||
kDragHasLeftSenderWindow = (1 << 0)
|
||||
kDragInsideSenderApplication = (1 << 1)
|
||||
kDragInsideSenderWindow = (1 << 2)
|
||||
kDragRegionAndImage = (1 << 4)
|
||||
flavorSenderOnly = (1 << 0)
|
||||
flavorSenderTranslated = (1 << 1)
|
||||
flavorNotSaved = (1 << 2)
|
||||
flavorSystemTranslated = (1 << 8)
|
||||
kDragHasLeftSenderWindow = (1 << 0)
|
||||
kDragInsideSenderApplication = (1 << 1)
|
||||
kDragInsideSenderWindow = (1 << 2)
|
||||
kDragBehaviorNone = 0
|
||||
kDragBehaviorZoomBackAnimation = (1 << 0)
|
||||
kDragRegionAndImage = (1 << 4)
|
||||
kDragStandardTranslucency = 0
|
||||
kDragDarkTranslucency = 1
|
||||
kDragDarkerTranslucency = 2
|
||||
kDragOpaqueTranslucency = 3
|
||||
kDragRegionBegin = 1
|
||||
kDragRegionDraw = 2
|
||||
kDragRegionHide = 3
|
||||
kDragRegionIdle = 4
|
||||
kDragRegionEnd = 5
|
||||
kZoomNoAcceleration = 0
|
||||
kZoomAccelerate = 1
|
||||
kZoomDecelerate = 2
|
||||
flavorSenderOnly = (1 << 0)
|
||||
flavorSenderTranslated = (1 << 1)
|
||||
flavorNotSaved = (1 << 2)
|
||||
flavorSystemTranslated = (1 << 8)
|
||||
flavorDataPromised = (1 << 9)
|
||||
kDragFlavorTypeHFS = FOUR_CHAR_CODE('hfs ')
|
||||
kDragFlavorTypePromiseHFS = FOUR_CHAR_CODE('phfs')
|
||||
flavorTypeHFS = kDragFlavorTypeHFS
|
||||
flavorTypePromiseHFS = kDragFlavorTypePromiseHFS
|
||||
kDragPromisedFlavorFindFile = FOUR_CHAR_CODE('rWm1')
|
||||
kDragPromisedFlavor = FOUR_CHAR_CODE('fssP')
|
||||
kDragPseudoCreatorVolumeOrDirectory = FOUR_CHAR_CODE('MACS')
|
||||
kDragPseudoFileTypeVolume = FOUR_CHAR_CODE('disk')
|
||||
kDragPseudoFileTypeDirectory = FOUR_CHAR_CODE('fold')
|
||||
flavorTypeDirectory = FOUR_CHAR_CODE('diry')
|
||||
kFlavorTypeClippingName = FOUR_CHAR_CODE('clnm')
|
||||
kFlavorTypeClippingFilename = FOUR_CHAR_CODE('clfn')
|
||||
kFlavorTypeDragToTrashOnly = FOUR_CHAR_CODE('fdtt')
|
||||
kFlavorTypeFinderNoTrackingBehavior = FOUR_CHAR_CODE('fntb')
|
||||
kDragTrackingEnterHandler = 1
|
||||
kDragTrackingEnterWindow = 2
|
||||
kDragTrackingInWindow = 3
|
||||
kDragTrackingLeaveWindow = 4
|
||||
kDragTrackingLeaveHandler = 5
|
||||
kDragActionNothing = 0
|
||||
kDragActionCopy = 1
|
||||
kDragActionAlias = (1 << 1)
|
||||
kDragActionGeneric = (1 << 2)
|
||||
kDragActionPrivate = (1 << 3)
|
||||
kDragActionMove = (1 << 4)
|
||||
kDragActionDelete = (1 << 5)
|
||||
# kDragActionAll = (long)0xFFFFFFFF
|
||||
dragHasLeftSenderWindow = kDragHasLeftSenderWindow
|
||||
dragInsideSenderApplication = kDragInsideSenderApplication
|
||||
dragInsideSenderWindow = kDragInsideSenderWindow
|
||||
dragTrackingEnterHandler = kDragTrackingEnterHandler
|
||||
dragTrackingEnterWindow = kDragTrackingEnterWindow
|
||||
dragTrackingInWindow = kDragTrackingInWindow
|
||||
dragTrackingLeaveWindow = kDragTrackingLeaveWindow
|
||||
dragTrackingLeaveHandler = kDragTrackingLeaveHandler
|
||||
dragRegionBegin = kDragRegionBegin
|
||||
dragRegionDraw = kDragRegionDraw
|
||||
dragRegionHide = kDragRegionHide
|
||||
dragRegionIdle = kDragRegionIdle
|
||||
dragRegionEnd = kDragRegionEnd
|
||||
zoomNoAcceleration = kZoomNoAcceleration
|
||||
zoomAccelerate = kZoomAccelerate
|
||||
zoomDecelerate = kZoomDecelerate
|
||||
kDragStandardImage = kDragStandardTranslucency
|
||||
kDragDarkImage = kDragDarkTranslucency
|
||||
kDragDarkerImage = kDragDarkerTranslucency
|
||||
kDragOpaqueImage = kDragOpaqueTranslucency
|
|
@ -1,102 +0,0 @@
|
|||
# Generated from 'Events.h'
|
||||
|
||||
nullEvent = 0
|
||||
mouseDown = 1
|
||||
mouseUp = 2
|
||||
keyDown = 3
|
||||
keyUp = 4
|
||||
autoKey = 5
|
||||
updateEvt = 6
|
||||
diskEvt = 7
|
||||
activateEvt = 8
|
||||
osEvt = 15
|
||||
kHighLevelEvent = 23
|
||||
mDownMask = 1 << mouseDown
|
||||
mUpMask = 1 << mouseUp
|
||||
keyDownMask = 1 << keyDown
|
||||
keyUpMask = 1 << keyUp
|
||||
autoKeyMask = 1 << autoKey
|
||||
updateMask = 1 << updateEvt
|
||||
diskMask = 1 << diskEvt
|
||||
activMask = 1 << activateEvt
|
||||
highLevelEventMask = 0x0400
|
||||
osMask = 1 << osEvt
|
||||
everyEvent = 0xFFFF
|
||||
charCodeMask = 0x000000FF
|
||||
keyCodeMask = 0x0000FF00
|
||||
adbAddrMask = 0x00FF0000
|
||||
# osEvtMessageMask = (unsigned long)0xFF000000
|
||||
mouseMovedMessage = 0x00FA
|
||||
suspendResumeMessage = 0x0001
|
||||
resumeFlag = 1
|
||||
convertClipboardFlag = 2
|
||||
activeFlagBit = 0
|
||||
btnStateBit = 7
|
||||
cmdKeyBit = 8
|
||||
shiftKeyBit = 9
|
||||
alphaLockBit = 10
|
||||
optionKeyBit = 11
|
||||
controlKeyBit = 12
|
||||
rightShiftKeyBit = 13
|
||||
rightOptionKeyBit = 14
|
||||
rightControlKeyBit = 15
|
||||
activeFlag = 1 << activeFlagBit
|
||||
btnState = 1 << btnStateBit
|
||||
cmdKey = 1 << cmdKeyBit
|
||||
shiftKey = 1 << shiftKeyBit
|
||||
alphaLock = 1 << alphaLockBit
|
||||
optionKey = 1 << optionKeyBit
|
||||
controlKey = 1 << controlKeyBit
|
||||
rightShiftKey = 1 << rightShiftKeyBit
|
||||
rightOptionKey = 1 << rightOptionKeyBit
|
||||
rightControlKey = 1 << rightControlKeyBit
|
||||
kNullCharCode = 0
|
||||
kHomeCharCode = 1
|
||||
kEnterCharCode = 3
|
||||
kEndCharCode = 4
|
||||
kHelpCharCode = 5
|
||||
kBellCharCode = 7
|
||||
kBackspaceCharCode = 8
|
||||
kTabCharCode = 9
|
||||
kLineFeedCharCode = 10
|
||||
kVerticalTabCharCode = 11
|
||||
kPageUpCharCode = 11
|
||||
kFormFeedCharCode = 12
|
||||
kPageDownCharCode = 12
|
||||
kReturnCharCode = 13
|
||||
kFunctionKeyCharCode = 16
|
||||
kCommandCharCode = 17
|
||||
kCheckCharCode = 18
|
||||
kDiamondCharCode = 19
|
||||
kAppleLogoCharCode = 20
|
||||
kEscapeCharCode = 27
|
||||
kClearCharCode = 27
|
||||
kLeftArrowCharCode = 28
|
||||
kRightArrowCharCode = 29
|
||||
kUpArrowCharCode = 30
|
||||
kDownArrowCharCode = 31
|
||||
kSpaceCharCode = 32
|
||||
kDeleteCharCode = 127
|
||||
kBulletCharCode = 165
|
||||
kNonBreakingSpaceCharCode = 202
|
||||
kShiftUnicode = 0x21E7
|
||||
kControlUnicode = 0x2303
|
||||
kOptionUnicode = 0x2325
|
||||
kCommandUnicode = 0x2318
|
||||
kPencilUnicode = 0x270E
|
||||
kCheckUnicode = 0x2713
|
||||
kDiamondUnicode = 0x25C6
|
||||
kBulletUnicode = 0x2022
|
||||
kAppleLogoUnicode = 0xF8FF
|
||||
networkEvt = 10
|
||||
driverEvt = 11
|
||||
app1Evt = 12
|
||||
app2Evt = 13
|
||||
app3Evt = 14
|
||||
app4Evt = 15
|
||||
networkMask = 0x0400
|
||||
driverMask = 0x0800
|
||||
app1Mask = 0x1000
|
||||
app2Mask = 0x2000
|
||||
app3Mask = 0x4000
|
||||
app4Mask = 0x8000
|
|
@ -1 +0,0 @@
|
|||
from _Evt import *
|
|
@ -1 +0,0 @@
|
|||
from _File import *
|
|
@ -1,426 +0,0 @@
|
|||
# Generated from 'Files.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
true = True
|
||||
false = False
|
||||
fsCurPerm = 0x00
|
||||
fsRdPerm = 0x01
|
||||
fsWrPerm = 0x02
|
||||
fsRdWrPerm = 0x03
|
||||
fsRdWrShPerm = 0x04
|
||||
fsRdDenyPerm = 0x10
|
||||
fsWrDenyPerm = 0x20
|
||||
fsRtParID = 1
|
||||
fsRtDirID = 2
|
||||
fsAtMark = 0
|
||||
fsFromStart = 1
|
||||
fsFromLEOF = 2
|
||||
fsFromMark = 3
|
||||
pleaseCacheBit = 4
|
||||
pleaseCacheMask = 0x0010
|
||||
noCacheBit = 5
|
||||
noCacheMask = 0x0020
|
||||
rdVerifyBit = 6
|
||||
rdVerifyMask = 0x0040
|
||||
rdVerify = 64
|
||||
forceReadBit = 6
|
||||
forceReadMask = 0x0040
|
||||
newLineBit = 7
|
||||
newLineMask = 0x0080
|
||||
newLineCharMask = 0xFF00
|
||||
fsSBPartialName = 1
|
||||
fsSBFullName = 2
|
||||
fsSBFlAttrib = 4
|
||||
fsSBFlFndrInfo = 8
|
||||
fsSBFlLgLen = 32
|
||||
fsSBFlPyLen = 64
|
||||
fsSBFlRLgLen = 128
|
||||
fsSBFlRPyLen = 256
|
||||
fsSBFlCrDat = 512
|
||||
fsSBFlMdDat = 1024
|
||||
fsSBFlBkDat = 2048
|
||||
fsSBFlXFndrInfo = 4096
|
||||
fsSBFlParID = 8192
|
||||
fsSBNegate = 16384
|
||||
fsSBDrUsrWds = 8
|
||||
fsSBDrNmFls = 16
|
||||
fsSBDrCrDat = 512
|
||||
fsSBDrMdDat = 1024
|
||||
fsSBDrBkDat = 2048
|
||||
fsSBDrFndrInfo = 4096
|
||||
fsSBDrParID = 8192
|
||||
fsSBPartialNameBit = 0
|
||||
fsSBFullNameBit = 1
|
||||
fsSBFlAttribBit = 2
|
||||
fsSBFlFndrInfoBit = 3
|
||||
fsSBFlLgLenBit = 5
|
||||
fsSBFlPyLenBit = 6
|
||||
fsSBFlRLgLenBit = 7
|
||||
fsSBFlRPyLenBit = 8
|
||||
fsSBFlCrDatBit = 9
|
||||
fsSBFlMdDatBit = 10
|
||||
fsSBFlBkDatBit = 11
|
||||
fsSBFlXFndrInfoBit = 12
|
||||
fsSBFlParIDBit = 13
|
||||
fsSBNegateBit = 14
|
||||
fsSBDrUsrWdsBit = 3
|
||||
fsSBDrNmFlsBit = 4
|
||||
fsSBDrCrDatBit = 9
|
||||
fsSBDrMdDatBit = 10
|
||||
fsSBDrBkDatBit = 11
|
||||
fsSBDrFndrInfoBit = 12
|
||||
fsSBDrParIDBit = 13
|
||||
bLimitFCBs = 31
|
||||
bLocalWList = 30
|
||||
bNoMiniFndr = 29
|
||||
bNoVNEdit = 28
|
||||
bNoLclSync = 27
|
||||
bTrshOffLine = 26
|
||||
bNoSwitchTo = 25
|
||||
bDontShareIt = 21
|
||||
bNoDeskItems = 20
|
||||
bNoBootBlks = 19
|
||||
bAccessCntl = 18
|
||||
bNoSysDir = 17
|
||||
bHasExtFSVol = 16
|
||||
bHasOpenDeny = 15
|
||||
bHasCopyFile = 14
|
||||
bHasMoveRename = 13
|
||||
bHasDesktopMgr = 12
|
||||
bHasShortName = 11
|
||||
bHasFolderLock = 10
|
||||
bHasPersonalAccessPrivileges = 9
|
||||
bHasUserGroupList = 8
|
||||
bHasCatSearch = 7
|
||||
bHasFileIDs = 6
|
||||
bHasBTreeMgr = 5
|
||||
bHasBlankAccessPrivileges = 4
|
||||
bSupportsAsyncRequests = 3
|
||||
bSupportsTrashVolumeCache = 2
|
||||
bIsEjectable = 0
|
||||
bSupportsHFSPlusAPIs = 1
|
||||
bSupportsFSCatalogSearch = 2
|
||||
bSupportsFSExchangeObjects = 3
|
||||
bSupports2TBFiles = 4
|
||||
bSupportsLongNames = 5
|
||||
bSupportsMultiScriptNames = 6
|
||||
bSupportsNamedForks = 7
|
||||
bSupportsSubtreeIterators = 8
|
||||
bL2PCanMapFileBlocks = 9
|
||||
bParentModDateChanges = 10
|
||||
bAncestorModDateChanges = 11
|
||||
bSupportsSymbolicLinks = 13
|
||||
bIsAutoMounted = 14
|
||||
bAllowCDiDataHandler = 17
|
||||
kLargeIcon = 1
|
||||
kLarge4BitIcon = 2
|
||||
kLarge8BitIcon = 3
|
||||
kSmallIcon = 4
|
||||
kSmall4BitIcon = 5
|
||||
kSmall8BitIcon = 6
|
||||
kicnsIconFamily = 239
|
||||
kLargeIconSize = 256
|
||||
kLarge4BitIconSize = 512
|
||||
kLarge8BitIconSize = 1024
|
||||
kSmallIconSize = 64
|
||||
kSmall4BitIconSize = 128
|
||||
kSmall8BitIconSize = 256
|
||||
kWidePosOffsetBit = 8
|
||||
kUseWidePositioning = (1 << kWidePosOffsetBit)
|
||||
kMaximumBlocksIn4GB = 0x007FFFFF
|
||||
fsUnixPriv = 1
|
||||
kNoUserAuthentication = 1
|
||||
kPassword = 2
|
||||
kEncryptPassword = 3
|
||||
kTwoWayEncryptPassword = 6
|
||||
kOwnerID2Name = 1
|
||||
kGroupID2Name = 2
|
||||
kOwnerName2ID = 3
|
||||
kGroupName2ID = 4
|
||||
kReturnNextUser = 1
|
||||
kReturnNextGroup = 2
|
||||
kReturnNextUG = 3
|
||||
kVCBFlagsIdleFlushBit = 3
|
||||
kVCBFlagsIdleFlushMask = 0x0008
|
||||
kVCBFlagsHFSPlusAPIsBit = 4
|
||||
kVCBFlagsHFSPlusAPIsMask = 0x0010
|
||||
kVCBFlagsHardwareGoneBit = 5
|
||||
kVCBFlagsHardwareGoneMask = 0x0020
|
||||
kVCBFlagsVolumeDirtyBit = 15
|
||||
kVCBFlagsVolumeDirtyMask = 0x8000
|
||||
kioVAtrbDefaultVolumeBit = 5
|
||||
kioVAtrbDefaultVolumeMask = 0x0020
|
||||
kioVAtrbFilesOpenBit = 6
|
||||
kioVAtrbFilesOpenMask = 0x0040
|
||||
kioVAtrbHardwareLockedBit = 7
|
||||
kioVAtrbHardwareLockedMask = 0x0080
|
||||
kioVAtrbSoftwareLockedBit = 15
|
||||
kioVAtrbSoftwareLockedMask = 0x8000
|
||||
kioFlAttribLockedBit = 0
|
||||
kioFlAttribLockedMask = 0x01
|
||||
kioFlAttribResOpenBit = 2
|
||||
kioFlAttribResOpenMask = 0x04
|
||||
kioFlAttribDataOpenBit = 3
|
||||
kioFlAttribDataOpenMask = 0x08
|
||||
kioFlAttribDirBit = 4
|
||||
kioFlAttribDirMask = 0x10
|
||||
ioDirFlg = 4
|
||||
ioDirMask = 0x10
|
||||
kioFlAttribCopyProtBit = 6
|
||||
kioFlAttribCopyProtMask = 0x40
|
||||
kioFlAttribFileOpenBit = 7
|
||||
kioFlAttribFileOpenMask = 0x80
|
||||
kioFlAttribInSharedBit = 2
|
||||
kioFlAttribInSharedMask = 0x04
|
||||
kioFlAttribMountedBit = 3
|
||||
kioFlAttribMountedMask = 0x08
|
||||
kioFlAttribSharePointBit = 5
|
||||
kioFlAttribSharePointMask = 0x20
|
||||
kioFCBWriteBit = 8
|
||||
kioFCBWriteMask = 0x0100
|
||||
kioFCBResourceBit = 9
|
||||
kioFCBResourceMask = 0x0200
|
||||
kioFCBWriteLockedBit = 10
|
||||
kioFCBWriteLockedMask = 0x0400
|
||||
kioFCBLargeFileBit = 11
|
||||
kioFCBLargeFileMask = 0x0800
|
||||
kioFCBSharedWriteBit = 12
|
||||
kioFCBSharedWriteMask = 0x1000
|
||||
kioFCBFileLockedBit = 13
|
||||
kioFCBFileLockedMask = 0x2000
|
||||
kioFCBOwnClumpBit = 14
|
||||
kioFCBOwnClumpMask = 0x4000
|
||||
kioFCBModifiedBit = 15
|
||||
kioFCBModifiedMask = 0x8000
|
||||
kioACUserNoSeeFolderBit = 0
|
||||
kioACUserNoSeeFolderMask = 0x01
|
||||
kioACUserNoSeeFilesBit = 1
|
||||
kioACUserNoSeeFilesMask = 0x02
|
||||
kioACUserNoMakeChangesBit = 2
|
||||
kioACUserNoMakeChangesMask = 0x04
|
||||
kioACUserNotOwnerBit = 7
|
||||
kioACUserNotOwnerMask = 0x80
|
||||
kioACAccessOwnerBit = 31
|
||||
# kioACAccessOwnerMask = (long)0x80000000
|
||||
kioACAccessBlankAccessBit = 28
|
||||
kioACAccessBlankAccessMask = 0x10000000
|
||||
kioACAccessUserWriteBit = 26
|
||||
kioACAccessUserWriteMask = 0x04000000
|
||||
kioACAccessUserReadBit = 25
|
||||
kioACAccessUserReadMask = 0x02000000
|
||||
kioACAccessUserSearchBit = 24
|
||||
kioACAccessUserSearchMask = 0x01000000
|
||||
kioACAccessEveryoneWriteBit = 18
|
||||
kioACAccessEveryoneWriteMask = 0x00040000
|
||||
kioACAccessEveryoneReadBit = 17
|
||||
kioACAccessEveryoneReadMask = 0x00020000
|
||||
kioACAccessEveryoneSearchBit = 16
|
||||
kioACAccessEveryoneSearchMask = 0x00010000
|
||||
kioACAccessGroupWriteBit = 10
|
||||
kioACAccessGroupWriteMask = 0x00000400
|
||||
kioACAccessGroupReadBit = 9
|
||||
kioACAccessGroupReadMask = 0x00000200
|
||||
kioACAccessGroupSearchBit = 8
|
||||
kioACAccessGroupSearchMask = 0x00000100
|
||||
kioACAccessOwnerWriteBit = 2
|
||||
kioACAccessOwnerWriteMask = 0x00000004
|
||||
kioACAccessOwnerReadBit = 1
|
||||
kioACAccessOwnerReadMask = 0x00000002
|
||||
kioACAccessOwnerSearchBit = 0
|
||||
kioACAccessOwnerSearchMask = 0x00000001
|
||||
kfullPrivileges = 0x00070007
|
||||
kownerPrivileges = 0x00000007
|
||||
knoUser = 0
|
||||
kadministratorUser = 1
|
||||
knoGroup = 0
|
||||
AppleShareMediaType = FOUR_CHAR_CODE('afpm')
|
||||
volMountNoLoginMsgFlagBit = 0
|
||||
volMountNoLoginMsgFlagMask = 0x0001
|
||||
volMountExtendedFlagsBit = 7
|
||||
volMountExtendedFlagsMask = 0x0080
|
||||
volMountInteractBit = 15
|
||||
volMountInteractMask = 0x8000
|
||||
volMountChangedBit = 14
|
||||
volMountChangedMask = 0x4000
|
||||
volMountFSReservedMask = 0x00FF
|
||||
volMountSysReservedMask = 0xFF00
|
||||
kAFPExtendedFlagsAlternateAddressMask = 1
|
||||
kAFPTagTypeIP = 0x01
|
||||
kAFPTagTypeIPPort = 0x02
|
||||
kAFPTagTypeDDP = 0x03
|
||||
kAFPTagTypeDNS = 0x04
|
||||
kAFPTagLengthIP = 0x06
|
||||
kAFPTagLengthIPPort = 0x08
|
||||
kAFPTagLengthDDP = 0x06
|
||||
kFSInvalidVolumeRefNum = 0
|
||||
kFSCatInfoNone = 0x00000000
|
||||
kFSCatInfoTextEncoding = 0x00000001
|
||||
kFSCatInfoNodeFlags = 0x00000002
|
||||
kFSCatInfoVolume = 0x00000004
|
||||
kFSCatInfoParentDirID = 0x00000008
|
||||
kFSCatInfoNodeID = 0x00000010
|
||||
kFSCatInfoCreateDate = 0x00000020
|
||||
kFSCatInfoContentMod = 0x00000040
|
||||
kFSCatInfoAttrMod = 0x00000080
|
||||
kFSCatInfoAccessDate = 0x00000100
|
||||
kFSCatInfoBackupDate = 0x00000200
|
||||
kFSCatInfoPermissions = 0x00000400
|
||||
kFSCatInfoFinderInfo = 0x00000800
|
||||
kFSCatInfoFinderXInfo = 0x00001000
|
||||
kFSCatInfoValence = 0x00002000
|
||||
kFSCatInfoDataSizes = 0x00004000
|
||||
kFSCatInfoRsrcSizes = 0x00008000
|
||||
kFSCatInfoSharingFlags = 0x00010000
|
||||
kFSCatInfoUserPrivs = 0x00020000
|
||||
kFSCatInfoUserAccess = 0x00080000
|
||||
kFSCatInfoAllDates = 0x000003E0
|
||||
kFSCatInfoGettableInfo = 0x0003FFFF
|
||||
kFSCatInfoSettableInfo = 0x00001FE3
|
||||
# kFSCatInfoReserved = (long)0xFFFC0000
|
||||
kFSNodeLockedBit = 0
|
||||
kFSNodeLockedMask = 0x0001
|
||||
kFSNodeResOpenBit = 2
|
||||
kFSNodeResOpenMask = 0x0004
|
||||
kFSNodeDataOpenBit = 3
|
||||
kFSNodeDataOpenMask = 0x0008
|
||||
kFSNodeIsDirectoryBit = 4
|
||||
kFSNodeIsDirectoryMask = 0x0010
|
||||
kFSNodeCopyProtectBit = 6
|
||||
kFSNodeCopyProtectMask = 0x0040
|
||||
kFSNodeForkOpenBit = 7
|
||||
kFSNodeForkOpenMask = 0x0080
|
||||
kFSNodeInSharedBit = 2
|
||||
kFSNodeInSharedMask = 0x0004
|
||||
kFSNodeIsMountedBit = 3
|
||||
kFSNodeIsMountedMask = 0x0008
|
||||
kFSNodeIsSharePointBit = 5
|
||||
kFSNodeIsSharePointMask = 0x0020
|
||||
kFSIterateFlat = 0
|
||||
kFSIterateSubtree = 1
|
||||
kFSIterateDelete = 2
|
||||
# kFSIterateReserved = (long)0xFFFFFFFC
|
||||
fsSBNodeID = 0x00008000
|
||||
fsSBAttributeModDate = 0x00010000
|
||||
fsSBAccessDate = 0x00020000
|
||||
fsSBPermissions = 0x00040000
|
||||
fsSBNodeIDBit = 15
|
||||
fsSBAttributeModDateBit = 16
|
||||
fsSBAccessDateBit = 17
|
||||
fsSBPermissionsBit = 18
|
||||
kFSAllocDefaultFlags = 0x0000
|
||||
kFSAllocAllOrNothingMask = 0x0001
|
||||
kFSAllocContiguousMask = 0x0002
|
||||
kFSAllocNoRoundUpMask = 0x0004
|
||||
kFSAllocReservedMask = 0xFFF8
|
||||
kFSVolInfoNone = 0x0000
|
||||
kFSVolInfoCreateDate = 0x0001
|
||||
kFSVolInfoModDate = 0x0002
|
||||
kFSVolInfoBackupDate = 0x0004
|
||||
kFSVolInfoCheckedDate = 0x0008
|
||||
kFSVolInfoFileCount = 0x0010
|
||||
kFSVolInfoDirCount = 0x0020
|
||||
kFSVolInfoSizes = 0x0040
|
||||
kFSVolInfoBlocks = 0x0080
|
||||
kFSVolInfoNextAlloc = 0x0100
|
||||
kFSVolInfoRsrcClump = 0x0200
|
||||
kFSVolInfoDataClump = 0x0400
|
||||
kFSVolInfoNextID = 0x0800
|
||||
kFSVolInfoFinderInfo = 0x1000
|
||||
kFSVolInfoFlags = 0x2000
|
||||
kFSVolInfoFSInfo = 0x4000
|
||||
kFSVolInfoDriveInfo = 0x8000
|
||||
kFSVolInfoGettableInfo = 0xFFFF
|
||||
kFSVolInfoSettableInfo = 0x3004
|
||||
kFSVolFlagDefaultVolumeBit = 5
|
||||
kFSVolFlagDefaultVolumeMask = 0x0020
|
||||
kFSVolFlagFilesOpenBit = 6
|
||||
kFSVolFlagFilesOpenMask = 0x0040
|
||||
kFSVolFlagHardwareLockedBit = 7
|
||||
kFSVolFlagHardwareLockedMask = 0x0080
|
||||
kFSVolFlagSoftwareLockedBit = 15
|
||||
kFSVolFlagSoftwareLockedMask = 0x8000
|
||||
kFNDirectoryModifiedMessage = 1
|
||||
kFNNoImplicitAllSubscription = (1 << 0)
|
||||
rAliasType = FOUR_CHAR_CODE('alis')
|
||||
kARMMountVol = 0x00000001
|
||||
kARMNoUI = 0x00000002
|
||||
kARMMultVols = 0x00000008
|
||||
kARMSearch = 0x00000100
|
||||
kARMSearchMore = 0x00000200
|
||||
kARMSearchRelFirst = 0x00000400
|
||||
asiZoneName = -3
|
||||
asiServerName = -2
|
||||
asiVolumeName = -1
|
||||
asiAliasName = 0
|
||||
asiParentName = 1
|
||||
kResolveAliasFileNoUI = 0x00000001
|
||||
kClippingCreator = FOUR_CHAR_CODE('drag')
|
||||
kClippingPictureType = FOUR_CHAR_CODE('clpp')
|
||||
kClippingTextType = FOUR_CHAR_CODE('clpt')
|
||||
kClippingSoundType = FOUR_CHAR_CODE('clps')
|
||||
kClippingUnknownType = FOUR_CHAR_CODE('clpu')
|
||||
kInternetLocationCreator = FOUR_CHAR_CODE('drag')
|
||||
kInternetLocationHTTP = FOUR_CHAR_CODE('ilht')
|
||||
kInternetLocationFTP = FOUR_CHAR_CODE('ilft')
|
||||
kInternetLocationFile = FOUR_CHAR_CODE('ilfi')
|
||||
kInternetLocationMail = FOUR_CHAR_CODE('ilma')
|
||||
kInternetLocationNNTP = FOUR_CHAR_CODE('ilnw')
|
||||
kInternetLocationAFP = FOUR_CHAR_CODE('ilaf')
|
||||
kInternetLocationAppleTalk = FOUR_CHAR_CODE('ilat')
|
||||
kInternetLocationNSL = FOUR_CHAR_CODE('ilns')
|
||||
kInternetLocationGeneric = FOUR_CHAR_CODE('ilge')
|
||||
kCustomIconResource = -16455
|
||||
kCustomBadgeResourceType = FOUR_CHAR_CODE('badg')
|
||||
kCustomBadgeResourceID = kCustomIconResource
|
||||
kCustomBadgeResourceVersion = 0
|
||||
# kSystemFolderType = 'macs'.
|
||||
kRoutingResourceType = FOUR_CHAR_CODE('rout')
|
||||
kRoutingResourceID = 0
|
||||
kContainerFolderAliasType = FOUR_CHAR_CODE('fdrp')
|
||||
kContainerTrashAliasType = FOUR_CHAR_CODE('trsh')
|
||||
kContainerHardDiskAliasType = FOUR_CHAR_CODE('hdsk')
|
||||
kContainerFloppyAliasType = FOUR_CHAR_CODE('flpy')
|
||||
kContainerServerAliasType = FOUR_CHAR_CODE('srvr')
|
||||
kApplicationAliasType = FOUR_CHAR_CODE('adrp')
|
||||
kContainerAliasType = FOUR_CHAR_CODE('drop')
|
||||
kDesktopPrinterAliasType = FOUR_CHAR_CODE('dtpa')
|
||||
kContainerCDROMAliasType = FOUR_CHAR_CODE('cddr')
|
||||
kApplicationCPAliasType = FOUR_CHAR_CODE('acdp')
|
||||
kApplicationDAAliasType = FOUR_CHAR_CODE('addp')
|
||||
kPackageAliasType = FOUR_CHAR_CODE('fpka')
|
||||
kAppPackageAliasType = FOUR_CHAR_CODE('fapa')
|
||||
kSystemFolderAliasType = FOUR_CHAR_CODE('fasy')
|
||||
kAppleMenuFolderAliasType = FOUR_CHAR_CODE('faam')
|
||||
kStartupFolderAliasType = FOUR_CHAR_CODE('fast')
|
||||
kPrintMonitorDocsFolderAliasType = FOUR_CHAR_CODE('fapn')
|
||||
kPreferencesFolderAliasType = FOUR_CHAR_CODE('fapf')
|
||||
kControlPanelFolderAliasType = FOUR_CHAR_CODE('fact')
|
||||
kExtensionFolderAliasType = FOUR_CHAR_CODE('faex')
|
||||
kExportedFolderAliasType = FOUR_CHAR_CODE('faet')
|
||||
kDropFolderAliasType = FOUR_CHAR_CODE('fadr')
|
||||
kSharedFolderAliasType = FOUR_CHAR_CODE('fash')
|
||||
kMountedFolderAliasType = FOUR_CHAR_CODE('famn')
|
||||
kIsOnDesk = 0x0001
|
||||
kColor = 0x000E
|
||||
kIsShared = 0x0040
|
||||
kHasNoINITs = 0x0080
|
||||
kHasBeenInited = 0x0100
|
||||
kHasCustomIcon = 0x0400
|
||||
kIsStationery = 0x0800
|
||||
kNameLocked = 0x1000
|
||||
kHasBundle = 0x2000
|
||||
kIsInvisible = 0x4000
|
||||
kIsAlias = 0x8000
|
||||
fOnDesk = kIsOnDesk
|
||||
fHasBundle = kHasBundle
|
||||
fInvisible = kIsInvisible
|
||||
fTrash = -3
|
||||
fDesktop = -2
|
||||
fDisk = 0
|
||||
kIsStationary = kIsStationery
|
||||
kExtendedFlagsAreInvalid = 0x8000
|
||||
kExtendedFlagHasCustomBadge = 0x0100
|
||||
kExtendedFlagHasRoutingInfo = 0x0004
|
||||
kFirstMagicBusyFiletype = FOUR_CHAR_CODE('bzy ')
|
||||
kLastMagicBusyFiletype = FOUR_CHAR_CODE('bzy?')
|
||||
kMagicBusyCreationDate = 0x4F3AFDB0
|
|
@ -1 +0,0 @@
|
|||
from _Fm import *
|
|
@ -1 +0,0 @@
|
|||
from _Folder import *
|
|
@ -1,190 +0,0 @@
|
|||
# Generated from 'Folders.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
true = True
|
||||
false = False
|
||||
kOnSystemDisk = -32768
|
||||
kOnAppropriateDisk = -32767
|
||||
kSystemDomain = -32766
|
||||
kLocalDomain = -32765
|
||||
kNetworkDomain = -32764
|
||||
kUserDomain = -32763
|
||||
kClassicDomain = -32762
|
||||
kCreateFolder = true
|
||||
kDontCreateFolder = false
|
||||
kSystemFolderType = FOUR_CHAR_CODE('macs')
|
||||
kDesktopFolderType = FOUR_CHAR_CODE('desk')
|
||||
kSystemDesktopFolderType = FOUR_CHAR_CODE('sdsk')
|
||||
kTrashFolderType = FOUR_CHAR_CODE('trsh')
|
||||
kSystemTrashFolderType = FOUR_CHAR_CODE('strs')
|
||||
kWhereToEmptyTrashFolderType = FOUR_CHAR_CODE('empt')
|
||||
kPrintMonitorDocsFolderType = FOUR_CHAR_CODE('prnt')
|
||||
kStartupFolderType = FOUR_CHAR_CODE('strt')
|
||||
kShutdownFolderType = FOUR_CHAR_CODE('shdf')
|
||||
kAppleMenuFolderType = FOUR_CHAR_CODE('amnu')
|
||||
kControlPanelFolderType = FOUR_CHAR_CODE('ctrl')
|
||||
kSystemControlPanelFolderType = FOUR_CHAR_CODE('sctl')
|
||||
kExtensionFolderType = FOUR_CHAR_CODE('extn')
|
||||
kFontsFolderType = FOUR_CHAR_CODE('font')
|
||||
kPreferencesFolderType = FOUR_CHAR_CODE('pref')
|
||||
kSystemPreferencesFolderType = FOUR_CHAR_CODE('sprf')
|
||||
kTemporaryFolderType = FOUR_CHAR_CODE('temp')
|
||||
kExtensionDisabledFolderType = FOUR_CHAR_CODE('extD')
|
||||
kControlPanelDisabledFolderType = FOUR_CHAR_CODE('ctrD')
|
||||
kSystemExtensionDisabledFolderType = FOUR_CHAR_CODE('macD')
|
||||
kStartupItemsDisabledFolderType = FOUR_CHAR_CODE('strD')
|
||||
kShutdownItemsDisabledFolderType = FOUR_CHAR_CODE('shdD')
|
||||
kApplicationsFolderType = FOUR_CHAR_CODE('apps')
|
||||
kDocumentsFolderType = FOUR_CHAR_CODE('docs')
|
||||
kVolumeRootFolderType = FOUR_CHAR_CODE('root')
|
||||
kChewableItemsFolderType = FOUR_CHAR_CODE('flnt')
|
||||
kApplicationSupportFolderType = FOUR_CHAR_CODE('asup')
|
||||
kTextEncodingsFolderType = FOUR_CHAR_CODE('\xc4tex')
|
||||
kStationeryFolderType = FOUR_CHAR_CODE('odst')
|
||||
kOpenDocFolderType = FOUR_CHAR_CODE('odod')
|
||||
kOpenDocShellPlugInsFolderType = FOUR_CHAR_CODE('odsp')
|
||||
kEditorsFolderType = FOUR_CHAR_CODE('oded')
|
||||
kOpenDocEditorsFolderType = FOUR_CHAR_CODE('\xc4odf')
|
||||
kOpenDocLibrariesFolderType = FOUR_CHAR_CODE('odlb')
|
||||
kGenEditorsFolderType = FOUR_CHAR_CODE('\xc4edi')
|
||||
kHelpFolderType = FOUR_CHAR_CODE('\xc4hlp')
|
||||
kInternetPlugInFolderType = FOUR_CHAR_CODE('\xc4net')
|
||||
kModemScriptsFolderType = FOUR_CHAR_CODE('\xc4mod')
|
||||
kPrinterDescriptionFolderType = FOUR_CHAR_CODE('ppdf')
|
||||
kPrinterDriverFolderType = FOUR_CHAR_CODE('\xc4prd')
|
||||
kScriptingAdditionsFolderType = FOUR_CHAR_CODE('\xc4scr')
|
||||
kSharedLibrariesFolderType = FOUR_CHAR_CODE('\xc4lib')
|
||||
kVoicesFolderType = FOUR_CHAR_CODE('fvoc')
|
||||
kControlStripModulesFolderType = FOUR_CHAR_CODE('sdev')
|
||||
kAssistantsFolderType = FOUR_CHAR_CODE('ast\xc4')
|
||||
kUtilitiesFolderType = FOUR_CHAR_CODE('uti\xc4')
|
||||
kAppleExtrasFolderType = FOUR_CHAR_CODE('aex\xc4')
|
||||
kContextualMenuItemsFolderType = FOUR_CHAR_CODE('cmnu')
|
||||
kMacOSReadMesFolderType = FOUR_CHAR_CODE('mor\xc4')
|
||||
kALMModulesFolderType = FOUR_CHAR_CODE('walk')
|
||||
kALMPreferencesFolderType = FOUR_CHAR_CODE('trip')
|
||||
kALMLocationsFolderType = FOUR_CHAR_CODE('fall')
|
||||
kColorSyncProfilesFolderType = FOUR_CHAR_CODE('prof')
|
||||
kThemesFolderType = FOUR_CHAR_CODE('thme')
|
||||
kFavoritesFolderType = FOUR_CHAR_CODE('favs')
|
||||
kInternetFolderType = FOUR_CHAR_CODE('int\xc4')
|
||||
kAppearanceFolderType = FOUR_CHAR_CODE('appr')
|
||||
kSoundSetsFolderType = FOUR_CHAR_CODE('snds')
|
||||
kDesktopPicturesFolderType = FOUR_CHAR_CODE('dtp\xc4')
|
||||
kInternetSearchSitesFolderType = FOUR_CHAR_CODE('issf')
|
||||
kFindSupportFolderType = FOUR_CHAR_CODE('fnds')
|
||||
kFindByContentFolderType = FOUR_CHAR_CODE('fbcf')
|
||||
kInstallerLogsFolderType = FOUR_CHAR_CODE('ilgf')
|
||||
kScriptsFolderType = FOUR_CHAR_CODE('scr\xc4')
|
||||
kFolderActionsFolderType = FOUR_CHAR_CODE('fasf')
|
||||
kLauncherItemsFolderType = FOUR_CHAR_CODE('laun')
|
||||
kRecentApplicationsFolderType = FOUR_CHAR_CODE('rapp')
|
||||
kRecentDocumentsFolderType = FOUR_CHAR_CODE('rdoc')
|
||||
kRecentServersFolderType = FOUR_CHAR_CODE('rsvr')
|
||||
kSpeakableItemsFolderType = FOUR_CHAR_CODE('spki')
|
||||
kKeychainFolderType = FOUR_CHAR_CODE('kchn')
|
||||
kQuickTimeExtensionsFolderType = FOUR_CHAR_CODE('qtex')
|
||||
kDisplayExtensionsFolderType = FOUR_CHAR_CODE('dspl')
|
||||
kMultiprocessingFolderType = FOUR_CHAR_CODE('mpxf')
|
||||
kPrintingPlugInsFolderType = FOUR_CHAR_CODE('pplg')
|
||||
kDomainTopLevelFolderType = FOUR_CHAR_CODE('dtop')
|
||||
kDomainLibraryFolderType = FOUR_CHAR_CODE('dlib')
|
||||
kColorSyncFolderType = FOUR_CHAR_CODE('sync')
|
||||
kColorSyncCMMFolderType = FOUR_CHAR_CODE('ccmm')
|
||||
kColorSyncScriptingFolderType = FOUR_CHAR_CODE('cscr')
|
||||
kPrintersFolderType = FOUR_CHAR_CODE('impr')
|
||||
kSpeechFolderType = FOUR_CHAR_CODE('spch')
|
||||
kCarbonLibraryFolderType = FOUR_CHAR_CODE('carb')
|
||||
kDocumentationFolderType = FOUR_CHAR_CODE('info')
|
||||
kDeveloperDocsFolderType = FOUR_CHAR_CODE('ddoc')
|
||||
kDeveloperHelpFolderType = FOUR_CHAR_CODE('devh')
|
||||
kISSDownloadsFolderType = FOUR_CHAR_CODE('issd')
|
||||
kUserSpecificTmpFolderType = FOUR_CHAR_CODE('utmp')
|
||||
kCachedDataFolderType = FOUR_CHAR_CODE('cach')
|
||||
kFrameworksFolderType = FOUR_CHAR_CODE('fram')
|
||||
kPrivateFrameworksFolderType = FOUR_CHAR_CODE('pfrm')
|
||||
kClassicDesktopFolderType = FOUR_CHAR_CODE('sdsk')
|
||||
kDeveloperFolderType = FOUR_CHAR_CODE('devf')
|
||||
kSystemSoundsFolderType = FOUR_CHAR_CODE('ssnd')
|
||||
kComponentsFolderType = FOUR_CHAR_CODE('cmpd')
|
||||
kQuickTimeComponentsFolderType = FOUR_CHAR_CODE('wcmp')
|
||||
kCoreServicesFolderType = FOUR_CHAR_CODE('csrv')
|
||||
kPictureDocumentsFolderType = FOUR_CHAR_CODE('pdoc')
|
||||
kMovieDocumentsFolderType = FOUR_CHAR_CODE('mdoc')
|
||||
kMusicDocumentsFolderType = FOUR_CHAR_CODE('\xb5doc')
|
||||
kInternetSitesFolderType = FOUR_CHAR_CODE('site')
|
||||
kPublicFolderType = FOUR_CHAR_CODE('pubb')
|
||||
kAudioSupportFolderType = FOUR_CHAR_CODE('adio')
|
||||
kAudioSoundsFolderType = FOUR_CHAR_CODE('asnd')
|
||||
kAudioSoundBanksFolderType = FOUR_CHAR_CODE('bank')
|
||||
kAudioAlertSoundsFolderType = FOUR_CHAR_CODE('alrt')
|
||||
kAudioPlugInsFolderType = FOUR_CHAR_CODE('aplg')
|
||||
kAudioComponentsFolderType = FOUR_CHAR_CODE('acmp')
|
||||
kKernelExtensionsFolderType = FOUR_CHAR_CODE('kext')
|
||||
kDirectoryServicesFolderType = FOUR_CHAR_CODE('dsrv')
|
||||
kDirectoryServicesPlugInsFolderType = FOUR_CHAR_CODE('dplg')
|
||||
kInstallerReceiptsFolderType = FOUR_CHAR_CODE('rcpt')
|
||||
kFileSystemSupportFolderType = FOUR_CHAR_CODE('fsys')
|
||||
kAppleShareSupportFolderType = FOUR_CHAR_CODE('shar')
|
||||
kAppleShareAuthenticationFolderType = FOUR_CHAR_CODE('auth')
|
||||
kMIDIDriversFolderType = FOUR_CHAR_CODE('midi')
|
||||
kLocalesFolderType = FOUR_CHAR_CODE('\xc4loc')
|
||||
kFindByContentPluginsFolderType = FOUR_CHAR_CODE('fbcp')
|
||||
kUsersFolderType = FOUR_CHAR_CODE('usrs')
|
||||
kCurrentUserFolderType = FOUR_CHAR_CODE('cusr')
|
||||
kCurrentUserRemoteFolderLocation = FOUR_CHAR_CODE('rusf')
|
||||
kCurrentUserRemoteFolderType = FOUR_CHAR_CODE('rusr')
|
||||
kSharedUserDataFolderType = FOUR_CHAR_CODE('sdat')
|
||||
kVolumeSettingsFolderType = FOUR_CHAR_CODE('vsfd')
|
||||
kAppleshareAutomountServerAliasesFolderType = FOUR_CHAR_CODE('srv\xc4')
|
||||
kPreMacOS91ApplicationsFolderType = FOUR_CHAR_CODE('\x8cpps')
|
||||
kPreMacOS91InstallerLogsFolderType = FOUR_CHAR_CODE('\x94lgf')
|
||||
kPreMacOS91AssistantsFolderType = FOUR_CHAR_CODE('\x8cst\xc4')
|
||||
kPreMacOS91UtilitiesFolderType = FOUR_CHAR_CODE('\x9fti\xc4')
|
||||
kPreMacOS91AppleExtrasFolderType = FOUR_CHAR_CODE('\x8cex\xc4')
|
||||
kPreMacOS91MacOSReadMesFolderType = FOUR_CHAR_CODE('\xb5or\xc4')
|
||||
kPreMacOS91InternetFolderType = FOUR_CHAR_CODE('\x94nt\xc4')
|
||||
kPreMacOS91AutomountedServersFolderType = FOUR_CHAR_CODE('\xa7rv\xc4')
|
||||
kPreMacOS91StationeryFolderType = FOUR_CHAR_CODE('\xbfdst')
|
||||
kCreateFolderAtBoot = 0x00000002
|
||||
kCreateFolderAtBootBit = 1
|
||||
kFolderCreatedInvisible = 0x00000004
|
||||
kFolderCreatedInvisibleBit = 2
|
||||
kFolderCreatedNameLocked = 0x00000008
|
||||
kFolderCreatedNameLockedBit = 3
|
||||
kFolderCreatedAdminPrivs = 0x00000010
|
||||
kFolderCreatedAdminPrivsBit = 4
|
||||
kFolderInUserFolder = 0x00000020
|
||||
kFolderInUserFolderBit = 5
|
||||
kFolderTrackedByAlias = 0x00000040
|
||||
kFolderTrackedByAliasBit = 6
|
||||
kFolderInRemoteUserFolderIfAvailable = 0x00000080
|
||||
kFolderInRemoteUserFolderIfAvailableBit = 7
|
||||
kFolderNeverMatchedInIdentifyFolder = 0x00000100
|
||||
kFolderNeverMatchedInIdentifyFolderBit = 8
|
||||
kFolderMustStayOnSameVolume = 0x00000200
|
||||
kFolderMustStayOnSameVolumeBit = 9
|
||||
kFolderManagerFolderInMacOS9FolderIfMacOSXIsInstalledMask = 0x00000400
|
||||
kFolderManagerFolderInMacOS9FolderIfMacOSXIsInstalledBit = 10
|
||||
kFolderInLocalOrRemoteUserFolder = kFolderInUserFolder | kFolderInRemoteUserFolderIfAvailable
|
||||
kRelativeFolder = FOUR_CHAR_CODE('relf')
|
||||
kSpecialFolder = FOUR_CHAR_CODE('spcf')
|
||||
kBlessedFolder = FOUR_CHAR_CODE('blsf')
|
||||
kRootFolder = FOUR_CHAR_CODE('rotf')
|
||||
kCurrentUserFolderLocation = FOUR_CHAR_CODE('cusf')
|
||||
kFindFolderRedirectionFlagUseDistinctUserFoldersBit = 0
|
||||
kFindFolderRedirectionFlagUseGivenVRefAndDirIDAsUserFolderBit = 1
|
||||
kFindFolderRedirectionFlagsUseGivenVRefNumAndDirIDAsRemoteUserFolderBit = 2
|
||||
kFolderManagerUserRedirectionGlobalsCurrentVersion = 1
|
||||
kFindFolderExtendedFlagsDoNotFollowAliasesBit = 0
|
||||
kFindFolderExtendedFlagsDoNotUseUserFolderBit = 1
|
||||
kFindFolderExtendedFlagsUseOtherUserRecord = 0x01000000
|
||||
kFolderManagerNotificationMessageUserLogIn = FOUR_CHAR_CODE('log+')
|
||||
kFolderManagerNotificationMessagePreUserLogIn = FOUR_CHAR_CODE('logj')
|
||||
kFolderManagerNotificationMessageUserLogOut = FOUR_CHAR_CODE('log-')
|
||||
kFolderManagerNotificationMessagePostUserLogOut = FOUR_CHAR_CODE('logp')
|
||||
kFolderManagerNotificationDiscardCachedData = FOUR_CHAR_CODE('dche')
|
||||
kFolderManagerNotificationMessageLoginStartup = FOUR_CHAR_CODE('stup')
|
||||
kDoNotRemoveWhenCurrentApplicationQuitsBit = 0
|
||||
kDoNotRemoveWheCurrentApplicationQuitsBit = kDoNotRemoveWhenCurrentApplicationQuitsBit
|
||||
kStopIfAnyNotificationProcReturnsErrorBit = 31
|
|
@ -1,59 +0,0 @@
|
|||
# Generated from 'Fonts.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
kNilOptions = 0
|
||||
systemFont = 0
|
||||
applFont = 1
|
||||
kFMDefaultOptions = kNilOptions
|
||||
kFMDefaultActivationContext = kFMDefaultOptions
|
||||
kFMGlobalActivationContext = 0x00000001
|
||||
kFMLocalActivationContext = kFMDefaultActivationContext
|
||||
kFMDefaultIterationScope = kFMDefaultOptions
|
||||
kFMGlobalIterationScope = 0x00000001
|
||||
kFMLocalIterationScope = kFMDefaultIterationScope
|
||||
kPlatformDefaultGuiFontID = applFont
|
||||
kPlatformDefaultGuiFontID = -1
|
||||
commandMark = 17
|
||||
checkMark = 18
|
||||
diamondMark = 19
|
||||
appleMark = 20
|
||||
propFont = 36864
|
||||
prpFntH = 36865
|
||||
prpFntW = 36866
|
||||
prpFntHW = 36867
|
||||
fixedFont = 45056
|
||||
fxdFntH = 45057
|
||||
fxdFntW = 45058
|
||||
fxdFntHW = 45059
|
||||
fontWid = 44208
|
||||
kFMUseGlobalScopeOption = 0x00000001
|
||||
kFontIDNewYork = 2
|
||||
kFontIDGeneva = 3
|
||||
kFontIDMonaco = 4
|
||||
kFontIDVenice = 5
|
||||
kFontIDLondon = 6
|
||||
kFontIDAthens = 7
|
||||
kFontIDSanFrancisco = 8
|
||||
kFontIDToronto = 9
|
||||
kFontIDCairo = 11
|
||||
kFontIDLosAngeles = 12
|
||||
kFontIDTimes = 20
|
||||
kFontIDHelvetica = 21
|
||||
kFontIDCourier = 22
|
||||
kFontIDSymbol = 23
|
||||
kFontIDMobile = 24
|
||||
newYork = kFontIDNewYork
|
||||
geneva = kFontIDGeneva
|
||||
monaco = kFontIDMonaco
|
||||
venice = kFontIDVenice
|
||||
london = kFontIDLondon
|
||||
athens = kFontIDAthens
|
||||
sanFran = kFontIDSanFrancisco
|
||||
toronto = kFontIDToronto
|
||||
cairo = kFontIDCairo
|
||||
losAngeles = kFontIDLosAngeles
|
||||
times = kFontIDTimes
|
||||
helvetica = kFontIDHelvetica
|
||||
courier = kFontIDCourier
|
||||
symbol = kFontIDSymbol
|
||||
mobile = kFontIDMobile
|
|
@ -1 +0,0 @@
|
|||
from _Help import *
|
|
@ -1 +0,0 @@
|
|||
from _IBCarbon import *
|
|
@ -1,5 +0,0 @@
|
|||
# Generated from 'IBCarbonRuntime.h'
|
||||
|
||||
kIBCarbonRuntimeCantFindNibFile = -10960
|
||||
kIBCarbonRuntimeObjectNotOfRequestedType = -10961
|
||||
kIBCarbonRuntimeCantFindObject = -10962
|
|
@ -1 +0,0 @@
|
|||
from _Icn import *
|
|
@ -1,381 +0,0 @@
|
|||
# Generated from 'Icons.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
from Carbon.Files import *
|
||||
kGenericDocumentIconResource = -4000
|
||||
kGenericStationeryIconResource = -3985
|
||||
kGenericEditionFileIconResource = -3989
|
||||
kGenericApplicationIconResource = -3996
|
||||
kGenericDeskAccessoryIconResource = -3991
|
||||
kGenericFolderIconResource = -3999
|
||||
kPrivateFolderIconResource = -3994
|
||||
kFloppyIconResource = -3998
|
||||
kTrashIconResource = -3993
|
||||
kGenericRAMDiskIconResource = -3988
|
||||
kGenericCDROMIconResource = -3987
|
||||
kDesktopIconResource = -3992
|
||||
kOpenFolderIconResource = -3997
|
||||
kGenericHardDiskIconResource = -3995
|
||||
kGenericFileServerIconResource = -3972
|
||||
kGenericSuitcaseIconResource = -3970
|
||||
kGenericMoverObjectIconResource = -3969
|
||||
kGenericPreferencesIconResource = -3971
|
||||
kGenericQueryDocumentIconResource = -16506
|
||||
kGenericExtensionIconResource = -16415
|
||||
kSystemFolderIconResource = -3983
|
||||
kHelpIconResource = -20271
|
||||
kAppleMenuFolderIconResource = -3982
|
||||
genericDocumentIconResource = kGenericDocumentIconResource
|
||||
genericStationeryIconResource = kGenericStationeryIconResource
|
||||
genericEditionFileIconResource = kGenericEditionFileIconResource
|
||||
genericApplicationIconResource = kGenericApplicationIconResource
|
||||
genericDeskAccessoryIconResource = kGenericDeskAccessoryIconResource
|
||||
genericFolderIconResource = kGenericFolderIconResource
|
||||
privateFolderIconResource = kPrivateFolderIconResource
|
||||
floppyIconResource = kFloppyIconResource
|
||||
trashIconResource = kTrashIconResource
|
||||
genericRAMDiskIconResource = kGenericRAMDiskIconResource
|
||||
genericCDROMIconResource = kGenericCDROMIconResource
|
||||
desktopIconResource = kDesktopIconResource
|
||||
openFolderIconResource = kOpenFolderIconResource
|
||||
genericHardDiskIconResource = kGenericHardDiskIconResource
|
||||
genericFileServerIconResource = kGenericFileServerIconResource
|
||||
genericSuitcaseIconResource = kGenericSuitcaseIconResource
|
||||
genericMoverObjectIconResource = kGenericMoverObjectIconResource
|
||||
genericPreferencesIconResource = kGenericPreferencesIconResource
|
||||
genericQueryDocumentIconResource = kGenericQueryDocumentIconResource
|
||||
genericExtensionIconResource = kGenericExtensionIconResource
|
||||
systemFolderIconResource = kSystemFolderIconResource
|
||||
appleMenuFolderIconResource = kAppleMenuFolderIconResource
|
||||
kStartupFolderIconResource = -3981
|
||||
kOwnedFolderIconResource = -3980
|
||||
kDropFolderIconResource = -3979
|
||||
kSharedFolderIconResource = -3978
|
||||
kMountedFolderIconResource = -3977
|
||||
kControlPanelFolderIconResource = -3976
|
||||
kPrintMonitorFolderIconResource = -3975
|
||||
kPreferencesFolderIconResource = -3974
|
||||
kExtensionsFolderIconResource = -3973
|
||||
kFontsFolderIconResource = -3968
|
||||
kFullTrashIconResource = -3984
|
||||
startupFolderIconResource = kStartupFolderIconResource
|
||||
ownedFolderIconResource = kOwnedFolderIconResource
|
||||
dropFolderIconResource = kDropFolderIconResource
|
||||
sharedFolderIconResource = kSharedFolderIconResource
|
||||
mountedFolderIconResource = kMountedFolderIconResource
|
||||
controlPanelFolderIconResource = kControlPanelFolderIconResource
|
||||
printMonitorFolderIconResource = kPrintMonitorFolderIconResource
|
||||
preferencesFolderIconResource = kPreferencesFolderIconResource
|
||||
extensionsFolderIconResource = kExtensionsFolderIconResource
|
||||
fontsFolderIconResource = kFontsFolderIconResource
|
||||
fullTrashIconResource = kFullTrashIconResource
|
||||
kThumbnail32BitData = FOUR_CHAR_CODE('it32')
|
||||
kThumbnail8BitMask = FOUR_CHAR_CODE('t8mk')
|
||||
kHuge1BitMask = FOUR_CHAR_CODE('ich#')
|
||||
kHuge4BitData = FOUR_CHAR_CODE('ich4')
|
||||
kHuge8BitData = FOUR_CHAR_CODE('ich8')
|
||||
kHuge32BitData = FOUR_CHAR_CODE('ih32')
|
||||
kHuge8BitMask = FOUR_CHAR_CODE('h8mk')
|
||||
kLarge1BitMask = FOUR_CHAR_CODE('ICN#')
|
||||
kLarge4BitData = FOUR_CHAR_CODE('icl4')
|
||||
kLarge8BitData = FOUR_CHAR_CODE('icl8')
|
||||
kLarge32BitData = FOUR_CHAR_CODE('il32')
|
||||
kLarge8BitMask = FOUR_CHAR_CODE('l8mk')
|
||||
kSmall1BitMask = FOUR_CHAR_CODE('ics#')
|
||||
kSmall4BitData = FOUR_CHAR_CODE('ics4')
|
||||
kSmall8BitData = FOUR_CHAR_CODE('ics8')
|
||||
kSmall32BitData = FOUR_CHAR_CODE('is32')
|
||||
kSmall8BitMask = FOUR_CHAR_CODE('s8mk')
|
||||
kMini1BitMask = FOUR_CHAR_CODE('icm#')
|
||||
kMini4BitData = FOUR_CHAR_CODE('icm4')
|
||||
kMini8BitData = FOUR_CHAR_CODE('icm8')
|
||||
kTileIconVariant = FOUR_CHAR_CODE('tile')
|
||||
kRolloverIconVariant = FOUR_CHAR_CODE('over')
|
||||
kDropIconVariant = FOUR_CHAR_CODE('drop')
|
||||
kOpenIconVariant = FOUR_CHAR_CODE('open')
|
||||
kOpenDropIconVariant = FOUR_CHAR_CODE('odrp')
|
||||
large1BitMask = kLarge1BitMask
|
||||
large4BitData = kLarge4BitData
|
||||
large8BitData = kLarge8BitData
|
||||
small1BitMask = kSmall1BitMask
|
||||
small4BitData = kSmall4BitData
|
||||
small8BitData = kSmall8BitData
|
||||
mini1BitMask = kMini1BitMask
|
||||
mini4BitData = kMini4BitData
|
||||
mini8BitData = kMini8BitData
|
||||
kAlignNone = 0x00
|
||||
kAlignVerticalCenter = 0x01
|
||||
kAlignTop = 0x02
|
||||
kAlignBottom = 0x03
|
||||
kAlignHorizontalCenter = 0x04
|
||||
kAlignAbsoluteCenter = kAlignVerticalCenter | kAlignHorizontalCenter
|
||||
kAlignCenterTop = kAlignTop | kAlignHorizontalCenter
|
||||
kAlignCenterBottom = kAlignBottom | kAlignHorizontalCenter
|
||||
kAlignLeft = 0x08
|
||||
kAlignCenterLeft = kAlignVerticalCenter | kAlignLeft
|
||||
kAlignTopLeft = kAlignTop | kAlignLeft
|
||||
kAlignBottomLeft = kAlignBottom | kAlignLeft
|
||||
kAlignRight = 0x0C
|
||||
kAlignCenterRight = kAlignVerticalCenter | kAlignRight
|
||||
kAlignTopRight = kAlignTop | kAlignRight
|
||||
kAlignBottomRight = kAlignBottom | kAlignRight
|
||||
atNone = kAlignNone
|
||||
atVerticalCenter = kAlignVerticalCenter
|
||||
atTop = kAlignTop
|
||||
atBottom = kAlignBottom
|
||||
atHorizontalCenter = kAlignHorizontalCenter
|
||||
atAbsoluteCenter = kAlignAbsoluteCenter
|
||||
atCenterTop = kAlignCenterTop
|
||||
atCenterBottom = kAlignCenterBottom
|
||||
atLeft = kAlignLeft
|
||||
atCenterLeft = kAlignCenterLeft
|
||||
atTopLeft = kAlignTopLeft
|
||||
atBottomLeft = kAlignBottomLeft
|
||||
atRight = kAlignRight
|
||||
atCenterRight = kAlignCenterRight
|
||||
atTopRight = kAlignTopRight
|
||||
atBottomRight = kAlignBottomRight
|
||||
kTransformNone = 0x00
|
||||
kTransformDisabled = 0x01
|
||||
kTransformOffline = 0x02
|
||||
kTransformOpen = 0x03
|
||||
kTransformLabel1 = 0x0100
|
||||
kTransformLabel2 = 0x0200
|
||||
kTransformLabel3 = 0x0300
|
||||
kTransformLabel4 = 0x0400
|
||||
kTransformLabel5 = 0x0500
|
||||
kTransformLabel6 = 0x0600
|
||||
kTransformLabel7 = 0x0700
|
||||
kTransformSelected = 0x4000
|
||||
kTransformSelectedDisabled = kTransformSelected | kTransformDisabled
|
||||
kTransformSelectedOffline = kTransformSelected | kTransformOffline
|
||||
kTransformSelectedOpen = kTransformSelected | kTransformOpen
|
||||
ttNone = kTransformNone
|
||||
ttDisabled = kTransformDisabled
|
||||
ttOffline = kTransformOffline
|
||||
ttOpen = kTransformOpen
|
||||
ttLabel1 = kTransformLabel1
|
||||
ttLabel2 = kTransformLabel2
|
||||
ttLabel3 = kTransformLabel3
|
||||
ttLabel4 = kTransformLabel4
|
||||
ttLabel5 = kTransformLabel5
|
||||
ttLabel6 = kTransformLabel6
|
||||
ttLabel7 = kTransformLabel7
|
||||
ttSelected = kTransformSelected
|
||||
ttSelectedDisabled = kTransformSelectedDisabled
|
||||
ttSelectedOffline = kTransformSelectedOffline
|
||||
ttSelectedOpen = kTransformSelectedOpen
|
||||
kSelectorLarge1Bit = 0x00000001
|
||||
kSelectorLarge4Bit = 0x00000002
|
||||
kSelectorLarge8Bit = 0x00000004
|
||||
kSelectorLarge32Bit = 0x00000008
|
||||
kSelectorLarge8BitMask = 0x00000010
|
||||
kSelectorSmall1Bit = 0x00000100
|
||||
kSelectorSmall4Bit = 0x00000200
|
||||
kSelectorSmall8Bit = 0x00000400
|
||||
kSelectorSmall32Bit = 0x00000800
|
||||
kSelectorSmall8BitMask = 0x00001000
|
||||
kSelectorMini1Bit = 0x00010000
|
||||
kSelectorMini4Bit = 0x00020000
|
||||
kSelectorMini8Bit = 0x00040000
|
||||
kSelectorHuge1Bit = 0x01000000
|
||||
kSelectorHuge4Bit = 0x02000000
|
||||
kSelectorHuge8Bit = 0x04000000
|
||||
kSelectorHuge32Bit = 0x08000000
|
||||
kSelectorHuge8BitMask = 0x10000000
|
||||
kSelectorAllLargeData = 0x000000FF
|
||||
kSelectorAllSmallData = 0x0000FF00
|
||||
kSelectorAllMiniData = 0x00FF0000
|
||||
# kSelectorAllHugeData = (long)0xFF000000
|
||||
kSelectorAll1BitData = kSelectorLarge1Bit | kSelectorSmall1Bit | kSelectorMini1Bit | kSelectorHuge1Bit
|
||||
kSelectorAll4BitData = kSelectorLarge4Bit | kSelectorSmall4Bit | kSelectorMini4Bit | kSelectorHuge4Bit
|
||||
kSelectorAll8BitData = kSelectorLarge8Bit | kSelectorSmall8Bit | kSelectorMini8Bit | kSelectorHuge8Bit
|
||||
kSelectorAll32BitData = kSelectorLarge32Bit | kSelectorSmall32Bit | kSelectorHuge32Bit
|
||||
# kSelectorAllAvailableData = (long)0xFFFFFFFF
|
||||
svLarge1Bit = kSelectorLarge1Bit
|
||||
svLarge4Bit = kSelectorLarge4Bit
|
||||
svLarge8Bit = kSelectorLarge8Bit
|
||||
svSmall1Bit = kSelectorSmall1Bit
|
||||
svSmall4Bit = kSelectorSmall4Bit
|
||||
svSmall8Bit = kSelectorSmall8Bit
|
||||
svMini1Bit = kSelectorMini1Bit
|
||||
svMini4Bit = kSelectorMini4Bit
|
||||
svMini8Bit = kSelectorMini8Bit
|
||||
svAllLargeData = kSelectorAllLargeData
|
||||
svAllSmallData = kSelectorAllSmallData
|
||||
svAllMiniData = kSelectorAllMiniData
|
||||
svAll1BitData = kSelectorAll1BitData
|
||||
svAll4BitData = kSelectorAll4BitData
|
||||
svAll8BitData = kSelectorAll8BitData
|
||||
# svAllAvailableData = kSelectorAllAvailableData
|
||||
kSystemIconsCreator = FOUR_CHAR_CODE('macs')
|
||||
# err = GetIconRef(kOnSystemDisk
|
||||
kClipboardIcon = FOUR_CHAR_CODE('CLIP')
|
||||
kClippingUnknownTypeIcon = FOUR_CHAR_CODE('clpu')
|
||||
kClippingPictureTypeIcon = FOUR_CHAR_CODE('clpp')
|
||||
kClippingTextTypeIcon = FOUR_CHAR_CODE('clpt')
|
||||
kClippingSoundTypeIcon = FOUR_CHAR_CODE('clps')
|
||||
kDesktopIcon = FOUR_CHAR_CODE('desk')
|
||||
kFinderIcon = FOUR_CHAR_CODE('FNDR')
|
||||
kFontSuitcaseIcon = FOUR_CHAR_CODE('FFIL')
|
||||
kFullTrashIcon = FOUR_CHAR_CODE('ftrh')
|
||||
kGenericApplicationIcon = FOUR_CHAR_CODE('APPL')
|
||||
kGenericCDROMIcon = FOUR_CHAR_CODE('cddr')
|
||||
kGenericControlPanelIcon = FOUR_CHAR_CODE('APPC')
|
||||
kGenericControlStripModuleIcon = FOUR_CHAR_CODE('sdev')
|
||||
kGenericComponentIcon = FOUR_CHAR_CODE('thng')
|
||||
kGenericDeskAccessoryIcon = FOUR_CHAR_CODE('APPD')
|
||||
kGenericDocumentIcon = FOUR_CHAR_CODE('docu')
|
||||
kGenericEditionFileIcon = FOUR_CHAR_CODE('edtf')
|
||||
kGenericExtensionIcon = FOUR_CHAR_CODE('INIT')
|
||||
kGenericFileServerIcon = FOUR_CHAR_CODE('srvr')
|
||||
kGenericFontIcon = FOUR_CHAR_CODE('ffil')
|
||||
kGenericFontScalerIcon = FOUR_CHAR_CODE('sclr')
|
||||
kGenericFloppyIcon = FOUR_CHAR_CODE('flpy')
|
||||
kGenericHardDiskIcon = FOUR_CHAR_CODE('hdsk')
|
||||
kGenericIDiskIcon = FOUR_CHAR_CODE('idsk')
|
||||
kGenericRemovableMediaIcon = FOUR_CHAR_CODE('rmov')
|
||||
kGenericMoverObjectIcon = FOUR_CHAR_CODE('movr')
|
||||
kGenericPCCardIcon = FOUR_CHAR_CODE('pcmc')
|
||||
kGenericPreferencesIcon = FOUR_CHAR_CODE('pref')
|
||||
kGenericQueryDocumentIcon = FOUR_CHAR_CODE('qery')
|
||||
kGenericRAMDiskIcon = FOUR_CHAR_CODE('ramd')
|
||||
kGenericSharedLibaryIcon = FOUR_CHAR_CODE('shlb')
|
||||
kGenericStationeryIcon = FOUR_CHAR_CODE('sdoc')
|
||||
kGenericSuitcaseIcon = FOUR_CHAR_CODE('suit')
|
||||
kGenericURLIcon = FOUR_CHAR_CODE('gurl')
|
||||
kGenericWORMIcon = FOUR_CHAR_CODE('worm')
|
||||
kInternationalResourcesIcon = FOUR_CHAR_CODE('ifil')
|
||||
kKeyboardLayoutIcon = FOUR_CHAR_CODE('kfil')
|
||||
kSoundFileIcon = FOUR_CHAR_CODE('sfil')
|
||||
kSystemSuitcaseIcon = FOUR_CHAR_CODE('zsys')
|
||||
kTrashIcon = FOUR_CHAR_CODE('trsh')
|
||||
kTrueTypeFontIcon = FOUR_CHAR_CODE('tfil')
|
||||
kTrueTypeFlatFontIcon = FOUR_CHAR_CODE('sfnt')
|
||||
kTrueTypeMultiFlatFontIcon = FOUR_CHAR_CODE('ttcf')
|
||||
kUserIDiskIcon = FOUR_CHAR_CODE('udsk')
|
||||
kInternationResourcesIcon = kInternationalResourcesIcon
|
||||
kInternetLocationHTTPIcon = FOUR_CHAR_CODE('ilht')
|
||||
kInternetLocationFTPIcon = FOUR_CHAR_CODE('ilft')
|
||||
kInternetLocationAppleShareIcon = FOUR_CHAR_CODE('ilaf')
|
||||
kInternetLocationAppleTalkZoneIcon = FOUR_CHAR_CODE('ilat')
|
||||
kInternetLocationFileIcon = FOUR_CHAR_CODE('ilfi')
|
||||
kInternetLocationMailIcon = FOUR_CHAR_CODE('ilma')
|
||||
kInternetLocationNewsIcon = FOUR_CHAR_CODE('ilnw')
|
||||
kInternetLocationNSLNeighborhoodIcon = FOUR_CHAR_CODE('ilns')
|
||||
kInternetLocationGenericIcon = FOUR_CHAR_CODE('ilge')
|
||||
kGenericFolderIcon = FOUR_CHAR_CODE('fldr')
|
||||
kDropFolderIcon = FOUR_CHAR_CODE('dbox')
|
||||
kMountedFolderIcon = FOUR_CHAR_CODE('mntd')
|
||||
kOpenFolderIcon = FOUR_CHAR_CODE('ofld')
|
||||
kOwnedFolderIcon = FOUR_CHAR_CODE('ownd')
|
||||
kPrivateFolderIcon = FOUR_CHAR_CODE('prvf')
|
||||
kSharedFolderIcon = FOUR_CHAR_CODE('shfl')
|
||||
kSharingPrivsNotApplicableIcon = FOUR_CHAR_CODE('shna')
|
||||
kSharingPrivsReadOnlyIcon = FOUR_CHAR_CODE('shro')
|
||||
kSharingPrivsReadWriteIcon = FOUR_CHAR_CODE('shrw')
|
||||
kSharingPrivsUnknownIcon = FOUR_CHAR_CODE('shuk')
|
||||
kSharingPrivsWritableIcon = FOUR_CHAR_CODE('writ')
|
||||
kUserFolderIcon = FOUR_CHAR_CODE('ufld')
|
||||
kWorkgroupFolderIcon = FOUR_CHAR_CODE('wfld')
|
||||
kGuestUserIcon = FOUR_CHAR_CODE('gusr')
|
||||
kUserIcon = FOUR_CHAR_CODE('user')
|
||||
kOwnerIcon = FOUR_CHAR_CODE('susr')
|
||||
kGroupIcon = FOUR_CHAR_CODE('grup')
|
||||
kAppearanceFolderIcon = FOUR_CHAR_CODE('appr')
|
||||
kAppleExtrasFolderIcon = FOUR_CHAR_CODE('aex\xc4')
|
||||
kAppleMenuFolderIcon = FOUR_CHAR_CODE('amnu')
|
||||
kApplicationsFolderIcon = FOUR_CHAR_CODE('apps')
|
||||
kApplicationSupportFolderIcon = FOUR_CHAR_CODE('asup')
|
||||
kAssistantsFolderIcon = FOUR_CHAR_CODE('ast\xc4')
|
||||
kColorSyncFolderIcon = FOUR_CHAR_CODE('prof')
|
||||
kContextualMenuItemsFolderIcon = FOUR_CHAR_CODE('cmnu')
|
||||
kControlPanelDisabledFolderIcon = FOUR_CHAR_CODE('ctrD')
|
||||
kControlPanelFolderIcon = FOUR_CHAR_CODE('ctrl')
|
||||
kControlStripModulesFolderIcon = FOUR_CHAR_CODE('sdv\xc4')
|
||||
kDocumentsFolderIcon = FOUR_CHAR_CODE('docs')
|
||||
kExtensionsDisabledFolderIcon = FOUR_CHAR_CODE('extD')
|
||||
kExtensionsFolderIcon = FOUR_CHAR_CODE('extn')
|
||||
kFavoritesFolderIcon = FOUR_CHAR_CODE('favs')
|
||||
kFontsFolderIcon = FOUR_CHAR_CODE('font')
|
||||
kHelpFolderIcon = FOUR_CHAR_CODE('\xc4hlp')
|
||||
kInternetFolderIcon = FOUR_CHAR_CODE('int\xc4')
|
||||
kInternetPlugInFolderIcon = FOUR_CHAR_CODE('\xc4net')
|
||||
kInternetSearchSitesFolderIcon = FOUR_CHAR_CODE('issf')
|
||||
kLocalesFolderIcon = FOUR_CHAR_CODE('\xc4loc')
|
||||
kMacOSReadMeFolderIcon = FOUR_CHAR_CODE('mor\xc4')
|
||||
kPublicFolderIcon = FOUR_CHAR_CODE('pubf')
|
||||
kPreferencesFolderIcon = FOUR_CHAR_CODE('prf\xc4')
|
||||
kPrinterDescriptionFolderIcon = FOUR_CHAR_CODE('ppdf')
|
||||
kPrinterDriverFolderIcon = FOUR_CHAR_CODE('\xc4prd')
|
||||
kPrintMonitorFolderIcon = FOUR_CHAR_CODE('prnt')
|
||||
kRecentApplicationsFolderIcon = FOUR_CHAR_CODE('rapp')
|
||||
kRecentDocumentsFolderIcon = FOUR_CHAR_CODE('rdoc')
|
||||
kRecentServersFolderIcon = FOUR_CHAR_CODE('rsrv')
|
||||
kScriptingAdditionsFolderIcon = FOUR_CHAR_CODE('\xc4scr')
|
||||
kSharedLibrariesFolderIcon = FOUR_CHAR_CODE('\xc4lib')
|
||||
kScriptsFolderIcon = FOUR_CHAR_CODE('scr\xc4')
|
||||
kShutdownItemsDisabledFolderIcon = FOUR_CHAR_CODE('shdD')
|
||||
kShutdownItemsFolderIcon = FOUR_CHAR_CODE('shdf')
|
||||
kSpeakableItemsFolder = FOUR_CHAR_CODE('spki')
|
||||
kStartupItemsDisabledFolderIcon = FOUR_CHAR_CODE('strD')
|
||||
kStartupItemsFolderIcon = FOUR_CHAR_CODE('strt')
|
||||
kSystemExtensionDisabledFolderIcon = FOUR_CHAR_CODE('macD')
|
||||
kSystemFolderIcon = FOUR_CHAR_CODE('macs')
|
||||
kTextEncodingsFolderIcon = FOUR_CHAR_CODE('\xc4tex')
|
||||
kUsersFolderIcon = FOUR_CHAR_CODE('usr\xc4')
|
||||
kUtilitiesFolderIcon = FOUR_CHAR_CODE('uti\xc4')
|
||||
kVoicesFolderIcon = FOUR_CHAR_CODE('fvoc')
|
||||
kSystemFolderXIcon = FOUR_CHAR_CODE('macx')
|
||||
kAppleScriptBadgeIcon = FOUR_CHAR_CODE('scrp')
|
||||
kLockedBadgeIcon = FOUR_CHAR_CODE('lbdg')
|
||||
kMountedBadgeIcon = FOUR_CHAR_CODE('mbdg')
|
||||
kSharedBadgeIcon = FOUR_CHAR_CODE('sbdg')
|
||||
kAliasBadgeIcon = FOUR_CHAR_CODE('abdg')
|
||||
kAlertCautionBadgeIcon = FOUR_CHAR_CODE('cbdg')
|
||||
kAlertNoteIcon = FOUR_CHAR_CODE('note')
|
||||
kAlertCautionIcon = FOUR_CHAR_CODE('caut')
|
||||
kAlertStopIcon = FOUR_CHAR_CODE('stop')
|
||||
kAppleTalkIcon = FOUR_CHAR_CODE('atlk')
|
||||
kAppleTalkZoneIcon = FOUR_CHAR_CODE('atzn')
|
||||
kAFPServerIcon = FOUR_CHAR_CODE('afps')
|
||||
kFTPServerIcon = FOUR_CHAR_CODE('ftps')
|
||||
kHTTPServerIcon = FOUR_CHAR_CODE('htps')
|
||||
kGenericNetworkIcon = FOUR_CHAR_CODE('gnet')
|
||||
kIPFileServerIcon = FOUR_CHAR_CODE('isrv')
|
||||
kToolbarCustomizeIcon = FOUR_CHAR_CODE('tcus')
|
||||
kToolbarDeleteIcon = FOUR_CHAR_CODE('tdel')
|
||||
kToolbarFavoritesIcon = FOUR_CHAR_CODE('tfav')
|
||||
kToolbarHomeIcon = FOUR_CHAR_CODE('thom')
|
||||
kAppleLogoIcon = FOUR_CHAR_CODE('capl')
|
||||
kAppleMenuIcon = FOUR_CHAR_CODE('sapl')
|
||||
kBackwardArrowIcon = FOUR_CHAR_CODE('baro')
|
||||
kFavoriteItemsIcon = FOUR_CHAR_CODE('favr')
|
||||
kForwardArrowIcon = FOUR_CHAR_CODE('faro')
|
||||
kGridIcon = FOUR_CHAR_CODE('grid')
|
||||
kHelpIcon = FOUR_CHAR_CODE('help')
|
||||
kKeepArrangedIcon = FOUR_CHAR_CODE('arng')
|
||||
kLockedIcon = FOUR_CHAR_CODE('lock')
|
||||
kNoFilesIcon = FOUR_CHAR_CODE('nfil')
|
||||
kNoFolderIcon = FOUR_CHAR_CODE('nfld')
|
||||
kNoWriteIcon = FOUR_CHAR_CODE('nwrt')
|
||||
kProtectedApplicationFolderIcon = FOUR_CHAR_CODE('papp')
|
||||
kProtectedSystemFolderIcon = FOUR_CHAR_CODE('psys')
|
||||
kRecentItemsIcon = FOUR_CHAR_CODE('rcnt')
|
||||
kShortcutIcon = FOUR_CHAR_CODE('shrt')
|
||||
kSortAscendingIcon = FOUR_CHAR_CODE('asnd')
|
||||
kSortDescendingIcon = FOUR_CHAR_CODE('dsnd')
|
||||
kUnlockedIcon = FOUR_CHAR_CODE('ulck')
|
||||
kConnectToIcon = FOUR_CHAR_CODE('cnct')
|
||||
kGenericWindowIcon = FOUR_CHAR_CODE('gwin')
|
||||
kQuestionMarkIcon = FOUR_CHAR_CODE('ques')
|
||||
kDeleteAliasIcon = FOUR_CHAR_CODE('dali')
|
||||
kEjectMediaIcon = FOUR_CHAR_CODE('ejec')
|
||||
kBurningIcon = FOUR_CHAR_CODE('burn')
|
||||
kRightContainerArrowIcon = FOUR_CHAR_CODE('rcar')
|
||||
kIconServicesNormalUsageFlag = 0
|
||||
kIconServicesCatalogInfoMask = (kFSCatInfoNodeID | kFSCatInfoParentDirID | kFSCatInfoVolume | kFSCatInfoNodeFlags | kFSCatInfoFinderInfo | kFSCatInfoFinderXInfo | kFSCatInfoUserAccess)
|
||||
kPlotIconRefNormalFlags = 0
|
||||
kPlotIconRefNoImage = (1 << 1)
|
||||
kPlotIconRefNoMask = (1 << 2)
|
||||
kIconFamilyType = FOUR_CHAR_CODE('icns')
|
|
@ -1 +0,0 @@
|
|||
from _Launch import *
|
|
@ -1,74 +0,0 @@
|
|||
# Generated from 'LaunchServices.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
from Carbon.Files import *
|
||||
kLSRequestAllInfo = -1
|
||||
kLSRolesAll = -1
|
||||
kLSUnknownType = FOUR_CHAR_CODE('\0\0\0\0')
|
||||
kLSUnknownCreator = FOUR_CHAR_CODE('\0\0\0\0')
|
||||
kLSInvalidExtensionIndex = -1
|
||||
kLSUnknownErr = -10810
|
||||
kLSNotAnApplicationErr = -10811
|
||||
kLSNotInitializedErr = -10812
|
||||
kLSDataUnavailableErr = -10813
|
||||
kLSApplicationNotFoundErr = -10814
|
||||
kLSUnknownTypeErr = -10815
|
||||
kLSDataTooOldErr = -10816
|
||||
kLSDataErr = -10817
|
||||
kLSLaunchInProgressErr = -10818
|
||||
kLSNotRegisteredErr = -10819
|
||||
kLSAppDoesNotClaimTypeErr = -10820
|
||||
kLSAppDoesNotSupportSchemeWarning = -10821
|
||||
kLSServerCommunicationErr = -10822
|
||||
kLSCannotSetInfoErr = -10823
|
||||
kLSInitializeDefaults = 0x00000001
|
||||
kLSMinCatInfoBitmap = (kFSCatInfoNodeFlags | kFSCatInfoParentDirID | kFSCatInfoFinderInfo | kFSCatInfoFinderXInfo)
|
||||
# kLSInvalidExtensionIndex = (unsigned long)0xFFFFFFFF
|
||||
kLSRequestExtension = 0x00000001
|
||||
kLSRequestTypeCreator = 0x00000002
|
||||
kLSRequestBasicFlagsOnly = 0x00000004
|
||||
kLSRequestAppTypeFlags = 0x00000008
|
||||
kLSRequestAllFlags = 0x00000010
|
||||
kLSRequestIconAndKind = 0x00000020
|
||||
kLSRequestExtensionFlagsOnly = 0x00000040
|
||||
# kLSRequestAllInfo = (unsigned long)0xFFFFFFFF
|
||||
kLSItemInfoIsPlainFile = 0x00000001
|
||||
kLSItemInfoIsPackage = 0x00000002
|
||||
kLSItemInfoIsApplication = 0x00000004
|
||||
kLSItemInfoIsContainer = 0x00000008
|
||||
kLSItemInfoIsAliasFile = 0x00000010
|
||||
kLSItemInfoIsSymlink = 0x00000020
|
||||
kLSItemInfoIsInvisible = 0x00000040
|
||||
kLSItemInfoIsNativeApp = 0x00000080
|
||||
kLSItemInfoIsClassicApp = 0x00000100
|
||||
kLSItemInfoAppPrefersNative = 0x00000200
|
||||
kLSItemInfoAppPrefersClassic = 0x00000400
|
||||
kLSItemInfoAppIsScriptable = 0x00000800
|
||||
kLSItemInfoIsVolume = 0x00001000
|
||||
kLSItemInfoExtensionIsHidden = 0x00100000
|
||||
kLSRolesNone = 0x00000001
|
||||
kLSRolesViewer = 0x00000002
|
||||
kLSRolesEditor = 0x00000004
|
||||
# kLSRolesAll = (unsigned long)0xFFFFFFFF
|
||||
kLSUnknownKindID = 0
|
||||
# kLSUnknownType = 0
|
||||
# kLSUnknownCreator = 0
|
||||
kLSAcceptDefault = 0x00000001
|
||||
kLSAcceptAllowLoginUI = 0x00000002
|
||||
kLSLaunchDefaults = 0x00000001
|
||||
kLSLaunchAndPrint = 0x00000002
|
||||
kLSLaunchReserved2 = 0x00000004
|
||||
kLSLaunchReserved3 = 0x00000008
|
||||
kLSLaunchReserved4 = 0x00000010
|
||||
kLSLaunchReserved5 = 0x00000020
|
||||
kLSLaunchReserved6 = 0x00000040
|
||||
kLSLaunchInhibitBGOnly = 0x00000080
|
||||
kLSLaunchDontAddToRecents = 0x00000100
|
||||
kLSLaunchDontSwitch = 0x00000200
|
||||
kLSLaunchNoParams = 0x00000800
|
||||
kLSLaunchAsync = 0x00010000
|
||||
kLSLaunchStartClassic = 0x00020000
|
||||
kLSLaunchInClassic = 0x00040000
|
||||
kLSLaunchNewInstance = 0x00080000
|
||||
kLSLaunchAndHide = 0x00100000
|
||||
kLSLaunchAndHideOthers = 0x00200000
|
|
@ -1 +0,0 @@
|
|||
from _List import *
|
|
@ -1,35 +0,0 @@
|
|||
# Generated from 'Lists.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
listNotifyNothing = FOUR_CHAR_CODE('nada')
|
||||
listNotifyClick = FOUR_CHAR_CODE('clik')
|
||||
listNotifyDoubleClick = FOUR_CHAR_CODE('dblc')
|
||||
listNotifyPreClick = FOUR_CHAR_CODE('pclk')
|
||||
lDrawingModeOffBit = 3
|
||||
lDoVAutoscrollBit = 1
|
||||
lDoHAutoscrollBit = 0
|
||||
lDrawingModeOff = 8
|
||||
lDoVAutoscroll = 2
|
||||
lDoHAutoscroll = 1
|
||||
lOnlyOneBit = 7
|
||||
lExtendDragBit = 6
|
||||
lNoDisjointBit = 5
|
||||
lNoExtendBit = 4
|
||||
lNoRectBit = 3
|
||||
lUseSenseBit = 2
|
||||
lNoNilHiliteBit = 1
|
||||
lOnlyOne = -128
|
||||
lExtendDrag = 64
|
||||
lNoDisjoint = 32
|
||||
lNoExtend = 16
|
||||
lNoRect = 8
|
||||
lUseSense = 4
|
||||
lNoNilHilite = 2
|
||||
lInitMsg = 0
|
||||
lDrawMsg = 1
|
||||
lHiliteMsg = 2
|
||||
lCloseMsg = 3
|
||||
kListDefProcPtr = 0
|
||||
kListDefUserProcType = kListDefProcPtr
|
||||
kListDefStandardTextType = 1
|
||||
kListDefStandardIconType = 2
|
|
@ -1,58 +0,0 @@
|
|||
# Generated from 'MacHelp.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
kMacHelpVersion = 0x0003
|
||||
kHMSupplyContent = 0
|
||||
kHMDisposeContent = 1
|
||||
kHMNoContent = FOUR_CHAR_CODE('none')
|
||||
kHMCFStringContent = FOUR_CHAR_CODE('cfst')
|
||||
kHMPascalStrContent = FOUR_CHAR_CODE('pstr')
|
||||
kHMStringResContent = FOUR_CHAR_CODE('str#')
|
||||
kHMTEHandleContent = FOUR_CHAR_CODE('txth')
|
||||
kHMTextResContent = FOUR_CHAR_CODE('text')
|
||||
kHMStrResContent = FOUR_CHAR_CODE('str ')
|
||||
kHMDefaultSide = 0
|
||||
kHMOutsideTopScriptAligned = 1
|
||||
kHMOutsideLeftCenterAligned = 2
|
||||
kHMOutsideBottomScriptAligned = 3
|
||||
kHMOutsideRightCenterAligned = 4
|
||||
kHMOutsideTopLeftAligned = 5
|
||||
kHMOutsideTopRightAligned = 6
|
||||
kHMOutsideLeftTopAligned = 7
|
||||
kHMOutsideLeftBottomAligned = 8
|
||||
kHMOutsideBottomLeftAligned = 9
|
||||
kHMOutsideBottomRightAligned = 10
|
||||
kHMOutsideRightTopAligned = 11
|
||||
kHMOutsideRightBottomAligned = 12
|
||||
kHMOutsideTopCenterAligned = 13
|
||||
kHMOutsideBottomCenterAligned = 14
|
||||
kHMInsideRightCenterAligned = 15
|
||||
kHMInsideLeftCenterAligned = 16
|
||||
kHMInsideBottomCenterAligned = 17
|
||||
kHMInsideTopCenterAligned = 18
|
||||
kHMInsideTopLeftCorner = 19
|
||||
kHMInsideTopRightCorner = 20
|
||||
kHMInsideBottomLeftCorner = 21
|
||||
kHMInsideBottomRightCorner = 22
|
||||
kHMAbsoluteCenterAligned = 23
|
||||
kHMTopSide = kHMOutsideTopScriptAligned
|
||||
kHMLeftSide = kHMOutsideLeftCenterAligned
|
||||
kHMBottomSide = kHMOutsideBottomScriptAligned
|
||||
kHMRightSide = kHMOutsideRightCenterAligned
|
||||
kHMTopLeftCorner = kHMOutsideTopLeftAligned
|
||||
kHMTopRightCorner = kHMOutsideTopRightAligned
|
||||
kHMLeftTopCorner = kHMOutsideLeftTopAligned
|
||||
kHMLeftBottomCorner = kHMOutsideLeftBottomAligned
|
||||
kHMBottomLeftCorner = kHMOutsideBottomLeftAligned
|
||||
kHMBottomRightCorner = kHMOutsideBottomRightAligned
|
||||
kHMRightTopCorner = kHMOutsideRightTopAligned
|
||||
kHMRightBottomCorner = kHMOutsideRightBottomAligned
|
||||
kHMContentProvided = 0
|
||||
kHMContentNotProvided = 1
|
||||
kHMContentNotProvidedDontPropagate = 2
|
||||
kHMMinimumContentIndex = 0
|
||||
kHMMaximumContentIndex = 1
|
||||
errHMIllegalContentForMinimumState = -10980
|
||||
errHMIllegalContentForMaximumState = -10981
|
||||
kHMIllegalContentForMinimumState = errHMIllegalContentForMinimumState
|
||||
kHelpTagEventHandlerTag = FOUR_CHAR_CODE('hevt')
|
|
@ -1,226 +0,0 @@
|
|||
# Generated from 'MacTextEditor.h'
|
||||
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
false = 0
|
||||
true = 1
|
||||
kTXNClearThisControl = 0xFFFFFFFF
|
||||
kTXNClearTheseFontFeatures = 0x80000000
|
||||
kTXNDontCareTypeSize = 0xFFFFFFFF
|
||||
kTXNDecrementTypeSize = 0x80000000
|
||||
kTXNUseCurrentSelection = 0xFFFFFFFF
|
||||
kTXNStartOffset = 0
|
||||
kTXNEndOffset = 0x7FFFFFFF
|
||||
MovieFileType = FOUR_CHAR_CODE('moov')
|
||||
kTXNUseEncodingWordRulesMask = 0x80000000
|
||||
kTXNFontSizeAttributeSize = 4
|
||||
normal = 0
|
||||
kTXNWillDefaultToATSUIBit = 0
|
||||
kTXNWillDefaultToCarbonEventBit = 1
|
||||
kTXNWillDefaultToATSUIMask = 1 << kTXNWillDefaultToATSUIBit
|
||||
kTXNWillDefaultToCarbonEventMask = 1 << kTXNWillDefaultToCarbonEventBit
|
||||
kTXNWantMoviesBit = 0
|
||||
kTXNWantSoundBit = 1
|
||||
kTXNWantGraphicsBit = 2
|
||||
kTXNAlwaysUseQuickDrawTextBit = 3
|
||||
kTXNUseTemporaryMemoryBit = 4
|
||||
kTXNWantMoviesMask = 1 << kTXNWantMoviesBit
|
||||
kTXNWantSoundMask = 1 << kTXNWantSoundBit
|
||||
kTXNWantGraphicsMask = 1 << kTXNWantGraphicsBit
|
||||
kTXNAlwaysUseQuickDrawTextMask = 1 << kTXNAlwaysUseQuickDrawTextBit
|
||||
kTXNUseTemporaryMemoryMask = 1 << kTXNUseTemporaryMemoryBit
|
||||
kTXNDrawGrowIconBit = 0
|
||||
kTXNShowWindowBit = 1
|
||||
kTXNWantHScrollBarBit = 2
|
||||
kTXNWantVScrollBarBit = 3
|
||||
kTXNNoTSMEverBit = 4
|
||||
kTXNReadOnlyBit = 5
|
||||
kTXNNoKeyboardSyncBit = 6
|
||||
kTXNNoSelectionBit = 7
|
||||
kTXNSaveStylesAsSTYLResourceBit = 8
|
||||
kOutputTextInUnicodeEncodingBit = 9
|
||||
kTXNDoNotInstallDragProcsBit = 10
|
||||
kTXNAlwaysWrapAtViewEdgeBit = 11
|
||||
kTXNDontDrawCaretWhenInactiveBit = 12
|
||||
kTXNDontDrawSelectionWhenInactiveBit = 13
|
||||
kTXNSingleLineOnlyBit = 14
|
||||
kTXNDisableDragAndDropBit = 15
|
||||
kTXNUseQDforImagingBit = 16
|
||||
kTXNDrawGrowIconMask = 1 << kTXNDrawGrowIconBit
|
||||
kTXNShowWindowMask = 1 << kTXNShowWindowBit
|
||||
kTXNWantHScrollBarMask = 1 << kTXNWantHScrollBarBit
|
||||
kTXNWantVScrollBarMask = 1 << kTXNWantVScrollBarBit
|
||||
kTXNNoTSMEverMask = 1 << kTXNNoTSMEverBit
|
||||
kTXNReadOnlyMask = 1 << kTXNReadOnlyBit
|
||||
kTXNNoKeyboardSyncMask = 1 << kTXNNoKeyboardSyncBit
|
||||
kTXNNoSelectionMask = 1 << kTXNNoSelectionBit
|
||||
kTXNSaveStylesAsSTYLResourceMask = 1 << kTXNSaveStylesAsSTYLResourceBit
|
||||
kOutputTextInUnicodeEncodingMask = 1 << kOutputTextInUnicodeEncodingBit
|
||||
kTXNDoNotInstallDragProcsMask = 1 << kTXNDoNotInstallDragProcsBit
|
||||
kTXNAlwaysWrapAtViewEdgeMask = 1 << kTXNAlwaysWrapAtViewEdgeBit
|
||||
kTXNDontDrawCaretWhenInactiveMask = 1 << kTXNDontDrawCaretWhenInactiveBit
|
||||
kTXNDontDrawSelectionWhenInactiveMask = 1 << kTXNDontDrawSelectionWhenInactiveBit
|
||||
kTXNSingleLineOnlyMask = 1 << kTXNSingleLineOnlyBit
|
||||
kTXNDisableDragAndDropMask = 1 << kTXNDisableDragAndDropBit
|
||||
kTXNUseQDforImagingMask = 1 << kTXNUseQDforImagingBit
|
||||
kTXNSetFlushnessBit = 0
|
||||
kTXNSetJustificationBit = 1
|
||||
kTXNUseFontFallBackBit = 2
|
||||
kTXNRotateTextBit = 3
|
||||
kTXNUseVerticalTextBit = 4
|
||||
kTXNDontUpdateBoxRectBit = 5
|
||||
kTXNDontDrawTextBit = 6
|
||||
kTXNUseCGContextRefBit = 7
|
||||
kTXNImageWithQDBit = 8
|
||||
kTXNDontWrapTextBit = 9
|
||||
kTXNSetFlushnessMask = 1 << kTXNSetFlushnessBit
|
||||
kTXNSetJustificationMask = 1 << kTXNSetJustificationBit
|
||||
kTXNUseFontFallBackMask = 1 << kTXNUseFontFallBackBit
|
||||
kTXNRotateTextMask = 1 << kTXNRotateTextBit
|
||||
kTXNUseVerticalTextMask = 1 << kTXNUseVerticalTextBit
|
||||
kTXNDontUpdateBoxRectMask = 1 << kTXNDontUpdateBoxRectBit
|
||||
kTXNDontDrawTextMask = 1 << kTXNDontDrawTextBit
|
||||
kTXNUseCGContextRefMask = 1 << kTXNUseCGContextRefBit
|
||||
kTXNImageWithQDMask = 1 << kTXNImageWithQDBit
|
||||
kTXNDontWrapTextMask = 1 << kTXNDontWrapTextBit
|
||||
kTXNFontContinuousBit = 0
|
||||
kTXNSizeContinuousBit = 1
|
||||
kTXNStyleContinuousBit = 2
|
||||
kTXNColorContinuousBit = 3
|
||||
kTXNFontContinuousMask = 1 << kTXNFontContinuousBit
|
||||
kTXNSizeContinuousMask = 1 << kTXNSizeContinuousBit
|
||||
kTXNStyleContinuousMask = 1 << kTXNStyleContinuousBit
|
||||
kTXNColorContinuousMask = 1 << kTXNColorContinuousBit
|
||||
kTXNIgnoreCaseBit = 0
|
||||
kTXNEntireWordBit = 1
|
||||
kTXNUseEncodingWordRulesBit = 31
|
||||
kTXNIgnoreCaseMask = 1 << kTXNIgnoreCaseBit
|
||||
kTXNEntireWordMask = 1 << kTXNEntireWordBit
|
||||
# kTXNUseEncodingWordRulesMask = (unsigned long)(1L << kTXNUseEncodingWordRulesBit)
|
||||
kTXNTextensionFile = FOUR_CHAR_CODE('txtn')
|
||||
kTXNTextFile = FOUR_CHAR_CODE('TEXT')
|
||||
kTXNPictureFile = FOUR_CHAR_CODE('PICT')
|
||||
kTXNMovieFile = FOUR_CHAR_CODE('MooV')
|
||||
kTXNSoundFile = FOUR_CHAR_CODE('sfil')
|
||||
kTXNAIFFFile = FOUR_CHAR_CODE('AIFF')
|
||||
kTXNUnicodeTextFile = FOUR_CHAR_CODE('utxt')
|
||||
kTXNTextEditStyleFrameType = 1
|
||||
kTXNPageFrameType = 2
|
||||
kTXNMultipleFrameType = 3
|
||||
kTXNTextData = FOUR_CHAR_CODE('TEXT')
|
||||
kTXNPictureData = FOUR_CHAR_CODE('PICT')
|
||||
kTXNMovieData = FOUR_CHAR_CODE('moov')
|
||||
kTXNSoundData = FOUR_CHAR_CODE('snd ')
|
||||
kTXNUnicodeTextData = FOUR_CHAR_CODE('utxt')
|
||||
kTXNLineDirectionTag = FOUR_CHAR_CODE('lndr')
|
||||
kTXNJustificationTag = FOUR_CHAR_CODE('just')
|
||||
kTXNIOPrivilegesTag = FOUR_CHAR_CODE('iopv')
|
||||
kTXNSelectionStateTag = FOUR_CHAR_CODE('slst')
|
||||
kTXNInlineStateTag = FOUR_CHAR_CODE('inst')
|
||||
kTXNWordWrapStateTag = FOUR_CHAR_CODE('wwrs')
|
||||
kTXNKeyboardSyncStateTag = FOUR_CHAR_CODE('kbsy')
|
||||
kTXNAutoIndentStateTag = FOUR_CHAR_CODE('auin')
|
||||
kTXNTabSettingsTag = FOUR_CHAR_CODE('tabs')
|
||||
kTXNRefConTag = FOUR_CHAR_CODE('rfcn')
|
||||
kTXNMarginsTag = FOUR_CHAR_CODE('marg')
|
||||
kTXNFlattenMoviesTag = FOUR_CHAR_CODE('flat')
|
||||
kTXNDoFontSubstitution = FOUR_CHAR_CODE('fSub')
|
||||
kTXNNoUserIOTag = FOUR_CHAR_CODE('nuio')
|
||||
kTXNUseCarbonEvents = FOUR_CHAR_CODE('cbcb')
|
||||
kTXNDrawCaretWhenInactiveTag = FOUR_CHAR_CODE('dcrt')
|
||||
kTXNDrawSelectionWhenInactiveTag = FOUR_CHAR_CODE('dsln')
|
||||
kTXNDisableDragAndDropTag = FOUR_CHAR_CODE('drag')
|
||||
kTXNTypingAction = 0
|
||||
kTXNCutAction = 1
|
||||
kTXNPasteAction = 2
|
||||
kTXNClearAction = 3
|
||||
kTXNChangeFontAction = 4
|
||||
kTXNChangeFontColorAction = 5
|
||||
kTXNChangeFontSizeAction = 6
|
||||
kTXNChangeStyleAction = 7
|
||||
kTXNAlignLeftAction = 8
|
||||
kTXNAlignCenterAction = 9
|
||||
kTXNAlignRightAction = 10
|
||||
kTXNDropAction = 11
|
||||
kTXNMoveAction = 12
|
||||
kTXNFontFeatureAction = 13
|
||||
kTXNFontVariationAction = 14
|
||||
kTXNUndoLastAction = 1024
|
||||
# kTXNClearThisControl = (long)0xFFFFFFFF
|
||||
# kTXNClearTheseFontFeatures = (long)0x80000000
|
||||
kTXNReadWrite = false
|
||||
kTXNReadOnly = true
|
||||
kTXNSelectionOn = true
|
||||
kTXNSelectionOff = false
|
||||
kTXNUseInline = false
|
||||
kTXNUseBottomline = true
|
||||
kTXNAutoWrap = false
|
||||
kTXNNoAutoWrap = true
|
||||
kTXNSyncKeyboard = false
|
||||
kTXNNoSyncKeyboard = true
|
||||
kTXNAutoIndentOff = false
|
||||
kTXNAutoIndentOn = true
|
||||
kTXNDontDrawCaretWhenInactive = false
|
||||
kTXNDrawCaretWhenInactive = true
|
||||
kTXNDontDrawSelectionWhenInactive = false
|
||||
kTXNDrawSelectionWhenInactive = true
|
||||
kTXNEnableDragAndDrop = false
|
||||
kTXNDisableDragAndDrop = true
|
||||
kTXNRightTab = -1
|
||||
kTXNLeftTab = 0
|
||||
kTXNCenterTab = 1
|
||||
kTXNLeftToRight = 0
|
||||
kTXNRightToLeft = 1
|
||||
kTXNFlushDefault = 0
|
||||
kTXNFlushLeft = 1
|
||||
kTXNFlushRight = 2
|
||||
kTXNCenter = 4
|
||||
kTXNFullJust = 8
|
||||
kTXNForceFullJust = 16
|
||||
kScrollBarsAlwaysActive = true
|
||||
kScrollBarsSyncWithFocus = false
|
||||
# kTXNDontCareTypeSize = (long)0xFFFFFFFF
|
||||
kTXNDontCareTypeStyle = 0xFF
|
||||
kTXNIncrementTypeSize = 0x00000001
|
||||
# kTXNDecrementTypeSize = (long)0x80000000
|
||||
kTXNUseScriptDefaultValue = -1
|
||||
kTXNNoFontVariations = 0x7FFF
|
||||
# kTXNUseCurrentSelection = (unsigned long)0xFFFFFFFF
|
||||
# kTXNStartOffset = 0
|
||||
# kTXNEndOffset = 0x7FFFFFFF
|
||||
kTXNSingleStylePerTextDocumentResType = FOUR_CHAR_CODE('MPSR')
|
||||
kTXNMultipleStylesPerTextDocumentResType = FOUR_CHAR_CODE('styl')
|
||||
kTXNShowStart = false
|
||||
kTXNShowEnd = true
|
||||
kTXNDefaultFontName = 0
|
||||
kTXNDefaultFontSize = 0x000C0000
|
||||
kTXNDefaultFontStyle = normal
|
||||
kTXNQDFontNameAttribute = FOUR_CHAR_CODE('fntn')
|
||||
kTXNQDFontFamilyIDAttribute = FOUR_CHAR_CODE('font')
|
||||
kTXNQDFontSizeAttribute = FOUR_CHAR_CODE('size')
|
||||
kTXNQDFontStyleAttribute = FOUR_CHAR_CODE('face')
|
||||
kTXNQDFontColorAttribute = FOUR_CHAR_CODE('klor')
|
||||
kTXNTextEncodingAttribute = FOUR_CHAR_CODE('encd')
|
||||
kTXNATSUIFontFeaturesAttribute = FOUR_CHAR_CODE('atfe')
|
||||
kTXNATSUIFontVariationsAttribute = FOUR_CHAR_CODE('atva')
|
||||
# kTXNQDFontNameAttributeSize = sizeof(Str255)
|
||||
# kTXNQDFontFamilyIDAttributeSize = sizeof(SInt16)
|
||||
# kTXNQDFontSizeAttributeSize = sizeof(SInt16)
|
||||
# kTXNQDFontStyleAttributeSize = sizeof(Style)
|
||||
# kTXNQDFontColorAttributeSize = sizeof(RGBColor)
|
||||
# kTXNTextEncodingAttributeSize = sizeof(TextEncoding)
|
||||
# kTXNFontSizeAttributeSize = sizeof(Fixed)
|
||||
kTXNSystemDefaultEncoding = 0
|
||||
kTXNMacOSEncoding = 1
|
||||
kTXNUnicodeEncoding = 2
|
||||
kTXNBackgroundTypeRGB = 1
|
||||
kTXNTextInputCountBit = 0
|
||||
kTXNRunCountBit = 1
|
||||
kTXNTextInputCountMask = 1 << kTXNTextInputCountBit
|
||||
kTXNRunCountMask = 1 << kTXNRunCountBit
|
||||
kTXNAllCountMask = kTXNTextInputCountMask | kTXNRunCountMask
|
||||
kTXNNoAppleEventHandlersBit = 0
|
||||
kTXNRestartAppleEventHandlersBit = 1
|
||||
kTXNNoAppleEventHandlersMask = 1 << kTXNNoAppleEventHandlersBit
|
||||
kTXNRestartAppleEventHandlersMask = 1 << kTXNRestartAppleEventHandlersBit
|
||||
# status = TXNInitTextension( &defaults
|
|
@ -1,97 +0,0 @@
|
|||
# Parsers/generators for QuickTime media descriptions
|
||||
import struct
|
||||
|
||||
Error = 'MediaDescr.Error'
|
||||
|
||||
class _MediaDescriptionCodec:
|
||||
def __init__(self, trunc, size, names, fmt):
|
||||
self.trunc = trunc
|
||||
self.size = size
|
||||
self.names = names
|
||||
self.fmt = fmt
|
||||
|
||||
def decode(self, data):
|
||||
if self.trunc:
|
||||
data = data[:self.size]
|
||||
values = struct.unpack(self.fmt, data)
|
||||
if len(values) != len(self.names):
|
||||
raise Error('Format length does not match number of names', descr)
|
||||
rv = {}
|
||||
for i in range(len(values)):
|
||||
name = self.names[i]
|
||||
value = values[i]
|
||||
if type(name) == type(()):
|
||||
name, cod, dec = name
|
||||
value = dec(value)
|
||||
rv[name] = value
|
||||
return rv
|
||||
|
||||
def encode(dict):
|
||||
list = [self.fmt]
|
||||
for name in self.names:
|
||||
if type(name) == type(()):
|
||||
name, cod, dec = name
|
||||
else:
|
||||
cod = dec = None
|
||||
value = dict[name]
|
||||
if cod:
|
||||
value = cod(value)
|
||||
list.append(value)
|
||||
rv = struct.pack(*list)
|
||||
return rv
|
||||
|
||||
# Helper functions
|
||||
def _tofixed(float):
|
||||
hi = int(float)
|
||||
lo = int(float*0x10000) & 0xffff
|
||||
return (hi<<16)|lo
|
||||
|
||||
def _fromfixed(fixed):
|
||||
hi = (fixed >> 16) & 0xffff
|
||||
lo = (fixed & 0xffff)
|
||||
return hi + (lo / float(0x10000))
|
||||
|
||||
def _tostr31(str):
|
||||
return chr(len(str)) + str + '\0'*(31-len(str))
|
||||
|
||||
def _fromstr31(str31):
|
||||
return str31[1:1+ord(str31[0])]
|
||||
|
||||
SampleDescription = _MediaDescriptionCodec(
|
||||
1, # May be longer, truncate
|
||||
16, # size
|
||||
('descSize', 'dataFormat', 'resvd1', 'resvd2', 'dataRefIndex'), # Attributes
|
||||
"l4slhh" # Format
|
||||
)
|
||||
|
||||
SoundDescription = _MediaDescriptionCodec(
|
||||
1,
|
||||
36,
|
||||
('descSize', 'dataFormat', 'resvd1', 'resvd2', 'dataRefIndex',
|
||||
'version', 'revlevel', 'vendor', 'numChannels', 'sampleSize',
|
||||
'compressionID', 'packetSize', ('sampleRate', _tofixed, _fromfixed)),
|
||||
"l4slhhhh4shhhhl" # Format
|
||||
)
|
||||
|
||||
SoundDescriptionV1 = _MediaDescriptionCodec(
|
||||
1,
|
||||
52,
|
||||
('descSize', 'dataFormat', 'resvd1', 'resvd2', 'dataRefIndex',
|
||||
'version', 'revlevel', 'vendor', 'numChannels', 'sampleSize',
|
||||
'compressionID', 'packetSize', ('sampleRate', _tofixed, _fromfixed), 'samplesPerPacket',
|
||||
'bytesPerPacket', 'bytesPerFrame', 'bytesPerSample'),
|
||||
"l4slhhhh4shhhhlllll" # Format
|
||||
)
|
||||
|
||||
ImageDescription = _MediaDescriptionCodec(
|
||||
1, # May be longer, truncate
|
||||
86, # size
|
||||
('idSize', 'cType', 'resvd1', 'resvd2', 'dataRefIndex', 'version',
|
||||
'revisionLevel', 'vendor', 'temporalQuality', 'spatialQuality',
|
||||
'width', 'height', ('hRes', _tofixed, _fromfixed), ('vRes', _tofixed, _fromfixed),
|
||||
'dataSize', 'frameCount', ('name', _tostr31, _fromstr31),
|
||||
'depth', 'clutID'),
|
||||
'l4slhhhh4sllhhlllh32shh',
|
||||
)
|
||||
|
||||
# XXXX Others, like TextDescription and such, remain to be done.
|
|
@ -1 +0,0 @@
|
|||
from _Menu import *
|
|
@ -1,169 +0,0 @@
|
|||
# Generated from 'Menus.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
noMark = 0
|
||||
kMenuDrawMsg = 0
|
||||
kMenuSizeMsg = 2
|
||||
kMenuPopUpMsg = 3
|
||||
kMenuCalcItemMsg = 5
|
||||
kMenuThemeSavvyMsg = 7
|
||||
mDrawMsg = 0
|
||||
mSizeMsg = 2
|
||||
mPopUpMsg = 3
|
||||
mCalcItemMsg = 5
|
||||
mChooseMsg = 1
|
||||
mDrawItemMsg = 4
|
||||
kMenuChooseMsg = 1
|
||||
kMenuDrawItemMsg = 4
|
||||
kThemeSavvyMenuResponse = 0x7473
|
||||
kMenuInitMsg = 8
|
||||
kMenuDisposeMsg = 9
|
||||
kMenuFindItemMsg = 10
|
||||
kMenuHiliteItemMsg = 11
|
||||
kMenuDrawItemsMsg = 12
|
||||
textMenuProc = 0
|
||||
hMenuCmd = 27
|
||||
hierMenu = -1
|
||||
kInsertHierarchicalMenu = -1
|
||||
mctAllItems = -98
|
||||
mctLastIDIndic = -99
|
||||
kMenuStdMenuProc = 63
|
||||
kMenuStdMenuBarProc = 63
|
||||
kMenuNoModifiers = 0
|
||||
kMenuShiftModifier = (1 << 0)
|
||||
kMenuOptionModifier = (1 << 1)
|
||||
kMenuControlModifier = (1 << 2)
|
||||
kMenuNoCommandModifier = (1 << 3)
|
||||
kMenuNoIcon = 0
|
||||
kMenuIconType = 1
|
||||
kMenuShrinkIconType = 2
|
||||
kMenuSmallIconType = 3
|
||||
kMenuColorIconType = 4
|
||||
kMenuIconSuiteType = 5
|
||||
kMenuIconRefType = 6
|
||||
kMenuCGImageRefType = 7
|
||||
kMenuSystemIconSelectorType = 8
|
||||
kMenuIconResourceType = 9
|
||||
kMenuNullGlyph = 0x00
|
||||
kMenuTabRightGlyph = 0x02
|
||||
kMenuTabLeftGlyph = 0x03
|
||||
kMenuEnterGlyph = 0x04
|
||||
kMenuShiftGlyph = 0x05
|
||||
kMenuControlGlyph = 0x06
|
||||
kMenuOptionGlyph = 0x07
|
||||
kMenuSpaceGlyph = 0x09
|
||||
kMenuDeleteRightGlyph = 0x0A
|
||||
kMenuReturnGlyph = 0x0B
|
||||
kMenuReturnR2LGlyph = 0x0C
|
||||
kMenuNonmarkingReturnGlyph = 0x0D
|
||||
kMenuPencilGlyph = 0x0F
|
||||
kMenuDownwardArrowDashedGlyph = 0x10
|
||||
kMenuCommandGlyph = 0x11
|
||||
kMenuCheckmarkGlyph = 0x12
|
||||
kMenuDiamondGlyph = 0x13
|
||||
kMenuAppleLogoFilledGlyph = 0x14
|
||||
kMenuParagraphKoreanGlyph = 0x15
|
||||
kMenuDeleteLeftGlyph = 0x17
|
||||
kMenuLeftArrowDashedGlyph = 0x18
|
||||
kMenuUpArrowDashedGlyph = 0x19
|
||||
kMenuRightArrowDashedGlyph = 0x1A
|
||||
kMenuEscapeGlyph = 0x1B
|
||||
kMenuClearGlyph = 0x1C
|
||||
kMenuLeftDoubleQuotesJapaneseGlyph = 0x1D
|
||||
kMenuRightDoubleQuotesJapaneseGlyph = 0x1E
|
||||
kMenuTrademarkJapaneseGlyph = 0x1F
|
||||
kMenuBlankGlyph = 0x61
|
||||
kMenuPageUpGlyph = 0x62
|
||||
kMenuCapsLockGlyph = 0x63
|
||||
kMenuLeftArrowGlyph = 0x64
|
||||
kMenuRightArrowGlyph = 0x65
|
||||
kMenuNorthwestArrowGlyph = 0x66
|
||||
kMenuHelpGlyph = 0x67
|
||||
kMenuUpArrowGlyph = 0x68
|
||||
kMenuSoutheastArrowGlyph = 0x69
|
||||
kMenuDownArrowGlyph = 0x6A
|
||||
kMenuPageDownGlyph = 0x6B
|
||||
kMenuAppleLogoOutlineGlyph = 0x6C
|
||||
kMenuContextualMenuGlyph = 0x6D
|
||||
kMenuPowerGlyph = 0x6E
|
||||
kMenuF1Glyph = 0x6F
|
||||
kMenuF2Glyph = 0x70
|
||||
kMenuF3Glyph = 0x71
|
||||
kMenuF4Glyph = 0x72
|
||||
kMenuF5Glyph = 0x73
|
||||
kMenuF6Glyph = 0x74
|
||||
kMenuF7Glyph = 0x75
|
||||
kMenuF8Glyph = 0x76
|
||||
kMenuF9Glyph = 0x77
|
||||
kMenuF10Glyph = 0x78
|
||||
kMenuF11Glyph = 0x79
|
||||
kMenuF12Glyph = 0x7A
|
||||
kMenuF13Glyph = 0x87
|
||||
kMenuF14Glyph = 0x88
|
||||
kMenuF15Glyph = 0x89
|
||||
kMenuControlISOGlyph = 0x8A
|
||||
kMenuAttrExcludesMarkColumn = (1 << 0)
|
||||
kMenuAttrAutoDisable = (1 << 2)
|
||||
kMenuAttrUsePencilGlyph = (1 << 3)
|
||||
kMenuAttrHidden = (1 << 4)
|
||||
kMenuItemAttrDisabled = (1 << 0)
|
||||
kMenuItemAttrIconDisabled = (1 << 1)
|
||||
kMenuItemAttrSubmenuParentChoosable = (1 << 2)
|
||||
kMenuItemAttrDynamic = (1 << 3)
|
||||
kMenuItemAttrNotPreviousAlternate = (1 << 4)
|
||||
kMenuItemAttrHidden = (1 << 5)
|
||||
kMenuItemAttrSeparator = (1 << 6)
|
||||
kMenuItemAttrSectionHeader = (1 << 7)
|
||||
kMenuItemAttrIgnoreMeta = (1 << 8)
|
||||
kMenuItemAttrAutoRepeat = (1 << 9)
|
||||
kMenuItemAttrUseVirtualKey = (1 << 10)
|
||||
kMenuItemAttrCustomDraw = (1 << 11)
|
||||
kMenuItemAttrIncludeInCmdKeyMatching = (1 << 12)
|
||||
kMenuTrackingModeMouse = 1
|
||||
kMenuTrackingModeKeyboard = 2
|
||||
kMenuEventIncludeDisabledItems = 0x0001
|
||||
kMenuEventQueryOnly = 0x0002
|
||||
kMenuEventDontCheckSubmenus = 0x0004
|
||||
kMenuItemDataText = (1 << 0)
|
||||
kMenuItemDataMark = (1 << 1)
|
||||
kMenuItemDataCmdKey = (1 << 2)
|
||||
kMenuItemDataCmdKeyGlyph = (1 << 3)
|
||||
kMenuItemDataCmdKeyModifiers = (1 << 4)
|
||||
kMenuItemDataStyle = (1 << 5)
|
||||
kMenuItemDataEnabled = (1 << 6)
|
||||
kMenuItemDataIconEnabled = (1 << 7)
|
||||
kMenuItemDataIconID = (1 << 8)
|
||||
kMenuItemDataIconHandle = (1 << 9)
|
||||
kMenuItemDataCommandID = (1 << 10)
|
||||
kMenuItemDataTextEncoding = (1 << 11)
|
||||
kMenuItemDataSubmenuID = (1 << 12)
|
||||
kMenuItemDataSubmenuHandle = (1 << 13)
|
||||
kMenuItemDataFontID = (1 << 14)
|
||||
kMenuItemDataRefcon = (1 << 15)
|
||||
kMenuItemDataAttributes = (1 << 16)
|
||||
kMenuItemDataCFString = (1 << 17)
|
||||
kMenuItemDataProperties = (1 << 18)
|
||||
kMenuItemDataIndent = (1 << 19)
|
||||
kMenuItemDataCmdVirtualKey = (1 << 20)
|
||||
kMenuItemDataAllDataVersionOne = 0x000FFFFF
|
||||
kMenuItemDataAllDataVersionTwo = kMenuItemDataAllDataVersionOne | kMenuItemDataCmdVirtualKey
|
||||
kMenuDefProcPtr = 0
|
||||
kMenuPropertyPersistent = 0x00000001
|
||||
kHierarchicalFontMenuOption = 0x00000001
|
||||
gestaltContextualMenuAttr = FOUR_CHAR_CODE('cmnu')
|
||||
gestaltContextualMenuUnusedBit = 0
|
||||
gestaltContextualMenuTrapAvailable = 1
|
||||
gestaltContextualMenuHasAttributeAndModifierKeys = 2
|
||||
gestaltContextualMenuHasUnicodeSupport = 3
|
||||
kCMHelpItemNoHelp = 0
|
||||
kCMHelpItemAppleGuide = 1
|
||||
kCMHelpItemOtherHelp = 2
|
||||
kCMHelpItemRemoveHelp = 3
|
||||
kCMNothingSelected = 0
|
||||
kCMMenuItemSelected = 1
|
||||
kCMShowHelpSelected = 3
|
||||
keyContextualMenuName = FOUR_CHAR_CODE('pnam')
|
||||
keyContextualMenuCommandID = FOUR_CHAR_CODE('cmcd')
|
||||
keyContextualMenuSubmenu = FOUR_CHAR_CODE('cmsb')
|
||||
keyContextualMenuAttributes = FOUR_CHAR_CODE('cmat')
|
||||
keyContextualMenuModifiers = FOUR_CHAR_CODE('cmmd')
|
|
@ -1 +0,0 @@
|
|||
from _Mlte import *
|
|
@ -1 +0,0 @@
|
|||
from _OSA import *
|
|
@ -1,133 +0,0 @@
|
|||
# Generated from 'OSA.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
from Carbon.AppleEvents import *
|
||||
kAEUseStandardDispatch = -1
|
||||
kOSAComponentType = FOUR_CHAR_CODE('osa ')
|
||||
kOSAGenericScriptingComponentSubtype = FOUR_CHAR_CODE('scpt')
|
||||
kOSAFileType = FOUR_CHAR_CODE('osas')
|
||||
kOSASuite = FOUR_CHAR_CODE('ascr')
|
||||
kOSARecordedText = FOUR_CHAR_CODE('recd')
|
||||
kOSAScriptIsModified = FOUR_CHAR_CODE('modi')
|
||||
kOSAScriptIsTypeCompiledScript = FOUR_CHAR_CODE('cscr')
|
||||
kOSAScriptIsTypeScriptValue = FOUR_CHAR_CODE('valu')
|
||||
kOSAScriptIsTypeScriptContext = FOUR_CHAR_CODE('cntx')
|
||||
kOSAScriptBestType = FOUR_CHAR_CODE('best')
|
||||
kOSACanGetSource = FOUR_CHAR_CODE('gsrc')
|
||||
typeOSADialectInfo = FOUR_CHAR_CODE('difo')
|
||||
keyOSADialectName = FOUR_CHAR_CODE('dnam')
|
||||
keyOSADialectCode = FOUR_CHAR_CODE('dcod')
|
||||
keyOSADialectLangCode = FOUR_CHAR_CODE('dlcd')
|
||||
keyOSADialectScriptCode = FOUR_CHAR_CODE('dscd')
|
||||
kOSANullScript = 0
|
||||
kOSANullMode = 0
|
||||
kOSAModeNull = 0
|
||||
kOSASupportsCompiling = 0x0002
|
||||
kOSASupportsGetSource = 0x0004
|
||||
kOSASupportsAECoercion = 0x0008
|
||||
kOSASupportsAESending = 0x0010
|
||||
kOSASupportsRecording = 0x0020
|
||||
kOSASupportsConvenience = 0x0040
|
||||
kOSASupportsDialects = 0x0080
|
||||
kOSASupportsEventHandling = 0x0100
|
||||
kOSASelectLoad = 0x0001
|
||||
kOSASelectStore = 0x0002
|
||||
kOSASelectExecute = 0x0003
|
||||
kOSASelectDisplay = 0x0004
|
||||
kOSASelectScriptError = 0x0005
|
||||
kOSASelectDispose = 0x0006
|
||||
kOSASelectSetScriptInfo = 0x0007
|
||||
kOSASelectGetScriptInfo = 0x0008
|
||||
kOSASelectSetActiveProc = 0x0009
|
||||
kOSASelectGetActiveProc = 0x000A
|
||||
kOSASelectScriptingComponentName = 0x0102
|
||||
kOSASelectCompile = 0x0103
|
||||
kOSASelectCopyID = 0x0104
|
||||
kOSASelectCopyScript = 0x0105
|
||||
kOSASelectGetSource = 0x0201
|
||||
kOSASelectCoerceFromDesc = 0x0301
|
||||
kOSASelectCoerceToDesc = 0x0302
|
||||
kOSASelectSetSendProc = 0x0401
|
||||
kOSASelectGetSendProc = 0x0402
|
||||
kOSASelectSetCreateProc = 0x0403
|
||||
kOSASelectGetCreateProc = 0x0404
|
||||
kOSASelectSetDefaultTarget = 0x0405
|
||||
kOSASelectStartRecording = 0x0501
|
||||
kOSASelectStopRecording = 0x0502
|
||||
kOSASelectLoadExecute = 0x0601
|
||||
kOSASelectCompileExecute = 0x0602
|
||||
kOSASelectDoScript = 0x0603
|
||||
kOSASelectSetCurrentDialect = 0x0701
|
||||
kOSASelectGetCurrentDialect = 0x0702
|
||||
kOSASelectAvailableDialects = 0x0703
|
||||
kOSASelectGetDialectInfo = 0x0704
|
||||
kOSASelectAvailableDialectCodeList = 0x0705
|
||||
kOSASelectSetResumeDispatchProc = 0x0801
|
||||
kOSASelectGetResumeDispatchProc = 0x0802
|
||||
kOSASelectExecuteEvent = 0x0803
|
||||
kOSASelectDoEvent = 0x0804
|
||||
kOSASelectMakeContext = 0x0805
|
||||
kOSADebuggerCreateSession = 0x0901
|
||||
kOSADebuggerGetSessionState = 0x0902
|
||||
kOSADebuggerSessionStep = 0x0903
|
||||
kOSADebuggerDisposeSession = 0x0904
|
||||
kOSADebuggerGetStatementRanges = 0x0905
|
||||
kOSADebuggerGetBreakpoint = 0x0910
|
||||
kOSADebuggerSetBreakpoint = 0x0911
|
||||
kOSADebuggerGetDefaultBreakpoint = 0x0912
|
||||
kOSADebuggerGetCurrentCallFrame = 0x0906
|
||||
kOSADebuggerGetCallFrameState = 0x0907
|
||||
kOSADebuggerGetVariable = 0x0908
|
||||
kOSADebuggerSetVariable = 0x0909
|
||||
kOSADebuggerGetPreviousCallFrame = 0x090A
|
||||
kOSADebuggerDisposeCallFrame = 0x090B
|
||||
kOSADebuggerCountVariables = 0x090C
|
||||
kOSASelectComponentSpecificStart = 0x1001
|
||||
kOSAModePreventGetSource = 0x00000001
|
||||
kOSAModeNeverInteract = kAENeverInteract
|
||||
kOSAModeCanInteract = kAECanInteract
|
||||
kOSAModeAlwaysInteract = kAEAlwaysInteract
|
||||
kOSAModeDontReconnect = kAEDontReconnect
|
||||
kOSAModeCantSwitchLayer = 0x00000040
|
||||
kOSAModeDoRecord = 0x00001000
|
||||
kOSAModeCompileIntoContext = 0x00000002
|
||||
kOSAModeAugmentContext = 0x00000004
|
||||
kOSAModeDisplayForHumans = 0x00000008
|
||||
kOSAModeDontStoreParent = 0x00010000
|
||||
kOSAModeDispatchToDirectObject = 0x00020000
|
||||
kOSAModeDontGetDataForArguments = 0x00040000
|
||||
kOSAScriptResourceType = kOSAGenericScriptingComponentSubtype
|
||||
typeOSAGenericStorage = kOSAScriptResourceType
|
||||
kOSAErrorNumber = keyErrorNumber
|
||||
kOSAErrorMessage = keyErrorString
|
||||
kOSAErrorBriefMessage = FOUR_CHAR_CODE('errb')
|
||||
kOSAErrorApp = FOUR_CHAR_CODE('erap')
|
||||
kOSAErrorPartialResult = FOUR_CHAR_CODE('ptlr')
|
||||
kOSAErrorOffendingObject = FOUR_CHAR_CODE('erob')
|
||||
kOSAErrorExpectedType = FOUR_CHAR_CODE('errt')
|
||||
kOSAErrorRange = FOUR_CHAR_CODE('erng')
|
||||
typeOSAErrorRange = FOUR_CHAR_CODE('erng')
|
||||
keyOSASourceStart = FOUR_CHAR_CODE('srcs')
|
||||
keyOSASourceEnd = FOUR_CHAR_CODE('srce')
|
||||
kOSAUseStandardDispatch = kAEUseStandardDispatch
|
||||
kOSANoDispatch = kAENoDispatch
|
||||
kOSADontUsePhac = 0x0001
|
||||
eNotStarted = 0
|
||||
eRunnable = 1
|
||||
eRunning = 2
|
||||
eStopped = 3
|
||||
eTerminated = 4
|
||||
eStepOver = 0
|
||||
eStepIn = 1
|
||||
eStepOut = 2
|
||||
eRun = 3
|
||||
eLocal = 0
|
||||
eGlobal = 1
|
||||
eProperties = 2
|
||||
keyProgramState = FOUR_CHAR_CODE('dsps')
|
||||
typeStatementRange = FOUR_CHAR_CODE('srng')
|
||||
keyProcedureName = FOUR_CHAR_CODE('dfnm')
|
||||
keyStatementRange = FOUR_CHAR_CODE('dfsr')
|
||||
keyLocalsNames = FOUR_CHAR_CODE('dfln')
|
||||
keyGlobalsNames = FOUR_CHAR_CODE('dfgn')
|
||||
keyParamsNames = FOUR_CHAR_CODE('dfpn')
|
|
@ -1,47 +0,0 @@
|
|||
# Generated from 'QDOffscreen.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
pixPurgeBit = 0
|
||||
noNewDeviceBit = 1
|
||||
useTempMemBit = 2
|
||||
keepLocalBit = 3
|
||||
useDistantHdwrMemBit = 4
|
||||
useLocalHdwrMemBit = 5
|
||||
pixelsPurgeableBit = 6
|
||||
pixelsLockedBit = 7
|
||||
mapPixBit = 16
|
||||
newDepthBit = 17
|
||||
alignPixBit = 18
|
||||
newRowBytesBit = 19
|
||||
reallocPixBit = 20
|
||||
clipPixBit = 28
|
||||
stretchPixBit = 29
|
||||
ditherPixBit = 30
|
||||
gwFlagErrBit = 31
|
||||
pixPurge = 1 << pixPurgeBit
|
||||
noNewDevice = 1 << noNewDeviceBit
|
||||
useTempMem = 1 << useTempMemBit
|
||||
keepLocal = 1 << keepLocalBit
|
||||
useDistantHdwrMem = 1 << useDistantHdwrMemBit
|
||||
useLocalHdwrMem = 1 << useLocalHdwrMemBit
|
||||
pixelsPurgeable = 1 << pixelsPurgeableBit
|
||||
pixelsLocked = 1 << pixelsLockedBit
|
||||
kAllocDirectDrawSurface = 1 << 14
|
||||
mapPix = 1 << mapPixBit
|
||||
newDepth = 1 << newDepthBit
|
||||
alignPix = 1 << alignPixBit
|
||||
newRowBytes = 1 << newRowBytesBit
|
||||
reallocPix = 1 << reallocPixBit
|
||||
clipPix = 1 << clipPixBit
|
||||
stretchPix = 1 << stretchPixBit
|
||||
ditherPix = 1 << ditherPixBit
|
||||
gwFlagErr = 1 << gwFlagErrBit
|
||||
deviceIsIndirect = (1 << 0)
|
||||
deviceNeedsLock = (1 << 1)
|
||||
deviceIsStatic = (1 << 2)
|
||||
deviceIsExternalBuffer = (1 << 3)
|
||||
deviceIsDDSurface = (1 << 4)
|
||||
deviceIsDCISurface = (1 << 5)
|
||||
deviceIsGDISurface = (1 << 6)
|
||||
deviceIsAScreen = (1 << 7)
|
||||
deviceIsOverlaySurface = (1 << 8)
|
|
@ -1 +0,0 @@
|
|||
from _Qd import *
|
|
@ -1 +0,0 @@
|
|||
from _Qdoffs import *
|
|
@ -1,5 +0,0 @@
|
|||
from _Qt import *
|
||||
try:
|
||||
_ = AddFilePreview
|
||||
except:
|
||||
raise ImportError("Old (2.3) _Qt.so module loaded in stead of new (2.4) _Qt.so")
|
|
@ -1,218 +0,0 @@
|
|||
# Generated from 'QuickDraw.h'
|
||||
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
normal = 0
|
||||
bold = 1
|
||||
italic = 2
|
||||
underline = 4
|
||||
outline = 8
|
||||
shadow = 0x10
|
||||
condense = 0x20
|
||||
extend = 0x40
|
||||
invalColReq = -1
|
||||
srcCopy = 0
|
||||
srcOr = 1
|
||||
srcXor = 2
|
||||
srcBic = 3
|
||||
notSrcCopy = 4
|
||||
notSrcOr = 5
|
||||
notSrcXor = 6
|
||||
notSrcBic = 7
|
||||
patCopy = 8
|
||||
patOr = 9
|
||||
patXor = 10
|
||||
patBic = 11
|
||||
notPatCopy = 12
|
||||
notPatOr = 13
|
||||
notPatXor = 14
|
||||
notPatBic = 15
|
||||
grayishTextOr = 49
|
||||
hilitetransfermode = 50
|
||||
hilite = 50
|
||||
blend = 32
|
||||
addPin = 33
|
||||
addOver = 34
|
||||
subPin = 35
|
||||
addMax = 37
|
||||
adMax = 37
|
||||
subOver = 38
|
||||
adMin = 39
|
||||
ditherCopy = 64
|
||||
transparent = 36
|
||||
italicBit = 1
|
||||
ulineBit = 2
|
||||
outlineBit = 3
|
||||
shadowBit = 4
|
||||
condenseBit = 5
|
||||
extendBit = 6
|
||||
normalBit = 0
|
||||
inverseBit = 1
|
||||
redBit = 4
|
||||
greenBit = 3
|
||||
blueBit = 2
|
||||
cyanBit = 8
|
||||
magentaBit = 7
|
||||
yellowBit = 6
|
||||
blackBit = 5
|
||||
blackColor = 33
|
||||
whiteColor = 30
|
||||
redColor = 205
|
||||
greenColor = 341
|
||||
blueColor = 409
|
||||
cyanColor = 273
|
||||
magentaColor = 137
|
||||
yellowColor = 69
|
||||
picLParen = 0
|
||||
picRParen = 1
|
||||
clutType = 0
|
||||
fixedType = 1
|
||||
directType = 2
|
||||
gdDevType = 0
|
||||
interlacedDevice = 2
|
||||
hwMirroredDevice = 4
|
||||
roundedDevice = 5
|
||||
hasAuxMenuBar = 6
|
||||
burstDevice = 7
|
||||
ext32Device = 8
|
||||
ramInit = 10
|
||||
mainScreen = 11
|
||||
allInit = 12
|
||||
screenDevice = 13
|
||||
noDriver = 14
|
||||
screenActive = 15
|
||||
hiliteBit = 7
|
||||
pHiliteBit = 0
|
||||
defQDColors = 127
|
||||
RGBDirect = 16
|
||||
baseAddr32 = 4
|
||||
sysPatListID = 0
|
||||
iBeamCursor = 1
|
||||
crossCursor = 2
|
||||
plusCursor = 3
|
||||
watchCursor = 4
|
||||
kQDGrafVerbFrame = 0
|
||||
kQDGrafVerbPaint = 1
|
||||
kQDGrafVerbErase = 2
|
||||
kQDGrafVerbInvert = 3
|
||||
kQDGrafVerbFill = 4
|
||||
frame = kQDGrafVerbFrame
|
||||
paint = kQDGrafVerbPaint
|
||||
erase = kQDGrafVerbErase
|
||||
invert = kQDGrafVerbInvert
|
||||
fill = kQDGrafVerbFill
|
||||
chunky = 0
|
||||
chunkyPlanar = 1
|
||||
planar = 2
|
||||
singleDevicesBit = 0
|
||||
dontMatchSeedsBit = 1
|
||||
allDevicesBit = 2
|
||||
singleDevices = 1 << singleDevicesBit
|
||||
dontMatchSeeds = 1 << dontMatchSeedsBit
|
||||
allDevices = 1 << allDevicesBit
|
||||
kPrinterFontStatus = 0
|
||||
kPrinterScalingStatus = 1
|
||||
kNoConstraint = 0
|
||||
kVerticalConstraint = 1
|
||||
kHorizontalConstraint = 2
|
||||
k1MonochromePixelFormat = 0x00000001
|
||||
k2IndexedPixelFormat = 0x00000002
|
||||
k4IndexedPixelFormat = 0x00000004
|
||||
k8IndexedPixelFormat = 0x00000008
|
||||
k16BE555PixelFormat = 0x00000010
|
||||
k24RGBPixelFormat = 0x00000018
|
||||
k32ARGBPixelFormat = 0x00000020
|
||||
k1IndexedGrayPixelFormat = 0x00000021
|
||||
k2IndexedGrayPixelFormat = 0x00000022
|
||||
k4IndexedGrayPixelFormat = 0x00000024
|
||||
k8IndexedGrayPixelFormat = 0x00000028
|
||||
k16LE555PixelFormat = FOUR_CHAR_CODE('L555')
|
||||
k16LE5551PixelFormat = FOUR_CHAR_CODE('5551')
|
||||
k16BE565PixelFormat = FOUR_CHAR_CODE('B565')
|
||||
k16LE565PixelFormat = FOUR_CHAR_CODE('L565')
|
||||
k24BGRPixelFormat = FOUR_CHAR_CODE('24BG')
|
||||
k32BGRAPixelFormat = FOUR_CHAR_CODE('BGRA')
|
||||
k32ABGRPixelFormat = FOUR_CHAR_CODE('ABGR')
|
||||
k32RGBAPixelFormat = FOUR_CHAR_CODE('RGBA')
|
||||
kYUVSPixelFormat = FOUR_CHAR_CODE('yuvs')
|
||||
kYUVUPixelFormat = FOUR_CHAR_CODE('yuvu')
|
||||
kYVU9PixelFormat = FOUR_CHAR_CODE('YVU9')
|
||||
kYUV411PixelFormat = FOUR_CHAR_CODE('Y411')
|
||||
kYVYU422PixelFormat = FOUR_CHAR_CODE('YVYU')
|
||||
kUYVY422PixelFormat = FOUR_CHAR_CODE('UYVY')
|
||||
kYUV211PixelFormat = FOUR_CHAR_CODE('Y211')
|
||||
k2vuyPixelFormat = FOUR_CHAR_CODE('2vuy')
|
||||
kCursorImageMajorVersion = 0x0001
|
||||
kCursorImageMinorVersion = 0x0000
|
||||
kQDParseRegionFromTop = (1 << 0)
|
||||
kQDParseRegionFromBottom = (1 << 1)
|
||||
kQDParseRegionFromLeft = (1 << 2)
|
||||
kQDParseRegionFromRight = (1 << 3)
|
||||
kQDParseRegionFromTopLeft = kQDParseRegionFromTop | kQDParseRegionFromLeft
|
||||
kQDParseRegionFromBottomRight = kQDParseRegionFromBottom | kQDParseRegionFromRight
|
||||
kQDRegionToRectsMsgInit = 1
|
||||
kQDRegionToRectsMsgParse = 2
|
||||
kQDRegionToRectsMsgTerminate = 3
|
||||
colorXorXFer = 52
|
||||
noiseXFer = 53
|
||||
customXFer = 54
|
||||
kXFer1PixelAtATime = 0x00000001
|
||||
kXFerConvertPixelToRGB32 = 0x00000002
|
||||
kCursorComponentsVersion = 0x00010001
|
||||
kCursorComponentType = FOUR_CHAR_CODE('curs')
|
||||
cursorDoesAnimate = 1 << 0
|
||||
cursorDoesHardware = 1 << 1
|
||||
cursorDoesUnreadableScreenBits = 1 << 2
|
||||
kRenderCursorInHardware = 1 << 0
|
||||
kRenderCursorInSoftware = 1 << 1
|
||||
kCursorComponentInit = 0x0001
|
||||
kCursorComponentGetInfo = 0x0002
|
||||
kCursorComponentSetOutputMode = 0x0003
|
||||
kCursorComponentSetData = 0x0004
|
||||
kCursorComponentReconfigure = 0x0005
|
||||
kCursorComponentDraw = 0x0006
|
||||
kCursorComponentErase = 0x0007
|
||||
kCursorComponentMove = 0x0008
|
||||
kCursorComponentAnimate = 0x0009
|
||||
kCursorComponentLastReserved = 0x0050
|
||||
# Generated from 'QuickDrawText.h'
|
||||
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
normal = 0
|
||||
bold = 1
|
||||
italic = 2
|
||||
underline = 4
|
||||
outline = 8
|
||||
shadow = 0x10
|
||||
condense = 0x20
|
||||
extend = 0x40
|
||||
leftCaret = 0
|
||||
rightCaret = -1
|
||||
kHilite = 1
|
||||
smLeftCaret = 0
|
||||
smRightCaret = -1
|
||||
smHilite = 1
|
||||
onlyStyleRun = 0
|
||||
leftStyleRun = 1
|
||||
rightStyleRun = 2
|
||||
middleStyleRun = 3
|
||||
smOnlyStyleRun = 0
|
||||
smLeftStyleRun = 1
|
||||
smRightStyleRun = 2
|
||||
smMiddleStyleRun = 3
|
||||
truncEnd = 0
|
||||
truncMiddle = 0x4000
|
||||
smTruncEnd = 0
|
||||
smTruncMiddle = 0x4000
|
||||
notTruncated = 0
|
||||
truncated = 1
|
||||
truncErr = -1
|
||||
smNotTruncated = 0
|
||||
smTruncated = 1
|
||||
smTruncErr = -1
|
||||
smBreakWord = 0
|
||||
smBreakChar = 1
|
||||
smBreakOverflow = 2
|
||||
tfAntiAlias = 1 << 0
|
||||
tfUnicode = 1 << 1
|
File diff suppressed because it is too large
Load Diff
|
@ -1,4 +0,0 @@
|
|||
try:
|
||||
from OverrideFrom23._Res import *
|
||||
except ImportError:
|
||||
from _Res import *
|
|
@ -1,27 +0,0 @@
|
|||
# Generated from 'Resources.h'
|
||||
|
||||
resSysHeap = 64
|
||||
resPurgeable = 32
|
||||
resLocked = 16
|
||||
resProtected = 8
|
||||
resPreload = 4
|
||||
resChanged = 2
|
||||
mapReadOnly = 128
|
||||
mapCompact = 64
|
||||
mapChanged = 32
|
||||
resSysRefBit = 7
|
||||
resSysHeapBit = 6
|
||||
resPurgeableBit = 5
|
||||
resLockedBit = 4
|
||||
resProtectedBit = 3
|
||||
resPreloadBit = 2
|
||||
resChangedBit = 1
|
||||
mapReadOnlyBit = 7
|
||||
mapCompactBit = 6
|
||||
mapChangedBit = 5
|
||||
kResFileNotOpened = -1
|
||||
kSystemResFile = 0
|
||||
kRsrcChainBelowSystemMap = 0
|
||||
kRsrcChainBelowApplicationMap = 1
|
||||
kRsrcChainAboveApplicationMap = 2
|
||||
kRsrcChainAboveAllMaps = 4
|
|
@ -1 +0,0 @@
|
|||
from _Scrap import *
|
|
@ -1 +0,0 @@
|
|||
from _Snd import *
|
|
@ -1 +0,0 @@
|
|||
from _Sndihooks import *
|
|
@ -1,400 +0,0 @@
|
|||
# Generated from 'Sound.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
soundListRsrc = FOUR_CHAR_CODE('snd ')
|
||||
kSimpleBeepID = 1
|
||||
# rate48khz = (long)0xBB800000
|
||||
# rate44khz = (long)0xAC440000
|
||||
rate32khz = 0x7D000000
|
||||
rate22050hz = 0x56220000
|
||||
rate22khz = 0x56EE8BA3
|
||||
rate16khz = 0x3E800000
|
||||
rate11khz = 0x2B7745D1
|
||||
rate11025hz = 0x2B110000
|
||||
rate8khz = 0x1F400000
|
||||
sampledSynth = 5
|
||||
squareWaveSynth = 1
|
||||
waveTableSynth = 3
|
||||
MACE3snthID = 11
|
||||
MACE6snthID = 13
|
||||
kMiddleC = 60
|
||||
kNoVolume = 0
|
||||
kFullVolume = 0x0100
|
||||
stdQLength = 128
|
||||
dataOffsetFlag = 0x8000
|
||||
kUseOptionalOutputDevice = -1
|
||||
notCompressed = 0
|
||||
fixedCompression = -1
|
||||
variableCompression = -2
|
||||
twoToOne = 1
|
||||
eightToThree = 2
|
||||
threeToOne = 3
|
||||
sixToOne = 4
|
||||
sixToOnePacketSize = 8
|
||||
threeToOnePacketSize = 16
|
||||
stateBlockSize = 64
|
||||
leftOverBlockSize = 32
|
||||
firstSoundFormat = 0x0001
|
||||
secondSoundFormat = 0x0002
|
||||
dbBufferReady = 0x00000001
|
||||
dbLastBuffer = 0x00000004
|
||||
sysBeepDisable = 0x0000
|
||||
sysBeepEnable = (1 << 0)
|
||||
sysBeepSynchronous = (1 << 1)
|
||||
unitTypeNoSelection = 0xFFFF
|
||||
unitTypeSeconds = 0x0000
|
||||
stdSH = 0x00
|
||||
extSH = 0xFF
|
||||
cmpSH = 0xFE
|
||||
nullCmd = 0
|
||||
quietCmd = 3
|
||||
flushCmd = 4
|
||||
reInitCmd = 5
|
||||
waitCmd = 10
|
||||
pauseCmd = 11
|
||||
resumeCmd = 12
|
||||
callBackCmd = 13
|
||||
syncCmd = 14
|
||||
availableCmd = 24
|
||||
versionCmd = 25
|
||||
volumeCmd = 46
|
||||
getVolumeCmd = 47
|
||||
clockComponentCmd = 50
|
||||
getClockComponentCmd = 51
|
||||
scheduledSoundCmd = 52
|
||||
linkSoundComponentsCmd = 53
|
||||
soundCmd = 80
|
||||
bufferCmd = 81
|
||||
rateMultiplierCmd = 86
|
||||
getRateMultiplierCmd = 87
|
||||
initCmd = 1
|
||||
freeCmd = 2
|
||||
totalLoadCmd = 26
|
||||
loadCmd = 27
|
||||
freqDurationCmd = 40
|
||||
restCmd = 41
|
||||
freqCmd = 42
|
||||
ampCmd = 43
|
||||
timbreCmd = 44
|
||||
getAmpCmd = 45
|
||||
waveTableCmd = 60
|
||||
phaseCmd = 61
|
||||
rateCmd = 82
|
||||
continueCmd = 83
|
||||
doubleBufferCmd = 84
|
||||
getRateCmd = 85
|
||||
sizeCmd = 90
|
||||
convertCmd = 91
|
||||
waveInitChannelMask = 0x07
|
||||
waveInitChannel0 = 0x04
|
||||
waveInitChannel1 = 0x05
|
||||
waveInitChannel2 = 0x06
|
||||
waveInitChannel3 = 0x07
|
||||
initChan0 = waveInitChannel0
|
||||
initChan1 = waveInitChannel1
|
||||
initChan2 = waveInitChannel2
|
||||
initChan3 = waveInitChannel3
|
||||
outsideCmpSH = 0
|
||||
insideCmpSH = 1
|
||||
aceSuccess = 0
|
||||
aceMemFull = 1
|
||||
aceNilBlock = 2
|
||||
aceBadComp = 3
|
||||
aceBadEncode = 4
|
||||
aceBadDest = 5
|
||||
aceBadCmd = 6
|
||||
initChanLeft = 0x0002
|
||||
initChanRight = 0x0003
|
||||
initNoInterp = 0x0004
|
||||
initNoDrop = 0x0008
|
||||
initMono = 0x0080
|
||||
initStereo = 0x00C0
|
||||
initMACE3 = 0x0300
|
||||
initMACE6 = 0x0400
|
||||
initPanMask = 0x0003
|
||||
initSRateMask = 0x0030
|
||||
initStereoMask = 0x00C0
|
||||
initCompMask = 0xFF00
|
||||
siActiveChannels = FOUR_CHAR_CODE('chac')
|
||||
siActiveLevels = FOUR_CHAR_CODE('lmac')
|
||||
siAGCOnOff = FOUR_CHAR_CODE('agc ')
|
||||
siAsync = FOUR_CHAR_CODE('asyn')
|
||||
siAVDisplayBehavior = FOUR_CHAR_CODE('avdb')
|
||||
siChannelAvailable = FOUR_CHAR_CODE('chav')
|
||||
siCompressionAvailable = FOUR_CHAR_CODE('cmav')
|
||||
siCompressionChannels = FOUR_CHAR_CODE('cpct')
|
||||
siCompressionFactor = FOUR_CHAR_CODE('cmfa')
|
||||
siCompressionHeader = FOUR_CHAR_CODE('cmhd')
|
||||
siCompressionNames = FOUR_CHAR_CODE('cnam')
|
||||
siCompressionParams = FOUR_CHAR_CODE('evaw')
|
||||
siCompressionSampleRate = FOUR_CHAR_CODE('cprt')
|
||||
siCompressionType = FOUR_CHAR_CODE('comp')
|
||||
siContinuous = FOUR_CHAR_CODE('cont')
|
||||
siDecompressionParams = FOUR_CHAR_CODE('wave')
|
||||
siDeviceBufferInfo = FOUR_CHAR_CODE('dbin')
|
||||
siDeviceConnected = FOUR_CHAR_CODE('dcon')
|
||||
siDeviceIcon = FOUR_CHAR_CODE('icon')
|
||||
siDeviceName = FOUR_CHAR_CODE('name')
|
||||
siEQSpectrumBands = FOUR_CHAR_CODE('eqsb')
|
||||
siEQSpectrumLevels = FOUR_CHAR_CODE('eqlv')
|
||||
siEQSpectrumOnOff = FOUR_CHAR_CODE('eqlo')
|
||||
siEQSpectrumResolution = FOUR_CHAR_CODE('eqrs')
|
||||
siEQToneControlGain = FOUR_CHAR_CODE('eqtg')
|
||||
siEQToneControlOnOff = FOUR_CHAR_CODE('eqtc')
|
||||
siHardwareBalance = FOUR_CHAR_CODE('hbal')
|
||||
siHardwareBalanceSteps = FOUR_CHAR_CODE('hbls')
|
||||
siHardwareBass = FOUR_CHAR_CODE('hbas')
|
||||
siHardwareBassSteps = FOUR_CHAR_CODE('hbst')
|
||||
siHardwareBusy = FOUR_CHAR_CODE('hwbs')
|
||||
siHardwareFormat = FOUR_CHAR_CODE('hwfm')
|
||||
siHardwareMute = FOUR_CHAR_CODE('hmut')
|
||||
siHardwareMuteNoPrefs = FOUR_CHAR_CODE('hmnp')
|
||||
siHardwareTreble = FOUR_CHAR_CODE('htrb')
|
||||
siHardwareTrebleSteps = FOUR_CHAR_CODE('hwts')
|
||||
siHardwareVolume = FOUR_CHAR_CODE('hvol')
|
||||
siHardwareVolumeSteps = FOUR_CHAR_CODE('hstp')
|
||||
siHeadphoneMute = FOUR_CHAR_CODE('pmut')
|
||||
siHeadphoneVolume = FOUR_CHAR_CODE('pvol')
|
||||
siHeadphoneVolumeSteps = FOUR_CHAR_CODE('hdst')
|
||||
siInputAvailable = FOUR_CHAR_CODE('inav')
|
||||
siInputGain = FOUR_CHAR_CODE('gain')
|
||||
siInputSource = FOUR_CHAR_CODE('sour')
|
||||
siInputSourceNames = FOUR_CHAR_CODE('snam')
|
||||
siLevelMeterOnOff = FOUR_CHAR_CODE('lmet')
|
||||
siModemGain = FOUR_CHAR_CODE('mgai')
|
||||
siMonitorAvailable = FOUR_CHAR_CODE('mnav')
|
||||
siMonitorSource = FOUR_CHAR_CODE('mons')
|
||||
siNumberChannels = FOUR_CHAR_CODE('chan')
|
||||
siOptionsDialog = FOUR_CHAR_CODE('optd')
|
||||
siOSTypeInputSource = FOUR_CHAR_CODE('inpt')
|
||||
siOSTypeInputAvailable = FOUR_CHAR_CODE('inav')
|
||||
siOutputDeviceName = FOUR_CHAR_CODE('onam')
|
||||
siPlayThruOnOff = FOUR_CHAR_CODE('plth')
|
||||
siPostMixerSoundComponent = FOUR_CHAR_CODE('psmx')
|
||||
siPreMixerSoundComponent = FOUR_CHAR_CODE('prmx')
|
||||
siQuality = FOUR_CHAR_CODE('qual')
|
||||
siRateMultiplier = FOUR_CHAR_CODE('rmul')
|
||||
siRecordingQuality = FOUR_CHAR_CODE('qual')
|
||||
siSampleRate = FOUR_CHAR_CODE('srat')
|
||||
siSampleRateAvailable = FOUR_CHAR_CODE('srav')
|
||||
siSampleSize = FOUR_CHAR_CODE('ssiz')
|
||||
siSampleSizeAvailable = FOUR_CHAR_CODE('ssav')
|
||||
siSetupCDAudio = FOUR_CHAR_CODE('sucd')
|
||||
siSetupModemAudio = FOUR_CHAR_CODE('sumd')
|
||||
siSlopeAndIntercept = FOUR_CHAR_CODE('flap')
|
||||
siSoundClock = FOUR_CHAR_CODE('sclk')
|
||||
siUseThisSoundClock = FOUR_CHAR_CODE('sclc')
|
||||
siSpeakerMute = FOUR_CHAR_CODE('smut')
|
||||
siSpeakerVolume = FOUR_CHAR_CODE('svol')
|
||||
siSSpCPULoadLimit = FOUR_CHAR_CODE('3dll')
|
||||
siSSpLocalization = FOUR_CHAR_CODE('3dif')
|
||||
siSSpSpeakerSetup = FOUR_CHAR_CODE('3dst')
|
||||
siStereoInputGain = FOUR_CHAR_CODE('sgai')
|
||||
siSubwooferMute = FOUR_CHAR_CODE('bmut')
|
||||
siTerminalType = FOUR_CHAR_CODE('ttyp')
|
||||
siTwosComplementOnOff = FOUR_CHAR_CODE('twos')
|
||||
siVendorProduct = FOUR_CHAR_CODE('vpro')
|
||||
siVolume = FOUR_CHAR_CODE('volu')
|
||||
siVoxRecordInfo = FOUR_CHAR_CODE('voxr')
|
||||
siVoxStopInfo = FOUR_CHAR_CODE('voxs')
|
||||
siWideStereo = FOUR_CHAR_CODE('wide')
|
||||
siSupportedExtendedFlags = FOUR_CHAR_CODE('exfl')
|
||||
siRateConverterRollOffSlope = FOUR_CHAR_CODE('rcdb')
|
||||
siOutputLatency = FOUR_CHAR_CODE('olte')
|
||||
siCloseDriver = FOUR_CHAR_CODE('clos')
|
||||
siInitializeDriver = FOUR_CHAR_CODE('init')
|
||||
siPauseRecording = FOUR_CHAR_CODE('paus')
|
||||
siUserInterruptProc = FOUR_CHAR_CODE('user')
|
||||
# kInvalidSource = (long)0xFFFFFFFF
|
||||
kNoSource = FOUR_CHAR_CODE('none')
|
||||
kCDSource = FOUR_CHAR_CODE('cd ')
|
||||
kExtMicSource = FOUR_CHAR_CODE('emic')
|
||||
kSoundInSource = FOUR_CHAR_CODE('sinj')
|
||||
kRCAInSource = FOUR_CHAR_CODE('irca')
|
||||
kTVFMTunerSource = FOUR_CHAR_CODE('tvfm')
|
||||
kDAVInSource = FOUR_CHAR_CODE('idav')
|
||||
kIntMicSource = FOUR_CHAR_CODE('imic')
|
||||
kMediaBaySource = FOUR_CHAR_CODE('mbay')
|
||||
kModemSource = FOUR_CHAR_CODE('modm')
|
||||
kPCCardSource = FOUR_CHAR_CODE('pcm ')
|
||||
kZoomVideoSource = FOUR_CHAR_CODE('zvpc')
|
||||
kDVDSource = FOUR_CHAR_CODE('dvda')
|
||||
kMicrophoneArray = FOUR_CHAR_CODE('mica')
|
||||
kNoSoundComponentType = FOUR_CHAR_CODE('****')
|
||||
kSoundComponentType = FOUR_CHAR_CODE('sift')
|
||||
kSoundComponentPPCType = FOUR_CHAR_CODE('nift')
|
||||
kRate8SubType = FOUR_CHAR_CODE('ratb')
|
||||
kRate16SubType = FOUR_CHAR_CODE('ratw')
|
||||
kConverterSubType = FOUR_CHAR_CODE('conv')
|
||||
kSndSourceSubType = FOUR_CHAR_CODE('sour')
|
||||
kMixerType = FOUR_CHAR_CODE('mixr')
|
||||
kMixer8SubType = FOUR_CHAR_CODE('mixb')
|
||||
kMixer16SubType = FOUR_CHAR_CODE('mixw')
|
||||
kSoundInputDeviceType = FOUR_CHAR_CODE('sinp')
|
||||
kWaveInSubType = FOUR_CHAR_CODE('wavi')
|
||||
kWaveInSnifferSubType = FOUR_CHAR_CODE('wisn')
|
||||
kSoundOutputDeviceType = FOUR_CHAR_CODE('sdev')
|
||||
kClassicSubType = FOUR_CHAR_CODE('clas')
|
||||
kASCSubType = FOUR_CHAR_CODE('asc ')
|
||||
kDSPSubType = FOUR_CHAR_CODE('dsp ')
|
||||
kAwacsSubType = FOUR_CHAR_CODE('awac')
|
||||
kGCAwacsSubType = FOUR_CHAR_CODE('awgc')
|
||||
kSingerSubType = FOUR_CHAR_CODE('sing')
|
||||
kSinger2SubType = FOUR_CHAR_CODE('sng2')
|
||||
kWhitSubType = FOUR_CHAR_CODE('whit')
|
||||
kSoundBlasterSubType = FOUR_CHAR_CODE('sbls')
|
||||
kWaveOutSubType = FOUR_CHAR_CODE('wavo')
|
||||
kWaveOutSnifferSubType = FOUR_CHAR_CODE('wosn')
|
||||
kDirectSoundSubType = FOUR_CHAR_CODE('dsnd')
|
||||
kDirectSoundSnifferSubType = FOUR_CHAR_CODE('dssn')
|
||||
kUNIXsdevSubType = FOUR_CHAR_CODE('un1x')
|
||||
kUSBSubType = FOUR_CHAR_CODE('usb ')
|
||||
kBlueBoxSubType = FOUR_CHAR_CODE('bsnd')
|
||||
kSoundCompressor = FOUR_CHAR_CODE('scom')
|
||||
kSoundDecompressor = FOUR_CHAR_CODE('sdec')
|
||||
kAudioComponentType = FOUR_CHAR_CODE('adio')
|
||||
kAwacsPhoneSubType = FOUR_CHAR_CODE('hphn')
|
||||
kAudioVisionSpeakerSubType = FOUR_CHAR_CODE('telc')
|
||||
kAudioVisionHeadphoneSubType = FOUR_CHAR_CODE('telh')
|
||||
kPhilipsFaderSubType = FOUR_CHAR_CODE('tvav')
|
||||
kSGSToneSubType = FOUR_CHAR_CODE('sgs0')
|
||||
kSoundEffectsType = FOUR_CHAR_CODE('snfx')
|
||||
kEqualizerSubType = FOUR_CHAR_CODE('eqal')
|
||||
kSSpLocalizationSubType = FOUR_CHAR_CODE('snd3')
|
||||
kSoundNotCompressed = FOUR_CHAR_CODE('NONE')
|
||||
k8BitOffsetBinaryFormat = FOUR_CHAR_CODE('raw ')
|
||||
k16BitBigEndianFormat = FOUR_CHAR_CODE('twos')
|
||||
k16BitLittleEndianFormat = FOUR_CHAR_CODE('sowt')
|
||||
kFloat32Format = FOUR_CHAR_CODE('fl32')
|
||||
kFloat64Format = FOUR_CHAR_CODE('fl64')
|
||||
k24BitFormat = FOUR_CHAR_CODE('in24')
|
||||
k32BitFormat = FOUR_CHAR_CODE('in32')
|
||||
k32BitLittleEndianFormat = FOUR_CHAR_CODE('23ni')
|
||||
kMACE3Compression = FOUR_CHAR_CODE('MAC3')
|
||||
kMACE6Compression = FOUR_CHAR_CODE('MAC6')
|
||||
kCDXA4Compression = FOUR_CHAR_CODE('cdx4')
|
||||
kCDXA2Compression = FOUR_CHAR_CODE('cdx2')
|
||||
kIMACompression = FOUR_CHAR_CODE('ima4')
|
||||
kULawCompression = FOUR_CHAR_CODE('ulaw')
|
||||
kALawCompression = FOUR_CHAR_CODE('alaw')
|
||||
kMicrosoftADPCMFormat = 0x6D730002
|
||||
kDVIIntelIMAFormat = 0x6D730011
|
||||
kDVAudioFormat = FOUR_CHAR_CODE('dvca')
|
||||
kQDesignCompression = FOUR_CHAR_CODE('QDMC')
|
||||
kQDesign2Compression = FOUR_CHAR_CODE('QDM2')
|
||||
kQUALCOMMCompression = FOUR_CHAR_CODE('Qclp')
|
||||
kOffsetBinary = k8BitOffsetBinaryFormat
|
||||
kTwosComplement = k16BitBigEndianFormat
|
||||
kLittleEndianFormat = k16BitLittleEndianFormat
|
||||
kMPEGLayer3Format = 0x6D730055
|
||||
kFullMPEGLay3Format = FOUR_CHAR_CODE('.mp3')
|
||||
k16BitNativeEndianFormat = k16BitLittleEndianFormat
|
||||
k16BitNonNativeEndianFormat = k16BitBigEndianFormat
|
||||
k16BitNativeEndianFormat = k16BitBigEndianFormat
|
||||
k16BitNonNativeEndianFormat = k16BitLittleEndianFormat
|
||||
k8BitRawIn = (1 << 0)
|
||||
k8BitTwosIn = (1 << 1)
|
||||
k16BitIn = (1 << 2)
|
||||
kStereoIn = (1 << 3)
|
||||
k8BitRawOut = (1 << 8)
|
||||
k8BitTwosOut = (1 << 9)
|
||||
k16BitOut = (1 << 10)
|
||||
kStereoOut = (1 << 11)
|
||||
kReverse = (1 << 16)
|
||||
kRateConvert = (1 << 17)
|
||||
kCreateSoundSource = (1 << 18)
|
||||
kVMAwareness = (1 << 21)
|
||||
kHighQuality = (1 << 22)
|
||||
kNonRealTime = (1 << 23)
|
||||
kSourcePaused = (1 << 0)
|
||||
kPassThrough = (1 << 16)
|
||||
kNoSoundComponentChain = (1 << 17)
|
||||
kNoMixing = (1 << 0)
|
||||
kNoSampleRateConversion = (1 << 1)
|
||||
kNoSampleSizeConversion = (1 << 2)
|
||||
kNoSampleFormatConversion = (1 << 3)
|
||||
kNoChannelConversion = (1 << 4)
|
||||
kNoDecompression = (1 << 5)
|
||||
kNoVolumeConversion = (1 << 6)
|
||||
kNoRealtimeProcessing = (1 << 7)
|
||||
kScheduledSource = (1 << 8)
|
||||
kNonInterleavedBuffer = (1 << 9)
|
||||
kNonPagingMixer = (1 << 10)
|
||||
kSoundConverterMixer = (1 << 11)
|
||||
kPagingMixer = (1 << 12)
|
||||
kVMAwareMixer = (1 << 13)
|
||||
kExtendedSoundData = (1 << 14)
|
||||
kBestQuality = (1 << 0)
|
||||
kInputMask = 0x000000FF
|
||||
kOutputMask = 0x0000FF00
|
||||
kOutputShift = 8
|
||||
kActionMask = 0x00FF0000
|
||||
kSoundComponentBits = 0x00FFFFFF
|
||||
kAudioFormatAtomType = FOUR_CHAR_CODE('frma')
|
||||
kAudioEndianAtomType = FOUR_CHAR_CODE('enda')
|
||||
kAudioVBRAtomType = FOUR_CHAR_CODE('vbra')
|
||||
kAudioTerminatorAtomType = 0
|
||||
kAVDisplayHeadphoneRemove = 0
|
||||
kAVDisplayHeadphoneInsert = 1
|
||||
kAVDisplayPlainTalkRemove = 2
|
||||
kAVDisplayPlainTalkInsert = 3
|
||||
audioAllChannels = 0
|
||||
audioLeftChannel = 1
|
||||
audioRightChannel = 2
|
||||
audioUnmuted = 0
|
||||
audioMuted = 1
|
||||
audioDoesMono = (1 << 0)
|
||||
audioDoesStereo = (1 << 1)
|
||||
audioDoesIndependentChannels = (1 << 2)
|
||||
siCDQuality = FOUR_CHAR_CODE('cd ')
|
||||
siBestQuality = FOUR_CHAR_CODE('best')
|
||||
siBetterQuality = FOUR_CHAR_CODE('betr')
|
||||
siGoodQuality = FOUR_CHAR_CODE('good')
|
||||
siNoneQuality = FOUR_CHAR_CODE('none')
|
||||
siDeviceIsConnected = 1
|
||||
siDeviceNotConnected = 0
|
||||
siDontKnowIfConnected = -1
|
||||
siReadPermission = 0
|
||||
siWritePermission = 1
|
||||
kSoundConverterDidntFillBuffer = (1 << 0)
|
||||
kSoundConverterHasLeftOverData = (1 << 1)
|
||||
kExtendedSoundSampleCountNotValid = 1 << 0
|
||||
kExtendedSoundBufferSizeValid = 1 << 1
|
||||
kScheduledSoundDoScheduled = 1 << 0
|
||||
kScheduledSoundDoCallBack = 1 << 1
|
||||
kScheduledSoundExtendedHdr = 1 << 2
|
||||
kSoundComponentInitOutputDeviceSelect = 0x0001
|
||||
kSoundComponentSetSourceSelect = 0x0002
|
||||
kSoundComponentGetSourceSelect = 0x0003
|
||||
kSoundComponentGetSourceDataSelect = 0x0004
|
||||
kSoundComponentSetOutputSelect = 0x0005
|
||||
kSoundComponentAddSourceSelect = 0x0101
|
||||
kSoundComponentRemoveSourceSelect = 0x0102
|
||||
kSoundComponentGetInfoSelect = 0x0103
|
||||
kSoundComponentSetInfoSelect = 0x0104
|
||||
kSoundComponentStartSourceSelect = 0x0105
|
||||
kSoundComponentStopSourceSelect = 0x0106
|
||||
kSoundComponentPauseSourceSelect = 0x0107
|
||||
kSoundComponentPlaySourceBufferSelect = 0x0108
|
||||
kAudioGetVolumeSelect = 0x0000
|
||||
kAudioSetVolumeSelect = 0x0001
|
||||
kAudioGetMuteSelect = 0x0002
|
||||
kAudioSetMuteSelect = 0x0003
|
||||
kAudioSetToDefaultsSelect = 0x0004
|
||||
kAudioGetInfoSelect = 0x0005
|
||||
kAudioGetBassSelect = 0x0006
|
||||
kAudioSetBassSelect = 0x0007
|
||||
kAudioGetTrebleSelect = 0x0008
|
||||
kAudioSetTrebleSelect = 0x0009
|
||||
kAudioGetOutputDeviceSelect = 0x000A
|
||||
kAudioMuteOnEventSelect = 0x0081
|
||||
kDelegatedSoundComponentSelectors = 0x0100
|
||||
kSndInputReadAsyncSelect = 0x0001
|
||||
kSndInputReadSyncSelect = 0x0002
|
||||
kSndInputPauseRecordingSelect = 0x0003
|
||||
kSndInputResumeRecordingSelect = 0x0004
|
||||
kSndInputStopRecordingSelect = 0x0005
|
||||
kSndInputGetStatusSelect = 0x0006
|
||||
kSndInputGetDeviceInfoSelect = 0x0007
|
||||
kSndInputSetDeviceInfoSelect = 0x0008
|
||||
kSndInputInitHardwareSelect = 0x0009
|
|
@ -1 +0,0 @@
|
|||
from _TE import *
|
|
@ -1,57 +0,0 @@
|
|||
# Generated from 'TextEdit.h'
|
||||
|
||||
teJustLeft = 0
|
||||
teJustCenter = 1
|
||||
teJustRight = -1
|
||||
teForceLeft = -2
|
||||
teFlushDefault = 0
|
||||
teCenter = 1
|
||||
teFlushRight = -1
|
||||
teFlushLeft = -2
|
||||
fontBit = 0
|
||||
faceBit = 1
|
||||
sizeBit = 2
|
||||
clrBit = 3
|
||||
addSizeBit = 4
|
||||
toggleBit = 5
|
||||
doFont = 1
|
||||
doFace = 2
|
||||
doSize = 4
|
||||
doColor = 8
|
||||
doAll = 15
|
||||
addSize = 16
|
||||
doToggle = 32
|
||||
EOLHook = 0
|
||||
DRAWHook = 4
|
||||
WIDTHHook = 8
|
||||
HITTESTHook = 12
|
||||
nWIDTHHook = 24
|
||||
TextWidthHook = 28
|
||||
intEOLHook = 0
|
||||
intDrawHook = 1
|
||||
intWidthHook = 2
|
||||
intHitTestHook = 3
|
||||
intNWidthHook = 6
|
||||
intTextWidthHook = 7
|
||||
intInlineInputTSMTEPreUpdateHook = 8
|
||||
intInlineInputTSMTEPostUpdateHook = 9
|
||||
teFAutoScroll = 0
|
||||
teFTextBuffering = 1
|
||||
teFOutlineHilite = 2
|
||||
teFInlineInput = 3
|
||||
teFUseWhiteBackground = 4
|
||||
teFUseInlineInput = 5
|
||||
teFInlineInputAutoScroll = 6
|
||||
teFIdleWithEventLoopTimer = 7
|
||||
teBitClear = 0
|
||||
teBitSet = 1
|
||||
teBitTest = -1
|
||||
teWordSelect = 4
|
||||
teWordDrag = 8
|
||||
teFromFind = 12
|
||||
teFromRecal = 16
|
||||
teFind = 0
|
||||
teHighlight = 1
|
||||
teDraw = -1
|
||||
teCaret = -2
|
||||
teFUseTextServices = 4
|
|
@ -1 +0,0 @@
|
|||
from _Win import *
|
|
@ -1,279 +0,0 @@
|
|||
# Generated from 'MacWindows.h'
|
||||
|
||||
def FOUR_CHAR_CODE(x): return x
|
||||
false = 0
|
||||
true = 1
|
||||
kWindowNoConstrainAttribute = 0x80000000
|
||||
kAlertWindowClass = 1
|
||||
kMovableAlertWindowClass = 2
|
||||
kModalWindowClass = 3
|
||||
kMovableModalWindowClass = 4
|
||||
kFloatingWindowClass = 5
|
||||
kDocumentWindowClass = 6
|
||||
kUtilityWindowClass = 8
|
||||
kHelpWindowClass = 10
|
||||
kSheetWindowClass = 11
|
||||
kToolbarWindowClass = 12
|
||||
kPlainWindowClass = 13
|
||||
kOverlayWindowClass = 14
|
||||
kSheetAlertWindowClass = 15
|
||||
kAltPlainWindowClass = 16
|
||||
kDrawerWindowClass = 20
|
||||
# kAllWindowClasses = (unsigned long)0xFFFFFFFF
|
||||
kWindowNoAttributes = 0
|
||||
kWindowCloseBoxAttribute = (1 << 0)
|
||||
kWindowHorizontalZoomAttribute = (1 << 1)
|
||||
kWindowVerticalZoomAttribute = (1 << 2)
|
||||
kWindowFullZoomAttribute = (kWindowVerticalZoomAttribute | kWindowHorizontalZoomAttribute)
|
||||
kWindowCollapseBoxAttribute = (1 << 3)
|
||||
kWindowResizableAttribute = (1 << 4)
|
||||
kWindowSideTitlebarAttribute = (1 << 5)
|
||||
kWindowToolbarButtonAttribute = (1 << 6)
|
||||
kWindowNoUpdatesAttribute = (1 << 16)
|
||||
kWindowNoActivatesAttribute = (1 << 17)
|
||||
kWindowOpaqueForEventsAttribute = (1 << 18)
|
||||
kWindowNoShadowAttribute = (1 << 21)
|
||||
kWindowHideOnSuspendAttribute = (1 << 24)
|
||||
kWindowStandardHandlerAttribute = (1 << 25)
|
||||
kWindowHideOnFullScreenAttribute = (1 << 26)
|
||||
kWindowInWindowMenuAttribute = (1 << 27)
|
||||
kWindowLiveResizeAttribute = (1 << 28)
|
||||
# kWindowNoConstrainAttribute = (unsigned long)((1L << 31))
|
||||
kWindowStandardDocumentAttributes = (kWindowCloseBoxAttribute | kWindowFullZoomAttribute | kWindowCollapseBoxAttribute | kWindowResizableAttribute)
|
||||
kWindowStandardFloatingAttributes = (kWindowCloseBoxAttribute | kWindowCollapseBoxAttribute)
|
||||
kWindowDefProcType = FOUR_CHAR_CODE('WDEF')
|
||||
kStandardWindowDefinition = 0
|
||||
kRoundWindowDefinition = 1
|
||||
kFloatingWindowDefinition = 124
|
||||
kDocumentWindowVariantCode = 0
|
||||
kModalDialogVariantCode = 1
|
||||
kPlainDialogVariantCode = 2
|
||||
kShadowDialogVariantCode = 3
|
||||
kMovableModalDialogVariantCode = 5
|
||||
kAlertVariantCode = 7
|
||||
kMovableAlertVariantCode = 9
|
||||
kSideFloaterVariantCode = 8
|
||||
documentProc = 0
|
||||
dBoxProc = 1
|
||||
plainDBox = 2
|
||||
altDBoxProc = 3
|
||||
noGrowDocProc = 4
|
||||
movableDBoxProc = 5
|
||||
zoomDocProc = 8
|
||||
zoomNoGrow = 12
|
||||
floatProc = 1985
|
||||
floatGrowProc = 1987
|
||||
floatZoomProc = 1989
|
||||
floatZoomGrowProc = 1991
|
||||
floatSideProc = 1993
|
||||
floatSideGrowProc = 1995
|
||||
floatSideZoomProc = 1997
|
||||
floatSideZoomGrowProc = 1999
|
||||
rDocProc = 16
|
||||
kWindowDocumentDefProcResID = 64
|
||||
kWindowDialogDefProcResID = 65
|
||||
kWindowUtilityDefProcResID = 66
|
||||
kWindowUtilitySideTitleDefProcResID = 67
|
||||
kWindowSheetDefProcResID = 68
|
||||
kWindowSimpleDefProcResID = 69
|
||||
kWindowSheetAlertDefProcResID = 70
|
||||
kWindowDocumentProc = 1024
|
||||
kWindowGrowDocumentProc = 1025
|
||||
kWindowVertZoomDocumentProc = 1026
|
||||
kWindowVertZoomGrowDocumentProc = 1027
|
||||
kWindowHorizZoomDocumentProc = 1028
|
||||
kWindowHorizZoomGrowDocumentProc = 1029
|
||||
kWindowFullZoomDocumentProc = 1030
|
||||
kWindowFullZoomGrowDocumentProc = 1031
|
||||
kWindowPlainDialogProc = 1040
|
||||
kWindowShadowDialogProc = 1041
|
||||
kWindowModalDialogProc = 1042
|
||||
kWindowMovableModalDialogProc = 1043
|
||||
kWindowAlertProc = 1044
|
||||
kWindowMovableAlertProc = 1045
|
||||
kWindowMovableModalGrowProc = 1046
|
||||
kWindowFloatProc = 1057
|
||||
kWindowFloatGrowProc = 1059
|
||||
kWindowFloatVertZoomProc = 1061
|
||||
kWindowFloatVertZoomGrowProc = 1063
|
||||
kWindowFloatHorizZoomProc = 1065
|
||||
kWindowFloatHorizZoomGrowProc = 1067
|
||||
kWindowFloatFullZoomProc = 1069
|
||||
kWindowFloatFullZoomGrowProc = 1071
|
||||
kWindowFloatSideProc = 1073
|
||||
kWindowFloatSideGrowProc = 1075
|
||||
kWindowFloatSideVertZoomProc = 1077
|
||||
kWindowFloatSideVertZoomGrowProc = 1079
|
||||
kWindowFloatSideHorizZoomProc = 1081
|
||||
kWindowFloatSideHorizZoomGrowProc = 1083
|
||||
kWindowFloatSideFullZoomProc = 1085
|
||||
kWindowFloatSideFullZoomGrowProc = 1087
|
||||
kWindowSheetProc = 1088
|
||||
kWindowSheetAlertProc = 1120
|
||||
kWindowSimpleProc = 1104
|
||||
kWindowSimpleFrameProc = 1105
|
||||
kWindowNoPosition = 0x0000
|
||||
kWindowDefaultPosition = 0x0000
|
||||
kWindowCenterMainScreen = 0x280A
|
||||
kWindowAlertPositionMainScreen = 0x300A
|
||||
kWindowStaggerMainScreen = 0x380A
|
||||
kWindowCenterParentWindow = 0xA80A
|
||||
kWindowAlertPositionParentWindow = 0xB00A
|
||||
kWindowStaggerParentWindow = 0xB80A
|
||||
kWindowCenterParentWindowScreen = 0x680A
|
||||
kWindowAlertPositionParentWindowScreen = 0x700A
|
||||
kWindowStaggerParentWindowScreen = 0x780A
|
||||
kWindowCenterOnMainScreen = 1
|
||||
kWindowCenterOnParentWindow = 2
|
||||
kWindowCenterOnParentWindowScreen = 3
|
||||
kWindowCascadeOnMainScreen = 4
|
||||
kWindowCascadeOnParentWindow = 5
|
||||
kWindowCascadeOnParentWindowScreen = 6
|
||||
kWindowCascadeStartAtParentWindowScreen = 10
|
||||
kWindowAlertPositionOnMainScreen = 7
|
||||
kWindowAlertPositionOnParentWindow = 8
|
||||
kWindowAlertPositionOnParentWindowScreen = 9
|
||||
kWindowTitleBarRgn = 0
|
||||
kWindowTitleTextRgn = 1
|
||||
kWindowCloseBoxRgn = 2
|
||||
kWindowZoomBoxRgn = 3
|
||||
kWindowDragRgn = 5
|
||||
kWindowGrowRgn = 6
|
||||
kWindowCollapseBoxRgn = 7
|
||||
kWindowTitleProxyIconRgn = 8
|
||||
kWindowStructureRgn = 32
|
||||
kWindowContentRgn = 33
|
||||
kWindowUpdateRgn = 34
|
||||
kWindowOpaqueRgn = 35
|
||||
kWindowGlobalPortRgn = 40
|
||||
dialogKind = 2
|
||||
userKind = 8
|
||||
kDialogWindowKind = 2
|
||||
kApplicationWindowKind = 8
|
||||
inDesk = 0
|
||||
inNoWindow = 0
|
||||
inMenuBar = 1
|
||||
inSysWindow = 2
|
||||
inContent = 3
|
||||
inDrag = 4
|
||||
inGrow = 5
|
||||
inGoAway = 6
|
||||
inZoomIn = 7
|
||||
inZoomOut = 8
|
||||
inCollapseBox = 11
|
||||
inProxyIcon = 12
|
||||
inToolbarButton = 13
|
||||
inStructure = 15
|
||||
wNoHit = 0
|
||||
wInContent = 1
|
||||
wInDrag = 2
|
||||
wInGrow = 3
|
||||
wInGoAway = 4
|
||||
wInZoomIn = 5
|
||||
wInZoomOut = 6
|
||||
wInCollapseBox = 9
|
||||
wInProxyIcon = 10
|
||||
wInToolbarButton = 11
|
||||
wInStructure = 13
|
||||
kWindowMsgDraw = 0
|
||||
kWindowMsgHitTest = 1
|
||||
kWindowMsgCalculateShape = 2
|
||||
kWindowMsgInitialize = 3
|
||||
kWindowMsgCleanUp = 4
|
||||
kWindowMsgDrawGrowOutline = 5
|
||||
kWindowMsgDrawGrowBox = 6
|
||||
kWindowMsgGetFeatures = 7
|
||||
kWindowMsgGetRegion = 8
|
||||
kWindowMsgDragHilite = 9
|
||||
kWindowMsgModified = 10
|
||||
kWindowMsgDrawInCurrentPort = 11
|
||||
kWindowMsgSetupProxyDragImage = 12
|
||||
kWindowMsgStateChanged = 13
|
||||
kWindowMsgMeasureTitle = 14
|
||||
kWindowMsgGetGrowImageRegion = 19
|
||||
wDraw = 0
|
||||
wHit = 1
|
||||
wCalcRgns = 2
|
||||
wNew = 3
|
||||
wDispose = 4
|
||||
wGrow = 5
|
||||
wDrawGIcon = 6
|
||||
kWindowStateTitleChanged = (1 << 0)
|
||||
kWindowCanGrow = (1 << 0)
|
||||
kWindowCanZoom = (1 << 1)
|
||||
kWindowCanCollapse = (1 << 2)
|
||||
kWindowIsModal = (1 << 3)
|
||||
kWindowCanGetWindowRegion = (1 << 4)
|
||||
kWindowIsAlert = (1 << 5)
|
||||
kWindowHasTitleBar = (1 << 6)
|
||||
kWindowSupportsDragHilite = (1 << 7)
|
||||
kWindowSupportsModifiedBit = (1 << 8)
|
||||
kWindowCanDrawInCurrentPort = (1 << 9)
|
||||
kWindowCanSetupProxyDragImage = (1 << 10)
|
||||
kWindowCanMeasureTitle = (1 << 11)
|
||||
kWindowWantsDisposeAtProcessDeath = (1 << 12)
|
||||
kWindowSupportsGetGrowImageRegion = (1 << 13)
|
||||
kWindowDefSupportsColorGrafPort = 0x40000002
|
||||
kWindowIsOpaque = (1 << 14)
|
||||
kWindowSupportsSetGrowImageRegion = (1 << 13)
|
||||
deskPatID = 16
|
||||
wContentColor = 0
|
||||
wFrameColor = 1
|
||||
wTextColor = 2
|
||||
wHiliteColor = 3
|
||||
wTitleBarColor = 4
|
||||
# kMouseUpOutOfSlop = (long)0x80008000
|
||||
kWindowDefinitionVersionOne = 1
|
||||
kWindowDefinitionVersionTwo = 2
|
||||
kWindowIsCollapsedState = (1 << 0)
|
||||
kStoredWindowSystemTag = FOUR_CHAR_CODE('appl')
|
||||
kStoredBasicWindowDescriptionID = FOUR_CHAR_CODE('sbas')
|
||||
kStoredWindowPascalTitleID = FOUR_CHAR_CODE('s255')
|
||||
kWindowDefProcPtr = 0
|
||||
kWindowDefObjectClass = 1
|
||||
kWindowDefProcID = 2
|
||||
kWindowModalityNone = 0
|
||||
kWindowModalitySystemModal = 1
|
||||
kWindowModalityAppModal = 2
|
||||
kWindowModalityWindowModal = 3
|
||||
kWindowGroupAttrSelectAsLayer = 1 << 0
|
||||
kWindowGroupAttrMoveTogether = 1 << 1
|
||||
kWindowGroupAttrLayerTogether = 1 << 2
|
||||
kWindowGroupAttrSharedActivation = 1 << 3
|
||||
kWindowGroupAttrHideOnCollapse = 1 << 4
|
||||
kWindowActivationScopeNone = 0
|
||||
kWindowActivationScopeIndependent = 1
|
||||
kWindowActivationScopeAll = 2
|
||||
kNextWindowGroup = true
|
||||
kPreviousWindowGroup = false
|
||||
kWindowGroupContentsReturnWindows = 1 << 0
|
||||
kWindowGroupContentsRecurse = 1 << 1
|
||||
kWindowGroupContentsVisible = 1 << 2
|
||||
kWindowPaintProcOptionsNone = 0
|
||||
kScrollWindowNoOptions = 0
|
||||
kScrollWindowInvalidate = (1 << 0)
|
||||
kScrollWindowEraseToPortBackground = (1 << 1)
|
||||
kWindowMenuIncludeRotate = 1 << 0
|
||||
kWindowZoomTransitionEffect = 1
|
||||
kWindowSheetTransitionEffect = 2
|
||||
kWindowSlideTransitionEffect = 3
|
||||
kWindowShowTransitionAction = 1
|
||||
kWindowHideTransitionAction = 2
|
||||
kWindowMoveTransitionAction = 3
|
||||
kWindowResizeTransitionAction = 4
|
||||
kWindowConstrainMayResize = (1 << 0)
|
||||
kWindowConstrainMoveRegardlessOfFit = (1 << 1)
|
||||
kWindowConstrainAllowPartial = (1 << 2)
|
||||
kWindowConstrainCalcOnly = (1 << 3)
|
||||
kWindowConstrainUseTransitionWindow = (1 << 4)
|
||||
kWindowConstrainStandardOptions = kWindowConstrainMoveRegardlessOfFit
|
||||
kWindowLatentVisibleFloater = 1 << 0
|
||||
kWindowLatentVisibleSuspend = 1 << 1
|
||||
kWindowLatentVisibleFullScreen = 1 << 2
|
||||
kWindowLatentVisibleAppHidden = 1 << 3
|
||||
kWindowLatentVisibleCollapsedOwner = 1 << 4
|
||||
kWindowLatentVisibleCollapsedGroup = 1 << 5
|
||||
kWindowPropertyPersistent = 0x00000001
|
||||
kWindowGroupAttrSelectable = kWindowGroupAttrSelectAsLayer
|
||||
kWindowGroupAttrPositionFixed = kWindowGroupAttrMoveTogether
|
||||
kWindowGroupAttrZOrderFixed = kWindowGroupAttrLayerTogether
|
|
@ -1,4 +0,0 @@
|
|||
# Filter out warnings about signed/unsigned constants
|
||||
import warnings
|
||||
warnings.filterwarnings("ignore", "", FutureWarning, ".*Controls")
|
||||
warnings.filterwarnings("ignore", "", FutureWarning, ".*MacTextEditor")
|
|
@ -1,837 +0,0 @@
|
|||
"""Easy to use dialogs.
|
||||
|
||||
Message(msg) -- display a message and an OK button.
|
||||
AskString(prompt, default) -- ask for a string, display OK and Cancel buttons.
|
||||
AskPassword(prompt, default) -- like AskString(), but shows text as bullets.
|
||||
AskYesNoCancel(question, default) -- display a question and Yes, No and Cancel buttons.
|
||||
GetArgv(optionlist, commandlist) -- fill a sys.argv-like list using a dialog
|
||||
AskFileForOpen(...) -- Ask the user for an existing file
|
||||
AskFileForSave(...) -- Ask the user for an output file
|
||||
AskFolder(...) -- Ask the user to select a folder
|
||||
bar = Progress(label, maxvalue) -- Display a progress bar
|
||||
bar.set(value) -- Set value
|
||||
bar.inc( *amount ) -- increment value by amount (default=1)
|
||||
bar.label( *newlabel ) -- get or set text label.
|
||||
|
||||
More documentation in each function.
|
||||
This module uses DLOG resources 260 and on.
|
||||
Based upon STDWIN dialogs with the same names and functions.
|
||||
"""
|
||||
|
||||
from Carbon.Dlg import GetNewDialog, SetDialogItemText, GetDialogItemText, ModalDialog
|
||||
from Carbon import Qd
|
||||
from Carbon import QuickDraw
|
||||
from Carbon import Dialogs
|
||||
from Carbon import Windows
|
||||
from Carbon import Dlg,Win,Evt,Events # sdm7g
|
||||
from Carbon import Ctl
|
||||
from Carbon import Controls
|
||||
from Carbon import Menu
|
||||
from Carbon import AE
|
||||
import Nav
|
||||
import MacOS
|
||||
from Carbon.ControlAccessor import * # Also import Controls constants
|
||||
import Carbon.File
|
||||
import macresource
|
||||
import os
|
||||
import sys
|
||||
|
||||
__all__ = ['Message', 'AskString', 'AskPassword', 'AskYesNoCancel',
|
||||
'GetArgv', 'AskFileForOpen', 'AskFileForSave', 'AskFolder',
|
||||
'ProgressBar']
|
||||
|
||||
_initialized = 0
|
||||
|
||||
def _initialize():
|
||||
global _initialized
|
||||
if _initialized: return
|
||||
macresource.need("DLOG", 260, "dialogs.rsrc", __name__)
|
||||
|
||||
def _interact():
|
||||
"""Make sure the application is in the foreground"""
|
||||
AE.AEInteractWithUser(50000000)
|
||||
|
||||
def cr2lf(text):
|
||||
if '\r' in text:
|
||||
text = '\n'.join(text.split('\r'))
|
||||
return text
|
||||
|
||||
def lf2cr(text):
|
||||
if '\n' in text:
|
||||
text = '\r'.join(text.split('\n'))
|
||||
if len(text) > 253:
|
||||
text = text[:253] + '\311'
|
||||
return text
|
||||
|
||||
def Message(msg, id=260, ok=None):
|
||||
"""Display a MESSAGE string.
|
||||
|
||||
Return when the user clicks the OK button or presses Return.
|
||||
|
||||
The MESSAGE string can be at most 255 characters long.
|
||||
"""
|
||||
_initialize()
|
||||
_interact()
|
||||
d = GetNewDialog(id, -1)
|
||||
if not d:
|
||||
print("EasyDialogs: Can't get DLOG resource with id =", id, " (missing resource file?)")
|
||||
return
|
||||
h = d.GetDialogItemAsControl(2)
|
||||
SetDialogItemText(h, lf2cr(msg))
|
||||
if ok is not None:
|
||||
h = d.GetDialogItemAsControl(1)
|
||||
h.SetControlTitle(ok)
|
||||
d.SetDialogDefaultItem(1)
|
||||
d.AutoSizeDialog()
|
||||
d.GetDialogWindow().ShowWindow()
|
||||
while 1:
|
||||
n = ModalDialog(None)
|
||||
if n == 1:
|
||||
return
|
||||
|
||||
|
||||
def AskString(prompt, default = "", id=261, ok=None, cancel=None):
|
||||
"""Display a PROMPT string and a text entry field with a DEFAULT string.
|
||||
|
||||
Return the contents of the text entry field when the user clicks the
|
||||
OK button or presses Return.
|
||||
Return None when the user clicks the Cancel button.
|
||||
|
||||
If omitted, DEFAULT is empty.
|
||||
|
||||
The PROMPT and DEFAULT strings, as well as the return value,
|
||||
can be at most 255 characters long.
|
||||
"""
|
||||
|
||||
_initialize()
|
||||
_interact()
|
||||
d = GetNewDialog(id, -1)
|
||||
if not d:
|
||||
print("EasyDialogs: Can't get DLOG resource with id =", id, " (missing resource file?)")
|
||||
return
|
||||
h = d.GetDialogItemAsControl(3)
|
||||
SetDialogItemText(h, lf2cr(prompt))
|
||||
h = d.GetDialogItemAsControl(4)
|
||||
SetDialogItemText(h, lf2cr(default))
|
||||
d.SelectDialogItemText(4, 0, 999)
|
||||
# d.SetDialogItem(4, 0, 255)
|
||||
if ok is not None:
|
||||
h = d.GetDialogItemAsControl(1)
|
||||
h.SetControlTitle(ok)
|
||||
if cancel is not None:
|
||||
h = d.GetDialogItemAsControl(2)
|
||||
h.SetControlTitle(cancel)
|
||||
d.SetDialogDefaultItem(1)
|
||||
d.SetDialogCancelItem(2)
|
||||
d.AutoSizeDialog()
|
||||
d.GetDialogWindow().ShowWindow()
|
||||
while 1:
|
||||
n = ModalDialog(None)
|
||||
if n == 1:
|
||||
h = d.GetDialogItemAsControl(4)
|
||||
return cr2lf(GetDialogItemText(h))
|
||||
if n == 2: return None
|
||||
|
||||
def AskPassword(prompt, default='', id=264, ok=None, cancel=None):
|
||||
"""Display a PROMPT string and a text entry field with a DEFAULT string.
|
||||
The string is displayed as bullets only.
|
||||
|
||||
Return the contents of the text entry field when the user clicks the
|
||||
OK button or presses Return.
|
||||
Return None when the user clicks the Cancel button.
|
||||
|
||||
If omitted, DEFAULT is empty.
|
||||
|
||||
The PROMPT and DEFAULT strings, as well as the return value,
|
||||
can be at most 255 characters long.
|
||||
"""
|
||||
_initialize()
|
||||
_interact()
|
||||
d = GetNewDialog(id, -1)
|
||||
if not d:
|
||||
print("EasyDialogs: Can't get DLOG resource with id =", id, " (missing resource file?)")
|
||||
return
|
||||
h = d.GetDialogItemAsControl(3)
|
||||
SetDialogItemText(h, lf2cr(prompt))
|
||||
pwd = d.GetDialogItemAsControl(4)
|
||||
bullets = '\245'*len(default)
|
||||
## SetControlData(pwd, kControlEditTextPart, kControlEditTextTextTag, bullets)
|
||||
SetControlData(pwd, kControlEditTextPart, kControlEditTextPasswordTag, default)
|
||||
d.SelectDialogItemText(4, 0, 999)
|
||||
Ctl.SetKeyboardFocus(d.GetDialogWindow(), pwd, kControlEditTextPart)
|
||||
if ok is not None:
|
||||
h = d.GetDialogItemAsControl(1)
|
||||
h.SetControlTitle(ok)
|
||||
if cancel is not None:
|
||||
h = d.GetDialogItemAsControl(2)
|
||||
h.SetControlTitle(cancel)
|
||||
d.SetDialogDefaultItem(Dialogs.ok)
|
||||
d.SetDialogCancelItem(Dialogs.cancel)
|
||||
d.AutoSizeDialog()
|
||||
d.GetDialogWindow().ShowWindow()
|
||||
while 1:
|
||||
n = ModalDialog(None)
|
||||
if n == 1:
|
||||
h = d.GetDialogItemAsControl(4)
|
||||
return cr2lf(GetControlData(pwd, kControlEditTextPart, kControlEditTextPasswordTag))
|
||||
if n == 2: return None
|
||||
|
||||
def AskYesNoCancel(question, default = 0, yes=None, no=None, cancel=None, id=262):
|
||||
"""Display a QUESTION string which can be answered with Yes or No.
|
||||
|
||||
Return 1 when the user clicks the Yes button.
|
||||
Return 0 when the user clicks the No button.
|
||||
Return -1 when the user clicks the Cancel button.
|
||||
|
||||
When the user presses Return, the DEFAULT value is returned.
|
||||
If omitted, this is 0 (No).
|
||||
|
||||
The QUESTION string can be at most 255 characters.
|
||||
"""
|
||||
|
||||
_initialize()
|
||||
_interact()
|
||||
d = GetNewDialog(id, -1)
|
||||
if not d:
|
||||
print("EasyDialogs: Can't get DLOG resource with id =", id, " (missing resource file?)")
|
||||
return
|
||||
# Button assignments:
|
||||
# 1 = default (invisible)
|
||||
# 2 = Yes
|
||||
# 3 = No
|
||||
# 4 = Cancel
|
||||
# The question string is item 5
|
||||
h = d.GetDialogItemAsControl(5)
|
||||
SetDialogItemText(h, lf2cr(question))
|
||||
if yes is not None:
|
||||
if yes == '':
|
||||
d.HideDialogItem(2)
|
||||
else:
|
||||
h = d.GetDialogItemAsControl(2)
|
||||
h.SetControlTitle(yes)
|
||||
if no is not None:
|
||||
if no == '':
|
||||
d.HideDialogItem(3)
|
||||
else:
|
||||
h = d.GetDialogItemAsControl(3)
|
||||
h.SetControlTitle(no)
|
||||
if cancel is not None:
|
||||
if cancel == '':
|
||||
d.HideDialogItem(4)
|
||||
else:
|
||||
h = d.GetDialogItemAsControl(4)
|
||||
h.SetControlTitle(cancel)
|
||||
d.SetDialogCancelItem(4)
|
||||
if default == 1:
|
||||
d.SetDialogDefaultItem(2)
|
||||
elif default == 0:
|
||||
d.SetDialogDefaultItem(3)
|
||||
elif default == -1:
|
||||
d.SetDialogDefaultItem(4)
|
||||
d.AutoSizeDialog()
|
||||
d.GetDialogWindow().ShowWindow()
|
||||
while 1:
|
||||
n = ModalDialog(None)
|
||||
if n == 1: return default
|
||||
if n == 2: return 1
|
||||
if n == 3: return 0
|
||||
if n == 4: return -1
|
||||
|
||||
|
||||
|
||||
|
||||
screenbounds = Qd.GetQDGlobalsScreenBits().bounds
|
||||
screenbounds = screenbounds[0]+4, screenbounds[1]+4, \
|
||||
screenbounds[2]-4, screenbounds[3]-4
|
||||
|
||||
kControlProgressBarIndeterminateTag = 'inde' # from Controls.py
|
||||
|
||||
|
||||
class ProgressBar:
|
||||
def __init__(self, title="Working...", maxval=0, label="", id=263):
|
||||
self.w = None
|
||||
self.d = None
|
||||
_initialize()
|
||||
self.d = GetNewDialog(id, -1)
|
||||
self.w = self.d.GetDialogWindow()
|
||||
self.label(label)
|
||||
self.title(title)
|
||||
self.set(0, maxval)
|
||||
self.d.AutoSizeDialog()
|
||||
self.w.ShowWindow()
|
||||
self.d.DrawDialog()
|
||||
|
||||
def __del__(self):
|
||||
if self.w:
|
||||
self.w.BringToFront()
|
||||
self.w.HideWindow()
|
||||
del self.w
|
||||
del self.d
|
||||
|
||||
def title(self, newstr=""):
|
||||
"""title(text) - Set title of progress window"""
|
||||
self.w.BringToFront()
|
||||
self.w.SetWTitle(newstr)
|
||||
|
||||
def label(self, *newstr):
|
||||
"""label(text) - Set text in progress box"""
|
||||
self.w.BringToFront()
|
||||
if newstr:
|
||||
self._label = lf2cr(newstr[0])
|
||||
text_h = self.d.GetDialogItemAsControl(2)
|
||||
SetDialogItemText(text_h, self._label)
|
||||
|
||||
def _update(self, value):
|
||||
maxval = self.maxval
|
||||
if maxval == 0: # an indeterminate bar
|
||||
Ctl.IdleControls(self.w) # spin the barber pole
|
||||
else: # a determinate bar
|
||||
if maxval > 32767:
|
||||
value = int(value/(maxval/32767.0))
|
||||
maxval = 32767
|
||||
maxval = int(maxval)
|
||||
value = int(value)
|
||||
progbar = self.d.GetDialogItemAsControl(3)
|
||||
progbar.SetControlMaximum(maxval)
|
||||
progbar.SetControlValue(value) # set the bar length
|
||||
|
||||
# Test for cancel button
|
||||
ready, ev = Evt.WaitNextEvent( Events.mDownMask, 1 )
|
||||
if ready :
|
||||
what,msg,when,where,mod = ev
|
||||
part = Win.FindWindow(where)[0]
|
||||
if Dlg.IsDialogEvent(ev):
|
||||
ds = Dlg.DialogSelect(ev)
|
||||
if ds[0] and ds[1] == self.d and ds[-1] == 1:
|
||||
self.w.HideWindow()
|
||||
self.w = None
|
||||
self.d = None
|
||||
raise KeyboardInterrupt(ev)
|
||||
else:
|
||||
if part == 4: # inDrag
|
||||
self.w.DragWindow(where, screenbounds)
|
||||
else:
|
||||
MacOS.HandleEvent(ev)
|
||||
|
||||
|
||||
def set(self, value, max=None):
|
||||
"""set(value) - Set progress bar position"""
|
||||
if max is not None:
|
||||
self.maxval = max
|
||||
bar = self.d.GetDialogItemAsControl(3)
|
||||
if max <= 0: # indeterminate bar
|
||||
bar.SetControlData(0,kControlProgressBarIndeterminateTag,'\x01')
|
||||
else: # determinate bar
|
||||
bar.SetControlData(0,kControlProgressBarIndeterminateTag,'\x00')
|
||||
if value < 0:
|
||||
value = 0
|
||||
elif value > self.maxval:
|
||||
value = self.maxval
|
||||
self.curval = value
|
||||
self._update(value)
|
||||
|
||||
def inc(self, n=1):
|
||||
"""inc(amt) - Increment progress bar position"""
|
||||
self.set(self.curval + n)
|
||||
|
||||
ARGV_ID=265
|
||||
ARGV_ITEM_OK=1
|
||||
ARGV_ITEM_CANCEL=2
|
||||
ARGV_OPTION_GROUP=3
|
||||
ARGV_OPTION_EXPLAIN=4
|
||||
ARGV_OPTION_VALUE=5
|
||||
ARGV_OPTION_ADD=6
|
||||
ARGV_COMMAND_GROUP=7
|
||||
ARGV_COMMAND_EXPLAIN=8
|
||||
ARGV_COMMAND_ADD=9
|
||||
ARGV_ADD_OLDFILE=10
|
||||
ARGV_ADD_NEWFILE=11
|
||||
ARGV_ADD_FOLDER=12
|
||||
ARGV_CMDLINE_GROUP=13
|
||||
ARGV_CMDLINE_DATA=14
|
||||
|
||||
##def _myModalDialog(d):
|
||||
## while 1:
|
||||
## ready, ev = Evt.WaitNextEvent(0xffff, -1)
|
||||
## print 'DBG: WNE', ready, ev
|
||||
## if ready :
|
||||
## what,msg,when,where,mod = ev
|
||||
## part, window = Win.FindWindow(where)
|
||||
## if Dlg.IsDialogEvent(ev):
|
||||
## didit, dlgdone, itemdone = Dlg.DialogSelect(ev)
|
||||
## print 'DBG: DialogSelect', didit, dlgdone, itemdone, d
|
||||
## if didit and dlgdone == d:
|
||||
## return itemdone
|
||||
## elif window == d.GetDialogWindow():
|
||||
## d.GetDialogWindow().SelectWindow()
|
||||
## if part == 4: # inDrag
|
||||
## d.DragWindow(where, screenbounds)
|
||||
## else:
|
||||
## MacOS.HandleEvent(ev)
|
||||
## else:
|
||||
## MacOS.HandleEvent(ev)
|
||||
##
|
||||
def _setmenu(control, items):
|
||||
mhandle = control.GetControlData_Handle(Controls.kControlMenuPart,
|
||||
Controls.kControlPopupButtonMenuHandleTag)
|
||||
menu = Menu.as_Menu(mhandle)
|
||||
for item in items:
|
||||
if type(item) == type(()):
|
||||
label = item[0]
|
||||
else:
|
||||
label = item
|
||||
if label[-1] == '=' or label[-1] == ':':
|
||||
label = label[:-1]
|
||||
menu.AppendMenu(label)
|
||||
## mhandle, mid = menu.getpopupinfo()
|
||||
## control.SetControlData_Handle(Controls.kControlMenuPart,
|
||||
## Controls.kControlPopupButtonMenuHandleTag, mhandle)
|
||||
control.SetControlMinimum(1)
|
||||
control.SetControlMaximum(len(items)+1)
|
||||
|
||||
def _selectoption(d, optionlist, idx):
|
||||
if idx < 0 or idx >= len(optionlist):
|
||||
MacOS.SysBeep()
|
||||
return
|
||||
option = optionlist[idx]
|
||||
if type(option) == type(()):
|
||||
if len(option) == 4:
|
||||
help = option[2]
|
||||
elif len(option) > 1:
|
||||
help = option[-1]
|
||||
else:
|
||||
help = ''
|
||||
else:
|
||||
help = ''
|
||||
h = d.GetDialogItemAsControl(ARGV_OPTION_EXPLAIN)
|
||||
if help and len(help) > 250:
|
||||
help = help[:250] + '...'
|
||||
Dlg.SetDialogItemText(h, help)
|
||||
hasvalue = 0
|
||||
if type(option) == type(()):
|
||||
label = option[0]
|
||||
else:
|
||||
label = option
|
||||
if label[-1] == '=' or label[-1] == ':':
|
||||
hasvalue = 1
|
||||
h = d.GetDialogItemAsControl(ARGV_OPTION_VALUE)
|
||||
Dlg.SetDialogItemText(h, '')
|
||||
if hasvalue:
|
||||
d.ShowDialogItem(ARGV_OPTION_VALUE)
|
||||
d.SelectDialogItemText(ARGV_OPTION_VALUE, 0, 0)
|
||||
else:
|
||||
d.HideDialogItem(ARGV_OPTION_VALUE)
|
||||
|
||||
|
||||
def GetArgv(optionlist=None, commandlist=None, addoldfile=1, addnewfile=1, addfolder=1, id=ARGV_ID):
|
||||
_initialize()
|
||||
_interact()
|
||||
d = GetNewDialog(id, -1)
|
||||
if not d:
|
||||
print("EasyDialogs: Can't get DLOG resource with id =", id, " (missing resource file?)")
|
||||
return
|
||||
# h = d.GetDialogItemAsControl(3)
|
||||
# SetDialogItemText(h, lf2cr(prompt))
|
||||
# h = d.GetDialogItemAsControl(4)
|
||||
# SetDialogItemText(h, lf2cr(default))
|
||||
# d.SelectDialogItemText(4, 0, 999)
|
||||
# d.SetDialogItem(4, 0, 255)
|
||||
if optionlist:
|
||||
_setmenu(d.GetDialogItemAsControl(ARGV_OPTION_GROUP), optionlist)
|
||||
_selectoption(d, optionlist, 0)
|
||||
else:
|
||||
d.GetDialogItemAsControl(ARGV_OPTION_GROUP).DeactivateControl()
|
||||
if commandlist:
|
||||
_setmenu(d.GetDialogItemAsControl(ARGV_COMMAND_GROUP), commandlist)
|
||||
if type(commandlist[0]) == type(()) and len(commandlist[0]) > 1:
|
||||
help = commandlist[0][-1]
|
||||
h = d.GetDialogItemAsControl(ARGV_COMMAND_EXPLAIN)
|
||||
Dlg.SetDialogItemText(h, help)
|
||||
else:
|
||||
d.GetDialogItemAsControl(ARGV_COMMAND_GROUP).DeactivateControl()
|
||||
if not addoldfile:
|
||||
d.GetDialogItemAsControl(ARGV_ADD_OLDFILE).DeactivateControl()
|
||||
if not addnewfile:
|
||||
d.GetDialogItemAsControl(ARGV_ADD_NEWFILE).DeactivateControl()
|
||||
if not addfolder:
|
||||
d.GetDialogItemAsControl(ARGV_ADD_FOLDER).DeactivateControl()
|
||||
d.SetDialogDefaultItem(ARGV_ITEM_OK)
|
||||
d.SetDialogCancelItem(ARGV_ITEM_CANCEL)
|
||||
d.GetDialogWindow().ShowWindow()
|
||||
d.DrawDialog()
|
||||
if hasattr(MacOS, 'SchedParams'):
|
||||
appsw = MacOS.SchedParams(1, 0)
|
||||
try:
|
||||
while 1:
|
||||
stringstoadd = []
|
||||
n = ModalDialog(None)
|
||||
if n == ARGV_ITEM_OK:
|
||||
break
|
||||
elif n == ARGV_ITEM_CANCEL:
|
||||
raise SystemExit
|
||||
elif n == ARGV_OPTION_GROUP:
|
||||
idx = d.GetDialogItemAsControl(ARGV_OPTION_GROUP).GetControlValue()-1
|
||||
_selectoption(d, optionlist, idx)
|
||||
elif n == ARGV_OPTION_VALUE:
|
||||
pass
|
||||
elif n == ARGV_OPTION_ADD:
|
||||
idx = d.GetDialogItemAsControl(ARGV_OPTION_GROUP).GetControlValue()-1
|
||||
if 0 <= idx < len(optionlist):
|
||||
option = optionlist[idx]
|
||||
if type(option) == type(()):
|
||||
option = option[0]
|
||||
if option[-1] == '=' or option[-1] == ':':
|
||||
option = option[:-1]
|
||||
h = d.GetDialogItemAsControl(ARGV_OPTION_VALUE)
|
||||
value = Dlg.GetDialogItemText(h)
|
||||
else:
|
||||
value = ''
|
||||
if len(option) == 1:
|
||||
stringtoadd = '-' + option
|
||||
else:
|
||||
stringtoadd = '--' + option
|
||||
stringstoadd = [stringtoadd]
|
||||
if value:
|
||||
stringstoadd.append(value)
|
||||
else:
|
||||
MacOS.SysBeep()
|
||||
elif n == ARGV_COMMAND_GROUP:
|
||||
idx = d.GetDialogItemAsControl(ARGV_COMMAND_GROUP).GetControlValue()-1
|
||||
if 0 <= idx < len(commandlist) and type(commandlist[idx]) == type(()) and \
|
||||
len(commandlist[idx]) > 1:
|
||||
help = commandlist[idx][-1]
|
||||
h = d.GetDialogItemAsControl(ARGV_COMMAND_EXPLAIN)
|
||||
Dlg.SetDialogItemText(h, help)
|
||||
elif n == ARGV_COMMAND_ADD:
|
||||
idx = d.GetDialogItemAsControl(ARGV_COMMAND_GROUP).GetControlValue()-1
|
||||
if 0 <= idx < len(commandlist):
|
||||
command = commandlist[idx]
|
||||
if type(command) == type(()):
|
||||
command = command[0]
|
||||
stringstoadd = [command]
|
||||
else:
|
||||
MacOS.SysBeep()
|
||||
elif n == ARGV_ADD_OLDFILE:
|
||||
pathname = AskFileForOpen()
|
||||
if pathname:
|
||||
stringstoadd = [pathname]
|
||||
elif n == ARGV_ADD_NEWFILE:
|
||||
pathname = AskFileForSave()
|
||||
if pathname:
|
||||
stringstoadd = [pathname]
|
||||
elif n == ARGV_ADD_FOLDER:
|
||||
pathname = AskFolder()
|
||||
if pathname:
|
||||
stringstoadd = [pathname]
|
||||
elif n == ARGV_CMDLINE_DATA:
|
||||
pass # Nothing to do
|
||||
else:
|
||||
raise RuntimeError("Unknown dialog item %d"%n)
|
||||
|
||||
for stringtoadd in stringstoadd:
|
||||
if '"' in stringtoadd or "'" in stringtoadd or " " in stringtoadd:
|
||||
stringtoadd = repr(stringtoadd)
|
||||
h = d.GetDialogItemAsControl(ARGV_CMDLINE_DATA)
|
||||
oldstr = GetDialogItemText(h)
|
||||
if oldstr and oldstr[-1] != ' ':
|
||||
oldstr = oldstr + ' '
|
||||
oldstr = oldstr + stringtoadd
|
||||
if oldstr[-1] != ' ':
|
||||
oldstr = oldstr + ' '
|
||||
SetDialogItemText(h, oldstr)
|
||||
d.SelectDialogItemText(ARGV_CMDLINE_DATA, 0x7fff, 0x7fff)
|
||||
h = d.GetDialogItemAsControl(ARGV_CMDLINE_DATA)
|
||||
oldstr = GetDialogItemText(h)
|
||||
tmplist = oldstr.split()
|
||||
newlist = []
|
||||
while tmplist:
|
||||
item = tmplist[0]
|
||||
del tmplist[0]
|
||||
if item[0] == '"':
|
||||
while item[-1] != '"':
|
||||
if not tmplist:
|
||||
raise RuntimeError("Unterminated quoted argument")
|
||||
item = item + ' ' + tmplist[0]
|
||||
del tmplist[0]
|
||||
item = item[1:-1]
|
||||
if item[0] == "'":
|
||||
while item[-1] != "'":
|
||||
if not tmplist:
|
||||
raise RuntimeError("Unterminated quoted argument")
|
||||
item = item + ' ' + tmplist[0]
|
||||
del tmplist[0]
|
||||
item = item[1:-1]
|
||||
newlist.append(item)
|
||||
return newlist
|
||||
finally:
|
||||
if hasattr(MacOS, 'SchedParams'):
|
||||
MacOS.SchedParams(*appsw)
|
||||
del d
|
||||
|
||||
def _process_Nav_args(dftflags, **args):
|
||||
import aepack
|
||||
import Carbon.AE
|
||||
import Carbon.File
|
||||
for k in args.keys():
|
||||
if args[k] is None:
|
||||
del args[k]
|
||||
# Set some defaults, and modify some arguments
|
||||
if 'dialogOptionFlags' not in args:
|
||||
args['dialogOptionFlags'] = dftflags
|
||||
if 'defaultLocation' in args and \
|
||||
not isinstance(args['defaultLocation'], Carbon.AE.AEDesc):
|
||||
defaultLocation = args['defaultLocation']
|
||||
if isinstance(defaultLocation, (Carbon.File.FSSpec, Carbon.File.FSRef)):
|
||||
args['defaultLocation'] = aepack.pack(defaultLocation)
|
||||
else:
|
||||
defaultLocation = Carbon.File.FSRef(defaultLocation)
|
||||
args['defaultLocation'] = aepack.pack(defaultLocation)
|
||||
if 'typeList' in args and not isinstance(args['typeList'], Carbon.Res.ResourceType):
|
||||
typeList = args['typeList'][:]
|
||||
# Workaround for OSX typeless files:
|
||||
if 'TEXT' in typeList and not '\0\0\0\0' in typeList:
|
||||
typeList = typeList + ('\0\0\0\0',)
|
||||
data = 'Pyth' + struct.pack("hh", 0, len(typeList))
|
||||
for type in typeList:
|
||||
data = data+type
|
||||
args['typeList'] = Carbon.Res.Handle(data)
|
||||
tpwanted = str
|
||||
if 'wanted' in args:
|
||||
tpwanted = args['wanted']
|
||||
del args['wanted']
|
||||
return args, tpwanted
|
||||
|
||||
def _dummy_Nav_eventproc(msg, data):
|
||||
pass
|
||||
|
||||
_default_Nav_eventproc = _dummy_Nav_eventproc
|
||||
|
||||
def SetDefaultEventProc(proc):
|
||||
global _default_Nav_eventproc
|
||||
rv = _default_Nav_eventproc
|
||||
if proc is None:
|
||||
proc = _dummy_Nav_eventproc
|
||||
_default_Nav_eventproc = proc
|
||||
return rv
|
||||
|
||||
def AskFileForOpen(
|
||||
message=None,
|
||||
typeList=None,
|
||||
# From here on the order is not documented
|
||||
version=None,
|
||||
defaultLocation=None,
|
||||
dialogOptionFlags=None,
|
||||
location=None,
|
||||
clientName=None,
|
||||
windowTitle=None,
|
||||
actionButtonLabel=None,
|
||||
cancelButtonLabel=None,
|
||||
preferenceKey=None,
|
||||
popupExtension=None,
|
||||
eventProc=_dummy_Nav_eventproc,
|
||||
previewProc=None,
|
||||
filterProc=None,
|
||||
wanted=None,
|
||||
multiple=None):
|
||||
"""Display a dialog asking the user for a file to open.
|
||||
|
||||
wanted is the return type wanted: FSSpec, FSRef, unicode or string (default)
|
||||
the other arguments can be looked up in Apple's Navigation Services documentation"""
|
||||
|
||||
default_flags = 0x56 # Or 0xe4?
|
||||
args, tpwanted = _process_Nav_args(default_flags, version=version,
|
||||
defaultLocation=defaultLocation, dialogOptionFlags=dialogOptionFlags,
|
||||
location=location,clientName=clientName,windowTitle=windowTitle,
|
||||
actionButtonLabel=actionButtonLabel,cancelButtonLabel=cancelButtonLabel,
|
||||
message=message,preferenceKey=preferenceKey,
|
||||
popupExtension=popupExtension,eventProc=eventProc,previewProc=previewProc,
|
||||
filterProc=filterProc,typeList=typeList,wanted=wanted,multiple=multiple)
|
||||
_interact()
|
||||
try:
|
||||
rr = Nav.NavChooseFile(args)
|
||||
good = 1
|
||||
except Nav.error as arg:
|
||||
if arg.args[0] != -128: # userCancelledErr
|
||||
raise Nav.error(arg)
|
||||
return None
|
||||
if not rr.validRecord or not rr.selection:
|
||||
return None
|
||||
if issubclass(tpwanted, Carbon.File.FSRef):
|
||||
return tpwanted(rr.selection_fsr[0])
|
||||
if issubclass(tpwanted, Carbon.File.FSSpec):
|
||||
return tpwanted(rr.selection[0])
|
||||
if issubclass(tpwanted, str):
|
||||
return tpwanted(rr.selection_fsr[0].as_pathname())
|
||||
if issubclass(tpwanted, str):
|
||||
return tpwanted(rr.selection_fsr[0].as_pathname(), 'utf8')
|
||||
raise TypeError("Unknown value for argument 'wanted': %s" % repr(tpwanted))
|
||||
|
||||
def AskFileForSave(
|
||||
message=None,
|
||||
savedFileName=None,
|
||||
# From here on the order is not documented
|
||||
version=None,
|
||||
defaultLocation=None,
|
||||
dialogOptionFlags=None,
|
||||
location=None,
|
||||
clientName=None,
|
||||
windowTitle=None,
|
||||
actionButtonLabel=None,
|
||||
cancelButtonLabel=None,
|
||||
preferenceKey=None,
|
||||
popupExtension=None,
|
||||
eventProc=_dummy_Nav_eventproc,
|
||||
fileType=None,
|
||||
fileCreator=None,
|
||||
wanted=None,
|
||||
multiple=None):
|
||||
"""Display a dialog asking the user for a filename to save to.
|
||||
|
||||
wanted is the return type wanted: FSSpec, FSRef, unicode or string (default)
|
||||
the other arguments can be looked up in Apple's Navigation Services documentation"""
|
||||
|
||||
|
||||
default_flags = 0x07
|
||||
args, tpwanted = _process_Nav_args(default_flags, version=version,
|
||||
defaultLocation=defaultLocation, dialogOptionFlags=dialogOptionFlags,
|
||||
location=location,clientName=clientName,windowTitle=windowTitle,
|
||||
actionButtonLabel=actionButtonLabel,cancelButtonLabel=cancelButtonLabel,
|
||||
savedFileName=savedFileName,message=message,preferenceKey=preferenceKey,
|
||||
popupExtension=popupExtension,eventProc=eventProc,fileType=fileType,
|
||||
fileCreator=fileCreator,wanted=wanted,multiple=multiple)
|
||||
_interact()
|
||||
try:
|
||||
rr = Nav.NavPutFile(args)
|
||||
good = 1
|
||||
except Nav.error as arg:
|
||||
if arg.args[0] != -128: # userCancelledErr
|
||||
raise Nav.error(arg)
|
||||
return None
|
||||
if not rr.validRecord or not rr.selection:
|
||||
return None
|
||||
if issubclass(tpwanted, Carbon.File.FSRef):
|
||||
raise TypeError("Cannot pass wanted=FSRef to AskFileForSave")
|
||||
if issubclass(tpwanted, Carbon.File.FSSpec):
|
||||
return tpwanted(rr.selection[0])
|
||||
if issubclass(tpwanted, str):
|
||||
if sys.platform == 'mac':
|
||||
fullpath = rr.selection[0].as_pathname()
|
||||
else:
|
||||
# This is gross, and probably incorrect too
|
||||
vrefnum, dirid, name = rr.selection[0].as_tuple()
|
||||
pardir_fss = Carbon.File.FSSpec((vrefnum, dirid, ''))
|
||||
pardir_fsr = Carbon.File.FSRef(pardir_fss)
|
||||
pardir_path = pardir_fsr.FSRefMakePath() # This is utf-8
|
||||
name_utf8 = str(name, 'macroman').encode('utf8')
|
||||
fullpath = os.path.join(pardir_path, name_utf8)
|
||||
if issubclass(tpwanted, str):
|
||||
return str(fullpath, 'utf8')
|
||||
return tpwanted(fullpath)
|
||||
raise TypeError("Unknown value for argument 'wanted': %s" % repr(tpwanted))
|
||||
|
||||
def AskFolder(
|
||||
message=None,
|
||||
# From here on the order is not documented
|
||||
version=None,
|
||||
defaultLocation=None,
|
||||
dialogOptionFlags=None,
|
||||
location=None,
|
||||
clientName=None,
|
||||
windowTitle=None,
|
||||
actionButtonLabel=None,
|
||||
cancelButtonLabel=None,
|
||||
preferenceKey=None,
|
||||
popupExtension=None,
|
||||
eventProc=_dummy_Nav_eventproc,
|
||||
filterProc=None,
|
||||
wanted=None,
|
||||
multiple=None):
|
||||
"""Display a dialog asking the user for select a folder.
|
||||
|
||||
wanted is the return type wanted: FSSpec, FSRef, unicode or string (default)
|
||||
the other arguments can be looked up in Apple's Navigation Services documentation"""
|
||||
|
||||
default_flags = 0x17
|
||||
args, tpwanted = _process_Nav_args(default_flags, version=version,
|
||||
defaultLocation=defaultLocation, dialogOptionFlags=dialogOptionFlags,
|
||||
location=location,clientName=clientName,windowTitle=windowTitle,
|
||||
actionButtonLabel=actionButtonLabel,cancelButtonLabel=cancelButtonLabel,
|
||||
message=message,preferenceKey=preferenceKey,
|
||||
popupExtension=popupExtension,eventProc=eventProc,filterProc=filterProc,
|
||||
wanted=wanted,multiple=multiple)
|
||||
_interact()
|
||||
try:
|
||||
rr = Nav.NavChooseFolder(args)
|
||||
good = 1
|
||||
except Nav.error as arg:
|
||||
if arg.args[0] != -128: # userCancelledErr
|
||||
raise Nav.error(arg)
|
||||
return None
|
||||
if not rr.validRecord or not rr.selection:
|
||||
return None
|
||||
if issubclass(tpwanted, Carbon.File.FSRef):
|
||||
return tpwanted(rr.selection_fsr[0])
|
||||
if issubclass(tpwanted, Carbon.File.FSSpec):
|
||||
return tpwanted(rr.selection[0])
|
||||
if issubclass(tpwanted, str):
|
||||
return tpwanted(rr.selection_fsr[0].as_pathname())
|
||||
if issubclass(tpwanted, str):
|
||||
return tpwanted(rr.selection_fsr[0].as_pathname(), 'utf8')
|
||||
raise TypeError("Unknown value for argument 'wanted': %s" % repr(tpwanted))
|
||||
|
||||
|
||||
def test():
|
||||
import time
|
||||
|
||||
Message("Testing EasyDialogs.")
|
||||
optionlist = (('v', 'Verbose'), ('verbose', 'Verbose as long option'),
|
||||
('flags=', 'Valued option'), ('f:', 'Short valued option'))
|
||||
commandlist = (('start', 'Start something'), ('stop', 'Stop something'))
|
||||
argv = GetArgv(optionlist=optionlist, commandlist=commandlist, addoldfile=0)
|
||||
Message("Command line: %s"%' '.join(argv))
|
||||
for i in range(len(argv)):
|
||||
print('arg[%d] = %r' % (i, argv[i]))
|
||||
ok = AskYesNoCancel("Do you want to proceed?")
|
||||
ok = AskYesNoCancel("Do you want to identify?", yes="Identify", no="No")
|
||||
if ok > 0:
|
||||
s = AskString("Enter your first name", "Joe")
|
||||
s2 = AskPassword("Okay %s, tell us your nickname"%s, s, cancel="None")
|
||||
if not s2:
|
||||
Message("%s has no secret nickname"%s)
|
||||
else:
|
||||
Message("Hello everybody!!\nThe secret nickname of %s is %s!!!"%(s, s2))
|
||||
else:
|
||||
s = 'Anonymous'
|
||||
rv = AskFileForOpen(message="Gimme a file, %s"%s, wanted=Carbon.File.FSSpec)
|
||||
Message("rv: %s"%rv)
|
||||
rv = AskFileForSave(wanted=Carbon.File.FSRef, savedFileName="%s.txt"%s)
|
||||
Message("rv.as_pathname: %s"%rv.as_pathname())
|
||||
rv = AskFolder()
|
||||
Message("Folder name: %s"%rv)
|
||||
text = ( "Working Hard...", "Hardly Working..." ,
|
||||
"So far, so good!", "Keep on truckin'" )
|
||||
bar = ProgressBar("Progress, progress...", 0, label="Ramping up...")
|
||||
try:
|
||||
if hasattr(MacOS, 'SchedParams'):
|
||||
appsw = MacOS.SchedParams(1, 0)
|
||||
for i in range(20):
|
||||
bar.inc()
|
||||
time.sleep(0.05)
|
||||
bar.set(0,100)
|
||||
for i in range(100):
|
||||
bar.set(i)
|
||||
time.sleep(0.05)
|
||||
if i % 10 == 0:
|
||||
bar.label(text[(i/10) % 4])
|
||||
bar.label("Done.")
|
||||
time.sleep(1.0) # give'em a chance to see "Done."
|
||||
finally:
|
||||
del bar
|
||||
if hasattr(MacOS, 'SchedParams'):
|
||||
MacOS.SchedParams(*appsw)
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
test()
|
||||
except KeyboardInterrupt:
|
||||
Message("Operation Canceled.")
|
File diff suppressed because it is too large
Load Diff
|
@ -1,198 +0,0 @@
|
|||
"""MiniAEFrame - A minimal AppleEvent Application framework.
|
||||
|
||||
There are two classes:
|
||||
AEServer -- a mixin class offering nice AE handling.
|
||||
MiniApplication -- a very minimal alternative to FrameWork.py,
|
||||
only suitable for the simplest of AppleEvent servers.
|
||||
"""
|
||||
|
||||
import traceback
|
||||
import MacOS
|
||||
from Carbon import AE
|
||||
from Carbon.AppleEvents import *
|
||||
from Carbon import Evt
|
||||
from Carbon.Events import *
|
||||
from Carbon import Menu
|
||||
from Carbon import Win
|
||||
from Carbon.Windows import *
|
||||
from Carbon import Qd
|
||||
|
||||
import aetools
|
||||
import EasyDialogs
|
||||
|
||||
kHighLevelEvent = 23 # Not defined anywhere for Python yet?
|
||||
|
||||
|
||||
class MiniApplication:
|
||||
|
||||
"""A minimal FrameWork.Application-like class"""
|
||||
|
||||
def __init__(self):
|
||||
self.quitting = 0
|
||||
# Initialize menu
|
||||
self.appleid = 1
|
||||
self.quitid = 2
|
||||
Menu.ClearMenuBar()
|
||||
self.applemenu = applemenu = Menu.NewMenu(self.appleid, "\024")
|
||||
applemenu.AppendMenu("%s;(-" % self.getaboutmenutext())
|
||||
if MacOS.runtimemodel == 'ppc':
|
||||
applemenu.AppendResMenu('DRVR')
|
||||
applemenu.InsertMenu(0)
|
||||
self.quitmenu = Menu.NewMenu(self.quitid, "File")
|
||||
self.quitmenu.AppendMenu("Quit")
|
||||
self.quitmenu.SetItemCmd(1, ord("Q"))
|
||||
self.quitmenu.InsertMenu(0)
|
||||
Menu.DrawMenuBar()
|
||||
|
||||
def __del__(self):
|
||||
self.close()
|
||||
|
||||
def close(self):
|
||||
pass
|
||||
|
||||
def mainloop(self, mask = everyEvent, timeout = 60*60):
|
||||
while not self.quitting:
|
||||
self.dooneevent(mask, timeout)
|
||||
|
||||
def _quit(self):
|
||||
self.quitting = 1
|
||||
|
||||
def dooneevent(self, mask = everyEvent, timeout = 60*60):
|
||||
got, event = Evt.WaitNextEvent(mask, timeout)
|
||||
if got:
|
||||
self.lowlevelhandler(event)
|
||||
|
||||
def lowlevelhandler(self, event):
|
||||
what, message, when, where, modifiers = event
|
||||
h, v = where
|
||||
if what == kHighLevelEvent:
|
||||
msg = "High Level Event: %r %r" % (code(message), code(h | (v<<16)))
|
||||
try:
|
||||
AE.AEProcessAppleEvent(event)
|
||||
except AE.Error as err:
|
||||
print('AE error: ', err)
|
||||
print('in', msg)
|
||||
traceback.print_exc()
|
||||
return
|
||||
elif what == keyDown:
|
||||
c = chr(message & charCodeMask)
|
||||
if modifiers & cmdKey:
|
||||
if c == '.':
|
||||
raise KeyboardInterrupt("Command-period")
|
||||
if c == 'q':
|
||||
if hasattr(MacOS, 'OutputSeen'):
|
||||
MacOS.OutputSeen()
|
||||
self.quitting = 1
|
||||
return
|
||||
elif what == mouseDown:
|
||||
partcode, window = Win.FindWindow(where)
|
||||
if partcode == inMenuBar:
|
||||
result = Menu.MenuSelect(where)
|
||||
id = (result>>16) & 0xffff # Hi word
|
||||
item = result & 0xffff # Lo word
|
||||
if id == self.appleid:
|
||||
if item == 1:
|
||||
EasyDialogs.Message(self.getabouttext())
|
||||
elif item > 1 and hasattr(Menu, 'OpenDeskAcc'):
|
||||
name = self.applemenu.GetMenuItemText(item)
|
||||
Menu.OpenDeskAcc(name)
|
||||
elif id == self.quitid and item == 1:
|
||||
if hasattr(MacOS, 'OutputSeen'):
|
||||
MacOS.OutputSeen()
|
||||
self.quitting = 1
|
||||
Menu.HiliteMenu(0)
|
||||
return
|
||||
# Anything not handled is passed to Python/SIOUX
|
||||
if hasattr(MacOS, 'HandleEvent'):
|
||||
MacOS.HandleEvent(event)
|
||||
else:
|
||||
print("Unhandled event:", event)
|
||||
|
||||
def getabouttext(self):
|
||||
return self.__class__.__name__
|
||||
|
||||
def getaboutmenutext(self):
|
||||
return "About %s\311" % self.__class__.__name__
|
||||
|
||||
|
||||
class AEServer:
|
||||
|
||||
def __init__(self):
|
||||
self.ae_handlers = {}
|
||||
|
||||
def installaehandler(self, classe, type, callback):
|
||||
AE.AEInstallEventHandler(classe, type, self.callback_wrapper)
|
||||
self.ae_handlers[(classe, type)] = callback
|
||||
|
||||
def close(self):
|
||||
for classe, type in self.ae_handlers.keys():
|
||||
AE.AERemoveEventHandler(classe, type)
|
||||
|
||||
def callback_wrapper(self, _request, _reply):
|
||||
_parameters, _attributes = aetools.unpackevent(_request)
|
||||
_class = _attributes['evcl'].type
|
||||
_type = _attributes['evid'].type
|
||||
|
||||
if (_class, _type) in self.ae_handlers:
|
||||
_function = self.ae_handlers[(_class, _type)]
|
||||
elif (_class, '****') in self.ae_handlers:
|
||||
_function = self.ae_handlers[(_class, '****')]
|
||||
elif ('****', '****') in self.ae_handlers:
|
||||
_function = self.ae_handlers[('****', '****')]
|
||||
else:
|
||||
raise RuntimeError('AE callback without handler: '
|
||||
+ str((_class, _type)))
|
||||
|
||||
# XXXX Do key-to-name mapping here
|
||||
|
||||
_parameters['_attributes'] = _attributes
|
||||
_parameters['_class'] = _class
|
||||
_parameters['_type'] = _type
|
||||
if '----' in _parameters:
|
||||
_object = _parameters['----']
|
||||
del _parameters['----']
|
||||
# The try/except that used to be here can mask programmer errors.
|
||||
# Let the program crash, the programmer can always add a **args
|
||||
# to the formal parameter list.
|
||||
rv = _function(_object, **_parameters)
|
||||
else:
|
||||
#Same try/except comment as above
|
||||
rv = _function(**_parameters)
|
||||
|
||||
if rv is None:
|
||||
aetools.packevent(_reply, {})
|
||||
else:
|
||||
aetools.packevent(_reply, {'----':rv})
|
||||
|
||||
|
||||
def code(x):
|
||||
"Convert a long int to the 4-character code it really is"
|
||||
s = ''
|
||||
for i in range(4):
|
||||
x, c = divmod(x, 256)
|
||||
s = chr(c) + s
|
||||
return s
|
||||
|
||||
class _Test(AEServer, MiniApplication):
|
||||
"""Mini test application, handles required events"""
|
||||
|
||||
def __init__(self):
|
||||
MiniApplication.__init__(self)
|
||||
AEServer.__init__(self)
|
||||
self.installaehandler('aevt', 'oapp', self.open_app)
|
||||
self.installaehandler('aevt', 'quit', self.quit)
|
||||
self.installaehandler('****', '****', self.other)
|
||||
self.mainloop()
|
||||
|
||||
def quit(self, **args):
|
||||
self._quit()
|
||||
|
||||
def open_app(self, **args):
|
||||
pass
|
||||
|
||||
def other(self, _object=None, _class=None, _type=None, **args):
|
||||
print('AppleEvent', (_class, _type), 'for', _object, 'Other args:', args)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
_Test()
|
|
@ -1,215 +0,0 @@
|
|||
"""PixMapWrapper - defines the PixMapWrapper class, which wraps an opaque
|
||||
QuickDraw PixMap data structure in a handy Python class. Also provides
|
||||
methods to convert to/from pixel data (from, e.g., the img module) or a
|
||||
Python Imaging Library Image object.
|
||||
|
||||
J. Strout <joe@strout.net> February 1999"""
|
||||
|
||||
from Carbon import Qd
|
||||
from Carbon import QuickDraw
|
||||
import struct
|
||||
import MacOS
|
||||
import img
|
||||
import imgformat
|
||||
|
||||
# PixMap data structure element format (as used with struct)
|
||||
_pmElemFormat = {
|
||||
'baseAddr':'l', # address of pixel data
|
||||
'rowBytes':'H', # bytes per row, plus 0x8000
|
||||
'bounds':'hhhh', # coordinates imposed over pixel data
|
||||
'top':'h',
|
||||
'left':'h',
|
||||
'bottom':'h',
|
||||
'right':'h',
|
||||
'pmVersion':'h', # flags for Color QuickDraw
|
||||
'packType':'h', # format of compression algorithm
|
||||
'packSize':'l', # size after compression
|
||||
'hRes':'l', # horizontal pixels per inch
|
||||
'vRes':'l', # vertical pixels per inch
|
||||
'pixelType':'h', # pixel format
|
||||
'pixelSize':'h', # bits per pixel
|
||||
'cmpCount':'h', # color components per pixel
|
||||
'cmpSize':'h', # bits per component
|
||||
'planeBytes':'l', # offset in bytes to next plane
|
||||
'pmTable':'l', # handle to color table
|
||||
'pmReserved':'l' # reserved for future use
|
||||
}
|
||||
|
||||
# PixMap data structure element offset
|
||||
_pmElemOffset = {
|
||||
'baseAddr':0,
|
||||
'rowBytes':4,
|
||||
'bounds':6,
|
||||
'top':6,
|
||||
'left':8,
|
||||
'bottom':10,
|
||||
'right':12,
|
||||
'pmVersion':14,
|
||||
'packType':16,
|
||||
'packSize':18,
|
||||
'hRes':22,
|
||||
'vRes':26,
|
||||
'pixelType':30,
|
||||
'pixelSize':32,
|
||||
'cmpCount':34,
|
||||
'cmpSize':36,
|
||||
'planeBytes':38,
|
||||
'pmTable':42,
|
||||
'pmReserved':46
|
||||
}
|
||||
|
||||
class PixMapWrapper:
|
||||
"""PixMapWrapper -- wraps the QD PixMap object in a Python class,
|
||||
with methods to easily get/set various pixmap fields. Note: Use the
|
||||
PixMap() method when passing to QD calls."""
|
||||
|
||||
def __init__(self):
|
||||
self.__dict__['data'] = ''
|
||||
self._header = struct.pack("lhhhhhhhlllhhhhlll",
|
||||
id(self.data)+MacOS.string_id_to_buffer,
|
||||
0, # rowBytes
|
||||
0, 0, 0, 0, # bounds
|
||||
0, # pmVersion
|
||||
0, 0, # packType, packSize
|
||||
72<<16, 72<<16, # hRes, vRes
|
||||
QuickDraw.RGBDirect, # pixelType
|
||||
16, # pixelSize
|
||||
2, 5, # cmpCount, cmpSize,
|
||||
0, 0, 0) # planeBytes, pmTable, pmReserved
|
||||
self.__dict__['_pm'] = Qd.RawBitMap(self._header)
|
||||
|
||||
def _stuff(self, element, bytes):
|
||||
offset = _pmElemOffset[element]
|
||||
fmt = _pmElemFormat[element]
|
||||
self._header = self._header[:offset] \
|
||||
+ struct.pack(fmt, bytes) \
|
||||
+ self._header[offset + struct.calcsize(fmt):]
|
||||
self.__dict__['_pm'] = None
|
||||
|
||||
def _unstuff(self, element):
|
||||
offset = _pmElemOffset[element]
|
||||
fmt = _pmElemFormat[element]
|
||||
return struct.unpack(fmt, self._header[offset:offset+struct.calcsize(fmt)])[0]
|
||||
|
||||
def __setattr__(self, attr, val):
|
||||
if attr == 'baseAddr':
|
||||
raise RuntimeError("don't assign to .baseAddr "
|
||||
"-- assign to .data instead")
|
||||
elif attr == 'data':
|
||||
self.__dict__['data'] = val
|
||||
self._stuff('baseAddr', id(self.data) + MacOS.string_id_to_buffer)
|
||||
elif attr == 'rowBytes':
|
||||
# high bit is always set for some odd reason
|
||||
self._stuff('rowBytes', val | 0x8000)
|
||||
elif attr == 'bounds':
|
||||
# assume val is in official Left, Top, Right, Bottom order!
|
||||
self._stuff('left',val[0])
|
||||
self._stuff('top',val[1])
|
||||
self._stuff('right',val[2])
|
||||
self._stuff('bottom',val[3])
|
||||
elif attr == 'hRes' or attr == 'vRes':
|
||||
# 16.16 fixed format, so just shift 16 bits
|
||||
self._stuff(attr, int(val) << 16)
|
||||
elif attr in _pmElemFormat.keys():
|
||||
# any other pm attribute -- just stuff
|
||||
self._stuff(attr, val)
|
||||
else:
|
||||
self.__dict__[attr] = val
|
||||
|
||||
def __getattr__(self, attr):
|
||||
if attr == 'rowBytes':
|
||||
# high bit is always set for some odd reason
|
||||
return self._unstuff('rowBytes') & 0x7FFF
|
||||
elif attr == 'bounds':
|
||||
# return bounds in official Left, Top, Right, Bottom order!
|
||||
return (
|
||||
self._unstuff('left'),
|
||||
self._unstuff('top'),
|
||||
self._unstuff('right'),
|
||||
self._unstuff('bottom') )
|
||||
elif attr == 'hRes' or attr == 'vRes':
|
||||
# 16.16 fixed format, so just shift 16 bits
|
||||
return self._unstuff(attr) >> 16
|
||||
elif attr in _pmElemFormat.keys():
|
||||
# any other pm attribute -- just unstuff
|
||||
return self._unstuff(attr)
|
||||
else:
|
||||
return self.__dict__[attr]
|
||||
|
||||
|
||||
def PixMap(self):
|
||||
"Return a QuickDraw PixMap corresponding to this data."
|
||||
if not self.__dict__['_pm']:
|
||||
self.__dict__['_pm'] = Qd.RawBitMap(self._header)
|
||||
return self.__dict__['_pm']
|
||||
|
||||
def blit(self, x1=0,y1=0,x2=None,y2=None, port=None):
|
||||
"""Draw this pixmap into the given (default current) grafport."""
|
||||
src = self.bounds
|
||||
dest = [x1,y1,x2,y2]
|
||||
if x2 is None:
|
||||
dest[2] = x1 + src[2]-src[0]
|
||||
if y2 is None:
|
||||
dest[3] = y1 + src[3]-src[1]
|
||||
if not port: port = Qd.GetPort()
|
||||
Qd.CopyBits(self.PixMap(), port.GetPortBitMapForCopyBits(), src, tuple(dest),
|
||||
QuickDraw.srcCopy, None)
|
||||
|
||||
def fromstring(self,s,width,height,format=imgformat.macrgb):
|
||||
"""Stuff this pixmap with raw pixel data from a string.
|
||||
Supply width, height, and one of the imgformat specifiers."""
|
||||
# we only support 16- and 32-bit mac rgb...
|
||||
# so convert if necessary
|
||||
if format != imgformat.macrgb and format != imgformat.macrgb16:
|
||||
# (LATER!)
|
||||
raise NotImplementedError("conversion to macrgb or macrgb16")
|
||||
self.data = s
|
||||
self.bounds = (0,0,width,height)
|
||||
self.cmpCount = 3
|
||||
self.pixelType = QuickDraw.RGBDirect
|
||||
if format == imgformat.macrgb:
|
||||
self.pixelSize = 32
|
||||
self.cmpSize = 8
|
||||
else:
|
||||
self.pixelSize = 16
|
||||
self.cmpSize = 5
|
||||
self.rowBytes = width*self.pixelSize/8
|
||||
|
||||
def tostring(self, format=imgformat.macrgb):
|
||||
"""Return raw data as a string in the specified format."""
|
||||
# is the native format requested? if so, just return data
|
||||
if (format == imgformat.macrgb and self.pixelSize == 32) or \
|
||||
(format == imgformat.macrgb16 and self.pixelsize == 16):
|
||||
return self.data
|
||||
# otherwise, convert to the requested format
|
||||
# (LATER!)
|
||||
raise NotImplementedError("data format conversion")
|
||||
|
||||
def fromImage(self,im):
|
||||
"""Initialize this PixMap from a PIL Image object."""
|
||||
# We need data in ARGB format; PIL can't currently do that,
|
||||
# but it can do RGBA, which we can use by inserting one null
|
||||
# up frontpm =
|
||||
if im.mode != 'RGBA': im = im.convert('RGBA')
|
||||
data = chr(0) + im.tostring()
|
||||
self.fromstring(data, im.size[0], im.size[1])
|
||||
|
||||
def toImage(self):
|
||||
"""Return the contents of this PixMap as a PIL Image object."""
|
||||
import Image
|
||||
# our tostring() method returns data in ARGB format,
|
||||
# whereas Image uses RGBA; a bit of slicing fixes this...
|
||||
data = self.tostring()[1:] + chr(0)
|
||||
bounds = self.bounds
|
||||
return Image.fromstring('RGBA',(bounds[2]-bounds[0],bounds[3]-bounds[1]),data)
|
||||
|
||||
def test():
|
||||
import MacOS
|
||||
import EasyDialogs
|
||||
import Image
|
||||
path = EasyDialogs.AskFileForOpen("Image File:")
|
||||
if not path: return
|
||||
pm = PixMapWrapper()
|
||||
pm.fromImage( Image.open(path) )
|
||||
pm.blit(20,20)
|
||||
return pm
|
|
@ -1,375 +0,0 @@
|
|||
"""Tools for use in AppleEvent clients and servers:
|
||||
conversion between AE types and python types
|
||||
|
||||
pack(x) converts a Python object to an AEDesc object
|
||||
unpack(desc) does the reverse
|
||||
coerce(x, wanted_sample) coerces a python object to another python object
|
||||
"""
|
||||
|
||||
#
|
||||
# This code was originally written by Guido, and modified/extended by Jack
|
||||
# to include the various types that were missing. The reference used is
|
||||
# Apple Event Registry, chapter 9.
|
||||
#
|
||||
|
||||
import struct
|
||||
from Carbon import AE
|
||||
from Carbon.AppleEvents import *
|
||||
import MacOS
|
||||
import Carbon.File
|
||||
import io
|
||||
import aetypes
|
||||
from aetypes import mkenum, ObjectSpecifier
|
||||
|
||||
# These ones seem to be missing from AppleEvents
|
||||
# (they're in AERegistry.h)
|
||||
|
||||
#typeColorTable = b'clrt'
|
||||
#typeDrawingArea = b'cdrw'
|
||||
#typePixelMap = b'cpix'
|
||||
#typePixelMapMinus = b'tpmm'
|
||||
#typeRotation = b'trot'
|
||||
#typeTextStyles = b'tsty'
|
||||
#typeStyledText = b'STXT'
|
||||
#typeAEText = b'tTXT'
|
||||
#typeEnumeration = b'enum'
|
||||
|
||||
def b2i(byte_string):
|
||||
result = 0
|
||||
for byte in byte_string:
|
||||
result <<= 8
|
||||
result += byte
|
||||
return result
|
||||
#
|
||||
# Some AE types are immedeately coerced into something
|
||||
# we like better (and which is equivalent)
|
||||
#
|
||||
unpacker_coercions = {
|
||||
b2i(typeComp) : typeFloat,
|
||||
b2i(typeColorTable) : typeAEList,
|
||||
b2i(typeDrawingArea) : typeAERecord,
|
||||
b2i(typeFixed) : typeFloat,
|
||||
b2i(typeExtended) : typeFloat,
|
||||
b2i(typePixelMap) : typeAERecord,
|
||||
b2i(typeRotation) : typeAERecord,
|
||||
b2i(typeStyledText) : typeAERecord,
|
||||
b2i(typeTextStyles) : typeAERecord,
|
||||
};
|
||||
|
||||
#
|
||||
# Some python types we need in the packer:
|
||||
#
|
||||
AEDescType = AE.AEDescType
|
||||
FSSType = Carbon.File.FSSpecType
|
||||
FSRefType = Carbon.File.FSRefType
|
||||
AliasType = Carbon.File.AliasType
|
||||
|
||||
def packkey(ae, key, value):
|
||||
if hasattr(key, 'which'):
|
||||
keystr = key.which
|
||||
elif hasattr(key, 'want'):
|
||||
keystr = key.want
|
||||
else:
|
||||
keystr = key
|
||||
ae.AEPutParamDesc(keystr, pack(value))
|
||||
|
||||
def pack(x, forcetype = None):
|
||||
"""Pack a python object into an AE descriptor"""
|
||||
|
||||
if forcetype:
|
||||
if isinstance(x, bytes):
|
||||
return AE.AECreateDesc(forcetype, x)
|
||||
else:
|
||||
return pack(x).AECoerceDesc(forcetype)
|
||||
|
||||
if x is None:
|
||||
return AE.AECreateDesc(b'null', '')
|
||||
|
||||
if isinstance(x, AEDescType):
|
||||
return x
|
||||
if isinstance(x, FSSType):
|
||||
return AE.AECreateDesc(b'fss ', x.data)
|
||||
if isinstance(x, FSRefType):
|
||||
return AE.AECreateDesc(b'fsrf', x.data)
|
||||
if isinstance(x, AliasType):
|
||||
return AE.AECreateDesc(b'alis', x.data)
|
||||
if isinstance(x, int):
|
||||
return AE.AECreateDesc(b'long', struct.pack('l', x))
|
||||
if isinstance(x, float):
|
||||
return AE.AECreateDesc(b'doub', struct.pack('d', x))
|
||||
if isinstance(x, (bytes, bytearray)):
|
||||
return AE.AECreateDesc(b'TEXT', x)
|
||||
if isinstance(x, str):
|
||||
# See http://developer.apple.com/documentation/Carbon/Reference/Apple_Event_Manager/Reference/reference.html#//apple_ref/doc/constant_group/typeUnicodeText
|
||||
# for the possible encodings.
|
||||
data = x.encode('utf16')
|
||||
if data[:2] == b'\xfe\xff':
|
||||
data = data[2:]
|
||||
return AE.AECreateDesc(b'utxt', data)
|
||||
if isinstance(x, list):
|
||||
lst = AE.AECreateList('', 0)
|
||||
for item in x:
|
||||
lst.AEPutDesc(0, pack(item))
|
||||
return lst
|
||||
if isinstance(x, dict):
|
||||
record = AE.AECreateList('', 1)
|
||||
for key, value in x.items():
|
||||
packkey(record, key, value)
|
||||
#record.AEPutParamDesc(key, pack(value))
|
||||
return record
|
||||
if isinstance(x, type) and issubclass(x, ObjectSpecifier):
|
||||
# Note: we are getting a class object here, not an instance
|
||||
return AE.AECreateDesc(b'type', x.want)
|
||||
if hasattr(x, '__aepack__'):
|
||||
return x.__aepack__()
|
||||
if hasattr(x, 'which'):
|
||||
return AE.AECreateDesc(b'TEXT', x.which)
|
||||
if hasattr(x, 'want'):
|
||||
return AE.AECreateDesc(b'TEXT', x.want)
|
||||
return AE.AECreateDesc(b'TEXT', repr(x)) # Copout
|
||||
|
||||
def unpack(desc, formodulename=""):
|
||||
"""Unpack an AE descriptor to a python object"""
|
||||
t = desc.type
|
||||
|
||||
if b2i(t) in unpacker_coercions:
|
||||
desc = desc.AECoerceDesc(unpacker_coercions[b2i(t)])
|
||||
t = desc.type # This is a guess by Jack....
|
||||
|
||||
if t == typeAEList:
|
||||
l = []
|
||||
for i in range(desc.AECountItems()):
|
||||
keyword, item = desc.AEGetNthDesc(i+1, b'****')
|
||||
l.append(unpack(item, formodulename))
|
||||
return l
|
||||
if t == typeAERecord:
|
||||
d = {}
|
||||
for i in range(desc.AECountItems()):
|
||||
keyword, item = desc.AEGetNthDesc(i+1, b'****')
|
||||
d[b2i(keyword)] = unpack(item, formodulename)
|
||||
return d
|
||||
if t == typeAEText:
|
||||
record = desc.AECoerceDesc(b'reco')
|
||||
return mkaetext(unpack(record, formodulename))
|
||||
if t == typeAlias:
|
||||
return Carbon.File.Alias(rawdata=desc.data)
|
||||
# typeAppleEvent returned as unknown
|
||||
if t == typeBoolean:
|
||||
return struct.unpack('b', desc.data)[0]
|
||||
if t == typeChar:
|
||||
return desc.data
|
||||
if t == typeUnicodeText:
|
||||
return str(desc.data, 'utf16')
|
||||
# typeColorTable coerced to typeAEList
|
||||
# typeComp coerced to extended
|
||||
# typeData returned as unknown
|
||||
# typeDrawingArea coerced to typeAERecord
|
||||
if t == typeEnumeration:
|
||||
return mkenum(desc.data)
|
||||
# typeEPS returned as unknown
|
||||
if t == typeFalse:
|
||||
return 0
|
||||
if t == typeFloat:
|
||||
data = desc.data
|
||||
return struct.unpack('d', data)[0]
|
||||
if t == typeFSS:
|
||||
return Carbon.File.FSSpec(rawdata=desc.data)
|
||||
if t == typeFSRef:
|
||||
return Carbon.File.FSRef(rawdata=desc.data)
|
||||
if t == typeInsertionLoc:
|
||||
record = desc.AECoerceDesc(b'reco')
|
||||
return mkinsertionloc(unpack(record, formodulename))
|
||||
# typeInteger equal to typeLongInteger
|
||||
if t == typeIntlText:
|
||||
script, language = struct.unpack('hh', desc.data[:4])
|
||||
return aetypes.IntlText(script, language, desc.data[4:])
|
||||
if t == typeIntlWritingCode:
|
||||
script, language = struct.unpack('hh', desc.data)
|
||||
return aetypes.IntlWritingCode(script, language)
|
||||
if t == typeKeyword:
|
||||
return mkkeyword(desc.data)
|
||||
if t == typeLongInteger:
|
||||
return struct.unpack('l', desc.data)[0]
|
||||
if t == typeLongDateTime:
|
||||
a, b = struct.unpack('lL', desc.data)
|
||||
return (int(a) << 32) + b
|
||||
if t == typeNull:
|
||||
return None
|
||||
if t == typeMagnitude:
|
||||
v = struct.unpack('l', desc.data)
|
||||
if v < 0:
|
||||
v = 0x100000000 + v
|
||||
return v
|
||||
if t == typeObjectSpecifier:
|
||||
record = desc.AECoerceDesc(b'reco')
|
||||
# If we have been told the name of the module we are unpacking aedescs for,
|
||||
# we can attempt to create the right type of python object from that module.
|
||||
if formodulename:
|
||||
return mkobjectfrommodule(unpack(record, formodulename), formodulename)
|
||||
return mkobject(unpack(record, formodulename))
|
||||
# typePict returned as unknown
|
||||
# typePixelMap coerced to typeAERecord
|
||||
# typePixelMapMinus returned as unknown
|
||||
# typeProcessSerialNumber returned as unknown
|
||||
if t == typeQDPoint:
|
||||
v, h = struct.unpack('hh', desc.data)
|
||||
return aetypes.QDPoint(v, h)
|
||||
if t == typeQDRectangle:
|
||||
v0, h0, v1, h1 = struct.unpack('hhhh', desc.data)
|
||||
return aetypes.QDRectangle(v0, h0, v1, h1)
|
||||
if t == typeRGBColor:
|
||||
r, g, b = struct.unpack('hhh', desc.data)
|
||||
return aetypes.RGBColor(r, g, b)
|
||||
# typeRotation coerced to typeAERecord
|
||||
# typeScrapStyles returned as unknown
|
||||
# typeSessionID returned as unknown
|
||||
if t == typeShortFloat:
|
||||
return struct.unpack('f', desc.data)[0]
|
||||
if t == typeShortInteger:
|
||||
return struct.unpack('h', desc.data)[0]
|
||||
# typeSMFloat identical to typeShortFloat
|
||||
# typeSMInt indetical to typeShortInt
|
||||
# typeStyledText coerced to typeAERecord
|
||||
if t == typeTargetID:
|
||||
return mktargetid(desc.data)
|
||||
# typeTextStyles coerced to typeAERecord
|
||||
# typeTIFF returned as unknown
|
||||
if t == typeTrue:
|
||||
return 1
|
||||
if t == typeType:
|
||||
return mktype(desc.data, formodulename)
|
||||
#
|
||||
# The following are special
|
||||
#
|
||||
if t == b'rang':
|
||||
record = desc.AECoerceDesc(b'reco')
|
||||
return mkrange(unpack(record, formodulename))
|
||||
if t == b'cmpd':
|
||||
record = desc.AECoerceDesc(b'reco')
|
||||
return mkcomparison(unpack(record, formodulename))
|
||||
if t == b'logi':
|
||||
record = desc.AECoerceDesc(b'reco')
|
||||
return mklogical(unpack(record, formodulename))
|
||||
return mkunknown(desc.type, desc.data)
|
||||
|
||||
def coerce(data, egdata):
|
||||
"""Coerce a python object to another type using the AE coercers"""
|
||||
pdata = pack(data)
|
||||
pegdata = pack(egdata)
|
||||
pdata = pdata.AECoerceDesc(pegdata.type)
|
||||
return unpack(pdata)
|
||||
|
||||
#
|
||||
# Helper routines for unpack
|
||||
#
|
||||
def mktargetid(data):
|
||||
sessionID = getlong(data[:4])
|
||||
name = mkppcportrec(data[4:4+72])
|
||||
location = mklocationnamerec(data[76:76+36])
|
||||
rcvrName = mkppcportrec(data[112:112+72])
|
||||
return sessionID, name, location, rcvrName
|
||||
|
||||
def mkppcportrec(rec):
|
||||
namescript = getword(rec[:2])
|
||||
name = getpstr(rec[2:2+33])
|
||||
portkind = getword(rec[36:38])
|
||||
if portkind == 1:
|
||||
ctor = rec[38:42]
|
||||
type = rec[42:46]
|
||||
identity = (ctor, type)
|
||||
else:
|
||||
identity = getpstr(rec[38:38+33])
|
||||
return namescript, name, portkind, identity
|
||||
|
||||
def mklocationnamerec(rec):
|
||||
kind = getword(rec[:2])
|
||||
stuff = rec[2:]
|
||||
if kind == 0: stuff = None
|
||||
if kind == 2: stuff = getpstr(stuff)
|
||||
return kind, stuff
|
||||
|
||||
def mkunknown(type, data):
|
||||
return aetypes.Unknown(type, data)
|
||||
|
||||
def getpstr(s):
|
||||
return s[1:1+ord(s[0])]
|
||||
|
||||
def getlong(s):
|
||||
return (ord(s[0])<<24) | (ord(s[1])<<16) | (ord(s[2])<<8) | ord(s[3])
|
||||
|
||||
def getword(s):
|
||||
return (ord(s[0])<<8) | (ord(s[1])<<0)
|
||||
|
||||
def mkkeyword(keyword):
|
||||
return aetypes.Keyword(keyword)
|
||||
|
||||
def mkrange(dict):
|
||||
return aetypes.Range(dict[b2i(b'star')], dict[b2i(b'stop')])
|
||||
|
||||
def mkcomparison(dict):
|
||||
return aetypes.Comparison(dict[b2i(b'obj1')],
|
||||
dict[b2i(b'relo')].enum,
|
||||
dict[b2i(b'obj2')])
|
||||
|
||||
def mklogical(dict):
|
||||
return aetypes.Logical(dict[b2i(b'logc')], dict[b2i(b'term')])
|
||||
|
||||
def mkstyledtext(dict):
|
||||
return aetypes.StyledText(dict[b2i(b'ksty')], dict[b2i(b'ktxt')])
|
||||
|
||||
def mkaetext(dict):
|
||||
return aetypes.AEText(dict[b2i(keyAEScriptTag)],
|
||||
dict[b2i(keyAEStyles)],
|
||||
dict[b2i(keyAEText)])
|
||||
|
||||
def mkinsertionloc(dict):
|
||||
return aetypes.InsertionLoc(dict[b2i(keyAEObject)],
|
||||
dict[b2i(keyAEPosition)])
|
||||
|
||||
def mkobject(dict):
|
||||
want = dict[b2i(b'want')].type
|
||||
form = dict[b2i(b'form')].enum
|
||||
seld = dict[b2i(b'seld')]
|
||||
fr = dict[b2i(b'from')]
|
||||
if form in (b'name', b'indx', b'rang', b'test'):
|
||||
if want == b'text': return aetypes.Text(seld, fr)
|
||||
if want == b'cha ': return aetypes.Character(seld, fr)
|
||||
if want == b'cwor': return aetypes.Word(seld, fr)
|
||||
if want == b'clin': return aetypes.Line(seld, fr)
|
||||
if want == b'cpar': return aetypes.Paragraph(seld, fr)
|
||||
if want == b'cwin': return aetypes.Window(seld, fr)
|
||||
if want == b'docu': return aetypes.Document(seld, fr)
|
||||
if want == b'file': return aetypes.File(seld, fr)
|
||||
if want == b'cins': return aetypes.InsertionPoint(seld, fr)
|
||||
if want == b'prop' and form == b'prop' and aetypes.IsType(seld):
|
||||
return aetypes.Property(seld.type, fr)
|
||||
return aetypes.ObjectSpecifier(want, form, seld, fr)
|
||||
|
||||
# Note by Jack: I'm not 100% sure of the following code. This was
|
||||
# provided by Donovan Preston, but I wonder whether the assignment
|
||||
# to __class__ is safe. Moreover, shouldn't there be a better
|
||||
# initializer for the classes in the suites?
|
||||
def mkobjectfrommodule(dict, modulename):
|
||||
if (isinstance(dict[b2i(b'want')], type) and
|
||||
issubclass(dict[b2i(b'want')], ObjectSpecifier)):
|
||||
# The type has already been converted to Python. Convert back:-(
|
||||
classtype = dict[b2i(b'want')]
|
||||
dict[b2i(b'want')] = aetypes.mktype(classtype.want)
|
||||
want = dict[b2i(b'want')].type
|
||||
module = __import__(modulename)
|
||||
codenamemapper = module._classdeclarations
|
||||
classtype = codenamemapper.get(b2i(want), None)
|
||||
newobj = mkobject(dict)
|
||||
if classtype:
|
||||
assert issubclass(classtype, ObjectSpecifier)
|
||||
newobj.__class__ = classtype
|
||||
return newobj
|
||||
|
||||
def mktype(typecode, modulename=None):
|
||||
if modulename:
|
||||
module = __import__(modulename)
|
||||
codenamemapper = module._classdeclarations
|
||||
classtype = codenamemapper.get(b2i(typecode), None)
|
||||
if classtype:
|
||||
return classtype
|
||||
return aetypes.mktype(typecode)
|
|
@ -1,364 +0,0 @@
|
|||
"""Tools for use in AppleEvent clients and servers.
|
||||
|
||||
pack(x) converts a Python object to an AEDesc object
|
||||
unpack(desc) does the reverse
|
||||
|
||||
packevent(event, parameters, attributes) sets params and attrs in an AEAppleEvent record
|
||||
unpackevent(event) returns the parameters and attributes from an AEAppleEvent record
|
||||
|
||||
Plus... Lots of classes and routines that help representing AE objects,
|
||||
ranges, conditionals, logicals, etc., so you can write, e.g.:
|
||||
|
||||
x = Character(1, Document("foobar"))
|
||||
|
||||
and pack(x) will create an AE object reference equivalent to AppleScript's
|
||||
|
||||
character 1 of document "foobar"
|
||||
|
||||
Some of the stuff that appears to be exported from this module comes from other
|
||||
files: the pack stuff from aepack, the objects from aetypes.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
from Carbon import AE
|
||||
from Carbon import Evt
|
||||
from Carbon import AppleEvents
|
||||
import MacOS
|
||||
import sys
|
||||
import time
|
||||
|
||||
from aetypes import *
|
||||
from aepack import packkey, pack, unpack, coerce, AEDescType
|
||||
|
||||
Error = 'aetools.Error'
|
||||
|
||||
# Amount of time to wait for program to be launched
|
||||
LAUNCH_MAX_WAIT_TIME=10
|
||||
|
||||
# Special code to unpack an AppleEvent (which is *not* a disguised record!)
|
||||
# Note by Jack: No??!? If I read the docs correctly it *is*....
|
||||
|
||||
aekeywords = [
|
||||
'tran',
|
||||
'rtid',
|
||||
'evcl',
|
||||
'evid',
|
||||
'addr',
|
||||
'optk',
|
||||
'timo',
|
||||
'inte', # this attribute is read only - will be set in AESend
|
||||
'esrc', # this attribute is read only
|
||||
'miss', # this attribute is read only
|
||||
'from' # new in 1.0.1
|
||||
]
|
||||
|
||||
def missed(ae):
|
||||
try:
|
||||
desc = ae.AEGetAttributeDesc('miss', 'keyw')
|
||||
except AE.Error as msg:
|
||||
return None
|
||||
return desc.data
|
||||
|
||||
def unpackevent(ae, formodulename=""):
|
||||
parameters = {}
|
||||
try:
|
||||
dirobj = ae.AEGetParamDesc('----', '****')
|
||||
except AE.Error:
|
||||
pass
|
||||
else:
|
||||
parameters['----'] = unpack(dirobj, formodulename)
|
||||
del dirobj
|
||||
# Workaround for what I feel is a bug in OSX 10.2: 'errn' won't show up in missed...
|
||||
try:
|
||||
dirobj = ae.AEGetParamDesc('errn', '****')
|
||||
except AE.Error:
|
||||
pass
|
||||
else:
|
||||
parameters['errn'] = unpack(dirobj, formodulename)
|
||||
del dirobj
|
||||
while 1:
|
||||
key = missed(ae)
|
||||
if not key: break
|
||||
parameters[key] = unpack(ae.AEGetParamDesc(key, '****'), formodulename)
|
||||
attributes = {}
|
||||
for key in aekeywords:
|
||||
try:
|
||||
desc = ae.AEGetAttributeDesc(key, '****')
|
||||
except (AE.Error, MacOS.Error) as msg:
|
||||
if msg.args[0] not in (-1701, -1704):
|
||||
raise
|
||||
continue
|
||||
attributes[key] = unpack(desc, formodulename)
|
||||
return parameters, attributes
|
||||
|
||||
def packevent(ae, parameters = {}, attributes = {}):
|
||||
for key, value in parameters.items():
|
||||
packkey(ae, key, value)
|
||||
for key, value in attributes.items():
|
||||
ae.AEPutAttributeDesc(key, pack(value))
|
||||
|
||||
#
|
||||
# Support routine for automatically generated Suite interfaces
|
||||
# These routines are also useable for the reverse function.
|
||||
#
|
||||
def keysubst(arguments, keydict):
|
||||
"""Replace long name keys by their 4-char counterparts, and check"""
|
||||
ok = keydict.values()
|
||||
for k in arguments.keys():
|
||||
if k in keydict:
|
||||
v = arguments[k]
|
||||
del arguments[k]
|
||||
arguments[keydict[k]] = v
|
||||
elif k != '----' and k not in ok:
|
||||
raise TypeError('Unknown keyword argument: %s'%k)
|
||||
|
||||
def enumsubst(arguments, key, edict):
|
||||
"""Substitute a single enum keyword argument, if it occurs"""
|
||||
if key not in arguments or edict is None:
|
||||
return
|
||||
v = arguments[key]
|
||||
ok = edict.values()
|
||||
if v in edict:
|
||||
arguments[key] = Enum(edict[v])
|
||||
elif not v in ok:
|
||||
raise TypeError('Unknown enumerator: %s'%v)
|
||||
|
||||
def decodeerror(arguments):
|
||||
"""Create the 'best' argument for a raise MacOS.Error"""
|
||||
errn = arguments['errn']
|
||||
err_a1 = errn
|
||||
if 'errs' in arguments:
|
||||
err_a2 = arguments['errs']
|
||||
else:
|
||||
err_a2 = MacOS.GetErrorString(errn)
|
||||
if 'erob' in arguments:
|
||||
err_a3 = arguments['erob']
|
||||
else:
|
||||
err_a3 = None
|
||||
|
||||
return (err_a1, err_a2, err_a3)
|
||||
|
||||
class TalkTo:
|
||||
"""An AE connection to an application"""
|
||||
_signature = None # Can be overridden by subclasses
|
||||
_moduleName = None # Can be overridden by subclasses
|
||||
_elemdict = {} # Can be overridden by subclasses
|
||||
_propdict = {} # Can be overridden by subclasses
|
||||
|
||||
__eventloop_initialized = 0
|
||||
def __ensure_WMAvailable(klass):
|
||||
if klass.__eventloop_initialized: return 1
|
||||
if not MacOS.WMAvailable(): return 0
|
||||
# Workaround for a but in MacOSX 10.2: we must have an event
|
||||
# loop before we can call AESend.
|
||||
Evt.WaitNextEvent(0,0)
|
||||
return 1
|
||||
__ensure_WMAvailable = classmethod(__ensure_WMAvailable)
|
||||
|
||||
def __init__(self, signature=None, start=0, timeout=0):
|
||||
"""Create a communication channel with a particular application.
|
||||
|
||||
Addressing the application is done by specifying either a
|
||||
4-byte signature, an AEDesc or an object that will __aepack__
|
||||
to an AEDesc.
|
||||
"""
|
||||
self.target_signature = None
|
||||
if signature is None:
|
||||
signature = self._signature
|
||||
if isinstance(signature, AEDescType):
|
||||
self.target = signature
|
||||
elif hasattr(signature, '__aepack__'):
|
||||
self.target = signature.__aepack__()
|
||||
elif isinstance(signature, str) and len(signature) == 4:
|
||||
self.target = AE.AECreateDesc(AppleEvents.typeApplSignature, signature)
|
||||
self.target_signature = signature
|
||||
else:
|
||||
raise TypeError("signature should be 4-char string or AEDesc")
|
||||
self.send_flags = AppleEvents.kAEWaitReply
|
||||
self.send_priority = AppleEvents.kAENormalPriority
|
||||
if timeout:
|
||||
self.send_timeout = timeout
|
||||
else:
|
||||
self.send_timeout = AppleEvents.kAEDefaultTimeout
|
||||
if start:
|
||||
self._start()
|
||||
|
||||
def _start(self):
|
||||
"""Start the application, if it is not running yet"""
|
||||
try:
|
||||
self.send('ascr', 'noop')
|
||||
except AE.Error:
|
||||
_launch(self.target_signature)
|
||||
for i in range(LAUNCH_MAX_WAIT_TIME):
|
||||
try:
|
||||
self.send('ascr', 'noop')
|
||||
except AE.Error:
|
||||
pass
|
||||
else:
|
||||
break
|
||||
time.sleep(1)
|
||||
|
||||
def start(self):
|
||||
"""Deprecated, used _start()"""
|
||||
self._start()
|
||||
|
||||
def newevent(self, code, subcode, parameters = {}, attributes = {}):
|
||||
"""Create a complete structure for an apple event"""
|
||||
|
||||
event = AE.AECreateAppleEvent(code, subcode, self.target,
|
||||
AppleEvents.kAutoGenerateReturnID, AppleEvents.kAnyTransactionID)
|
||||
packevent(event, parameters, attributes)
|
||||
return event
|
||||
|
||||
def sendevent(self, event):
|
||||
"""Send a pre-created appleevent, await the reply and unpack it"""
|
||||
if not self.__ensure_WMAvailable():
|
||||
raise RuntimeError("No window manager access, cannot send AppleEvent")
|
||||
reply = event.AESend(self.send_flags, self.send_priority,
|
||||
self.send_timeout)
|
||||
parameters, attributes = unpackevent(reply, self._moduleName)
|
||||
return reply, parameters, attributes
|
||||
|
||||
def send(self, code, subcode, parameters = {}, attributes = {}):
|
||||
"""Send an appleevent given code/subcode/pars/attrs and unpack the reply"""
|
||||
return self.sendevent(self.newevent(code, subcode, parameters, attributes))
|
||||
|
||||
#
|
||||
# The following events are somehow "standard" and don't seem to appear in any
|
||||
# suite...
|
||||
#
|
||||
def activate(self):
|
||||
"""Send 'activate' command"""
|
||||
self.send('misc', 'actv')
|
||||
|
||||
def _get(self, _object, asfile=None, _attributes={}):
|
||||
"""_get: get data from an object
|
||||
Required argument: the object
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
Returns: the data
|
||||
"""
|
||||
_code = 'core'
|
||||
_subcode = 'getd'
|
||||
|
||||
_arguments = {'----':_object}
|
||||
if asfile:
|
||||
_arguments['rtyp'] = mktype(asfile)
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if 'errn' in _arguments:
|
||||
raise Error(decodeerror(_arguments))
|
||||
|
||||
if '----' in _arguments:
|
||||
return _arguments['----']
|
||||
if asfile:
|
||||
item.__class__ = asfile
|
||||
return item
|
||||
|
||||
get = _get
|
||||
|
||||
_argmap_set = {
|
||||
'to' : 'data',
|
||||
}
|
||||
|
||||
def _set(self, _object, _attributes={}, **_arguments):
|
||||
"""set: Set an object's data.
|
||||
Required argument: the object for the command
|
||||
Keyword argument to: The new value.
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
"""
|
||||
_code = 'core'
|
||||
_subcode = 'setd'
|
||||
|
||||
keysubst(_arguments, self._argmap_set)
|
||||
_arguments['----'] = _object
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if _arguments.get('errn', 0):
|
||||
raise Error(decodeerror(_arguments))
|
||||
# XXXX Optionally decode result
|
||||
if '----' in _arguments:
|
||||
return _arguments['----']
|
||||
|
||||
set = _set
|
||||
|
||||
# Magic glue to allow suite-generated classes to function somewhat
|
||||
# like the "application" class in OSA.
|
||||
|
||||
def __getattr__(self, name):
|
||||
if name in self._elemdict:
|
||||
cls = self._elemdict[name]
|
||||
return DelayedComponentItem(cls, None)
|
||||
if name in self._propdict:
|
||||
cls = self._propdict[name]
|
||||
return cls()
|
||||
raise AttributeError(name)
|
||||
|
||||
# Tiny Finder class, for local use only
|
||||
|
||||
class _miniFinder(TalkTo):
|
||||
def open(self, _object, _attributes={}, **_arguments):
|
||||
"""open: Open the specified object(s)
|
||||
Required argument: list of objects to open
|
||||
Keyword argument _attributes: AppleEvent attribute dictionary
|
||||
"""
|
||||
_code = 'aevt'
|
||||
_subcode = 'odoc'
|
||||
|
||||
if _arguments: raise TypeError('No optional args expected')
|
||||
_arguments['----'] = _object
|
||||
|
||||
|
||||
_reply, _arguments, _attributes = self.send(_code, _subcode,
|
||||
_arguments, _attributes)
|
||||
if 'errn' in _arguments:
|
||||
raise Error(decodeerror(_arguments))
|
||||
# XXXX Optionally decode result
|
||||
if '----' in _arguments:
|
||||
return _arguments['----']
|
||||
#pass
|
||||
|
||||
_finder = _miniFinder('MACS')
|
||||
|
||||
def _launch(appfile):
|
||||
"""Open a file thru the finder. Specify file by name or fsspec"""
|
||||
_finder.open(_application_file(('ID ', appfile)))
|
||||
|
||||
|
||||
class _application_file(ComponentItem):
|
||||
"""application file - An application's file on disk"""
|
||||
want = 'appf'
|
||||
|
||||
_application_file._propdict = {
|
||||
}
|
||||
_application_file._elemdict = {
|
||||
}
|
||||
|
||||
# Test program
|
||||
# XXXX Should test more, really...
|
||||
|
||||
def test():
|
||||
def raw_input(prompt):
|
||||
sys.stdout.write(prompt)
|
||||
sys.stdout.flush()
|
||||
return sys.stdin.readline()
|
||||
|
||||
target = AE.AECreateDesc('sign', 'quil')
|
||||
ae = AE.AECreateAppleEvent('aevt', 'oapp', target, -1, 0)
|
||||
print(unpackevent(ae))
|
||||
raw_input(":")
|
||||
ae = AE.AECreateAppleEvent('core', 'getd', target, -1, 0)
|
||||
obj = Character(2, Word(1, Document(1)))
|
||||
print(obj)
|
||||
print(repr(obj))
|
||||
packevent(ae, {'----': obj})
|
||||
params, attrs = unpackevent(ae)
|
||||
print(params['----'])
|
||||
raw_input(":")
|
||||
|
||||
if __name__ == '__main__':
|
||||
test()
|
||||
sys.exit(1)
|
|
@ -1,584 +0,0 @@
|
|||
"""aetypes - Python objects representing various AE types."""
|
||||
|
||||
from Carbon.AppleEvents import *
|
||||
import struct
|
||||
|
||||
#
|
||||
# convoluted, since there are cyclic dependencies between this file and
|
||||
# aetools_convert.
|
||||
#
|
||||
def pack(*args, **kwargs):
|
||||
from aepack import pack
|
||||
return pack( *args, **kwargs)
|
||||
|
||||
def nice(s):
|
||||
"""'nice' representation of an object"""
|
||||
if isinstance(s, str): return repr(s)
|
||||
else: return str(s)
|
||||
|
||||
def _four_char_code(four_chars):
|
||||
"""Convert a str or bytes object into a 4-byte array.
|
||||
|
||||
four_chars must contain only ASCII characters.
|
||||
|
||||
"""
|
||||
if isinstance(four_chars, (bytes, bytearray)):
|
||||
b = bytes(four_chars[:4])
|
||||
n = len(b)
|
||||
if n < 4:
|
||||
b += b' ' * (4 - n)
|
||||
return b
|
||||
else:
|
||||
s = str(four_chars)[:4]
|
||||
n = len(s)
|
||||
if n < 4:
|
||||
s += ' ' * (4 - n)
|
||||
return bytes(s, "latin-1") # MacRoman?
|
||||
|
||||
class Unknown:
|
||||
"""An uninterpreted AE object"""
|
||||
|
||||
def __init__(self, type, data):
|
||||
self.type = type
|
||||
self.data = data
|
||||
|
||||
def __repr__(self):
|
||||
return "Unknown(%r, %r)" % (self.type, self.data)
|
||||
|
||||
def __aepack__(self):
|
||||
return pack(self.data, self.type)
|
||||
|
||||
class Enum:
|
||||
"""An AE enumeration value"""
|
||||
|
||||
def __init__(self, enum):
|
||||
self.enum = _four_char_code(enum)
|
||||
|
||||
def __repr__(self):
|
||||
return "Enum(%r)" % (self.enum,)
|
||||
|
||||
def __str__(self):
|
||||
return self.enum.decode("latin-1").strip(" ")
|
||||
|
||||
def __aepack__(self):
|
||||
return pack(self.enum, typeEnumeration)
|
||||
|
||||
def IsEnum(x):
|
||||
return isinstance(x, Enum)
|
||||
|
||||
def mkenum(enum):
|
||||
if IsEnum(enum): return enum
|
||||
return Enum(enum)
|
||||
|
||||
# Jack changed the way this is done
|
||||
class InsertionLoc:
|
||||
def __init__(self, of, pos):
|
||||
self.of = of
|
||||
self.pos = pos
|
||||
|
||||
def __repr__(self):
|
||||
return "InsertionLoc(%r, %r)" % (self.of, self.pos)
|
||||
|
||||
def __aepack__(self):
|
||||
rec = {'kobj': self.of, 'kpos': self.pos}
|
||||
return pack(rec, forcetype='insl')
|
||||
|
||||
# Convenience functions for dsp:
|
||||
def beginning(of):
|
||||
return InsertionLoc(of, Enum('bgng'))
|
||||
|
||||
def end(of):
|
||||
return InsertionLoc(of, Enum('end '))
|
||||
|
||||
class Boolean:
|
||||
"""An AE boolean value"""
|
||||
|
||||
def __init__(self, bool):
|
||||
self.bool = (not not bool)
|
||||
|
||||
def __repr__(self):
|
||||
return "Boolean(%r)" % (self.bool,)
|
||||
|
||||
def __str__(self):
|
||||
if self.bool:
|
||||
return "True"
|
||||
else:
|
||||
return "False"
|
||||
|
||||
def __aepack__(self):
|
||||
return pack(struct.pack('b', self.bool), 'bool')
|
||||
|
||||
def IsBoolean(x):
|
||||
return isinstance(x, Boolean)
|
||||
|
||||
def mkboolean(bool):
|
||||
if IsBoolean(bool): return bool
|
||||
return Boolean(bool)
|
||||
|
||||
class Type:
|
||||
"""An AE 4-char typename object"""
|
||||
|
||||
def __init__(self, type):
|
||||
self.type = _four_char_code(type)
|
||||
|
||||
def __repr__(self):
|
||||
return "Type(%r)" % (self.type,)
|
||||
|
||||
def __str__(self):
|
||||
return self.type.strip()
|
||||
|
||||
def __aepack__(self):
|
||||
return pack(self.type, typeType)
|
||||
|
||||
def IsType(x):
|
||||
return isinstance(x, Type)
|
||||
|
||||
def mktype(type):
|
||||
if IsType(type): return type
|
||||
return Type(type)
|
||||
|
||||
|
||||
class Keyword:
|
||||
"""An AE 4-char keyword object"""
|
||||
|
||||
def __init__(self, keyword):
|
||||
self.keyword = _four_char_code(keyword)
|
||||
|
||||
def __repr__(self):
|
||||
return "Keyword(%r)" % self.keyword
|
||||
|
||||
def __str__(self):
|
||||
return self.keyword.strip()
|
||||
|
||||
def __aepack__(self):
|
||||
return pack(self.keyword, typeKeyword)
|
||||
|
||||
def IsKeyword(x):
|
||||
return isinstance(x, Keyword)
|
||||
|
||||
class Range:
|
||||
"""An AE range object"""
|
||||
|
||||
def __init__(self, start, stop):
|
||||
self.start = start
|
||||
self.stop = stop
|
||||
|
||||
def __repr__(self):
|
||||
return "Range(%r, %r)" % (self.start, self.stop)
|
||||
|
||||
def __str__(self):
|
||||
return "%s thru %s" % (nice(self.start), nice(self.stop))
|
||||
|
||||
def __aepack__(self):
|
||||
return pack({'star': self.start, 'stop': self.stop}, 'rang')
|
||||
|
||||
def IsRange(x):
|
||||
return isinstance(x, Range)
|
||||
|
||||
class Comparison:
|
||||
"""An AE Comparison"""
|
||||
|
||||
def __init__(self, obj1, relo, obj2):
|
||||
self.obj1 = obj1
|
||||
self.relo = _four_char_code(relo)
|
||||
self.obj2 = obj2
|
||||
|
||||
def __repr__(self):
|
||||
return "Comparison(%r, %r, %r)" % (self.obj1, self.relo, self.obj2)
|
||||
|
||||
def __str__(self):
|
||||
return "%s %s %s" % (nice(self.obj1), self.relo.strip(), nice(self.obj2))
|
||||
|
||||
def __aepack__(self):
|
||||
return pack({'obj1': self.obj1,
|
||||
'relo': mkenum(self.relo),
|
||||
'obj2': self.obj2},
|
||||
'cmpd')
|
||||
|
||||
def IsComparison(x):
|
||||
return isinstance(x, Comparison)
|
||||
|
||||
class NComparison(Comparison):
|
||||
# The class attribute 'relo' must be set in a subclass
|
||||
|
||||
def __init__(self, obj1, obj2):
|
||||
Comparison.__init__(obj1, self.relo, obj2)
|
||||
|
||||
class Ordinal:
|
||||
"""An AE Ordinal"""
|
||||
|
||||
def __init__(self, abso):
|
||||
# self.obj1 = obj1
|
||||
self.abso = _four_char_code(abso)
|
||||
|
||||
def __repr__(self):
|
||||
return "Ordinal(%r)" % (self.abso,)
|
||||
|
||||
def __str__(self):
|
||||
return "%s" % (self.abso.strip())
|
||||
|
||||
def __aepack__(self):
|
||||
return pack(self.abso, 'abso')
|
||||
|
||||
def IsOrdinal(x):
|
||||
return isinstance(x, Ordinal)
|
||||
|
||||
class NOrdinal(Ordinal):
|
||||
# The class attribute 'abso' must be set in a subclass
|
||||
|
||||
def __init__(self):
|
||||
Ordinal.__init__(self, self.abso)
|
||||
|
||||
class Logical:
|
||||
"""An AE logical expression object"""
|
||||
|
||||
def __init__(self, logc, term):
|
||||
self.logc = _four_char_code(logc)
|
||||
self.term = term
|
||||
|
||||
def __repr__(self):
|
||||
return "Logical(%r, %r)" % (self.logc, self.term)
|
||||
|
||||
def __str__(self):
|
||||
if isinstance(self.term, list) and len(self.term) == 2:
|
||||
return "%s %s %s" % (nice(self.term[0]),
|
||||
self.logc.strip(),
|
||||
nice(self.term[1]))
|
||||
else:
|
||||
return "%s(%s)" % (self.logc.strip(), nice(self.term))
|
||||
|
||||
def __aepack__(self):
|
||||
return pack({'logc': mkenum(self.logc), 'term': self.term}, 'logi')
|
||||
|
||||
def IsLogical(x):
|
||||
return isinstance(x, Logical)
|
||||
|
||||
class StyledText:
|
||||
"""An AE object respresenting text in a certain style"""
|
||||
|
||||
def __init__(self, style, text):
|
||||
self.style = style
|
||||
self.text = text
|
||||
|
||||
def __repr__(self):
|
||||
return "StyledText(%r, %r)" % (self.style, self.text)
|
||||
|
||||
def __str__(self):
|
||||
return self.text
|
||||
|
||||
def __aepack__(self):
|
||||
return pack({'ksty': self.style, 'ktxt': self.text}, 'STXT')
|
||||
|
||||
def IsStyledText(x):
|
||||
return isinstance(x, StyledText)
|
||||
|
||||
class AEText:
|
||||
"""An AE text object with style, script and language specified"""
|
||||
|
||||
def __init__(self, script, style, text):
|
||||
self.script = script
|
||||
self.style = style
|
||||
self.text = text
|
||||
|
||||
def __repr__(self):
|
||||
return "AEText(%r, %r, %r)" % (self.script, self.style, self.text)
|
||||
|
||||
def __str__(self):
|
||||
return self.text
|
||||
|
||||
def __aepack__(self):
|
||||
return pack({keyAEScriptTag: self.script, keyAEStyles: self.style,
|
||||
keyAEText: self.text}, typeAEText)
|
||||
|
||||
def IsAEText(x):
|
||||
return isinstance(x, AEText)
|
||||
|
||||
class IntlText:
|
||||
"""A text object with script and language specified"""
|
||||
|
||||
def __init__(self, script, language, text):
|
||||
self.script = script
|
||||
self.language = language
|
||||
self.text = text
|
||||
|
||||
def __repr__(self):
|
||||
return "IntlText(%r, %r, %r)" % (self.script, self.language, self.text)
|
||||
|
||||
def __str__(self):
|
||||
return self.text
|
||||
|
||||
def __aepack__(self):
|
||||
return pack(struct.pack('hh', self.script, self.language)+self.text,
|
||||
typeIntlText)
|
||||
|
||||
def IsIntlText(x):
|
||||
return isinstance(x, IntlText)
|
||||
|
||||
class IntlWritingCode:
|
||||
"""An object representing script and language"""
|
||||
|
||||
def __init__(self, script, language):
|
||||
self.script = script
|
||||
self.language = language
|
||||
|
||||
def __repr__(self):
|
||||
return "IntlWritingCode(%r, %r)" % (self.script, self.language)
|
||||
|
||||
def __str__(self):
|
||||
return "script system %d, language %d"%(self.script, self.language)
|
||||
|
||||
def __aepack__(self):
|
||||
return pack(struct.pack('hh', self.script, self.language),
|
||||
typeIntlWritingCode)
|
||||
|
||||
def IsIntlWritingCode(x):
|
||||
return isinstance(x, IntlWritingCode)
|
||||
|
||||
class QDPoint:
|
||||
"""A point"""
|
||||
|
||||
def __init__(self, v, h):
|
||||
self.v = v
|
||||
self.h = h
|
||||
|
||||
def __repr__(self):
|
||||
return "QDPoint(%r, %r)" % (self.v, self.h)
|
||||
|
||||
def __str__(self):
|
||||
return "(%d, %d)"%(self.v, self.h)
|
||||
|
||||
def __aepack__(self):
|
||||
return pack(struct.pack('hh', self.v, self.h),
|
||||
typeQDPoint)
|
||||
|
||||
def IsQDPoint(x):
|
||||
return isinstance(x, QDPoint)
|
||||
|
||||
class QDRectangle:
|
||||
"""A rectangle"""
|
||||
|
||||
def __init__(self, v0, h0, v1, h1):
|
||||
self.v0 = v0
|
||||
self.h0 = h0
|
||||
self.v1 = v1
|
||||
self.h1 = h1
|
||||
|
||||
def __repr__(self):
|
||||
return "QDRectangle(%r, %r, %r, %r)" % (self.v0, self.h0, self.v1, self.h1)
|
||||
|
||||
def __str__(self):
|
||||
return "(%d, %d)-(%d, %d)"%(self.v0, self.h0, self.v1, self.h1)
|
||||
|
||||
def __aepack__(self):
|
||||
return pack(struct.pack('hhhh', self.v0, self.h0, self.v1, self.h1),
|
||||
typeQDRectangle)
|
||||
|
||||
def IsQDRectangle(x):
|
||||
return isinstance(x, QDRectangle)
|
||||
|
||||
class RGBColor:
|
||||
"""An RGB color"""
|
||||
|
||||
def __init__(self, r, g, b):
|
||||
self.r = r
|
||||
self.g = g
|
||||
self.b = b
|
||||
|
||||
def __repr__(self):
|
||||
return "RGBColor(%r, %r, %r)" % (self.r, self.g, self.b)
|
||||
|
||||
def __str__(self):
|
||||
return "0x%x red, 0x%x green, 0x%x blue"% (self.r, self.g, self.b)
|
||||
|
||||
def __aepack__(self):
|
||||
return pack(struct.pack('hhh', self.r, self.g, self.b),
|
||||
typeRGBColor)
|
||||
|
||||
def IsRGBColor(x):
|
||||
return isinstance(x, RGBColor)
|
||||
|
||||
class ObjectSpecifier:
|
||||
|
||||
"""A class for constructing and manipulation AE object specifiers in python.
|
||||
|
||||
An object specifier is actually a record with four fields:
|
||||
|
||||
key type description
|
||||
--- ---- -----------
|
||||
|
||||
'want' type 4-char class code of thing we want,
|
||||
e.g. word, paragraph or property
|
||||
|
||||
'form' enum how we specify which 'want' thing(s) we want,
|
||||
e.g. by index, by range, by name, or by property specifier
|
||||
|
||||
'seld' any which thing(s) we want,
|
||||
e.g. its index, its name, or its property specifier
|
||||
|
||||
'from' object the object in which it is contained,
|
||||
or null, meaning look for it in the application
|
||||
|
||||
Note that we don't call this class plain "Object", since that name
|
||||
is likely to be used by the application.
|
||||
"""
|
||||
|
||||
def __init__(self, want, form, seld, fr = None):
|
||||
self.want = want
|
||||
self.form = form
|
||||
self.seld = seld
|
||||
self.fr = fr
|
||||
|
||||
def __repr__(self):
|
||||
s = "ObjectSpecifier(%r, %r, %r" % (self.want, self.form, self.seld)
|
||||
if self.fr:
|
||||
s = s + ", %r)" % (self.fr,)
|
||||
else:
|
||||
s = s + ")"
|
||||
return s
|
||||
|
||||
def __aepack__(self):
|
||||
return pack({'want': mktype(self.want),
|
||||
'form': mkenum(self.form),
|
||||
'seld': self.seld,
|
||||
'from': self.fr},
|
||||
'obj ')
|
||||
|
||||
def IsObjectSpecifier(x):
|
||||
return isinstance(x, ObjectSpecifier)
|
||||
|
||||
|
||||
# Backwards compatibility, sigh...
|
||||
class Property(ObjectSpecifier):
|
||||
|
||||
def __init__(self, which, fr = None, want='prop'):
|
||||
ObjectSpecifier.__init__(self, want, 'prop', mktype(which), fr)
|
||||
|
||||
def __repr__(self):
|
||||
if self.fr:
|
||||
return "Property(%r, %r)" % (self.seld.type, self.fr)
|
||||
else:
|
||||
return "Property(%r)" % (self.seld.type,)
|
||||
|
||||
def __str__(self):
|
||||
if self.fr:
|
||||
return "Property %s of %s" % (str(self.seld), str(self.fr))
|
||||
else:
|
||||
return "Property %s" % str(self.seld)
|
||||
|
||||
|
||||
class NProperty(ObjectSpecifier):
|
||||
# Subclasses *must* self baseclass attributes:
|
||||
# want is the type of this property
|
||||
# which is the property name of this property
|
||||
|
||||
def __init__(self, fr = None):
|
||||
#try:
|
||||
# dummy = self.want
|
||||
#except:
|
||||
# self.want = 'prop'
|
||||
self.want = 'prop'
|
||||
ObjectSpecifier.__init__(self, self.want, 'prop',
|
||||
mktype(self.which), fr)
|
||||
|
||||
def __repr__(self):
|
||||
rv = "Property(%r" % (self.seld.type,)
|
||||
if self.fr:
|
||||
rv = rv + ", fr=%r" % (self.fr,)
|
||||
if self.want != 'prop':
|
||||
rv = rv + ", want=%r" % (self.want,)
|
||||
return rv + ")"
|
||||
|
||||
def __str__(self):
|
||||
if self.fr:
|
||||
return "Property %s of %s" % (str(self.seld), str(self.fr))
|
||||
else:
|
||||
return "Property %s" % str(self.seld)
|
||||
|
||||
|
||||
class SelectableItem(ObjectSpecifier):
|
||||
|
||||
def __init__(self, want, seld, fr = None):
|
||||
t = type(seld)
|
||||
if isinstance(t, str):
|
||||
form = 'name'
|
||||
elif IsRange(seld):
|
||||
form = 'rang'
|
||||
elif IsComparison(seld) or IsLogical(seld):
|
||||
form = 'test'
|
||||
elif isinstance(t, tuple):
|
||||
# Breakout: specify both form and seld in a tuple
|
||||
# (if you want ID or rele or somesuch)
|
||||
form, seld = seld
|
||||
else:
|
||||
form = 'indx'
|
||||
ObjectSpecifier.__init__(self, want, form, seld, fr)
|
||||
|
||||
|
||||
class ComponentItem(SelectableItem):
|
||||
# Derived classes *must* set the *class attribute* 'want' to some constant
|
||||
# Also, dictionaries _propdict and _elemdict must be set to map property
|
||||
# and element names to the correct classes
|
||||
|
||||
_propdict = {}
|
||||
_elemdict = {}
|
||||
def __init__(self, which, fr = None):
|
||||
SelectableItem.__init__(self, self.want, which, fr)
|
||||
|
||||
def __repr__(self):
|
||||
if not self.fr:
|
||||
return "%s(%r)" % (self.__class__.__name__, self.seld)
|
||||
return "%s(%r, %r)" % (self.__class__.__name__, self.seld, self.fr)
|
||||
|
||||
def __str__(self):
|
||||
seld = self.seld
|
||||
if isinstance(seld, str):
|
||||
ss = repr(seld)
|
||||
elif IsRange(seld):
|
||||
start, stop = seld.start, seld.stop
|
||||
if type(start) == type(stop) == type(self):
|
||||
ss = str(start.seld) + " thru " + str(stop.seld)
|
||||
else:
|
||||
ss = str(seld)
|
||||
else:
|
||||
ss = str(seld)
|
||||
s = "%s %s" % (self.__class__.__name__, ss)
|
||||
if self.fr: s = s + " of %s" % str(self.fr)
|
||||
return s
|
||||
|
||||
def __getattr__(self, name):
|
||||
if name in self._elemdict:
|
||||
cls = self._elemdict[name]
|
||||
return DelayedComponentItem(cls, self)
|
||||
if name in self._propdict:
|
||||
cls = self._propdict[name]
|
||||
return cls(self)
|
||||
raise AttributeError(name)
|
||||
|
||||
|
||||
class DelayedComponentItem:
|
||||
def __init__(self, compclass, fr):
|
||||
self.compclass = compclass
|
||||
self.fr = fr
|
||||
|
||||
def __call__(self, which):
|
||||
return self.compclass(which, self.fr)
|
||||
|
||||
def __repr__(self):
|
||||
return "%s(???, %r)" % (self.__class__.__name__, self.fr)
|
||||
|
||||
def __str__(self):
|
||||
return "selector for element %s of %s"%(self.__class__.__name__, str(self.fr))
|
||||
|
||||
template = """
|
||||
class %s(ComponentItem): want = %r
|
||||
"""
|
||||
|
||||
exec(template % ("Text", b'text'))
|
||||
exec(template % ("Character", b'cha '))
|
||||
exec(template % ("Word", b'cwor'))
|
||||
exec(template % ("Line", b'clin'))
|
||||
exec(template % ("paragraph", b'cpar'))
|
||||
exec(template % ("Window", b'cwin'))
|
||||
exec(template % ("Document", b'docu'))
|
||||
exec(template % ("File", b'file'))
|
||||
exec(template % ("InsertionPoint", b'cins'))
|
|
@ -1,137 +0,0 @@
|
|||
r"""Routines to decode AppleSingle files
|
||||
"""
|
||||
import struct
|
||||
import sys
|
||||
try:
|
||||
import MacOS
|
||||
import Carbon.File
|
||||
except:
|
||||
class MacOS:
|
||||
def openrf(path, mode):
|
||||
return open(path + '.rsrc', mode)
|
||||
openrf = classmethod(openrf)
|
||||
class Carbon:
|
||||
class File:
|
||||
class FSSpec:
|
||||
pass
|
||||
class FSRef:
|
||||
pass
|
||||
class Alias:
|
||||
pass
|
||||
|
||||
# all of the errors in this module are really errors in the input
|
||||
# so I think it should test positive against ValueError.
|
||||
class Error(ValueError):
|
||||
pass
|
||||
|
||||
# File header format: magic, version, unused, number of entries
|
||||
AS_HEADER_FORMAT=">LL16sh"
|
||||
AS_HEADER_LENGTH=26
|
||||
# The flag words for AppleSingle
|
||||
AS_MAGIC=0x00051600
|
||||
AS_VERSION=0x00020000
|
||||
|
||||
# Entry header format: id, offset, length
|
||||
AS_ENTRY_FORMAT=">lll"
|
||||
AS_ENTRY_LENGTH=12
|
||||
|
||||
# The id values
|
||||
AS_DATAFORK=1
|
||||
AS_RESOURCEFORK=2
|
||||
AS_IGNORE=(3,4,5,6,8,9,10,11,12,13,14,15)
|
||||
|
||||
class AppleSingle(object):
|
||||
datafork = None
|
||||
resourcefork = None
|
||||
|
||||
def __init__(self, fileobj, verbose=False):
|
||||
header = fileobj.read(AS_HEADER_LENGTH)
|
||||
try:
|
||||
magic, version, ig, nentry = struct.unpack(AS_HEADER_FORMAT, header)
|
||||
except ValueError as arg:
|
||||
raise Error("Unpack header error: %s" % (arg,))
|
||||
if verbose:
|
||||
print('Magic: 0x%8.8x' % (magic,))
|
||||
print('Version: 0x%8.8x' % (version,))
|
||||
print('Entries: %d' % (nentry,))
|
||||
if magic != AS_MAGIC:
|
||||
raise Error("Unknown AppleSingle magic number 0x%8.8x" % (magic,))
|
||||
if version != AS_VERSION:
|
||||
raise Error("Unknown AppleSingle version number 0x%8.8x" % (version,))
|
||||
if nentry <= 0:
|
||||
raise Error("AppleSingle file contains no forks")
|
||||
headers = [fileobj.read(AS_ENTRY_LENGTH) for i in range(nentry)]
|
||||
self.forks = []
|
||||
for hdr in headers:
|
||||
try:
|
||||
restype, offset, length = struct.unpack(AS_ENTRY_FORMAT, hdr)
|
||||
except ValueError as arg:
|
||||
raise Error("Unpack entry error: %s" % (arg,))
|
||||
if verbose:
|
||||
print("Fork %d, offset %d, length %d" % (restype, offset, length))
|
||||
fileobj.seek(offset)
|
||||
data = fileobj.read(length)
|
||||
if len(data) != length:
|
||||
raise Error("Short read: expected %d bytes got %d" % (length, len(data)))
|
||||
self.forks.append((restype, data))
|
||||
if restype == AS_DATAFORK:
|
||||
self.datafork = data
|
||||
elif restype == AS_RESOURCEFORK:
|
||||
self.resourcefork = data
|
||||
|
||||
def tofile(self, path, resonly=False):
|
||||
outfile = open(path, 'wb')
|
||||
data = False
|
||||
if resonly:
|
||||
if self.resourcefork is None:
|
||||
raise Error("No resource fork found")
|
||||
fp = open(path, 'wb')
|
||||
fp.write(self.resourcefork)
|
||||
fp.close()
|
||||
elif (self.resourcefork is None and self.datafork is None):
|
||||
raise Error("No useful forks found")
|
||||
else:
|
||||
if self.datafork is not None:
|
||||
fp = open(path, 'wb')
|
||||
fp.write(self.datafork)
|
||||
fp.close()
|
||||
if self.resourcefork is not None:
|
||||
fp = MacOS.openrf(path, '*wb')
|
||||
fp.write(self.resourcefork)
|
||||
fp.close()
|
||||
|
||||
def decode(infile, outpath, resonly=False, verbose=False):
|
||||
"""decode(infile, outpath [, resonly=False, verbose=False])
|
||||
|
||||
Creates a decoded file from an AppleSingle encoded file.
|
||||
If resonly is True, then it will create a regular file at
|
||||
outpath containing only the resource fork from infile.
|
||||
Otherwise it will create an AppleDouble file at outpath
|
||||
with the data and resource forks from infile. On platforms
|
||||
without the MacOS module, it will create inpath and inpath+'.rsrc'
|
||||
with the data and resource forks respectively.
|
||||
|
||||
"""
|
||||
if not hasattr(infile, 'read'):
|
||||
if isinstance(infile, Carbon.File.Alias):
|
||||
infile = infile.ResolveAlias()[0]
|
||||
if isinstance(infile, (Carbon.File.FSSpec, Carbon.File.FSRef)):
|
||||
infile = infile.as_pathname()
|
||||
infile = open(infile, 'rb')
|
||||
|
||||
asfile = AppleSingle(infile, verbose=verbose)
|
||||
asfile.tofile(outpath, resonly=resonly)
|
||||
|
||||
def _test():
|
||||
if len(sys.argv) < 3 or sys.argv[1] == '-r' and len(sys.argv) != 4:
|
||||
print('Usage: applesingle.py [-r] applesinglefile decodedfile')
|
||||
sys.exit(1)
|
||||
if sys.argv[1] == '-r':
|
||||
resonly = True
|
||||
del sys.argv[1]
|
||||
else:
|
||||
resonly = False
|
||||
decode(sys.argv[1], sys.argv[2], resonly=resonly)
|
||||
|
||||
if __name__ == '__main__':
|
||||
_test()
|
|
@ -1,63 +0,0 @@
|
|||
# Emulate sys.argv and run __main__.py or __main__.pyc in an environment that
|
||||
# is as close to "normal" as possible.
|
||||
#
|
||||
# This script is put into __rawmain__.pyc for applets that need argv
|
||||
# emulation, by BuildApplet and friends.
|
||||
#
|
||||
import argvemulator
|
||||
import os
|
||||
import sys
|
||||
import marshal
|
||||
|
||||
#
|
||||
# Make sure we have an argv[0], and make _dir point to the Resources
|
||||
# directory.
|
||||
#
|
||||
if not sys.argv or sys.argv[0][:1] == '-':
|
||||
# Insert our (guessed) name.
|
||||
_dir = os.path.split(sys.executable)[0] # removes "python"
|
||||
_dir = os.path.split(_dir)[0] # Removes "MacOS"
|
||||
_dir = os.path.join(_dir, 'Resources')
|
||||
sys.argv.insert(0, '__rawmain__')
|
||||
else:
|
||||
_dir = os.path.split(sys.argv[0])[0]
|
||||
#
|
||||
# Add the Resources directory to the path. This is where files installed
|
||||
# by BuildApplet.py with the --extra option show up, and if those files are
|
||||
# modules this sys.path modification is necessary to be able to import them.
|
||||
#
|
||||
sys.path.insert(0, _dir)
|
||||
#
|
||||
# Create sys.argv
|
||||
#
|
||||
argvemulator.ArgvCollector().mainloop()
|
||||
#
|
||||
# Find the real main program to run
|
||||
#
|
||||
__file__ = os.path.join(_dir, '__main__.py')
|
||||
if os.path.exists(__file__):
|
||||
#
|
||||
# Setup something resembling a normal environment and go.
|
||||
#
|
||||
sys.argv[0] = __file__
|
||||
del argvemulator, os, sys, _dir
|
||||
exec(open(__file__).read())
|
||||
else:
|
||||
__file__ = os.path.join(_dir, '__main__.pyc')
|
||||
if os.path.exists(__file__):
|
||||
#
|
||||
# If we have only a .pyc file we read the code object from that
|
||||
#
|
||||
sys.argv[0] = __file__
|
||||
_fp = open(__file__, 'rb')
|
||||
_fp.read(8)
|
||||
__code__ = marshal.load(_fp)
|
||||
#
|
||||
# Again, we create an almost-normal environment (only __code__ is
|
||||
# funny) and go.
|
||||
#
|
||||
del argvemulator, os, sys, marshal, _dir, _fp
|
||||
exec(__code__)
|
||||
else:
|
||||
sys.stderr.write("%s: neither __main__.py nor __main__.pyc found\n"%sys.argv[0])
|
||||
sys.exit(1)
|
|
@ -1,17 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
# This file is meant as an executable script for running applets.
|
||||
# BuildApplet will use it as the main executable in the .app bundle if
|
||||
# we are not running in a framework build.
|
||||
|
||||
import os
|
||||
import sys
|
||||
for name in ["__rawmain__.py", "__rawmain__.pyc", "__main__.py", "__main__.pyc"]:
|
||||
realmain = os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])),
|
||||
"Resources", name)
|
||||
if os.path.exists(realmain):
|
||||
break
|
||||
else:
|
||||
sys.stderr.write("%s: cannot find applet main program\n" % sys.argv[0])
|
||||
sys.exit(1)
|
||||
sys.argv.insert(1, realmain)
|
||||
os.execve(sys.executable, sys.argv, os.environ)
|
|
@ -1,89 +0,0 @@
|
|||
"""argvemulator - create sys.argv from OSA events. Used by applets that
|
||||
want unix-style arguments.
|
||||
"""
|
||||
|
||||
import sys
|
||||
import traceback
|
||||
from Carbon import AE
|
||||
from Carbon.AppleEvents import *
|
||||
from Carbon import Evt
|
||||
from Carbon import File
|
||||
from Carbon.Events import *
|
||||
import aetools
|
||||
|
||||
class ArgvCollector:
|
||||
|
||||
"""A minimal FrameWork.Application-like class"""
|
||||
|
||||
def __init__(self):
|
||||
self.quitting = 0
|
||||
# Remove the funny -psn_xxx_xxx argument
|
||||
if len(sys.argv) > 1 and sys.argv[1][:4] == '-psn':
|
||||
del sys.argv[1]
|
||||
|
||||
AE.AEInstallEventHandler(kCoreEventClass, kAEOpenApplication, self.__runapp)
|
||||
AE.AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments, self.__openfiles)
|
||||
|
||||
def close(self):
|
||||
AE.AERemoveEventHandler(kCoreEventClass, kAEOpenApplication)
|
||||
AE.AERemoveEventHandler(kCoreEventClass, kAEOpenDocuments)
|
||||
|
||||
def mainloop(self, mask = highLevelEventMask, timeout = 1*60):
|
||||
# Note: this is not the right way to run an event loop in OSX or even
|
||||
# "recent" versions of MacOS9. This is however code that has proven
|
||||
# itself.
|
||||
stoptime = Evt.TickCount() + timeout
|
||||
while not self.quitting and Evt.TickCount() < stoptime:
|
||||
self._dooneevent(mask, timeout)
|
||||
|
||||
if not self.quitting:
|
||||
print("argvemulator: timeout waiting for arguments")
|
||||
|
||||
self.close()
|
||||
|
||||
def _dooneevent(self, mask = highLevelEventMask, timeout = 1*60):
|
||||
got, event = Evt.WaitNextEvent(mask, timeout)
|
||||
if got:
|
||||
self._lowlevelhandler(event)
|
||||
|
||||
def _lowlevelhandler(self, event):
|
||||
what, message, when, where, modifiers = event
|
||||
h, v = where
|
||||
if what == kHighLevelEvent:
|
||||
try:
|
||||
AE.AEProcessAppleEvent(event)
|
||||
except AE.Error as err:
|
||||
msg = "High Level Event: %r %r" % (hex(message), hex(h | (v<<16)))
|
||||
print('AE error: ', err)
|
||||
print('in', msg)
|
||||
traceback.print_exc()
|
||||
return
|
||||
else:
|
||||
print("Unhandled event:", event)
|
||||
|
||||
|
||||
def _quit(self):
|
||||
self.quitting = 1
|
||||
|
||||
def __runapp(self, requestevent, replyevent):
|
||||
self._quit()
|
||||
|
||||
def __openfiles(self, requestevent, replyevent):
|
||||
try:
|
||||
listdesc = requestevent.AEGetParamDesc(keyDirectObject, typeAEList)
|
||||
for i in range(listdesc.AECountItems()):
|
||||
aliasdesc = listdesc.AEGetNthDesc(i+1, typeAlias)[1]
|
||||
alias = File.Alias(rawdata=aliasdesc.data)
|
||||
fsref = alias.FSResolveAlias(None)[0]
|
||||
pathname = fsref.as_pathname()
|
||||
sys.argv.append(pathname)
|
||||
except Exception as e:
|
||||
print("argvemulator.py warning: can't unpack an open document event")
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
|
||||
self._quit()
|
||||
|
||||
if __name__ == '__main__':
|
||||
ArgvCollector().mainloop()
|
||||
print("sys.argv=", sys.argv)
|
|
@ -1,55 +0,0 @@
|
|||
#
|
||||
# Local customizations for generating the Carbon interface modules.
|
||||
# Edit this file to reflect where things should be on your system.
|
||||
# Note that pathnames are unix-style for OSX MachoPython/unix-Python,
|
||||
# but mac-style for MacPython, whether running on OS9 or OSX.
|
||||
#
|
||||
|
||||
import os
|
||||
|
||||
Error = "bgenlocations.Error"
|
||||
#
|
||||
# Where bgen is. For unix-Python bgen isn't installed, so you have to refer to
|
||||
# the source tree here.
|
||||
BGENDIR="/Users/jack/src/python/Tools/bgen/bgen"
|
||||
|
||||
#
|
||||
# Where to find the Universal Header include files. If you have CodeWarrior
|
||||
# installed you can use the Universal Headers from there, otherwise you can
|
||||
# download them from the Apple website. Bgen can handle both unix- and mac-style
|
||||
# end of lines, so don't worry about that.
|
||||
#
|
||||
INCLUDEDIR="/Users/jack/src/Universal/Interfaces/CIncludes"
|
||||
|
||||
#
|
||||
# Where to put the python definitions files. Note that, on unix-Python,
|
||||
# if you want to commit your changes to the CVS repository this should refer to
|
||||
# your source directory, not your installed directory.
|
||||
#
|
||||
TOOLBOXDIR="/Users/jack/src/python/Lib/plat-mac/Carbon"
|
||||
|
||||
# Creator for C files:
|
||||
CREATOR="CWIE"
|
||||
|
||||
# The previous definitions can be overriden by creating a module
|
||||
# bgenlocationscustomize.py and putting it in site-packages (or anywere else
|
||||
# on sys.path, actually)
|
||||
try:
|
||||
from bgenlocationscustomize import *
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
if not os.path.exists(BGENDIR):
|
||||
raise Error("Please fix bgenlocations.py, BGENDIR does not exist: %s" % BGENDIR)
|
||||
if not os.path.exists(INCLUDEDIR):
|
||||
raise Error("Please fix bgenlocations.py, INCLUDEDIR does not exist: %s" % INCLUDEDIR)
|
||||
if not os.path.exists(TOOLBOXDIR):
|
||||
raise Error("Please fix bgenlocations.py, TOOLBOXDIR does not exist: %s" % TOOLBOXDIR)
|
||||
|
||||
# Sigh, due to the way these are used make sure they end with : or /.
|
||||
if BGENDIR[-1] != os.sep:
|
||||
BGENDIR = BGENDIR + os.sep
|
||||
if INCLUDEDIR[-1] != os.sep:
|
||||
INCLUDEDIR = INCLUDEDIR + os.sep
|
||||
if TOOLBOXDIR[-1] != os.sep:
|
||||
TOOLBOXDIR = TOOLBOXDIR + os.sep
|
|
@ -1,423 +0,0 @@
|
|||
"""tools for BuildApplet and BuildApplication"""
|
||||
|
||||
import sys
|
||||
import os
|
||||
import imp
|
||||
import marshal
|
||||
from Carbon import Res
|
||||
import Carbon.Files
|
||||
import Carbon.File
|
||||
import MacOS
|
||||
import macostools
|
||||
import macresource
|
||||
import EasyDialogs
|
||||
import shutil
|
||||
|
||||
import warnings
|
||||
warnings.warn("the buildtools module is deprecated", DeprecationWarning, 2)
|
||||
|
||||
|
||||
class BuildError(Exception):
|
||||
pass
|
||||
|
||||
# .pyc file (and 'PYC ' resource magic number)
|
||||
MAGIC = imp.get_magic()
|
||||
|
||||
# Template file (searched on sys.path)
|
||||
TEMPLATE = "PythonInterpreter"
|
||||
|
||||
# Specification of our resource
|
||||
RESTYPE = 'PYC '
|
||||
RESNAME = '__main__'
|
||||
|
||||
# A resource with this name sets the "owner" (creator) of the destination
|
||||
# It should also have ID=0. Either of these alone is not enough.
|
||||
OWNERNAME = "owner resource"
|
||||
|
||||
# Default applet creator code
|
||||
DEFAULT_APPLET_CREATOR="Pyta"
|
||||
|
||||
# OpenResFile mode parameters
|
||||
READ = 1
|
||||
WRITE = 2
|
||||
|
||||
# Parameter for FSOpenResourceFile
|
||||
RESOURCE_FORK_NAME=Carbon.File.FSGetResourceForkName()
|
||||
|
||||
def findtemplate(template=None):
|
||||
"""Locate the applet template along sys.path"""
|
||||
if MacOS.runtimemodel == 'macho':
|
||||
return None
|
||||
if not template:
|
||||
template=TEMPLATE
|
||||
for p in sys.path:
|
||||
file = os.path.join(p, template)
|
||||
try:
|
||||
file, d1, d2 = Carbon.File.FSResolveAliasFile(file, 1)
|
||||
break
|
||||
except (Carbon.File.Error, ValueError):
|
||||
continue
|
||||
else:
|
||||
raise BuildError("Template %r not found on sys.path" % (template,))
|
||||
file = file.as_pathname()
|
||||
return file
|
||||
|
||||
def process(template, filename, destname, copy_codefragment=0,
|
||||
rsrcname=None, others=[], raw=0, progress="default", destroot=""):
|
||||
|
||||
if progress == "default":
|
||||
progress = EasyDialogs.ProgressBar("Processing %s..."%os.path.split(filename)[1], 120)
|
||||
progress.label("Compiling...")
|
||||
progress.inc(0)
|
||||
# check for the script name being longer than 32 chars. This may trigger a bug
|
||||
# on OSX that can destroy your sourcefile.
|
||||
if '#' in os.path.split(filename)[1]:
|
||||
raise BuildError("BuildApplet could destroy your sourcefile on OSX, please rename: %s" % filename)
|
||||
# Read the source and compile it
|
||||
# (there's no point overwriting the destination if it has a syntax error)
|
||||
|
||||
fp = open(filename, 'rU')
|
||||
text = fp.read()
|
||||
fp.close()
|
||||
try:
|
||||
code = compile(text + '\n', filename, "exec")
|
||||
except SyntaxError as arg:
|
||||
raise BuildError("Syntax error in script %s: %s" % (filename, arg))
|
||||
except EOFError:
|
||||
raise BuildError("End-of-file in script %s" % (filename,))
|
||||
|
||||
# Set the destination file name. Note that basename
|
||||
# does contain the whole filepath, only a .py is stripped.
|
||||
|
||||
if filename[-3:].lower() == ".py":
|
||||
basename = filename[:-3]
|
||||
if MacOS.runtimemodel != 'macho' and not destname:
|
||||
destname = basename
|
||||
else:
|
||||
basename = filename
|
||||
|
||||
if not destname:
|
||||
if MacOS.runtimemodel == 'macho':
|
||||
destname = basename + '.app'
|
||||
else:
|
||||
destname = basename + '.applet'
|
||||
if not rsrcname:
|
||||
rsrcname = basename + '.rsrc'
|
||||
|
||||
# Try removing the output file. This fails in MachO, but it should
|
||||
# do any harm.
|
||||
try:
|
||||
os.remove(destname)
|
||||
except os.error:
|
||||
pass
|
||||
process_common(template, progress, code, rsrcname, destname, 0,
|
||||
copy_codefragment, raw, others, filename, destroot)
|
||||
|
||||
|
||||
def update(template, filename, output):
|
||||
if MacOS.runtimemodel == 'macho':
|
||||
raise BuildError("No updating yet for MachO applets")
|
||||
if progress:
|
||||
progress = EasyDialogs.ProgressBar("Updating %s..."%os.path.split(filename)[1], 120)
|
||||
else:
|
||||
progress = None
|
||||
if not output:
|
||||
output = filename + ' (updated)'
|
||||
|
||||
# Try removing the output file
|
||||
try:
|
||||
os.remove(output)
|
||||
except os.error:
|
||||
pass
|
||||
process_common(template, progress, None, filename, output, 1, 1)
|
||||
|
||||
|
||||
def process_common(template, progress, code, rsrcname, destname, is_update,
|
||||
copy_codefragment, raw=0, others=[], filename=None, destroot=""):
|
||||
if MacOS.runtimemodel == 'macho':
|
||||
return process_common_macho(template, progress, code, rsrcname, destname,
|
||||
is_update, raw, others, filename, destroot)
|
||||
if others:
|
||||
raise BuildError("Extra files only allowed for MachoPython applets")
|
||||
# Create FSSpecs for the various files
|
||||
template_fsr, d1, d2 = Carbon.File.FSResolveAliasFile(template, 1)
|
||||
template = template_fsr.as_pathname()
|
||||
|
||||
# Copy data (not resources, yet) from the template
|
||||
if progress:
|
||||
progress.label("Copy data fork...")
|
||||
progress.set(10)
|
||||
|
||||
if copy_codefragment:
|
||||
tmpl = open(template, "rb")
|
||||
dest = open(destname, "wb")
|
||||
data = tmpl.read()
|
||||
if data:
|
||||
dest.write(data)
|
||||
dest.close()
|
||||
tmpl.close()
|
||||
del dest
|
||||
del tmpl
|
||||
|
||||
# Open the output resource fork
|
||||
|
||||
if progress:
|
||||
progress.label("Copy resources...")
|
||||
progress.set(20)
|
||||
try:
|
||||
output = Res.FSOpenResourceFile(destname, RESOURCE_FORK_NAME, WRITE)
|
||||
except MacOS.Error:
|
||||
destdir, destfile = os.path.split(destname)
|
||||
Res.FSCreateResourceFile(destdir, str(destfile), RESOURCE_FORK_NAME)
|
||||
output = Res.FSOpenResourceFile(destname, RESOURCE_FORK_NAME, WRITE)
|
||||
|
||||
# Copy the resources from the target specific resource template, if any
|
||||
typesfound, ownertype = [], None
|
||||
try:
|
||||
input = Res.FSOpenResourceFile(rsrcname, RESOURCE_FORK_NAME, READ)
|
||||
except (MacOS.Error, ValueError):
|
||||
pass
|
||||
if progress:
|
||||
progress.inc(50)
|
||||
else:
|
||||
if is_update:
|
||||
skip_oldfile = ['cfrg']
|
||||
else:
|
||||
skip_oldfile = []
|
||||
typesfound, ownertype = copyres(input, output, skip_oldfile, 0, progress)
|
||||
Res.CloseResFile(input)
|
||||
|
||||
# Check which resource-types we should not copy from the template
|
||||
skiptypes = []
|
||||
if 'vers' in typesfound: skiptypes.append('vers')
|
||||
if 'SIZE' in typesfound: skiptypes.append('SIZE')
|
||||
if 'BNDL' in typesfound: skiptypes = skiptypes + ['BNDL', 'FREF', 'icl4',
|
||||
'icl8', 'ics4', 'ics8', 'ICN#', 'ics#']
|
||||
if not copy_codefragment:
|
||||
skiptypes.append('cfrg')
|
||||
## skipowner = (ownertype != None)
|
||||
|
||||
# Copy the resources from the template
|
||||
|
||||
input = Res.FSOpenResourceFile(template, RESOURCE_FORK_NAME, READ)
|
||||
dummy, tmplowner = copyres(input, output, skiptypes, 1, progress)
|
||||
|
||||
Res.CloseResFile(input)
|
||||
## if ownertype is None:
|
||||
## raise BuildError, "No owner resource found in either resource file or template"
|
||||
# Make sure we're manipulating the output resource file now
|
||||
|
||||
Res.UseResFile(output)
|
||||
|
||||
if ownertype is None:
|
||||
# No owner resource in the template. We have skipped the
|
||||
# Python owner resource, so we have to add our own. The relevant
|
||||
# bundle stuff is already included in the interpret/applet template.
|
||||
newres = Res.Resource('\0')
|
||||
newres.AddResource(DEFAULT_APPLET_CREATOR, 0, "Owner resource")
|
||||
ownertype = DEFAULT_APPLET_CREATOR
|
||||
|
||||
if code:
|
||||
# Delete any existing 'PYC ' resource named __main__
|
||||
|
||||
try:
|
||||
res = Res.Get1NamedResource(RESTYPE, RESNAME)
|
||||
res.RemoveResource()
|
||||
except Res.Error:
|
||||
pass
|
||||
|
||||
# Create the raw data for the resource from the code object
|
||||
if progress:
|
||||
progress.label("Write PYC resource...")
|
||||
progress.set(120)
|
||||
|
||||
data = marshal.dumps(code)
|
||||
del code
|
||||
data = (MAGIC + '\0\0\0\0') + data
|
||||
|
||||
# Create the resource and write it
|
||||
|
||||
id = 0
|
||||
while id < 128:
|
||||
id = Res.Unique1ID(RESTYPE)
|
||||
res = Res.Resource(data)
|
||||
res.AddResource(RESTYPE, id, RESNAME)
|
||||
attrs = res.GetResAttrs()
|
||||
attrs = attrs | 0x04 # set preload
|
||||
res.SetResAttrs(attrs)
|
||||
res.WriteResource()
|
||||
res.ReleaseResource()
|
||||
|
||||
# Close the output file
|
||||
|
||||
Res.CloseResFile(output)
|
||||
|
||||
# Now set the creator, type and bundle bit of the destination.
|
||||
# Done with FSSpec's, FSRef FInfo isn't good enough yet (2.3a1+)
|
||||
dest_fss = Carbon.File.FSSpec(destname)
|
||||
dest_finfo = dest_fss.FSpGetFInfo()
|
||||
dest_finfo.Creator = ownertype
|
||||
dest_finfo.Type = 'APPL'
|
||||
dest_finfo.Flags = dest_finfo.Flags | Carbon.Files.kHasBundle | Carbon.Files.kIsShared
|
||||
dest_finfo.Flags = dest_finfo.Flags & ~Carbon.Files.kHasBeenInited
|
||||
dest_fss.FSpSetFInfo(dest_finfo)
|
||||
|
||||
macostools.touched(destname)
|
||||
if progress:
|
||||
progress.label("Done.")
|
||||
progress.inc(0)
|
||||
|
||||
def process_common_macho(template, progress, code, rsrcname, destname, is_update,
|
||||
raw=0, others=[], filename=None, destroot=""):
|
||||
# Check that we have a filename
|
||||
if filename is None:
|
||||
raise BuildError("Need source filename on MacOSX")
|
||||
# First make sure the name ends in ".app"
|
||||
if destname[-4:] != '.app':
|
||||
destname = destname + '.app'
|
||||
# Now deduce the short name
|
||||
destdir, shortname = os.path.split(destname)
|
||||
if shortname[-4:] == '.app':
|
||||
# Strip the .app suffix
|
||||
shortname = shortname[:-4]
|
||||
# And deduce the .plist and .icns names
|
||||
plistname = None
|
||||
icnsname = None
|
||||
if rsrcname and rsrcname[-5:] == '.rsrc':
|
||||
tmp = rsrcname[:-5]
|
||||
plistname = tmp + '.plist'
|
||||
if os.path.exists(plistname):
|
||||
icnsname = tmp + '.icns'
|
||||
if not os.path.exists(icnsname):
|
||||
icnsname = None
|
||||
else:
|
||||
plistname = None
|
||||
if not icnsname:
|
||||
dft_icnsname = os.path.join(sys.prefix, 'Resources/Python.app/Contents/Resources/PythonApplet.icns')
|
||||
if os.path.exists(dft_icnsname):
|
||||
icnsname = dft_icnsname
|
||||
if not os.path.exists(rsrcname):
|
||||
rsrcname = None
|
||||
if progress:
|
||||
progress.label('Creating bundle...')
|
||||
import bundlebuilder
|
||||
builder = bundlebuilder.AppBuilder(verbosity=0)
|
||||
builder.mainprogram = filename
|
||||
builder.builddir = destdir
|
||||
builder.name = shortname
|
||||
builder.destroot = destroot
|
||||
if rsrcname:
|
||||
realrsrcname = macresource.resource_pathname(rsrcname)
|
||||
builder.files.append((realrsrcname,
|
||||
os.path.join('Contents/Resources', os.path.basename(rsrcname))))
|
||||
for o in others:
|
||||
if type(o) == str:
|
||||
builder.resources.append(o)
|
||||
else:
|
||||
builder.files.append(o)
|
||||
if plistname:
|
||||
import plistlib
|
||||
builder.plist = plistlib.Plist.fromFile(plistname)
|
||||
if icnsname:
|
||||
builder.iconfile = icnsname
|
||||
if not raw:
|
||||
builder.argv_emulation = 1
|
||||
builder.setup()
|
||||
builder.build()
|
||||
if progress:
|
||||
progress.label('Done.')
|
||||
progress.inc(0)
|
||||
|
||||
## macostools.touched(dest_fss)
|
||||
|
||||
# Copy resources between two resource file descriptors.
|
||||
# skip a resource named '__main__' or (if skipowner is set) with ID zero.
|
||||
# Also skip resources with a type listed in skiptypes.
|
||||
#
|
||||
def copyres(input, output, skiptypes, skipowner, progress=None):
|
||||
ctor = None
|
||||
alltypes = []
|
||||
Res.UseResFile(input)
|
||||
ntypes = Res.Count1Types()
|
||||
progress_type_inc = 50/ntypes
|
||||
for itype in range(1, 1+ntypes):
|
||||
type = Res.Get1IndType(itype)
|
||||
if type in skiptypes:
|
||||
continue
|
||||
alltypes.append(type)
|
||||
nresources = Res.Count1Resources(type)
|
||||
progress_cur_inc = progress_type_inc/nresources
|
||||
for ires in range(1, 1+nresources):
|
||||
res = Res.Get1IndResource(type, ires)
|
||||
id, type, name = res.GetResInfo()
|
||||
lcname = name.lower()
|
||||
|
||||
if lcname == OWNERNAME and id == 0:
|
||||
if skipowner:
|
||||
continue # Skip this one
|
||||
else:
|
||||
ctor = type
|
||||
size = res.size
|
||||
attrs = res.GetResAttrs()
|
||||
if progress:
|
||||
progress.label("Copy %s %d %s"%(type, id, name))
|
||||
progress.inc(progress_cur_inc)
|
||||
res.LoadResource()
|
||||
res.DetachResource()
|
||||
Res.UseResFile(output)
|
||||
try:
|
||||
res2 = Res.Get1Resource(type, id)
|
||||
except MacOS.Error:
|
||||
res2 = None
|
||||
if res2:
|
||||
if progress:
|
||||
progress.label("Overwrite %s %d %s"%(type, id, name))
|
||||
progress.inc(0)
|
||||
res2.RemoveResource()
|
||||
res.AddResource(type, id, name)
|
||||
res.WriteResource()
|
||||
attrs = attrs | res.GetResAttrs()
|
||||
res.SetResAttrs(attrs)
|
||||
Res.UseResFile(input)
|
||||
return alltypes, ctor
|
||||
|
||||
def copyapptree(srctree, dsttree, exceptlist=[], progress=None):
|
||||
names = []
|
||||
if os.path.exists(dsttree):
|
||||
shutil.rmtree(dsttree)
|
||||
os.mkdir(dsttree)
|
||||
todo = os.listdir(srctree)
|
||||
while todo:
|
||||
this, todo = todo[0], todo[1:]
|
||||
if this in exceptlist:
|
||||
continue
|
||||
thispath = os.path.join(srctree, this)
|
||||
if os.path.isdir(thispath):
|
||||
thiscontent = os.listdir(thispath)
|
||||
for t in thiscontent:
|
||||
todo.append(os.path.join(this, t))
|
||||
names.append(this)
|
||||
for this in names:
|
||||
srcpath = os.path.join(srctree, this)
|
||||
dstpath = os.path.join(dsttree, this)
|
||||
if os.path.isdir(srcpath):
|
||||
os.mkdir(dstpath)
|
||||
elif os.path.islink(srcpath):
|
||||
endpoint = os.readlink(srcpath)
|
||||
os.symlink(endpoint, dstpath)
|
||||
else:
|
||||
if progress:
|
||||
progress.label('Copy '+this)
|
||||
progress.inc(0)
|
||||
shutil.copy2(srcpath, dstpath)
|
||||
|
||||
def writepycfile(codeobject, cfile):
|
||||
import marshal
|
||||
fc = open(cfile, 'wb')
|
||||
fc.write('\0\0\0\0') # MAGIC placeholder, written later
|
||||
fc.write('\0\0\0\0') # Timestap placeholder, not needed
|
||||
marshal.dump(codeobject, fc)
|
||||
fc.flush()
|
||||
fc.seek(0, 0)
|
||||
fc.write(MAGIC)
|
||||
fc.close()
|
|
@ -1,939 +0,0 @@
|
|||
#! /usr/bin/env python
|
||||
|
||||
"""\
|
||||
bundlebuilder.py -- Tools to assemble MacOS X (application) bundles.
|
||||
|
||||
This module contains two classes to build so called "bundles" for
|
||||
MacOS X. BundleBuilder is a general tool, AppBuilder is a subclass
|
||||
specialized in building application bundles.
|
||||
|
||||
[Bundle|App]Builder objects are instantiated with a bunch of keyword
|
||||
arguments, and have a build() method that will do all the work. See
|
||||
the class doc strings for a description of the constructor arguments.
|
||||
|
||||
The module contains a main program that can be used in two ways:
|
||||
|
||||
% python bundlebuilder.py [options] build
|
||||
% python buildapp.py [options] build
|
||||
|
||||
Where "buildapp.py" is a user-supplied setup.py-like script following
|
||||
this model:
|
||||
|
||||
from bundlebuilder import buildapp
|
||||
buildapp(<lots-of-keyword-args>)
|
||||
|
||||
"""
|
||||
|
||||
|
||||
__all__ = ["BundleBuilder", "BundleBuilderError", "AppBuilder", "buildapp"]
|
||||
|
||||
|
||||
import sys
|
||||
import os, errno, shutil
|
||||
import imp, marshal
|
||||
import re
|
||||
from copy import deepcopy
|
||||
import getopt
|
||||
from plistlib import Plist
|
||||
from types import FunctionType as function
|
||||
|
||||
class BundleBuilderError(Exception): pass
|
||||
|
||||
|
||||
class Defaults:
|
||||
|
||||
"""Class attributes that don't start with an underscore and are
|
||||
not functions or classmethods are (deep)copied to self.__dict__.
|
||||
This allows for mutable default values.
|
||||
"""
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
defaults = self._getDefaults()
|
||||
defaults.update(kwargs)
|
||||
self.__dict__.update(defaults)
|
||||
|
||||
def _getDefaults(cls):
|
||||
defaults = {}
|
||||
for base in cls.__bases__:
|
||||
if hasattr(base, "_getDefaults"):
|
||||
defaults.update(base._getDefaults())
|
||||
for name, value in cls.__dict__.items():
|
||||
if name[0] != "_" and not isinstance(value,
|
||||
(function, classmethod)):
|
||||
defaults[name] = deepcopy(value)
|
||||
return defaults
|
||||
_getDefaults = classmethod(_getDefaults)
|
||||
|
||||
|
||||
class BundleBuilder(Defaults):
|
||||
|
||||
"""BundleBuilder is a barebones class for assembling bundles. It
|
||||
knows nothing about executables or icons, it only copies files
|
||||
and creates the PkgInfo and Info.plist files.
|
||||
"""
|
||||
|
||||
# (Note that Defaults.__init__ (deep)copies these values to
|
||||
# instance variables. Mutable defaults are therefore safe.)
|
||||
|
||||
# Name of the bundle, with or without extension.
|
||||
name = None
|
||||
|
||||
# The property list ("plist")
|
||||
plist = Plist(CFBundleDevelopmentRegion = "English",
|
||||
CFBundleInfoDictionaryVersion = "6.0")
|
||||
|
||||
# The type of the bundle.
|
||||
type = "BNDL"
|
||||
# The creator code of the bundle.
|
||||
creator = None
|
||||
|
||||
# the CFBundleIdentifier (this is used for the preferences file name)
|
||||
bundle_id = None
|
||||
|
||||
# List of files that have to be copied to <bundle>/Contents/Resources.
|
||||
resources = []
|
||||
|
||||
# List of (src, dest) tuples; dest should be a path relative to the bundle
|
||||
# (eg. "Contents/Resources/MyStuff/SomeFile.ext).
|
||||
files = []
|
||||
|
||||
# List of shared libraries (dylibs, Frameworks) to bundle with the app
|
||||
# will be placed in Contents/Frameworks
|
||||
libs = []
|
||||
|
||||
# Directory where the bundle will be assembled.
|
||||
builddir = "build"
|
||||
|
||||
# Make symlinks instead copying files. This is handy during debugging, but
|
||||
# makes the bundle non-distributable.
|
||||
symlink = 0
|
||||
|
||||
# Verbosity level.
|
||||
verbosity = 1
|
||||
|
||||
# Destination root directory
|
||||
destroot = ""
|
||||
|
||||
def setup(self):
|
||||
# XXX rethink self.name munging, this is brittle.
|
||||
self.name, ext = os.path.splitext(self.name)
|
||||
if not ext:
|
||||
ext = ".bundle"
|
||||
bundleextension = ext
|
||||
# misc (derived) attributes
|
||||
self.bundlepath = pathjoin(self.builddir, self.name + bundleextension)
|
||||
|
||||
plist = self.plist
|
||||
plist.CFBundleName = self.name
|
||||
plist.CFBundlePackageType = self.type
|
||||
if self.creator is None:
|
||||
if hasattr(plist, "CFBundleSignature"):
|
||||
self.creator = plist.CFBundleSignature
|
||||
else:
|
||||
self.creator = "????"
|
||||
plist.CFBundleSignature = self.creator
|
||||
if self.bundle_id:
|
||||
plist.CFBundleIdentifier = self.bundle_id
|
||||
elif not hasattr(plist, "CFBundleIdentifier"):
|
||||
plist.CFBundleIdentifier = self.name
|
||||
|
||||
def build(self):
|
||||
"""Build the bundle."""
|
||||
builddir = self.builddir
|
||||
if builddir and not os.path.exists(builddir):
|
||||
os.mkdir(builddir)
|
||||
self.message("Building %s" % repr(self.bundlepath), 1)
|
||||
if os.path.exists(self.bundlepath):
|
||||
shutil.rmtree(self.bundlepath)
|
||||
if os.path.exists(self.bundlepath + '~'):
|
||||
shutil.rmtree(self.bundlepath + '~')
|
||||
bp = self.bundlepath
|
||||
|
||||
# Create the app bundle in a temporary location and then
|
||||
# rename the completed bundle. This way the Finder will
|
||||
# never see an incomplete bundle (where it might pick up
|
||||
# and cache the wrong meta data)
|
||||
self.bundlepath = bp + '~'
|
||||
try:
|
||||
os.mkdir(self.bundlepath)
|
||||
self.preProcess()
|
||||
self._copyFiles()
|
||||
self._addMetaFiles()
|
||||
self.postProcess()
|
||||
os.rename(self.bundlepath, bp)
|
||||
finally:
|
||||
self.bundlepath = bp
|
||||
self.message("Done.", 1)
|
||||
|
||||
def preProcess(self):
|
||||
"""Hook for subclasses."""
|
||||
pass
|
||||
def postProcess(self):
|
||||
"""Hook for subclasses."""
|
||||
pass
|
||||
|
||||
def _addMetaFiles(self):
|
||||
contents = pathjoin(self.bundlepath, "Contents")
|
||||
makedirs(contents)
|
||||
#
|
||||
# Write Contents/PkgInfo
|
||||
assert len(self.type) == len(self.creator) == 4, \
|
||||
"type and creator must be 4-byte strings."
|
||||
pkginfo = pathjoin(contents, "PkgInfo")
|
||||
f = open(pkginfo, "w")
|
||||
f.write(self.type + self.creator)
|
||||
f.close()
|
||||
#
|
||||
# Write Contents/Info.plist
|
||||
infoplist = pathjoin(contents, "Info.plist")
|
||||
self.plist.write(infoplist)
|
||||
|
||||
def _copyFiles(self):
|
||||
files = self.files[:]
|
||||
for path in self.resources:
|
||||
files.append((path, pathjoin("Contents", "Resources",
|
||||
os.path.basename(path))))
|
||||
for path in self.libs:
|
||||
files.append((path, pathjoin("Contents", "Frameworks",
|
||||
os.path.basename(path))))
|
||||
if self.symlink:
|
||||
self.message("Making symbolic links", 1)
|
||||
msg = "Making symlink from"
|
||||
else:
|
||||
self.message("Copying files", 1)
|
||||
msg = "Copying"
|
||||
files.sort()
|
||||
for src, dst in files:
|
||||
if os.path.isdir(src):
|
||||
self.message("%s %s/ to %s/" % (msg, src, dst), 2)
|
||||
else:
|
||||
self.message("%s %s to %s" % (msg, src, dst), 2)
|
||||
dst = pathjoin(self.bundlepath, dst)
|
||||
if self.symlink:
|
||||
symlink(src, dst, mkdirs=1)
|
||||
else:
|
||||
copy(src, dst, mkdirs=1)
|
||||
|
||||
def message(self, msg, level=0):
|
||||
if level <= self.verbosity:
|
||||
indent = ""
|
||||
if level > 1:
|
||||
indent = (level - 1) * " "
|
||||
sys.stderr.write(indent + msg + "\n")
|
||||
|
||||
def report(self):
|
||||
# XXX something decent
|
||||
pass
|
||||
|
||||
|
||||
if __debug__:
|
||||
PYC_EXT = ".pyc"
|
||||
else:
|
||||
PYC_EXT = ".pyo"
|
||||
|
||||
MAGIC = imp.get_magic()
|
||||
USE_ZIPIMPORT = "zipimport" in sys.builtin_module_names
|
||||
|
||||
# For standalone apps, we have our own minimal site.py. We don't need
|
||||
# all the cruft of the real site.py.
|
||||
SITE_PY = """\
|
||||
import sys
|
||||
if not %(semi_standalone)s:
|
||||
del sys.path[1:] # sys.path[0] is Contents/Resources/
|
||||
"""
|
||||
|
||||
if USE_ZIPIMPORT:
|
||||
ZIP_ARCHIVE = "Modules.zip"
|
||||
SITE_PY += "sys.path.append(sys.path[0] + '/%s')\n" % ZIP_ARCHIVE
|
||||
def getPycData(fullname, code, ispkg):
|
||||
if ispkg:
|
||||
fullname += ".__init__"
|
||||
path = fullname.replace(".", os.sep) + PYC_EXT
|
||||
return path, MAGIC + '\0\0\0\0' + marshal.dumps(code)
|
||||
|
||||
#
|
||||
# Extension modules can't be in the modules zip archive, so a placeholder
|
||||
# is added instead, that loads the extension from a specified location.
|
||||
#
|
||||
EXT_LOADER = """\
|
||||
def __load():
|
||||
import imp, sys, os
|
||||
for p in sys.path:
|
||||
path = os.path.join(p, "%(filename)s")
|
||||
if os.path.exists(path):
|
||||
break
|
||||
else:
|
||||
assert 0, "file not found: %(filename)s"
|
||||
mod = imp.load_dynamic("%(name)s", path)
|
||||
|
||||
__load()
|
||||
del __load
|
||||
"""
|
||||
|
||||
MAYMISS_MODULES = ['mac', 'os2', 'nt', 'ntpath', 'dos', 'dospath',
|
||||
'win32api', 'ce', '_winreg', 'nturl2path', 'sitecustomize',
|
||||
'org.python.core'
|
||||
]
|
||||
|
||||
STRIP_EXEC = "/usr/bin/strip"
|
||||
|
||||
#
|
||||
# We're using a stock interpreter to run the app, yet we need
|
||||
# a way to pass the Python main program to the interpreter. The
|
||||
# bootstrapping script fires up the interpreter with the right
|
||||
# arguments. os.execve() is used as OSX doesn't like us to
|
||||
# start a real new process. Also, the executable name must match
|
||||
# the CFBundleExecutable value in the Info.plist, so we lie
|
||||
# deliberately with argv[0]. The actual Python executable is
|
||||
# passed in an environment variable so we can "repair"
|
||||
# sys.executable later.
|
||||
#
|
||||
BOOTSTRAP_SCRIPT = """\
|
||||
#!%(hashbang)s
|
||||
|
||||
import sys, os
|
||||
execdir = os.path.dirname(sys.argv[0])
|
||||
executable = os.path.join(execdir, "%(executable)s")
|
||||
resdir = os.path.join(os.path.dirname(execdir), "Resources")
|
||||
libdir = os.path.join(os.path.dirname(execdir), "Frameworks")
|
||||
mainprogram = os.path.join(resdir, "%(mainprogram)s")
|
||||
|
||||
sys.argv.insert(1, mainprogram)
|
||||
if %(standalone)s or %(semi_standalone)s:
|
||||
os.environ["PYTHONPATH"] = resdir
|
||||
if %(standalone)s:
|
||||
os.environ["PYTHONHOME"] = resdir
|
||||
else:
|
||||
pypath = os.getenv("PYTHONPATH", "")
|
||||
if pypath:
|
||||
pypath = ":" + pypath
|
||||
os.environ["PYTHONPATH"] = resdir + pypath
|
||||
os.environ["PYTHONEXECUTABLE"] = executable
|
||||
os.environ["DYLD_LIBRARY_PATH"] = libdir
|
||||
os.environ["DYLD_FRAMEWORK_PATH"] = libdir
|
||||
os.execve(executable, sys.argv, os.environ)
|
||||
"""
|
||||
|
||||
|
||||
#
|
||||
# Optional wrapper that converts "dropped files" into sys.argv values.
|
||||
#
|
||||
ARGV_EMULATOR = """\
|
||||
import argvemulator, os
|
||||
|
||||
argvemulator.ArgvCollector().mainloop()
|
||||
fp = os.path.join(os.path.split(__file__)[0], "%(realmainprogram)s")
|
||||
try:
|
||||
script = fp.read()
|
||||
finally:
|
||||
fp.close()
|
||||
exec(script)
|
||||
"""
|
||||
|
||||
#
|
||||
# When building a standalone app with Python.framework, we need to copy
|
||||
# a subset from Python.framework to the bundle. The following list
|
||||
# specifies exactly what items we'll copy.
|
||||
#
|
||||
PYTHONFRAMEWORKGOODIES = [
|
||||
"Python", # the Python core library
|
||||
"Resources/English.lproj",
|
||||
"Resources/Info.plist",
|
||||
"Resources/version.plist",
|
||||
]
|
||||
|
||||
def isFramework():
|
||||
return sys.exec_prefix.find("Python.framework") > 0
|
||||
|
||||
|
||||
LIB = os.path.join(sys.prefix, "lib", "python" + sys.version[:3])
|
||||
SITE_PACKAGES = os.path.join(LIB, "site-packages")
|
||||
|
||||
|
||||
class AppBuilder(BundleBuilder):
|
||||
|
||||
# Override type of the bundle.
|
||||
type = "APPL"
|
||||
|
||||
# platform, name of the subfolder of Contents that contains the executable.
|
||||
platform = "MacOS"
|
||||
|
||||
# A Python main program. If this argument is given, the main
|
||||
# executable in the bundle will be a small wrapper that invokes
|
||||
# the main program. (XXX Discuss why.)
|
||||
mainprogram = None
|
||||
|
||||
# The main executable. If a Python main program is specified
|
||||
# the executable will be copied to Resources and be invoked
|
||||
# by the wrapper program mentioned above. Otherwise it will
|
||||
# simply be used as the main executable.
|
||||
executable = None
|
||||
|
||||
# The name of the main nib, for Cocoa apps. *Must* be specified
|
||||
# when building a Cocoa app.
|
||||
nibname = None
|
||||
|
||||
# The name of the icon file to be copied to Resources and used for
|
||||
# the Finder icon.
|
||||
iconfile = None
|
||||
|
||||
# Symlink the executable instead of copying it.
|
||||
symlink_exec = 0
|
||||
|
||||
# If True, build standalone app.
|
||||
standalone = 0
|
||||
|
||||
# If True, build semi-standalone app (only includes third-party modules).
|
||||
semi_standalone = 0
|
||||
|
||||
# If set, use this for #! lines in stead of sys.executable
|
||||
python = None
|
||||
|
||||
# If True, add a real main program that emulates sys.argv before calling
|
||||
# mainprogram
|
||||
argv_emulation = 0
|
||||
|
||||
# The following attributes are only used when building a standalone app.
|
||||
|
||||
# Exclude these modules.
|
||||
excludeModules = []
|
||||
|
||||
# Include these modules.
|
||||
includeModules = []
|
||||
|
||||
# Include these packages.
|
||||
includePackages = []
|
||||
|
||||
# Strip binaries from debug info.
|
||||
strip = 0
|
||||
|
||||
# Found Python modules: [(name, codeobject, ispkg), ...]
|
||||
pymodules = []
|
||||
|
||||
# Modules that modulefinder couldn't find:
|
||||
missingModules = []
|
||||
maybeMissingModules = []
|
||||
|
||||
def setup(self):
|
||||
if ((self.standalone or self.semi_standalone)
|
||||
and self.mainprogram is None):
|
||||
raise BundleBuilderError("must specify 'mainprogram' when "
|
||||
"building a standalone application.")
|
||||
if self.mainprogram is None and self.executable is None:
|
||||
raise BundleBuilderError("must specify either or both of "
|
||||
"'executable' and 'mainprogram'")
|
||||
|
||||
self.execdir = pathjoin("Contents", self.platform)
|
||||
|
||||
if self.name is not None:
|
||||
pass
|
||||
elif self.mainprogram is not None:
|
||||
self.name = os.path.splitext(os.path.basename(self.mainprogram))[0]
|
||||
elif executable is not None:
|
||||
self.name = os.path.splitext(os.path.basename(self.executable))[0]
|
||||
if self.name[-4:] != ".app":
|
||||
self.name += ".app"
|
||||
|
||||
if self.executable is None:
|
||||
if not self.standalone and not isFramework():
|
||||
self.symlink_exec = 1
|
||||
if self.python:
|
||||
self.executable = self.python
|
||||
else:
|
||||
self.executable = sys.executable
|
||||
|
||||
if self.nibname:
|
||||
self.plist.NSMainNibFile = self.nibname
|
||||
if not hasattr(self.plist, "NSPrincipalClass"):
|
||||
self.plist.NSPrincipalClass = "NSApplication"
|
||||
|
||||
if self.standalone and isFramework():
|
||||
self.addPythonFramework()
|
||||
|
||||
BundleBuilder.setup(self)
|
||||
|
||||
self.plist.CFBundleExecutable = self.name
|
||||
|
||||
if self.standalone or self.semi_standalone:
|
||||
self.findDependencies()
|
||||
|
||||
def preProcess(self):
|
||||
resdir = "Contents/Resources"
|
||||
if self.executable is not None:
|
||||
if self.mainprogram is None:
|
||||
execname = self.name
|
||||
else:
|
||||
execname = os.path.basename(self.executable)
|
||||
execpath = pathjoin(self.execdir, execname)
|
||||
if not self.symlink_exec:
|
||||
self.files.append((self.destroot + self.executable, execpath))
|
||||
self.execpath = execpath
|
||||
|
||||
if self.mainprogram is not None:
|
||||
mainprogram = os.path.basename(self.mainprogram)
|
||||
self.files.append((self.mainprogram, pathjoin(resdir, mainprogram)))
|
||||
if self.argv_emulation:
|
||||
# Change the main program, and create the helper main program (which
|
||||
# does argv collection and then calls the real main).
|
||||
# Also update the included modules (if we're creating a standalone
|
||||
# program) and the plist
|
||||
realmainprogram = mainprogram
|
||||
mainprogram = '__argvemulator_' + mainprogram
|
||||
resdirpath = pathjoin(self.bundlepath, resdir)
|
||||
mainprogrampath = pathjoin(resdirpath, mainprogram)
|
||||
makedirs(resdirpath)
|
||||
open(mainprogrampath, "w").write(ARGV_EMULATOR % locals())
|
||||
if self.standalone or self.semi_standalone:
|
||||
self.includeModules.append("argvemulator")
|
||||
self.includeModules.append("os")
|
||||
if "CFBundleDocumentTypes" not in self.plist:
|
||||
self.plist["CFBundleDocumentTypes"] = [
|
||||
{ "CFBundleTypeOSTypes" : [
|
||||
"****",
|
||||
"fold",
|
||||
"disk"],
|
||||
"CFBundleTypeRole": "Viewer"}]
|
||||
# Write bootstrap script
|
||||
executable = os.path.basename(self.executable)
|
||||
execdir = pathjoin(self.bundlepath, self.execdir)
|
||||
bootstrappath = pathjoin(execdir, self.name)
|
||||
makedirs(execdir)
|
||||
if self.standalone or self.semi_standalone:
|
||||
# XXX we're screwed when the end user has deleted
|
||||
# /usr/bin/python
|
||||
hashbang = "/usr/bin/python"
|
||||
elif self.python:
|
||||
hashbang = self.python
|
||||
else:
|
||||
hashbang = os.path.realpath(sys.executable)
|
||||
standalone = self.standalone
|
||||
semi_standalone = self.semi_standalone
|
||||
open(bootstrappath, "w").write(BOOTSTRAP_SCRIPT % locals())
|
||||
os.chmod(bootstrappath, 0o775)
|
||||
|
||||
if self.iconfile is not None:
|
||||
iconbase = os.path.basename(self.iconfile)
|
||||
self.plist.CFBundleIconFile = iconbase
|
||||
self.files.append((self.iconfile, pathjoin(resdir, iconbase)))
|
||||
|
||||
def postProcess(self):
|
||||
if self.standalone or self.semi_standalone:
|
||||
self.addPythonModules()
|
||||
if self.strip and not self.symlink:
|
||||
self.stripBinaries()
|
||||
|
||||
if self.symlink_exec and self.executable:
|
||||
self.message("Symlinking executable %s to %s" % (self.executable,
|
||||
self.execpath), 2)
|
||||
dst = pathjoin(self.bundlepath, self.execpath)
|
||||
makedirs(os.path.dirname(dst))
|
||||
os.symlink(os.path.abspath(self.executable), dst)
|
||||
|
||||
if self.missingModules or self.maybeMissingModules:
|
||||
self.reportMissing()
|
||||
|
||||
def addPythonFramework(self):
|
||||
# If we're building a standalone app with Python.framework,
|
||||
# include a minimal subset of Python.framework, *unless*
|
||||
# Python.framework was specified manually in self.libs.
|
||||
for lib in self.libs:
|
||||
if os.path.basename(lib) == "Python.framework":
|
||||
# a Python.framework was specified as a library
|
||||
return
|
||||
|
||||
frameworkpath = sys.exec_prefix[:sys.exec_prefix.find(
|
||||
"Python.framework") + len("Python.framework")]
|
||||
|
||||
version = sys.version[:3]
|
||||
frameworkpath = pathjoin(frameworkpath, "Versions", version)
|
||||
destbase = pathjoin("Contents", "Frameworks", "Python.framework",
|
||||
"Versions", version)
|
||||
for item in PYTHONFRAMEWORKGOODIES:
|
||||
src = pathjoin(frameworkpath, item)
|
||||
dst = pathjoin(destbase, item)
|
||||
self.files.append((src, dst))
|
||||
|
||||
def _getSiteCode(self):
|
||||
return compile(SITE_PY % {"semi_standalone": self.semi_standalone},
|
||||
"<-bundlebuilder.py->", "exec")
|
||||
|
||||
def addPythonModules(self):
|
||||
self.message("Adding Python modules", 1)
|
||||
|
||||
if USE_ZIPIMPORT:
|
||||
# Create a zip file containing all modules as pyc.
|
||||
import zipfile
|
||||
relpath = pathjoin("Contents", "Resources", ZIP_ARCHIVE)
|
||||
abspath = pathjoin(self.bundlepath, relpath)
|
||||
zf = zipfile.ZipFile(abspath, "w", zipfile.ZIP_DEFLATED)
|
||||
for name, code, ispkg in self.pymodules:
|
||||
self.message("Adding Python module %s" % name, 2)
|
||||
path, pyc = getPycData(name, code, ispkg)
|
||||
zf.writestr(path, pyc)
|
||||
zf.close()
|
||||
# add site.pyc
|
||||
sitepath = pathjoin(self.bundlepath, "Contents", "Resources",
|
||||
"site" + PYC_EXT)
|
||||
writePyc(self._getSiteCode(), sitepath)
|
||||
else:
|
||||
# Create individual .pyc files.
|
||||
for name, code, ispkg in self.pymodules:
|
||||
if ispkg:
|
||||
name += ".__init__"
|
||||
path = name.split(".")
|
||||
path = pathjoin("Contents", "Resources", *path) + PYC_EXT
|
||||
|
||||
if ispkg:
|
||||
self.message("Adding Python package %s" % path, 2)
|
||||
else:
|
||||
self.message("Adding Python module %s" % path, 2)
|
||||
|
||||
abspath = pathjoin(self.bundlepath, path)
|
||||
makedirs(os.path.dirname(abspath))
|
||||
writePyc(code, abspath)
|
||||
|
||||
def stripBinaries(self):
|
||||
if not os.path.exists(STRIP_EXEC):
|
||||
self.message("Error: can't strip binaries: no strip program at "
|
||||
"%s" % STRIP_EXEC, 0)
|
||||
else:
|
||||
import stat
|
||||
self.message("Stripping binaries", 1)
|
||||
def walk(top):
|
||||
for name in os.listdir(top):
|
||||
path = pathjoin(top, name)
|
||||
if os.path.islink(path):
|
||||
continue
|
||||
if os.path.isdir(path):
|
||||
walk(path)
|
||||
else:
|
||||
mod = os.stat(path)[stat.ST_MODE]
|
||||
if not (mod & 0o100):
|
||||
continue
|
||||
relpath = path[len(self.bundlepath):]
|
||||
self.message("Stripping %s" % relpath, 2)
|
||||
inf, outf = os.popen4("%s -S \"%s\"" %
|
||||
(STRIP_EXEC, path))
|
||||
output = outf.read().strip()
|
||||
if output:
|
||||
# usually not a real problem, like when we're
|
||||
# trying to strip a script
|
||||
self.message("Problem stripping %s:" % relpath, 3)
|
||||
self.message(output, 3)
|
||||
walk(self.bundlepath)
|
||||
|
||||
def findDependencies(self):
|
||||
self.message("Finding module dependencies", 1)
|
||||
import modulefinder
|
||||
mf = modulefinder.ModuleFinder(excludes=self.excludeModules)
|
||||
if USE_ZIPIMPORT:
|
||||
# zipimport imports zlib, must add it manually
|
||||
mf.import_hook("zlib")
|
||||
# manually add our own site.py
|
||||
site = mf.add_module("site")
|
||||
site.__code__ = self._getSiteCode()
|
||||
mf.scan_code(site.__code__, site)
|
||||
|
||||
# warnings.py gets imported implicitly from C
|
||||
mf.import_hook("warnings")
|
||||
|
||||
includeModules = self.includeModules[:]
|
||||
for name in self.includePackages:
|
||||
includeModules.extend(findPackageContents(name).keys())
|
||||
for name in includeModules:
|
||||
try:
|
||||
mf.import_hook(name)
|
||||
except ImportError:
|
||||
self.missingModules.append(name)
|
||||
|
||||
mf.run_script(self.mainprogram)
|
||||
modules = mf.modules.items()
|
||||
modules.sort()
|
||||
for name, mod in modules:
|
||||
path = mod.__file__
|
||||
if path and self.semi_standalone:
|
||||
# skip the standard library
|
||||
if path.startswith(LIB) and not path.startswith(SITE_PACKAGES):
|
||||
continue
|
||||
if path and mod.__code__ is None:
|
||||
# C extension
|
||||
filename = os.path.basename(path)
|
||||
pathitems = name.split(".")[:-1] + [filename]
|
||||
dstpath = pathjoin(*pathitems)
|
||||
if USE_ZIPIMPORT:
|
||||
if name != "zlib":
|
||||
# neatly pack all extension modules in a subdirectory,
|
||||
# except zlib, since it's neccesary for bootstrapping.
|
||||
dstpath = pathjoin("ExtensionModules", dstpath)
|
||||
# Python modules are stored in a Zip archive, but put
|
||||
# extensions in Contents/Resources/. Add a tiny "loader"
|
||||
# program in the Zip archive. Due to Thomas Heller.
|
||||
source = EXT_LOADER % {"name": name, "filename": dstpath}
|
||||
code = compile(source, "<dynloader for %s>" % name, "exec")
|
||||
mod.__code__ = code
|
||||
self.files.append((path, pathjoin("Contents", "Resources", dstpath)))
|
||||
if mod.__code__ is not None:
|
||||
ispkg = mod.__path__ is not None
|
||||
if not USE_ZIPIMPORT or name != "site":
|
||||
# Our site.py is doing the bootstrapping, so we must
|
||||
# include a real .pyc file if USE_ZIPIMPORT is True.
|
||||
self.pymodules.append((name, mod.__code__, ispkg))
|
||||
|
||||
if hasattr(mf, "any_missing_maybe"):
|
||||
missing, maybe = mf.any_missing_maybe()
|
||||
else:
|
||||
missing = mf.any_missing()
|
||||
maybe = []
|
||||
self.missingModules.extend(missing)
|
||||
self.maybeMissingModules.extend(maybe)
|
||||
|
||||
def reportMissing(self):
|
||||
missing = [name for name in self.missingModules
|
||||
if name not in MAYMISS_MODULES]
|
||||
if self.maybeMissingModules:
|
||||
maybe = self.maybeMissingModules
|
||||
else:
|
||||
maybe = [name for name in missing if "." in name]
|
||||
missing = [name for name in missing if "." not in name]
|
||||
missing.sort()
|
||||
maybe.sort()
|
||||
if maybe:
|
||||
self.message("Warning: couldn't find the following submodules:", 1)
|
||||
self.message(" (Note that these could be false alarms -- "
|
||||
"it's not always", 1)
|
||||
self.message(" possible to distinguish between \"from package "
|
||||
"import submodule\" ", 1)
|
||||
self.message(" and \"from package import name\")", 1)
|
||||
for name in maybe:
|
||||
self.message(" ? " + name, 1)
|
||||
if missing:
|
||||
self.message("Warning: couldn't find the following modules:", 1)
|
||||
for name in missing:
|
||||
self.message(" ? " + name, 1)
|
||||
|
||||
def report(self):
|
||||
# XXX something decent
|
||||
import pprint
|
||||
pprint.pprint(self.__dict__)
|
||||
if self.standalone or self.semi_standalone:
|
||||
self.reportMissing()
|
||||
|
||||
#
|
||||
# Utilities.
|
||||
#
|
||||
|
||||
SUFFIXES = [_suf for _suf, _mode, _tp in imp.get_suffixes()]
|
||||
identifierRE = re.compile(r"[_a-zA-z][_a-zA-Z0-9]*$")
|
||||
|
||||
def findPackageContents(name, searchpath=None):
|
||||
head = name.split(".")[-1]
|
||||
if identifierRE.match(head) is None:
|
||||
return {}
|
||||
try:
|
||||
fp, path, (ext, mode, tp) = imp.find_module(head, searchpath)
|
||||
except ImportError:
|
||||
return {}
|
||||
modules = {name: None}
|
||||
if tp == imp.PKG_DIRECTORY and path:
|
||||
files = os.listdir(path)
|
||||
for sub in files:
|
||||
sub, ext = os.path.splitext(sub)
|
||||
fullname = name + "." + sub
|
||||
if sub != "__init__" and fullname not in modules:
|
||||
modules.update(findPackageContents(fullname, [path]))
|
||||
return modules
|
||||
|
||||
def writePyc(code, path):
|
||||
f = open(path, "wb")
|
||||
f.write(MAGIC)
|
||||
f.write("\0" * 4) # don't bother about a time stamp
|
||||
marshal.dump(code, f)
|
||||
f.close()
|
||||
|
||||
def copy(src, dst, mkdirs=0):
|
||||
"""Copy a file or a directory."""
|
||||
if mkdirs:
|
||||
makedirs(os.path.dirname(dst))
|
||||
if os.path.isdir(src):
|
||||
shutil.copytree(src, dst, symlinks=1)
|
||||
else:
|
||||
shutil.copy2(src, dst)
|
||||
|
||||
def copytodir(src, dstdir):
|
||||
"""Copy a file or a directory to an existing directory."""
|
||||
dst = pathjoin(dstdir, os.path.basename(src))
|
||||
copy(src, dst)
|
||||
|
||||
def makedirs(dir):
|
||||
"""Make all directories leading up to 'dir' including the leaf
|
||||
directory. Don't moan if any path element already exists."""
|
||||
try:
|
||||
os.makedirs(dir)
|
||||
except OSError as why:
|
||||
if why.errno != errno.EEXIST:
|
||||
raise
|
||||
|
||||
def symlink(src, dst, mkdirs=0):
|
||||
"""Copy a file or a directory."""
|
||||
if not os.path.exists(src):
|
||||
raise IOError("No such file or directory: '%s'" % src)
|
||||
if mkdirs:
|
||||
makedirs(os.path.dirname(dst))
|
||||
os.symlink(os.path.abspath(src), dst)
|
||||
|
||||
def pathjoin(*args):
|
||||
"""Safe wrapper for os.path.join: asserts that all but the first
|
||||
argument are relative paths."""
|
||||
for seg in args[1:]:
|
||||
assert seg[0] != "/"
|
||||
return os.path.join(*args)
|
||||
|
||||
|
||||
cmdline_doc = """\
|
||||
Usage:
|
||||
python bundlebuilder.py [options] command
|
||||
python mybuildscript.py [options] command
|
||||
|
||||
Commands:
|
||||
build build the application
|
||||
report print a report
|
||||
|
||||
Options:
|
||||
-b, --builddir=DIR the build directory; defaults to "build"
|
||||
-n, --name=NAME application name
|
||||
-r, --resource=FILE extra file or folder to be copied to Resources
|
||||
-f, --file=SRC:DST extra file or folder to be copied into the bundle;
|
||||
DST must be a path relative to the bundle root
|
||||
-e, --executable=FILE the executable to be used
|
||||
-m, --mainprogram=FILE the Python main program
|
||||
-a, --argv add a wrapper main program to create sys.argv
|
||||
-p, --plist=FILE .plist file (default: generate one)
|
||||
--nib=NAME main nib name
|
||||
-c, --creator=CCCC 4-char creator code (default: '????')
|
||||
--iconfile=FILE filename of the icon (an .icns file) to be used
|
||||
as the Finder icon
|
||||
--bundle-id=ID the CFBundleIdentifier, in reverse-dns format
|
||||
(eg. org.python.BuildApplet; this is used for
|
||||
the preferences file name)
|
||||
-l, --link symlink files/folder instead of copying them
|
||||
--link-exec symlink the executable instead of copying it
|
||||
--standalone build a standalone application, which is fully
|
||||
independent of a Python installation
|
||||
--semi-standalone build a standalone application, which depends on
|
||||
an installed Python, yet includes all third-party
|
||||
modules.
|
||||
--python=FILE Python to use in #! line in stead of current Python
|
||||
--lib=FILE shared library or framework to be copied into
|
||||
the bundle
|
||||
-x, --exclude=MODULE exclude module (with --(semi-)standalone)
|
||||
-i, --include=MODULE include module (with --(semi-)standalone)
|
||||
--package=PACKAGE include a whole package (with --(semi-)standalone)
|
||||
--strip strip binaries (remove debug info)
|
||||
-v, --verbose increase verbosity level
|
||||
-q, --quiet decrease verbosity level
|
||||
-h, --help print this message
|
||||
"""
|
||||
|
||||
def usage(msg=None):
|
||||
if msg:
|
||||
print(msg)
|
||||
print(cmdline_doc)
|
||||
sys.exit(1)
|
||||
|
||||
def main(builder=None):
|
||||
if builder is None:
|
||||
builder = AppBuilder(verbosity=1)
|
||||
|
||||
shortopts = "b:n:r:f:e:m:c:p:lx:i:hvqa"
|
||||
longopts = ("builddir=", "name=", "resource=", "file=", "executable=",
|
||||
"mainprogram=", "creator=", "nib=", "plist=", "link",
|
||||
"link-exec", "help", "verbose", "quiet", "argv", "standalone",
|
||||
"exclude=", "include=", "package=", "strip", "iconfile=",
|
||||
"lib=", "python=", "semi-standalone", "bundle-id=", "destroot=")
|
||||
|
||||
try:
|
||||
options, args = getopt.getopt(sys.argv[1:], shortopts, longopts)
|
||||
except getopt.error:
|
||||
usage()
|
||||
|
||||
for opt, arg in options:
|
||||
if opt in ('-b', '--builddir'):
|
||||
builder.builddir = arg
|
||||
elif opt in ('-n', '--name'):
|
||||
builder.name = arg
|
||||
elif opt in ('-r', '--resource'):
|
||||
builder.resources.append(os.path.normpath(arg))
|
||||
elif opt in ('-f', '--file'):
|
||||
srcdst = arg.split(':')
|
||||
if len(srcdst) != 2:
|
||||
usage("-f or --file argument must be two paths, "
|
||||
"separated by a colon")
|
||||
builder.files.append(srcdst)
|
||||
elif opt in ('-e', '--executable'):
|
||||
builder.executable = arg
|
||||
elif opt in ('-m', '--mainprogram'):
|
||||
builder.mainprogram = arg
|
||||
elif opt in ('-a', '--argv'):
|
||||
builder.argv_emulation = 1
|
||||
elif opt in ('-c', '--creator'):
|
||||
builder.creator = arg
|
||||
elif opt == '--bundle-id':
|
||||
builder.bundle_id = arg
|
||||
elif opt == '--iconfile':
|
||||
builder.iconfile = arg
|
||||
elif opt == "--lib":
|
||||
builder.libs.append(os.path.normpath(arg))
|
||||
elif opt == "--nib":
|
||||
builder.nibname = arg
|
||||
elif opt in ('-p', '--plist'):
|
||||
builder.plist = Plist.fromFile(arg)
|
||||
elif opt in ('-l', '--link'):
|
||||
builder.symlink = 1
|
||||
elif opt == '--link-exec':
|
||||
builder.symlink_exec = 1
|
||||
elif opt in ('-h', '--help'):
|
||||
usage()
|
||||
elif opt in ('-v', '--verbose'):
|
||||
builder.verbosity += 1
|
||||
elif opt in ('-q', '--quiet'):
|
||||
builder.verbosity -= 1
|
||||
elif opt == '--standalone':
|
||||
builder.standalone = 1
|
||||
elif opt == '--semi-standalone':
|
||||
builder.semi_standalone = 1
|
||||
elif opt == '--python':
|
||||
builder.python = arg
|
||||
elif opt in ('-x', '--exclude'):
|
||||
builder.excludeModules.append(arg)
|
||||
elif opt in ('-i', '--include'):
|
||||
builder.includeModules.append(arg)
|
||||
elif opt == '--package':
|
||||
builder.includePackages.append(arg)
|
||||
elif opt == '--strip':
|
||||
builder.strip = 1
|
||||
elif opt == '--destroot':
|
||||
builder.destroot = arg
|
||||
|
||||
if len(args) != 1:
|
||||
usage("Must specify one command ('build', 'report' or 'help')")
|
||||
command = args[0]
|
||||
|
||||
if command == "build":
|
||||
builder.setup()
|
||||
builder.build()
|
||||
elif command == "report":
|
||||
builder.setup()
|
||||
builder.report()
|
||||
elif command == "help":
|
||||
usage()
|
||||
else:
|
||||
usage("Unknown command '%s'" % command)
|
||||
|
||||
|
||||
def buildapp(**kwargs):
|
||||
builder = AppBuilder(**kwargs)
|
||||
main(builder)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue