Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
086f7c38
Kaydet (Commit)
086f7c38
authored
Ara 17, 2001
tarafından
Jack Jansen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
There's a new include file AEInteraction.h which contains AESend and friends.
üst
ec982e27
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
185 additions
and
1 deletion
+185
-1
_AEmodule.c
Mac/Modules/ae/_AEmodule.c
+184
-0
aescan.py
Mac/Modules/ae/aescan.py
+1
-1
No files found.
Mac/Modules/ae/_AEmodule.c
Dosyayı görüntüle @
086f7c38
...
...
@@ -5,8 +5,12 @@
#ifdef _WIN32
#include "pywintoolbox.h"
#else
#include "macglue.h"
#include "pymactoolbox.h"
#endif
/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
...
...
@@ -552,6 +556,105 @@ static PyObject *AEDesc_AEGetDescDataSize(AEDescObject *_self, PyObject *_args)
}
#endif
static
PyObject
*
AEDesc_AESend
(
AEDescObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
AppleEvent
reply
;
AESendMode
sendMode
;
AESendPriority
sendPriority
;
long
timeOutInTicks
;
if
(
!
PyArg_ParseTuple
(
_args
,
"lhl"
,
&
sendMode
,
&
sendPriority
,
&
timeOutInTicks
))
return
NULL
;
_err
=
AESend
(
&
_self
->
ob_itself
,
&
reply
,
sendMode
,
sendPriority
,
timeOutInTicks
,
upp_AEIdleProc
,
(
AEFilterUPP
)
0
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"O&"
,
AEDesc_New
,
&
reply
);
return
_res
;
}
static
PyObject
*
AEDesc_AEResetTimer
(
AEDescObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_err
=
AEResetTimer
(
&
_self
->
ob_itself
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
AEDesc_AESuspendTheCurrentEvent
(
AEDescObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_err
=
AESuspendTheCurrentEvent
(
&
_self
->
ob_itself
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
AEDesc_AEResumeTheCurrentEvent
(
AEDescObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
AppleEvent
reply
;
AEEventHandlerUPP
dispatcher__proc__
=
upp_GenericEventHandler
;
PyObject
*
dispatcher
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&O"
,
AEDesc_Convert
,
&
reply
,
&
dispatcher
))
return
NULL
;
_err
=
AEResumeTheCurrentEvent
(
&
_self
->
ob_itself
,
&
reply
,
dispatcher__proc__
,
(
long
)
dispatcher
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
Py_INCREF
(
dispatcher
);
/* XXX leak, but needed */
return
_res
;
}
static
PyObject
*
AEDesc_AEGetTheCurrentEvent
(
AEDescObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_err
=
AEGetTheCurrentEvent
(
&
_self
->
ob_itself
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
AEDesc_AESetTheCurrentEvent
(
AEDescObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_err
=
AESetTheCurrentEvent
(
&
_self
->
ob_itself
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
AEDesc_AEResolve
(
AEDescObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
...
...
@@ -616,6 +719,18 @@ static PyMethodDef AEDesc_methods[] = {
{
"AEGetDescDataSize"
,
(
PyCFunction
)
AEDesc_AEGetDescDataSize
,
1
,
"() -> (Size _rv)"
},
#endif
{
"AESend"
,
(
PyCFunction
)
AEDesc_AESend
,
1
,
"(AESendMode sendMode, AESendPriority sendPriority, long timeOutInTicks) -> (AppleEvent reply)"
},
{
"AEResetTimer"
,
(
PyCFunction
)
AEDesc_AEResetTimer
,
1
,
"() -> None"
},
{
"AESuspendTheCurrentEvent"
,
(
PyCFunction
)
AEDesc_AESuspendTheCurrentEvent
,
1
,
"() -> None"
},
{
"AEResumeTheCurrentEvent"
,
(
PyCFunction
)
AEDesc_AEResumeTheCurrentEvent
,
1
,
"(AppleEvent reply, EventHandler dispatcher) -> None"
},
{
"AEGetTheCurrentEvent"
,
(
PyCFunction
)
AEDesc_AEGetTheCurrentEvent
,
1
,
"() -> None"
},
{
"AESetTheCurrentEvent"
,
(
PyCFunction
)
AEDesc_AESetTheCurrentEvent
,
1
,
"() -> None"
},
{
"AEResolve"
,
(
PyCFunction
)
AEDesc_AEResolve
,
1
,
"(short callbackFlags) -> (AEDesc theToken)"
},
{
NULL
,
NULL
,
0
}
...
...
@@ -817,6 +932,67 @@ static PyObject *AE_AEReplaceDescData(PyObject *_self, PyObject *_args)
}
#endif
static
PyObject
*
AE_AEProcessAppleEvent
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
EventRecord
theEventRecord
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
PyMac_GetEventRecord
,
&
theEventRecord
))
return
NULL
;
_err
=
AEProcessAppleEvent
(
&
theEventRecord
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
AE_AEGetInteractionAllowed
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
AEInteractAllowed
level
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_err
=
AEGetInteractionAllowed
(
&
level
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"b"
,
level
);
return
_res
;
}
static
PyObject
*
AE_AESetInteractionAllowed
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
AEInteractAllowed
level
;
if
(
!
PyArg_ParseTuple
(
_args
,
"b"
,
&
level
))
return
NULL
;
_err
=
AESetInteractionAllowed
(
level
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
AE_AEInteractWithUser
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
long
timeOutInTicks
;
if
(
!
PyArg_ParseTuple
(
_args
,
"l"
,
&
timeOutInTicks
))
return
NULL
;
_err
=
AEInteractWithUser
(
timeOutInTicks
,
(
NMRecPtr
)
0
,
upp_AEIdleProc
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
AE_AEInstallEventHandler
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
...
...
@@ -1005,6 +1181,14 @@ static PyMethodDef AE_methods[] = {
{
"AEReplaceDescData"
,
(
PyCFunction
)
AE_AEReplaceDescData
,
1
,
"(DescType typeCode, Buffer dataPtr) -> (AEDesc theAEDesc)"
},
#endif
{
"AEProcessAppleEvent"
,
(
PyCFunction
)
AE_AEProcessAppleEvent
,
1
,
"(EventRecord theEventRecord) -> None"
},
{
"AEGetInteractionAllowed"
,
(
PyCFunction
)
AE_AEGetInteractionAllowed
,
1
,
"() -> (AEInteractAllowed level)"
},
{
"AESetInteractionAllowed"
,
(
PyCFunction
)
AE_AESetInteractionAllowed
,
1
,
"(AEInteractAllowed level) -> None"
},
{
"AEInteractWithUser"
,
(
PyCFunction
)
AE_AEInteractWithUser
,
1
,
"(long timeOutInTicks) -> None"
},
{
"AEInstallEventHandler"
,
(
PyCFunction
)
AE_AEInstallEventHandler
,
1
,
"(AEEventClass theAEEventClass, AEEventID theAEEventID, EventHandler handler) -> None"
},
{
"AERemoveEventHandler"
,
(
PyCFunction
)
AE_AERemoveEventHandler
,
1
,
...
...
Mac/Modules/ae/aescan.py
Dosyayı görüntüle @
086f7c38
...
...
@@ -15,7 +15,7 @@ from scantools import Scanner
def
main
():
print
"=== Scanning AEDataModel.h, AppleEvents.h, AERegistry.h, AEObjects.h ==="
input
=
[
"AEDataModel.h"
,
"AppleEvents.h"
,
"AERegistry.h"
,
"AEObjects.h"
]
input
=
[
"AEDataModel.h"
,
"A
EInteraction.h"
,
"A
ppleEvents.h"
,
"AERegistry.h"
,
"AEObjects.h"
]
output
=
"aegen.py"
defsoutput
=
TOOLBOXDIR
+
"AppleEvents.py"
scanner
=
AppleEventsScanner
(
input
,
output
,
defsoutput
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment