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
87eb4f8b
Kaydet (Commit)
87eb4f8b
authored
Ock 30, 2001
tarafından
Jack Jansen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
New internal function BMObj_NewCopied() which copies the BitMap. Used to get the screenBits bitmap.
üst
69c32798
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
8 deletions
+46
-8
Qdmodule.c
Mac/Modules/qd/Qdmodule.c
+23
-5
qdsupport.py
Mac/Modules/qd/qdsupport.py
+23
-3
No files found.
Mac/Modules/qd/Qdmodule.c
Dosyayı görüntüle @
87eb4f8b
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
#include <QuickDraw.h>
#include <QuickDraw.h>
#if !ACCESSOR_CALLS_ARE_FUNCTIONS
#if !ACCESSOR_CALLS_ARE_FUNCTIONS
#define GetPortBitMapForCopyBits(port) ((
(GrafPort
)(port))->portBits)
#define GetPortBitMapForCopyBits(port) ((
const struct BitMap *)&((GrafPort *
)(port))->portBits)
#define GetPortPixMap(port) (((CGrafPtr)(port))->portPixMap)
#define GetPortPixMap(port) (((CGrafPtr)(port))->portPixMap)
#define GetPortBounds(port, bounds) (*(bounds) = (port)->portRect, (bounds))
#define GetPortBounds(port, bounds) (*(bounds) = (port)->portRect, (bounds))
#define GetPortForeColor(port, color) (*(color) = (port)->rgbFgColor, (color))
#define GetPortForeColor(port, color) (*(color) = (port)->rgbFgColor, (color))
...
@@ -79,6 +79,8 @@
...
@@ -79,6 +79,8 @@
#define QDIsPortBuffered(port) 0
#define QDIsPortBuffered(port) 0
#endif
/* !TARGET_API_MAC_CARBON */
#endif
/* !TARGET_API_MAC_CARBON */
staticforward
PyObject
*
BMObj_NewCopied
(
BitMapPtr
);
/*
/*
** Parse/generate RGB records
** Parse/generate RGB records
*/
*/
...
@@ -115,8 +117,6 @@ PyObject *QdFI_New(itself)
...
@@ -115,8 +117,6 @@ PyObject *QdFI_New(itself)
itself
->
widMax
,
itself
->
leading
);
itself
->
widMax
,
itself
->
leading
);
}
}
static
PyObject
*
Qd_Error
;
static
PyObject
*
Qd_Error
;
/* ---------------------- Object type GrafPort ---------------------- */
/* ---------------------- Object type GrafPort ---------------------- */
...
@@ -584,7 +584,7 @@ static PyObject *QDGA_getattr(self, name)
...
@@ -584,7 +584,7 @@ static PyObject *QDGA_getattr(self, name)
if
(
strcmp
(
name
,
"screenBits"
)
==
0
)
{
if
(
strcmp
(
name
,
"screenBits"
)
==
0
)
{
BitMap
rv
;
BitMap
rv
;
GetQDGlobalsScreenBits
(
&
rv
);
GetQDGlobalsScreenBits
(
&
rv
);
return
BMObj_New
(
&
rv
);
return
BMObj_New
Copied
(
&
rv
);
}
}
if
(
strcmp
(
name
,
"thePort"
)
==
0
)
if
(
strcmp
(
name
,
"thePort"
)
==
0
)
return
GrafObj_New
(
GetQDGlobalsThePort
());
return
GrafObj_New
(
GetQDGlobalsThePort
());
...
@@ -4521,7 +4521,7 @@ static PyObject *Qd_GetQDGlobalsScreenBits(_self, _args)
...
@@ -4521,7 +4521,7 @@ static PyObject *Qd_GetQDGlobalsScreenBits(_self, _args)
return
NULL
;
return
NULL
;
GetQDGlobalsScreenBits
(
&
screenBits
);
GetQDGlobalsScreenBits
(
&
screenBits
);
_res
=
Py_BuildValue
(
"O&"
,
_res
=
Py_BuildValue
(
"O&"
,
BMObj_New
,
&
screenBits
);
BMObj_New
Copied
,
&
screenBits
);
return
_res
;
return
_res
;
}
}
...
@@ -6162,6 +6162,24 @@ static PyMethodDef Qd_methods[] = {
...
@@ -6162,6 +6162,24 @@ static PyMethodDef Qd_methods[] = {
/* Like BMObj_New, but the original bitmap data structure is copied (and
** released when the object is released)
*/
PyObject
*
BMObj_NewCopied
(
itself
)
BitMapPtr
itself
;
{
BitMapObject
*
it
;
BitMapPtr
itself_copy
;
if
((
itself_copy
=
(
BitMapPtr
)
malloc
(
sizeof
(
BitMap
)))
==
NULL
)
return
PyErr_NoMemory
();
*
itself_copy
=
*
itself
;
it
=
(
BitMapObject
*
)
BMObj_New
(
itself_copy
);
it
->
referred_bitmap
=
itself_copy
;
return
(
PyObject
*
)
it
;
}
void
initQd
()
void
initQd
()
{
{
...
...
Mac/Modules/qd/qdsupport.py
Dosyayı görüntüle @
87eb4f8b
...
@@ -46,7 +46,7 @@ CGrafPtr = OpaqueByValueType("CGrafPtr", "GrafObj")
...
@@ -46,7 +46,7 @@ CGrafPtr = OpaqueByValueType("CGrafPtr", "GrafObj")
GrafPtr
=
OpaqueByValueType
(
"GrafPtr"
,
"GrafObj"
)
GrafPtr
=
OpaqueByValueType
(
"GrafPtr"
,
"GrafObj"
)
BitMap_ptr
=
OpaqueByValueType
(
"BitMapPtr"
,
"BMObj"
)
BitMap_ptr
=
OpaqueByValueType
(
"BitMapPtr"
,
"BMObj"
)
const_BitMap_ptr
=
OpaqueByValueType
(
"const BitMap *"
,
"BMObj"
)
const_BitMap_ptr
=
OpaqueByValueType
(
"const BitMap *"
,
"BMObj"
)
BitMap
=
OpaqueType
(
"BitMap"
,
"BMObj"
)
BitMap
=
OpaqueType
(
"BitMap"
,
"BMObj
_NewCopied"
,
"BUG
"
)
RGBColor
=
OpaqueType
(
'RGBColor'
,
'QdRGB'
)
RGBColor
=
OpaqueType
(
'RGBColor'
,
'QdRGB'
)
RGBColor_ptr
=
RGBColor
RGBColor_ptr
=
RGBColor
FontInfo
=
OpaqueType
(
'FontInfo'
,
'QdFI'
)
FontInfo
=
OpaqueType
(
'FontInfo'
,
'QdFI'
)
...
@@ -64,7 +64,7 @@ includestuff = includestuff + """
...
@@ -64,7 +64,7 @@ includestuff = includestuff + """
#include <
%
s>"""
%
MACHEADERFILE
+
"""
#include <
%
s>"""
%
MACHEADERFILE
+
"""
#if !ACCESSOR_CALLS_ARE_FUNCTIONS
#if !ACCESSOR_CALLS_ARE_FUNCTIONS
#define GetPortBitMapForCopyBits(port) ((
(GrafPort
)(port))->portBits)
#define GetPortBitMapForCopyBits(port) ((
const struct BitMap *)&((GrafPort *
)(port))->portBits)
#define GetPortPixMap(port) (((CGrafPtr)(port))->portPixMap)
#define GetPortPixMap(port) (((CGrafPtr)(port))->portPixMap)
#define GetPortBounds(port, bounds) (*(bounds) = (port)->portRect, (bounds))
#define GetPortBounds(port, bounds) (*(bounds) = (port)->portRect, (bounds))
#define GetPortForeColor(port, color) (*(color) = (port)->rgbFgColor, (color))
#define GetPortForeColor(port, color) (*(color) = (port)->rgbFgColor, (color))
...
@@ -132,6 +132,8 @@ includestuff = includestuff + """
...
@@ -132,6 +132,8 @@ includestuff = includestuff + """
#define QDIsPortBuffered(port) 0
#define QDIsPortBuffered(port) 0
#endif /* !TARGET_API_MAC_CARBON */
#endif /* !TARGET_API_MAC_CARBON */
staticforward PyObject *BMObj_NewCopied(BitMapPtr);
/*
/*
** Parse/generate RGB records
** Parse/generate RGB records
*/
*/
...
@@ -167,7 +169,25 @@ PyObject *QdFI_New(itself)
...
@@ -167,7 +169,25 @@ PyObject *QdFI_New(itself)
return Py_BuildValue("hhhh", itself->ascent, itself->descent,
return Py_BuildValue("hhhh", itself->ascent, itself->descent,
itself->widMax, itself->leading);
itself->widMax, itself->leading);
}
}
"""
finalstuff
=
finalstuff
+
"""
/* Like BMObj_New, but the original bitmap data structure is copied (and
** released when the object is released)
*/
PyObject *BMObj_NewCopied(itself)
BitMapPtr itself;
{
BitMapObject *it;
BitMapPtr itself_copy;
if ((itself_copy=(BitMapPtr)malloc(sizeof(BitMap))) == NULL)
return PyErr_NoMemory();
*itself_copy = *itself;
it = (BitMapObject *)BMObj_New(itself_copy);
it->referred_bitmap = itself_copy;
return (PyObject *)it;
}
"""
"""
...
@@ -458,7 +478,7 @@ class QDGlobalsAccessObjectDefinition(ObjectDefinition):
...
@@ -458,7 +478,7 @@ class QDGlobalsAccessObjectDefinition(ObjectDefinition):
if ( strcmp(name, "screenBits") == 0 ) {
if ( strcmp(name, "screenBits") == 0 ) {
BitMap rv;
BitMap rv;
GetQDGlobalsScreenBits(&rv);
GetQDGlobalsScreenBits(&rv);
return BMObj_New(&rv);
return BMObj_New
Copied
(&rv);
}
}
if ( strcmp(name, "thePort") == 0 )
if ( strcmp(name, "thePort") == 0 )
return GrafObj_New(GetQDGlobalsThePort());
return GrafObj_New(GetQDGlobalsThePort());
...
...
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