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
ee1c85c8
Kaydet (Commit)
ee1c85c8
authored
Mar 06, 2003
tarafından
Jack Jansen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Various tweaks by Jack because of the different module name, adaptation
to the Python style, etc.
üst
86f25fb1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
43 deletions
+75
-43
OSATerminology.c
Mac/Modules/OSATerminology.c
+75
-43
No files found.
Mac/Modules/OSATerminology.c
Dosyayı görüntüle @
ee1c85c8
#include <Python/Python.h>
/*
** This module is a one-trick pony: given an FSSpec it gets the aeut
** resources. It was written by Donovan Preston and slightly modified
** by Jack.
**
** It should be considered a placeholder, it will probably be replaced
** by a full interface to OpenScripting.
*/
#include "Python.h"
#include "macglue.h"
#ifdef WITHOUT_FRAMEWORKS
#include <OpenScripting.h>
#else
#include <Carbon/Carbon.h>
#include <Carbon/Carbon.h>
#
include <Python/pymactoolbox.h>
#
endif
PyObject
*
PyOSA_GetAppTerminology
(
PyObject
*
self
,
PyObject
*
args
)
{
static
PyObject
*
AEDesc
temp
;
PyOSA_GetAppTerminology
(
PyObject
*
self
,
PyObject
*
args
)
FSSpec
tempFSSpec
;
{
AEDesc
theDesc
=
{
0
,
0
};
ComponentInstance
defaultComponent
;
FSSpec
fss
;
ScriptingComponentSelector
theType
;
ComponentInstance
defaultComponent
=
NULL
;
SInt16
defaultTerminology
;
SInt16
defaultTerminology
=
0
;
Boolean
didLaunch
;
Boolean
didLaunch
=
0
;
OSAError
err
;
OSAError
err
;
long
modeFlags
=
0
;
PyObject
*
returnVal
;
if
(
!
PyArg_ParseTuple
(
args
,
"O&|i"
,
PyMac_GetFSSpec
,
&
fss
,
&
modeFlags
))
return
NULL
;
if
(
!
PyArg_ParseTuple
(
args
,
"O&"
,
PyMac_GetFSSpec
,
&
tempFSSpec
))
return
NULL
;
defaultComponent
=
OpenDefaultComponent
(
kOSAComponentType
,
defaultComponent
=
OpenDefaultComponent
(
kOSAComponentType
,
'
ascr
'
);
'
ascr
'
);
err
=
GetComponentInstanceError
(
defaultComponent
);
// kOSAGenericScriptingComponentSubtype);
if
(
err
)
return
PyMac_Error
(
err
);
err
=
GetComponentInstanceError
(
defaultComponent
);
printf
(
"OpenDefaultComponent: %d
\n
"
,
err
);
err
=
OSAGetCurrentDialect
(
defaultComponent
,
&
defaultTerminology
);
err
=
OSAGetCurrentDialect
(
defaultComponent
,
&
defaultTerminology
);
printf
(
"getcurrentdialect: %d
\n
"
,
err
);
if
(
err
)
return
PyMac_Error
(
err
);
err
=
OSAGetAppTerminology
(
err
=
OSAGetAppTerminology
(
defaultComponent
,
defaultComponent
,
kOSAModeNull
,
modeFlags
,
&
tempFSSpec
,
&
fss
,
defaultTerminology
,
defaultTerminology
,
&
didLaunch
,
&
didLaunch
,
&
t
emp
&
t
heDesc
);
);
if
(
err
)
return
PyMac_Error
(
err
);
return
Py_BuildValue
(
"O&i"
,
AEDesc_New
,
&
theDesc
,
didLaunch
);
}
/* err = ASGetAppTerminology (
static
PyObject
*
PyOSA_GetSysTerminology
(
PyObject
*
self
,
PyObject
*
args
)
{
AEDesc
theDesc
=
{
0
,
0
};
FSSpec
fss
;
ComponentInstance
defaultComponent
=
NULL
;
SInt16
defaultTerminology
=
0
;
Boolean
didLaunch
=
0
;
OSAError
err
;
long
modeFlags
=
0
;
if
(
!
PyArg_ParseTuple
(
args
,
"O&|i"
,
PyMac_GetFSSpec
,
&
fss
,
&
modeFlags
))
return
NULL
;
defaultComponent
=
OpenDefaultComponent
(
kOSAComponentType
,
'
ascr
'
);
err
=
GetComponentInstanceError
(
defaultComponent
);
if
(
err
)
return
PyMac_Error
(
err
);
err
=
OSAGetCurrentDialect
(
defaultComponent
,
&
defaultTerminology
);
if
(
err
)
return
PyMac_Error
(
err
);
err
=
OSAGetAppTerminology
(
defaultComponent
,
defaultComponent
,
&tempFSSpec,
modeFlags
,
&
fss
,
defaultTerminology
,
defaultTerminology
,
&
didLaunch
,
&
didLaunch
,
&temp
&
theDesc
);*/
);
if
(
err
)
return
PyMac_Error
(
err
);
printf
(
"getappterminology: %d
\n
"
,
err
);
return
Py_BuildValue
(
"O&i"
,
AEDesc_New
,
&
theDesc
,
didLaunch
);
returnVal
=
Py_BuildValue
(
"O&i"
,
AEDesc_New
,
&
temp
,
didLaunch
);
return
returnVal
;
}
}
/*
/*
* List of methods defined in the module
* List of methods defined in the module
*/
*/
static
struct
PyMethodDef
PyOSA
_methods
[]
=
static
struct
PyMethodDef
OSATerminology
_methods
[]
=
{
{
{
"GetAppTerminology"
,
{
"GetAppTerminology"
,
(
PyCFunction
)
PyOSA_GetAppTerminology
,
(
PyCFunction
)
PyOSA_GetAppTerminology
,
METH_VARARGS
,
METH_VARARGS
,
"Get an applications terminology, as an AEDesc object."
},
"Get an applications terminology, as an AEDesc object."
},
{
"GetSysTerminology"
,
{
NULL
,
(
PyCFunction
)
NULL
,
0
,
NULL
}
(
PyCFunction
)
PyOSA_GetSysTerminology
,
METH_VARARGS
,
"Get an applications system terminology, as an AEDesc object."
},
{
NULL
,
(
PyCFunction
)
NULL
,
0
,
NULL
}
};
};
void
void
init
PyOSA
(
void
)
init
OSATerminology
(
void
)
{
{
Py_InitModule
(
"
PyOSA"
,
PyOSA
_methods
);
Py_InitModule
(
"
OSATerminology"
,
OSATerminology
_methods
);
}
}
\ No newline at end of file
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