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
a76382a6
Kaydet (Commit)
a76382a6
authored
Şub 02, 1995
tarafından
Jack Jansen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added HandleEvent method to macos, so python programs can hand back
events they don't want to handle to stdio
üst
8828fcf7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
13 deletions
+39
-13
macglue.h
Mac/Include/macglue.h
+2
-1
macosmodule.c
Mac/Modules/macosmodule.c
+14
-0
macglue.c
Mac/Python/macglue.c
+23
-12
No files found.
Mac/Include/macglue.h
Dosyayı görüntüle @
a76382a6
...
...
@@ -37,7 +37,8 @@ int PyMac_Idle Py_PROTO((void)); /* Idle routine */
void
PyMac_Yield
Py_PROTO
((
void
));
/* optional idle routine for mainloop */
void
PyMac_SetYield
Py_PROTO
((
long
,
long
,
long
,
long
));
/* Set timeouts */
PyObject
*
PyErr_Mac
(
PyObject
*
,
int
);
/* Exception with a mac error */
PyObject
*
PyMac_Error
(
OSErr
);
/* Uses PyMac_GetOSErrException */
PyObject
*
PyMac_Error
(
OSErr
);
/* Uses PyMac_GetOSErrException */
void
PyMac_HandleEvent
Py_PROTO
((
EventRecord
*
));
/* Handle one event, if possible */
int
PyMac_Idle
(
void
);
/* Idle routine */
...
...
Mac/Modules/macosmodule.c
Dosyayı görüntüle @
a76382a6
...
...
@@ -202,6 +202,19 @@ MacOS_EnableAppswitch(PyObject *self, PyObject *args)
return
Py_None
;
}
static
PyObject
*
MacOS_HandleEvent
(
PyObject
*
self
,
PyObject
*
args
)
{
EventRecord
ev
;
if
(
!
PyArg_ParseTuple
(
args
,
"O&"
,
PyMac_GetEventRecord
,
&
ev
))
return
NULL
;
PyMac_HandleEvent
(
&
ev
);
Py_INCREF
(
Py_None
);
return
Py_None
;
}
static
PyMethodDef
MacOS_Methods
[]
=
{
{
"AcceptHighLevelEvent"
,
MacOS_AcceptHighLevelEvent
,
1
},
{
"GetCreatorAndType"
,
MacOS_GetCreatorAndType
,
1
},
...
...
@@ -211,6 +224,7 @@ static PyMethodDef MacOS_Methods[] = {
#endif
{
"SetScheduleTimes"
,
MacOS_SetScheduleTimes
,
1
},
{
"EnableAppswitch"
,
MacOS_EnableAppswitch
,
1
},
{
"HandleEvent"
,
MacOS_HandleEvent
,
1
},
{
NULL
,
NULL
}
/* Sentinel */
};
...
...
Mac/Python/macglue.c
Dosyayı görüntüle @
a76382a6
...
...
@@ -266,6 +266,28 @@ PyMac_SetYield(long fgi, long fgy, long bgi, long bgy)
yield_bg
=
bgy
;
}
/*
** Handle an event, either one found in the mainloop eventhandler or
** one passed back from the python program.
*/
void
PyMac_HandleEvent
(
evp
)
EventRecord
*
evp
;
{
WindowPtr
wp
;
#ifdef __MWERKS__
/* If SIOUX wants it we're done */
(
void
)
SIOUXHandleOneEvent
(
evp
);
#else
/* Other compilers are just unlucky: we only weed out clicks in other applications */
if
(
evp
->
what
==
mouseDown
)
{
if
(
FindWindow
(
evp
->
where
,
&
wp
)
==
inSysWindow
)
SystemClick
(
evp
,
wp
);
}
#endif
/* !__MWERKS__ */
}
/*
** Yield the CPU to other tasks.
*/
...
...
@@ -273,7 +295,6 @@ static
PyMac_DoYield
()
{
EventRecord
ev
;
WindowPtr
wp
;
long
yield
;
static
int
no_waitnextevent
=
-
1
;
int
gotone
;
...
...
@@ -306,17 +327,7 @@ PyMac_DoYield()
/* Get out quickly if nothing interesting is happening */
if
(
!
gotone
||
ev
.
what
==
nullEvent
)
break
;
#ifdef __MWERKS__
/* If SIOUX wants it we're done too */
(
void
)
SIOUXHandleOneEvent
(
&
ev
);
#else
/* Other compilers are just unlucky: we only weed out clicks in other applications */
if
(
ev
.
what
==
mouseDown
)
{
if
(
FindWindow
(
ev
.
where
,
&
wp
)
==
inSysWindow
)
SystemClick
(
&
ev
,
wp
);
}
#endif
/* !__MWERKS__ */
PyMac_HandleEvent
(
&
ev
);
}
lastyield
=
TickCount
();
}
...
...
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