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
34cbe718
Kaydet (Commit)
34cbe718
authored
Kas 05, 2001
tarafından
Jack Jansen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed broken newlines and changed module name. Still untested.
üst
e8cbb9f1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
23 deletions
+18
-23
CarbonEvtscan.py
Mac/Modules/carbonevt/CarbonEvtscan.py
+7
-2
CarbonEvtsupport.py
Mac/Modules/carbonevt/CarbonEvtsupport.py
+11
-21
No files found.
Mac/Modules/carbonevt/CarbonEvtscan.py
Dosyayı görüntüle @
34cbe718
...
...
@@ -4,8 +4,9 @@ import sys
import
os
import
string
import
MacOS
import
sys
BGENDIR
=
'/Users/dsp/Documents/python/dist/src/Tools/bgen/bgen'
BGENDIR
=
os
.
path
.
join
(
sys
.
prefix
,
':Tools:bgen:bgen:'
)
sys
.
path
.
append
(
BGENDIR
)
from
bgenlocations
import
TOOLBOXDIR
...
...
@@ -21,7 +22,7 @@ def main():
scanner
.
scan
()
scanner
.
close
()
print
"--done scanning, importing--"
import
CarbonEv
ents
support
import
CarbonEv
t
support
print
"done"
RefObjectTypes
=
[
"EventRef"
,
...
...
@@ -87,5 +88,9 @@ class CarbonEvents_Scanner(Scanner):
# "EventLoopTimerProcPtr",
# "EventHandlerProcPtr",
# ]
def
makerepairinstructions
(
self
):
return
[]
if
__name__
==
"__main__"
:
main
()
Mac/Modules/carbonevt/CarbonEvtsupport.py
Dosyayı görüntüle @
34cbe718
...
...
@@ -126,8 +126,7 @@ EventHotKeyID_Convert(PyObject *v, EventHotKeyID *out)
/******** handlecommand ***********/
pascal OSStatus CarbonEvents_HandleCommand(EventHandlerCallRef handlerRef, Even
tRef event, void *outPyObject) {
pascal OSStatus CarbonEvents_HandleCommand(EventHandlerCallRef handlerRef, EventRef event, void *outPyObject) {
PyObject *retValue;
int status;
...
...
@@ -136,8 +135,7 @@ tRef event, void *outPyObject) {
PyEval_RestoreThread(_save);
#endif /* USE_MAC_MP_MULTITHREADING */
retValue = PyObject_CallFunction((PyObject *)outPyObject, "O&O&", EventHand
lerCallRef_New, handlerRef, EventRef_New, event);
retValue = PyObject_CallFunction((PyObject *)outPyObject, "O&O&", EventHandlerCallRef_New, handlerRef, EventRef_New, event);
status = PyInt_AsLong(retValue);
#if USE_MAC_MP_MULTITHREADING
...
...
@@ -152,8 +150,7 @@ lerCallRef_New, handlerRef, EventRef_New, event);
"""
module
=
MacModule
(
'CarbonEvents'
,
'CarbonEvents'
,
includestuff
,
finalstuff
,
in
itstuff
)
module
=
MacModule
(
'CarbonEvents'
,
'CarbonEvents'
,
includestuff
,
finalstuff
,
initstuff
)
#class CFReleaserObj(GlobalObjectDefinition):
# def outputFreeIt(self, name):
...
...
@@ -165,25 +162,20 @@ for typ in RefObjectTypes:
module
.
addobject
(
eval
(
typ
+
'object'
))
functions
=
[]
for
typ
in
RefObjectTypes
:
## go thru all ObjectTypes as defined in CarbonEvent
sscan
.
py
for
typ
in
RefObjectTypes
:
## go thru all ObjectTypes as defined in CarbonEventsscan.py
# initialize the lists for carbongen to fill
execstr
=
typ
+
'methods = []'
exec
execstr
execfile
(
'CarbonEventsgen.py'
)
for
f
in
functions
:
module
.
add
(
f
)
# add all the functions carboneventsgen
put
in
the
list
for
f
in
functions
:
module
.
add
(
f
)
# add all the functions carboneventsgen put in the list
for
typ
in
RefObjectTypes
:
## go thru all ObjectT
ypes
as
defined
in
CarbonEventsscan
.
py
for
typ
in
RefObjectTypes
:
## go thru all ObjectTypes as defined in CarbonEventsscan.py
methods
=
eval
(
typ
+
'methods'
)
## get a reference to the method list
from
the
main
namespace
obj
=
eval
(
typ
+
'object'
)
## get a reference to the obj
ect
for
m
in
methods
:
obj
.
add
(
m
)
## add each method in the list to the o
bject
obj
=
eval
(
typ
+
'object'
)
## get a reference to the object
for
m
in
methods
:
obj
.
add
(
m
)
## add each method in the list to the object
installeventhandler
=
"""
EventTypeSpec inSpec;
...
...
@@ -196,16 +188,14 @@ if (!PyArg_ParseTuple(_args, "O&O", EventTypeSpec_Convert, &inSpec, &callback))
return NULL;
event = NewEventHandlerUPP(CarbonEvents_HandleCommand);
_err = InstallEventHandler(_self->ob_itself, event, 1, &inSpec, (void *)callbac
k, &outRef);
_err = InstallEventHandler(_self->ob_itself, event, 1, &inSpec, (void *)callback, &outRef);
if (_err != noErr) return PyMac_Error(_err);
return Py_BuildValue("l", outRef);
"""
f
=
ManualGenerator
(
"InstallEventHandler"
,
installeventhandler
);
f
.
docstring
=
lambda
:
"(EventTargetRef inTarget, EventTypeSpec inSpec, Method c
allback) -> (EventHandlerRef outRef)"
f
.
docstring
=
lambda
:
"(EventTargetRef inTarget, EventTypeSpec inSpec, Method callback) -> (EventHandlerRef outRef)"
EventTargetRefobject
.
add
(
f
)
runappeventloop
=
"""
...
...
@@ -234,7 +224,7 @@ f = ManualGenerator("RunApplicationEventLoop", runappeventloop);
f
.
docstring
=
lambda
:
"() -> ()"
module
.
add
(
f
)
SetOutputFileName
(
'_CarbonEv
ents
.c'
)
SetOutputFileName
(
'_CarbonEv
t
.c'
)
module
.
generate
()
import
os
...
...
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