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
9bcb641a
Kaydet (Commit)
9bcb641a
authored
Şub 05, 1995
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
added Resource(), to create new resources from Python
üst
0818a4c1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
Resmodule.c
Mac/Modules/res/Resmodule.c
+28
-0
ressupport.py
Mac/Modules/res/ressupport.py
+1
-0
No files found.
Mac/Modules/res/Resmodule.c
Dosyayı görüntüle @
9bcb641a
...
...
@@ -30,6 +30,8 @@ extern int MenuObj_Convert(PyObject *, MenuHandle *);
extern
PyObject
*
CtlObj_New
(
ControlHandle
);
extern
int
CtlObj_Convert
(
PyObject
*
,
ControlHandle
*
);
extern
PyObject
*
WinObj_WhichWindow
(
WindowPtr
);
#include <Resources.h>
#define resNotFound -192
/* Can't include <Errors.h> because of Python's "errors.h" */
...
...
@@ -1161,6 +1163,30 @@ static PyObject *Res_FSpCreateResFile(_self, _args)
return
_res
;
}
static
PyObject
*
Res_Resource
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
char
*
buf
;
int
len
;
Handle
h
;
if
(
!
PyArg_ParseTuple
(
_args
,
"s#"
,
&
buf
,
&
len
))
return
NULL
;
h
=
NewHandle
(
len
);
if
(
h
==
NULL
)
{
PyErr_NoMemory
();
return
NULL
;
}
HLock
(
h
);
memcpy
(
*
h
,
buf
,
len
);
HUnlock
(
h
);
return
(
PyObject
*
)
ResObj_New
(
h
);
}
static
PyMethodDef
Res_methods
[]
=
{
{
"InitResources"
,
(
PyCFunction
)
Res_InitResources
,
1
,
"() -> (short _rv)"
},
...
...
@@ -1228,6 +1254,8 @@ static PyMethodDef Res_methods[] = {
"(FSSpec spec, SignedByte permission) -> (short _rv)"
},
{
"FSpCreateResFile"
,
(
PyCFunction
)
Res_FSpCreateResFile
,
1
,
"(FSSpec spec, OSType creator, OSType fileType, ScriptCode scriptTag) -> None"
},
{
"Resource"
,
(
PyCFunction
)
Res_Resource
,
1
,
"Convert a string to a resource object.
\n\n
The created resource object is actually just a handle.
\n
Apply AddResource() to write it to a resource file.
\n
"
},
{
NULL
,
NULL
,
0
}
};
...
...
Mac/Modules/res/ressupport.py
Dosyayı görüntüle @
9bcb641a
...
...
@@ -69,6 +69,7 @@ functions = []
resmethods
=
[]
execfile
(
'resgen.py'
)
execfile
(
'resedit.py'
)
for
f
in
functions
:
module
.
add
(
f
)
for
f
in
resmethods
:
resobject
.
add
(
f
)
...
...
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