first commit

This commit is contained in:
Florian Schmitt 2024-10-08 15:38:46 +03:00
commit 2e5df21095
2308 changed files with 453496 additions and 0 deletions

View file

@ -0,0 +1,357 @@
<!DOCTYPE html>
<html lang="en" data-content_root="../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>High level API exported by pygame.base &#8212; pygame v2.6.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../_static/pygame.css?v=a854c6a8" />
<script src="../_static/documentation_options.js?v=ae39cb24"></script>
<script src="../_static/doctools.js?v=9a2dae69"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<link rel="icon" href="../_static/pygame.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Class BufferProxy API exported by pygame.bufferproxy" href="bufferproxy.html" />
<link rel="prev" title="Slots and c_api - Making functions and data available from other modules" href="slots.html" />
</head><body>
<div class="document">
<div class="header">
<div class="flex-container">
<div class="logo">
<a href="https://www.pygame.org/">
<img src="../_static/pygame_tiny.png" alt="logo image"/>
</a>
<h5>pygame documentation</h5>
</div>
<div class="pagelinks">
<div class="top">
<a href="https://www.pygame.org/">Pygame Home</a> ||
<a href="../index.html">Help Contents</a> ||
<a href="../genindex.html">Reference Index</a>
<form action="../search.html" method="get" style="display:inline;float:right;">
<input name="q" value="" type="text">
<input value="search" type="submit">
</form>
</div>
<hr style="color:black;border-bottom:none;border-style: dotted;border-bottom-style:none;">
<p class="bottom"><strong>Most useful stuff</strong>:
<a href="../ref/color.html">Color</a> |
<a href="../ref/display.html">display</a> |
<a href="../ref/draw.html">draw</a> |
<a href="../ref/event.html">event</a> |
<a href="../ref/font.html">font</a> |
<a href="../ref/image.html">image</a> |
<a href="../ref/key.html">key</a> |
<a href="../ref/locals.html">locals</a> |
<a href="../ref/mixer.html">mixer</a> |
<a href="../ref/mouse.html">mouse</a> |
<a href="../ref/rect.html">Rect</a> |
<a href="../ref/surface.html">Surface</a> |
<a href="../ref/time.html">time</a> |
<a href="../ref/music.html">music</a> |
<a href="../ref/pygame.html">pygame</a>
</p>
<p class="bottom"><strong>Advanced stuff</strong>:
<a href="../ref/cursors.html">cursors</a> |
<a href="../ref/joystick.html">joystick</a> |
<a href="../ref/mask.html">mask</a> |
<a href="../ref/sprite.html">sprite</a> |
<a href="../ref/transform.html">transform</a> |
<a href="../ref/bufferproxy.html">BufferProxy</a> |
<a href="../ref/freetype.html">freetype</a> |
<a href="../ref/gfxdraw.html">gfxdraw</a> |
<a href="../ref/midi.html">midi</a> |
<a href="../ref/pixelarray.html">PixelArray</a> |
<a href="../ref/pixelcopy.html">pixelcopy</a> |
<a href="../ref/sndarray.html">sndarray</a> |
<a href="../ref/surfarray.html">surfarray</a> |
<a href="../ref/math.html">math</a>
</p>
<p class="bottom"><strong>Other</strong>:
<a href="../ref/camera.html">camera</a> |
<a href="../ref/sdl2_controller.html#module-pygame._sdl2.controller">controller</a> |
<a href="../ref/examples.html">examples</a> |
<a href="../ref/fastevent.html">fastevent</a> |
<a href="../ref/scrap.html">scrap</a> |
<a href="../ref/tests.html">tests</a> |
<a href="../ref/touch.html">touch</a> |
<a href="../ref/pygame.html#module-pygame.version">version</a>
</p>
</div>
</div>
</div>
<div class="documentwrapper">
<div class="body" role="main">
<section id="high-level-api-exported-by-pygame-base">
<section id="src-c-base-c">
<h2>src_c/base.c<a class="headerlink" href="#src-c-base-c" title="Link to this heading"></a></h2>
<p>This extension module defines general purpose routines for starting and stopping
SDL as well as various conversion routines uses elsewhere in pygame.</p>
<p>C header: src_c/include/pygame.h</p>
<dl class="c var">
<dt class="sig sig-object c" id="c.pgExc_SDLError">
<span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pgExc_SDLError</span></span></span><a class="headerlink" href="#c.pgExc_SDLError" title="Link to this definition"></a><br /></dt>
<dd><p>This is <a class="reference internal" href="../ref/pygame.html#pygame.error" title="pygame.error"><code class="xref py py-exc docutils literal notranslate"><span class="pre">pygame.error</span></code></a>, the exception type used to raise SDL errors.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pg_mod_autoinit">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pg_mod_autoinit</span></span></span><span class="sig-paren">(</span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">modname</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pg_mod_autoinit" title="Link to this definition"></a><br /></dt>
<dd><p>Inits a pygame module, which has the name <code class="docutils literal notranslate"><span class="pre">modname</span></code>
Return <code class="docutils literal notranslate"><span class="pre">1</span></code> on success, <code class="docutils literal notranslate"><span class="pre">0</span></code> on error, with python
error set.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pg_mod_autoquit">
<span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pg_mod_autoquit</span></span></span><span class="sig-paren">(</span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">modname</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pg_mod_autoquit" title="Link to this definition"></a><br /></dt>
<dd><p>Quits a pygame module, which has the name <code class="docutils literal notranslate"><span class="pre">modname</span></code></p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pg_RegisterQuit">
<span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pg_RegisterQuit</span></span></span><span class="sig-paren">(</span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">f</span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><span class="kt"><span class="pre">void</span></span><span class="p"><span class="pre">)</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pg_RegisterQuit" title="Link to this definition"></a><br /></dt>
<dd><p>Register function <em>f</em> as a callback on Pygame termination.
Multiple functions can be registered.
Functions are called in the reverse order they were registered.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pg_IntFromObj">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pg_IntFromObj</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">obj</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">val</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pg_IntFromObj" title="Link to this definition"></a><br /></dt>
<dd><p>Convert number like object <em>obj</em> to C int and place in argument <em>val</em>.
Return <code class="docutils literal notranslate"><span class="pre">1</span></code> on success, else <code class="docutils literal notranslate"><span class="pre">0</span></code>.
No Python exceptions are raised.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pg_IntFromObjIndex">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pg_IntFromObjIndex</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">obj</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">index</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">val</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pg_IntFromObjIndex" title="Link to this definition"></a><br /></dt>
<dd><p>Convert number like object at position <em>i</em> in sequence <em>obj</em>
to C int and place in argument <em>val</em>.
Return <code class="docutils literal notranslate"><span class="pre">1</span></code> on success, <code class="docutils literal notranslate"><span class="pre">0</span></code> on failure.
No Python exceptions are raised.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pg_TwoIntsFromObj">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pg_TwoIntsFromObj</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">obj</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">val1</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">v2</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pg_TwoIntsFromObj" title="Link to this definition"></a><br /></dt>
<dd><p>Convert the two number like objects in length 2 sequence <em>obj</em>
to C int and place in arguments <em>val1</em> and <em>val2</em> respectively.
Return <code class="docutils literal notranslate"><span class="pre">1</span></code> on success, <code class="docutils literal notranslate"><span class="pre">0</span></code> on failure.
No Python exceptions are raised.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pg_FloatFromObj">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pg_FloatFromObj</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">obj</span></span>, <span class="kt"><span class="pre">float</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">val</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pg_FloatFromObj" title="Link to this definition"></a><br /></dt>
<dd><p>Convert number like object <em>obj</em> to C float and place in argument <em>val</em>.
Returns <code class="docutils literal notranslate"><span class="pre">1</span></code> on success, <code class="docutils literal notranslate"><span class="pre">0</span></code> on failure.
No Python exceptions are raised.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pg_FloatFromObjIndex">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pg_FloatFromObjIndex</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">obj</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">index</span></span>, <span class="kt"><span class="pre">float</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">val</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pg_FloatFromObjIndex" title="Link to this definition"></a><br /></dt>
<dd><p>Convert number like object at position <em>i</em> in sequence <em>obj</em>
to C float and place in argument <em>val</em>.
Return <code class="docutils literal notranslate"><span class="pre">1</span></code> on success, else <code class="docutils literal notranslate"><span class="pre">0</span></code>.
No Python exceptions are raised.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pg_TwoFloatsFromObj">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pg_TwoFloatsFromObj</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">obj</span></span>, <span class="kt"><span class="pre">float</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">val1</span></span>, <span class="kt"><span class="pre">float</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">val2</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pg_TwoFloatsFromObj" title="Link to this definition"></a><br /></dt>
<dd><p>Convert the two number like objects in length 2 sequence <em>obj</em>
to C float and place in arguments <em>val1</em> and <em>val2</em> respectively.
Return <code class="docutils literal notranslate"><span class="pre">1</span></code> on success, else <code class="docutils literal notranslate"><span class="pre">0</span></code>.
No Python exceptions are raised.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pg_UintFromObj">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pg_UintFromObj</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">obj</span></span>, <span class="n"><span class="pre">Uint32</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">val</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pg_UintFromObj" title="Link to this definition"></a><br /></dt>
<dd><p>Convert number like object <em>obj</em> to unsigned 32 bit integer and place
in argument <em>val</em>.
Return <code class="docutils literal notranslate"><span class="pre">1</span></code> on success, else <code class="docutils literal notranslate"><span class="pre">0</span></code>.
No Python exceptions are raised.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pg_UintFromObjIndex">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pg_UintFromObjIndex</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">obj</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">_index</span></span>, <span class="n"><span class="pre">Uint32</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">val</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pg_UintFromObjIndex" title="Link to this definition"></a><br /></dt>
<dd><p>Convert number like object at position <em>i</em> in sequence <em>obj</em>
to unsigned 32 bit integer and place in argument <em>val</em>.
Return <code class="docutils literal notranslate"><span class="pre">1</span></code> on success, else <code class="docutils literal notranslate"><span class="pre">0</span></code>.
No Python exceptions are raised.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pg_RGBAFromObj">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pg_RGBAFromObj</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">obj</span></span>, <span class="n"><span class="pre">Uint8</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">RGBA</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pg_RGBAFromObj" title="Link to this definition"></a><br /></dt>
<dd><p>Convert the color represented by object <em>obj</em> into a red, green, blue, alpha
length 4 C array <em>RGBA</em>.
The object must be a length 3 or 4 sequence of numbers having values
between 0 and 255 inclusive.
For a length 3 sequence an alpha value of 255 is assumed.
Return <code class="docutils literal notranslate"><span class="pre">1</span></code> on success, <code class="docutils literal notranslate"><span class="pre">0</span></code> otherwise.
No Python exceptions are raised.</p>
</dd></dl>
<dl class="c type">
<dt class="sig sig-object c" id="c.pg_buffer">
<span class="k"><span class="pre">type</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pg_buffer</span></span></span><a class="headerlink" href="#c.pg_buffer" title="Link to this definition"></a><br /></dt>
<dd><dl class="c member">
<dt class="sig sig-object c" id="c.pg_buffer.view">
<span class="n"><span class="pre">Py_buffer</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">view</span></span></span><a class="headerlink" href="#c.pg_buffer.view" title="Link to this definition"></a><br /></dt>
<dd><p>A standard buffer description</p>
</dd></dl>
<dl class="c member">
<dt class="sig sig-object c" id="c.pg_buffer.consumer">
<span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">consumer</span></span></span><a class="headerlink" href="#c.pg_buffer.consumer" title="Link to this definition"></a><br /></dt>
<dd><p>The object holding the buffer</p>
</dd></dl>
<dl class="c member">
<dt class="sig sig-object c" id="c.pg_buffer.release_buffer">
<span class="n"><span class="pre">pybuffer_releaseproc</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">release_buffer</span></span></span><a class="headerlink" href="#c.pg_buffer.release_buffer" title="Link to this definition"></a><br /></dt>
<dd><p>A buffer release callback.</p>
</dd></dl>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c" id="c.pgExc_BufferError">
<span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pgExc_BufferError</span></span></span><a class="headerlink" href="#c.pgExc_BufferError" title="Link to this definition"></a><br /></dt>
<dd><p>Python exception type raised for any pg_buffer related errors.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgBuffer_AsArrayInterface">
<span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pgBuffer_AsArrayInterface</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">Py_buffer</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">view_p</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgBuffer_AsArrayInterface" title="Link to this definition"></a><br /></dt>
<dd><p>Return a Python array interface object representation of buffer <em>view_p</em>.
On failure raise a Python exception and return <em>NULL</em>.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgBuffer_AsArrayStruct">
<span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pgBuffer_AsArrayStruct</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">Py_buffer</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">view_p</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgBuffer_AsArrayStruct" title="Link to this definition"></a><br /></dt>
<dd><p>Return a Python array struct object representation of buffer <em>view_p</em>.
On failure raise a Python exception and return <em>NULL</em>.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgObject_GetBuffer">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgObject_GetBuffer</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">obj</span></span>, <a class="reference internal" href="#c.pg_buffer" title="pg_buffer"><span class="n"><span class="pre">pg_buffer</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">pg_view_p</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">flags</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgObject_GetBuffer" title="Link to this definition"></a><br /></dt>
<dd><p>Request a buffer for object <em>obj</em>.
Argument <em>flags</em> are PyBUF options.
Return the buffer description in <em>pg_view_p</em>.
An object may support the Python buffer interface, the NumPy array interface,
or the NumPy array struct interface.
Return <code class="docutils literal notranslate"><span class="pre">0</span></code> on success, raise a Python exception and return <code class="docutils literal notranslate"><span class="pre">-1</span></code> on failure.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgBuffer_Release">
<span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgBuffer_Release</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">Pg_buffer</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">pg_view_p</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgBuffer_Release" title="Link to this definition"></a><br /></dt>
<dd><p>Release the Pygame <em>pg_view_p</em> buffer.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgDict_AsBuffer">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgDict_AsBuffer</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">Pg_buffer</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">pg_view_p</span></span>, <span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">dict</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">flags</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgDict_AsBuffer" title="Link to this definition"></a><br /></dt>
<dd><p>Write the array interface dictionary buffer description <em>dict</em> into a Pygame
buffer description struct <em>pg_view_p</em>.
The <em>flags</em> PyBUF options describe the view type requested.
Return <code class="docutils literal notranslate"><span class="pre">0</span></code> on success, or raise a Python exception and return <code class="docutils literal notranslate"><span class="pre">-1</span></code> on failure.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.import_pygame_base">
<span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">import_pygame_base</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#c.import_pygame_base" title="Link to this definition"></a><br /></dt>
<dd><p>Import the pygame.base module C API into an extension module.
On failure raise a Python exception.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pg_GetDefaultWindow">
<span class="n"><span class="pre">SDL_Window</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pg_GetDefaultWindow</span></span></span><span class="sig-paren">(</span><span class="kt"><span class="pre">void</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pg_GetDefaultWindow" title="Link to this definition"></a><br /></dt>
<dd><p>Return the Pygame default SDL window created by a
pygame.display.set_mode() call, or <em>NULL</em>.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pg_SetDefaultWindow">
<span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pg_SetDefaultWindow</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">SDL_Window</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">win</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pg_SetDefaultWindow" title="Link to this definition"></a><br /></dt>
<dd><p>Replace the Pygame default window with <em>win</em>.
The previous window, if any, is destroyed.
Argument <em>win</em> may be <em>NULL</em>.
This function is called by pygame.display.set_mode().</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pg_GetDefaultWindowSurface">
<a class="reference internal" href="surface.html#c.pgSurfaceObject" title="pgSurfaceObject"><span class="n"><span class="pre">pgSurfaceObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pg_GetDefaultWindowSurface</span></span></span><span class="sig-paren">(</span><span class="kt"><span class="pre">void</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pg_GetDefaultWindowSurface" title="Link to this definition"></a><br /></dt>
<dd><p>Return a borrowed reference to the Pygame default window display surface,
or <em>NULL</em> if no default window is open.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pg_SetDefaultWindowSurface">
<span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pg_SetDefaultWindowSurface</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="surface.html#c.pgSurfaceObject" title="pgSurfaceObject"><span class="n"><span class="pre">pgSurfaceObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">screen</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pg_SetDefaultWindowSurface" title="Link to this definition"></a><br /></dt>
<dd><p>Replace the Pygame default display surface with object <em>screen</em>.
The previous surface object, if any, is invalidated.
Argument <em>screen</em> may be <em>NULL</em>.
This functions is called by pygame.display.set_mode().</p>
</dd></dl>
</section>
</section>
<br /><br />
<hr />
<a href="https://github.com/pygame/pygame/edit/main/docs/reST/c_api/base.rst" rel="nofollow">Edit on GitHub</a>
<div class="clearer"></div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="bufferproxy.html" title="Class BufferProxy API exported by pygame.bufferproxy"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="slots.html" title="Slots and c_api - Making functions and data available from other modules"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">pygame v2.6.0 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../c_api.html" accesskey="U">pygame C API</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">High level API exported by pygame.base</a></li>
<script type="text/javascript" src="https://www.pygame.org/comment/jquery.plugin.docscomments.js"></script>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2000-2023, pygame developers.
</div>
</body>
</html>

View file

@ -0,0 +1,179 @@
<!DOCTYPE html>
<html lang="en" data-content_root="../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Class BufferProxy API exported by pygame.bufferproxy &#8212; pygame v2.6.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../_static/pygame.css?v=a854c6a8" />
<script src="../_static/documentation_options.js?v=ae39cb24"></script>
<script src="../_static/doctools.js?v=9a2dae69"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<link rel="icon" href="../_static/pygame.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Class Color API exported by pygame.color" href="color.html" />
<link rel="prev" title="High level API exported by pygame.base" href="base.html" />
</head><body>
<div class="document">
<div class="header">
<div class="flex-container">
<div class="logo">
<a href="https://www.pygame.org/">
<img src="../_static/pygame_tiny.png" alt="logo image"/>
</a>
<h5>pygame documentation</h5>
</div>
<div class="pagelinks">
<div class="top">
<a href="https://www.pygame.org/">Pygame Home</a> ||
<a href="../index.html">Help Contents</a> ||
<a href="../genindex.html">Reference Index</a>
<form action="../search.html" method="get" style="display:inline;float:right;">
<input name="q" value="" type="text">
<input value="search" type="submit">
</form>
</div>
<hr style="color:black;border-bottom:none;border-style: dotted;border-bottom-style:none;">
<p class="bottom"><strong>Most useful stuff</strong>:
<a href="../ref/color.html">Color</a> |
<a href="../ref/display.html">display</a> |
<a href="../ref/draw.html">draw</a> |
<a href="../ref/event.html">event</a> |
<a href="../ref/font.html">font</a> |
<a href="../ref/image.html">image</a> |
<a href="../ref/key.html">key</a> |
<a href="../ref/locals.html">locals</a> |
<a href="../ref/mixer.html">mixer</a> |
<a href="../ref/mouse.html">mouse</a> |
<a href="../ref/rect.html">Rect</a> |
<a href="../ref/surface.html">Surface</a> |
<a href="../ref/time.html">time</a> |
<a href="../ref/music.html">music</a> |
<a href="../ref/pygame.html">pygame</a>
</p>
<p class="bottom"><strong>Advanced stuff</strong>:
<a href="../ref/cursors.html">cursors</a> |
<a href="../ref/joystick.html">joystick</a> |
<a href="../ref/mask.html">mask</a> |
<a href="../ref/sprite.html">sprite</a> |
<a href="../ref/transform.html">transform</a> |
<a href="../ref/bufferproxy.html">BufferProxy</a> |
<a href="../ref/freetype.html">freetype</a> |
<a href="../ref/gfxdraw.html">gfxdraw</a> |
<a href="../ref/midi.html">midi</a> |
<a href="../ref/pixelarray.html">PixelArray</a> |
<a href="../ref/pixelcopy.html">pixelcopy</a> |
<a href="../ref/sndarray.html">sndarray</a> |
<a href="../ref/surfarray.html">surfarray</a> |
<a href="../ref/math.html">math</a>
</p>
<p class="bottom"><strong>Other</strong>:
<a href="../ref/camera.html">camera</a> |
<a href="../ref/sdl2_controller.html#module-pygame._sdl2.controller">controller</a> |
<a href="../ref/examples.html">examples</a> |
<a href="../ref/fastevent.html">fastevent</a> |
<a href="../ref/scrap.html">scrap</a> |
<a href="../ref/tests.html">tests</a> |
<a href="../ref/touch.html">touch</a> |
<a href="../ref/pygame.html#module-pygame.version">version</a>
</p>
</div>
</div>
</div>
<div class="documentwrapper">
<div class="body" role="main">
<section id="class-bufferproxy-api-exported-by-pygame-bufferproxy">
<section id="src-c-bufferproxy-c">
<h2>src_c/bufferproxy.c<a class="headerlink" href="#src-c-bufferproxy-c" title="Link to this heading"></a></h2>
<p>This extension module defines Python type <a class="tooltip reference internal" href="../ref/bufferproxy.html#pygame.BufferProxy" title=""><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.BufferProxy</span></code><span class="tooltip-content">pygame object to export a surface buffer through an array protocol</span></a>.</p>
<p>Header file: src_c/include/pygame_bufferproxy.h</p>
<dl class="c var">
<dt class="sig sig-object c" id="c.pgBufproxy_Type">
<span class="n"><span class="pre">PyTypeObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pgBufproxy_Type</span></span></span><a class="headerlink" href="#c.pgBufproxy_Type" title="Link to this definition"></a><br /></dt>
<dd><p>The pygame buffer proxy object type pygame.BufferProxy.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgBufproxy_Check">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgBufproxy_Check</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">x</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgBufproxy_Check" title="Link to this definition"></a><br /></dt>
<dd><p>Return true if Python object <em>x</em> is a <a class="reference internal" href="../ref/bufferproxy.html#pygame.BufferProxy" title="pygame.BufferProxy"><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.BufferProxy</span></code></a> instance,
false otherwise.
This will return false on <a class="reference internal" href="../ref/bufferproxy.html#pygame.BufferProxy" title="pygame.BufferProxy"><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.BufferProxy</span></code></a> subclass instances as well.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgBufproxy_New">
<span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pgBufproxy_New</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">obj</span></span>, <span class="n"><span class="pre">getbufferproc</span></span><span class="w"> </span><span class="n"><span class="pre">get_buffer</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgBufproxy_New" title="Link to this definition"></a><br /></dt>
<dd><p>Return a new <a class="reference internal" href="../ref/bufferproxy.html#pygame.BufferProxy" title="pygame.BufferProxy"><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.BufferProxy</span></code></a> instance.
Argument <em>obj</em> is the Python object that has its data exposed.
It may be <code class="docutils literal notranslate"><span class="pre">NULL</span></code>.
Argument <em>get_buffer</em> is the <a class="reference internal" href="base.html#c.pg_buffer" title="pg_buffer"><code class="xref c c-type docutils literal notranslate"><span class="pre">pg_buffer</span></code></a> get callback.
It must not be <code class="docutils literal notranslate"><span class="pre">NULL</span></code>.
On failure raise a Python error and return <code class="docutils literal notranslate"><span class="pre">NULL</span></code>.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgBufproxy_GetParent">
<span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pgBufproxy_GetParent</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">obj</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgBufproxy_GetParent" title="Link to this definition"></a><br /></dt>
<dd><p>Return the Python object wrapped by buffer proxy <em>obj</em>.
Argument <em>obj</em> must not be <code class="docutils literal notranslate"><span class="pre">NULL</span></code>.
On failure, raise a Python error and return <code class="docutils literal notranslate"><span class="pre">NULL</span></code>.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgBufproxy_Trip">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgBufproxy_Trip</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">obj</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgBufproxy_Trip" title="Link to this definition"></a><br /></dt>
<dd><p>Cause the buffer proxy object <em>obj</em> to create a <a class="reference internal" href="base.html#c.pg_buffer" title="pg_buffer"><code class="xref c c-type docutils literal notranslate"><span class="pre">pg_buffer</span></code></a> view of its parent.
Argument <em>obj</em> must not be <code class="docutils literal notranslate"><span class="pre">NULL</span></code>.
Return <code class="docutils literal notranslate"><span class="pre">0</span></code> on success, otherwise raise a Python error and return <code class="docutils literal notranslate"><span class="pre">-1</span></code>.</p>
</dd></dl>
</section>
</section>
<br /><br />
<hr />
<a href="https://github.com/pygame/pygame/edit/main/docs/reST/c_api/bufferproxy.rst" rel="nofollow">Edit on GitHub</a>
<div class="clearer"></div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="color.html" title="Class Color API exported by pygame.color"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="base.html" title="High level API exported by pygame.base"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">pygame v2.6.0 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../c_api.html" accesskey="U">pygame C API</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Class BufferProxy API exported by pygame.bufferproxy</a></li>
<script type="text/javascript" src="https://www.pygame.org/comment/jquery.plugin.docscomments.js"></script>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2000-2023, pygame developers.
</div>
</body>
</html>

View file

@ -0,0 +1,178 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<title>API exported by pygame.cdrom &#8212; pygame v2.1.3 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="../_static/pygame.css" />
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<link rel="shortcut icon" href="../_static/pygame.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Class Color API exported by pygame.color" href="color.html" />
<link rel="prev" title="Class BufferProxy API exported by pgyame.bufferproxy" href="bufferproxy.html" />
</head><body>
<div class="document">
<div class="header">
<table>
<tr>
<td class="logo">
<a href="https://www.pygame.org/">
<img src="../_static/pygame_tiny.png"/>
</a>
<h5>pygame documentation</h5>
</td>
<td class="pagelinks">
<div class="top">
<a href="https://www.pygame.org/">Pygame Home</a> ||
<a href="../index.html">Help Contents</a> ||
<a href="../genindex.html">Reference Index</a>
<form action="../search.html" method="get" style="display:inline;float:right;">
<input name="q" value="" type="text">
<input value="search" type="submit">
</form>
</div>
<hr style="color:black;border-bottom:none;border-style: dotted;border-bottom-style:none;">
<p class="bottom"><b>Most useful stuff</b>:
<a href="../ref/color.html">Color</a> |
<a href="../ref/display.html">display</a> |
<a href="../ref/draw.html">draw</a> |
<a href="../ref/event.html">event</a> |
<a href="../ref/font.html">font</a> |
<a href="../ref/image.html">image</a> |
<a href="../ref/key.html">key</a> |
<a href="../ref/locals.html">locals</a> |
<a href="../ref/mixer.html">mixer</a> |
<a href="../ref/mouse.html">mouse</a> |
<a href="../ref/rect.html">Rect</a> |
<a href="../ref/surface.html">Surface</a> |
<a href="../ref/time.html">time</a> |
<a href="../ref/music.html">music</a> |
<a href="../ref/pygame.html">pygame</a>
</p>
<p class="bottom"><b>Advanced stuff</b>:
<a href="../ref/cursors.html">cursors</a> |
<a href="../ref/joystick.html">joystick</a> |
<a href="../ref/mask.html">mask</a> |
<a href="../ref/sprite.html">sprite</a> |
<a href="../ref/transform.html">transform</a> |
<a href="../ref/bufferproxy.html">BufferProxy</a> |
<a href="../ref/freetype.html">freetype</a> |
<a href="../ref/gfxdraw.html">gfxdraw</a> |
<a href="../ref/midi.html">midi</a> |
<a href="../ref/pixelarray.html">PixelArray</a> |
<a href="../ref/pixelcopy.html">pixelcopy</a> |
<a href="../ref/sndarray.html">sndarray</a> |
<a href="../ref/surfarray.html">surfarray</a> |
<a href="../ref/math.html">math</a>
</p>
<p class="bottom"><b>Other</b>:
<a href="../ref/camera.html">camera</a> |
<a href="../ref/sdl2_controller.html#module-pygame._sdl2.controller">controller</a> |
<a href="../ref/examples.html">examples</a> |
<a href="../ref/fastevent.html">fastevent</a> |
<a href="../ref/scrap.html">scrap</a> |
<a href="../ref/tests.html">tests</a> |
<a href="../ref/touch.html">touch</a> |
<a href="../ref/pygame.html#module-pygame.version">version</a>
</p>
</td>
</tr>
</table>
</div>
<div class="documentwrapper">
<div class="body" role="main">
<section id="api-exported-by-pygame-cdrom">
<section id="src-c-cdrom-c">
<h2>src_c/cdrom.c<a class="headerlink" href="#src-c-cdrom-c" title="Permalink to this headline"></a></h2>
<p>The <a class="tooltip reference internal" href="../ref/cdrom.html#module-pygame.cdrom" title=""><code class="xref py py-mod docutils literal notranslate"><span class="pre">pygame.cdrom</span></code><span class="tooltip-content">pygame module for audio cdrom control</span></a> extension module. Only available for SDL 1.</p>
<p>Header file: src_c/include/pygame.h</p>
<dl class="c type">
<dt class="sig sig-object c" id="c.pgCDObject">
<span class="k"><span class="pre">type</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgCDObject</span></span></span><a class="headerlink" href="#c.pgCDObject" title="Permalink to this definition"></a><br /></dt>
<dd><p>The <a class="reference internal" href="../ref/cdrom.html#pygame.cdrom.CD" title="pygame.cdrom.CD"><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.cdrom.CD</span></code></a> instance C struct.</p>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c" id="c.pgCD_Type">
<span class="n"><span class="pre">PyTypeObject</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgCD_Type</span></span></span><a class="headerlink" href="#c.pgCD_Type" title="Permalink to this definition"></a><br /></dt>
<dd><p>The <a class="reference internal" href="../ref/cdrom.html#pygame.cdrom.CD" title="pygame.cdrom.CD"><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.cdrom.CD</span></code></a> Python type.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgCD_New">
<span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pgCD_New</span></span></span><span class="sig-paren">(</span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">id</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgCD_New" title="Permalink to this definition"></a><br /></dt>
<dd><p>Return a new <a class="reference internal" href="../ref/cdrom.html#pygame.cdrom.CD" title="pygame.cdrom.CD"><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.cdrom.CD</span></code></a> instance for CD drive <em>id</em>.
On error raise a Python exception and return <code class="docutils literal notranslate"><span class="pre">NULL</span></code>.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgCD_Check">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgCD_Check</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">x</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgCD_Check" title="Permalink to this definition"></a><br /></dt>
<dd><p>Return true if <em>x</em> is a <a class="reference internal" href="../ref/cdrom.html#pygame.cdrom.CD" title="pygame.cdrom.CD"><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.cdrom.CD</span></code></a> instance.
Will return false for a subclass of <code class="xref py py-class docutils literal notranslate"><span class="pre">CD</span></code>.
This is a macro. No check is made that <em>x</em> is not <code class="docutils literal notranslate"><span class="pre">NULL</span></code>.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgCD_AsID">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgCD_AsID</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">x</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgCD_AsID" title="Permalink to this definition"></a><br /></dt>
<dd><p>Return the CD identifier associated with the <a class="reference internal" href="../ref/cdrom.html#pygame.cdrom.CD" title="pygame.cdrom.CD"><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.cdrom.CD</span></code></a>
instance <em>x</em>.
This is a macro. No check is made that <em>x</em> is a <a class="reference internal" href="../ref/cdrom.html#pygame.cdrom.CD" title="pygame.cdrom.CD"><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.cdrom.CD</span></code></a>
instance or is not <code class="docutils literal notranslate"><span class="pre">NULL</span></code>.</p>
</dd></dl>
</section>
</section>
<br /><br />
<hr />
<a href="https://github.com/pygame/pygame/edit/main/docs/reST/c_api/cdrom.rst" rel="nofollow">Edit on GitHub</a>
<div class="clearer"></div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="color.html" title="Class Color API exported by pygame.color"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="bufferproxy.html" title="Class BufferProxy API exported by pgyame.bufferproxy"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">pygame v2.1.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../c_api.html" accesskey="U">pygame C API</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">API exported by pygame.cdrom</a></li>
<script type="text/javascript" src="https://www.pygame.org/comment/jquery.plugin.docscomments.js"></script>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2000-2021, pygame developers.
</div>
</body>
</html>

View file

@ -0,0 +1,168 @@
<!DOCTYPE html>
<html lang="en" data-content_root="../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Class Color API exported by pygame.color &#8212; pygame v2.6.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../_static/pygame.css?v=a854c6a8" />
<script src="../_static/documentation_options.js?v=ae39cb24"></script>
<script src="../_static/doctools.js?v=9a2dae69"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<link rel="icon" href="../_static/pygame.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="API exported by pygame.display" href="display.html" />
<link rel="prev" title="Class BufferProxy API exported by pygame.bufferproxy" href="bufferproxy.html" />
</head><body>
<div class="document">
<div class="header">
<div class="flex-container">
<div class="logo">
<a href="https://www.pygame.org/">
<img src="../_static/pygame_tiny.png" alt="logo image"/>
</a>
<h5>pygame documentation</h5>
</div>
<div class="pagelinks">
<div class="top">
<a href="https://www.pygame.org/">Pygame Home</a> ||
<a href="../index.html">Help Contents</a> ||
<a href="../genindex.html">Reference Index</a>
<form action="../search.html" method="get" style="display:inline;float:right;">
<input name="q" value="" type="text">
<input value="search" type="submit">
</form>
</div>
<hr style="color:black;border-bottom:none;border-style: dotted;border-bottom-style:none;">
<p class="bottom"><strong>Most useful stuff</strong>:
<a href="../ref/color.html">Color</a> |
<a href="../ref/display.html">display</a> |
<a href="../ref/draw.html">draw</a> |
<a href="../ref/event.html">event</a> |
<a href="../ref/font.html">font</a> |
<a href="../ref/image.html">image</a> |
<a href="../ref/key.html">key</a> |
<a href="../ref/locals.html">locals</a> |
<a href="../ref/mixer.html">mixer</a> |
<a href="../ref/mouse.html">mouse</a> |
<a href="../ref/rect.html">Rect</a> |
<a href="../ref/surface.html">Surface</a> |
<a href="../ref/time.html">time</a> |
<a href="../ref/music.html">music</a> |
<a href="../ref/pygame.html">pygame</a>
</p>
<p class="bottom"><strong>Advanced stuff</strong>:
<a href="../ref/cursors.html">cursors</a> |
<a href="../ref/joystick.html">joystick</a> |
<a href="../ref/mask.html">mask</a> |
<a href="../ref/sprite.html">sprite</a> |
<a href="../ref/transform.html">transform</a> |
<a href="../ref/bufferproxy.html">BufferProxy</a> |
<a href="../ref/freetype.html">freetype</a> |
<a href="../ref/gfxdraw.html">gfxdraw</a> |
<a href="../ref/midi.html">midi</a> |
<a href="../ref/pixelarray.html">PixelArray</a> |
<a href="../ref/pixelcopy.html">pixelcopy</a> |
<a href="../ref/sndarray.html">sndarray</a> |
<a href="../ref/surfarray.html">surfarray</a> |
<a href="../ref/math.html">math</a>
</p>
<p class="bottom"><strong>Other</strong>:
<a href="../ref/camera.html">camera</a> |
<a href="../ref/sdl2_controller.html#module-pygame._sdl2.controller">controller</a> |
<a href="../ref/examples.html">examples</a> |
<a href="../ref/fastevent.html">fastevent</a> |
<a href="../ref/scrap.html">scrap</a> |
<a href="../ref/tests.html">tests</a> |
<a href="../ref/touch.html">touch</a> |
<a href="../ref/pygame.html#module-pygame.version">version</a>
</p>
</div>
</div>
</div>
<div class="documentwrapper">
<div class="body" role="main">
<section id="class-color-api-exported-by-pygame-color">
<section id="src-c-color-c">
<h2>src_c/color.c<a class="headerlink" href="#src-c-color-c" title="Link to this heading"></a></h2>
<p>This extension module defines the Python type <a class="tooltip reference internal" href="../ref/color.html#pygame.Color" title=""><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.Color</span></code><span class="tooltip-content">pygame object for color representations</span></a>.</p>
<p>Header file: src_c/include/pygame.h</p>
<dl class="c var">
<dt class="sig sig-object c" id="c.pgColor_Type">
<span class="n"><span class="pre">PyTypeObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pgColor_Type</span></span></span><a class="headerlink" href="#c.pgColor_Type" title="Link to this definition"></a><br /></dt>
<dd><p>The Pygame color object type <a class="reference internal" href="../ref/color.html#pygame.Color" title="pygame.Color"><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.Color</span></code></a>.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgColor_Check">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgColor_Check</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">obj</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgColor_Check" title="Link to this definition"></a><br /></dt>
<dd><p>Return true if <em>obj</em> is an instance of type pgColor_Type,
but not a pgColor_Type subclass instance.
This macro does not check if <em>obj</em> is not <code class="docutils literal notranslate"><span class="pre">NULL</span></code> or indeed a Python type.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgColor_New">
<span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pgColor_New</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">Uint8</span></span><span class="w"> </span><span class="n"><span class="pre">rgba</span></span><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">]</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgColor_New" title="Link to this definition"></a><br /></dt>
<dd><p>Return a new <a class="reference internal" href="../ref/color.html#pygame.Color" title="pygame.Color"><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.Color</span></code></a> instance for the the four element array <em>rgba</em>.
On failure, raise a Python exception and return <code class="docutils literal notranslate"><span class="pre">NULL</span></code>.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgColor_NewLength">
<span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pgColor_NewLength</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">Uint8</span></span><span class="w"> </span><span class="n"><span class="pre">rgba</span></span><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">]</span></span>, <span class="n"><span class="pre">Uint8</span></span><span class="w"> </span><span class="n"><span class="pre">length</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgColor_NewLength" title="Link to this definition"></a><br /></dt>
<dd><p>Return a <code class="xref py py-class docutils literal notranslate"><span class="pre">new</span> <span class="pre">pygame.Color</span></code> instance having <em>length</em> elements,
with element values taken from the first <em>length</em> elements of array <em>rgba</em>.
Argument <em>length</em> must be between <code class="docutils literal notranslate"><span class="pre">1</span></code> and <code class="docutils literal notranslate"><span class="pre">4</span></code> inclusive.
On failure, raise a Python exception and return <code class="docutils literal notranslate"><span class="pre">NULL</span></code>.</p>
</dd></dl>
</section>
</section>
<br /><br />
<hr />
<a href="https://github.com/pygame/pygame/edit/main/docs/reST/c_api/color.rst" rel="nofollow">Edit on GitHub</a>
<div class="clearer"></div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="display.html" title="API exported by pygame.display"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="bufferproxy.html" title="Class BufferProxy API exported by pygame.bufferproxy"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">pygame v2.6.0 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../c_api.html" accesskey="U">pygame C API</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Class Color API exported by pygame.color</a></li>
<script type="text/javascript" src="https://www.pygame.org/comment/jquery.plugin.docscomments.js"></script>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2000-2023, pygame developers.
</div>
</body>
</html>

View file

@ -0,0 +1,173 @@
<!DOCTYPE html>
<html lang="en" data-content_root="../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>API exported by pygame.display &#8212; pygame v2.6.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../_static/pygame.css?v=a854c6a8" />
<script src="../_static/documentation_options.js?v=ae39cb24"></script>
<script src="../_static/doctools.js?v=9a2dae69"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<link rel="icon" href="../_static/pygame.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="API exported by pygame.event" href="event.html" />
<link rel="prev" title="Class Color API exported by pygame.color" href="color.html" />
</head><body>
<div class="document">
<div class="header">
<div class="flex-container">
<div class="logo">
<a href="https://www.pygame.org/">
<img src="../_static/pygame_tiny.png" alt="logo image"/>
</a>
<h5>pygame documentation</h5>
</div>
<div class="pagelinks">
<div class="top">
<a href="https://www.pygame.org/">Pygame Home</a> ||
<a href="../index.html">Help Contents</a> ||
<a href="../genindex.html">Reference Index</a>
<form action="../search.html" method="get" style="display:inline;float:right;">
<input name="q" value="" type="text">
<input value="search" type="submit">
</form>
</div>
<hr style="color:black;border-bottom:none;border-style: dotted;border-bottom-style:none;">
<p class="bottom"><strong>Most useful stuff</strong>:
<a href="../ref/color.html">Color</a> |
<a href="../ref/display.html">display</a> |
<a href="../ref/draw.html">draw</a> |
<a href="../ref/event.html">event</a> |
<a href="../ref/font.html">font</a> |
<a href="../ref/image.html">image</a> |
<a href="../ref/key.html">key</a> |
<a href="../ref/locals.html">locals</a> |
<a href="../ref/mixer.html">mixer</a> |
<a href="../ref/mouse.html">mouse</a> |
<a href="../ref/rect.html">Rect</a> |
<a href="../ref/surface.html">Surface</a> |
<a href="../ref/time.html">time</a> |
<a href="../ref/music.html">music</a> |
<a href="../ref/pygame.html">pygame</a>
</p>
<p class="bottom"><strong>Advanced stuff</strong>:
<a href="../ref/cursors.html">cursors</a> |
<a href="../ref/joystick.html">joystick</a> |
<a href="../ref/mask.html">mask</a> |
<a href="../ref/sprite.html">sprite</a> |
<a href="../ref/transform.html">transform</a> |
<a href="../ref/bufferproxy.html">BufferProxy</a> |
<a href="../ref/freetype.html">freetype</a> |
<a href="../ref/gfxdraw.html">gfxdraw</a> |
<a href="../ref/midi.html">midi</a> |
<a href="../ref/pixelarray.html">PixelArray</a> |
<a href="../ref/pixelcopy.html">pixelcopy</a> |
<a href="../ref/sndarray.html">sndarray</a> |
<a href="../ref/surfarray.html">surfarray</a> |
<a href="../ref/math.html">math</a>
</p>
<p class="bottom"><strong>Other</strong>:
<a href="../ref/camera.html">camera</a> |
<a href="../ref/sdl2_controller.html#module-pygame._sdl2.controller">controller</a> |
<a href="../ref/examples.html">examples</a> |
<a href="../ref/fastevent.html">fastevent</a> |
<a href="../ref/scrap.html">scrap</a> |
<a href="../ref/tests.html">tests</a> |
<a href="../ref/touch.html">touch</a> |
<a href="../ref/pygame.html#module-pygame.version">version</a>
</p>
</div>
</div>
</div>
<div class="documentwrapper">
<div class="body" role="main">
<section id="api-exported-by-pygame-display">
<section id="src-c-display-c">
<h2>src_c/display.c<a class="headerlink" href="#src-c-display-c" title="Link to this heading"></a></h2>
<p>This is the <a class="tooltip reference internal" href="../ref/display.html#module-pygame.display" title=""><code class="xref py py-mod docutils literal notranslate"><span class="pre">pygame.display</span></code><span class="tooltip-content">pygame module to control the display window and screen</span></a> extension module.</p>
<p>Header file: src_c/include/pygame.h</p>
<dl class="c type">
<dt class="sig sig-object c" id="c.pgVidInfoObject">
<span class="k"><span class="pre">type</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgVidInfoObject</span></span></span><a class="headerlink" href="#c.pgVidInfoObject" title="Link to this definition"></a><br /></dt>
<dd><p>A pygame object that wraps an SDL_VideoInfo struct.
The object returned by <a class="reference internal" href="../ref/display.html#pygame.display.Info" title="pygame.display.Info"><code class="xref py py-func docutils literal notranslate"><span class="pre">pygame.display.Info()</span></code></a>.</p>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c" id="c.pgVidInfo_Type">
<span class="n"><span class="pre">PyTypeObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pgVidInfo_Type</span></span></span><a class="headerlink" href="#c.pgVidInfo_Type" title="Link to this definition"></a><br /></dt>
<dd><p>The pgVidInfoObject object Python type.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgVidInfo_AsVidInfo">
<span class="n"><span class="pre">SDL_VideoInfo</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgVidInfo_AsVidInfo</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">obj</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgVidInfo_AsVidInfo" title="Link to this definition"></a><br /></dt>
<dd><p>Return the SDL_VideoInfo field of <em>obj</em>, a <a class="reference internal" href="#c.pgVidInfo_Type" title="pgVidInfo_Type"><code class="xref c c-data docutils literal notranslate"><span class="pre">pgVidInfo_Type</span></code></a> instance.
This macro does not check that <em>obj</em> is not <code class="docutils literal notranslate"><span class="pre">NULL</span></code> or an actual <a class="reference internal" href="#c.pgVidInfoObject" title="pgVidInfoObject"><code class="xref c c-type docutils literal notranslate"><span class="pre">pgVidInfoObject</span></code></a> object.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgVidInfo_New">
<span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pgVidInfo_New</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">SDL_VideoInfo</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">i</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgVidInfo_New" title="Link to this definition"></a><br /></dt>
<dd><p>Return a new <a class="reference internal" href="#c.pgVidInfoObject" title="pgVidInfoObject"><code class="xref c c-type docutils literal notranslate"><span class="pre">pgVidInfoObject</span></code></a> object for the SDL_VideoInfo <em>i</em>.
On failure, raise a Python exception and return <code class="docutils literal notranslate"><span class="pre">NULL</span></code>.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgVidInfo_Check">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgVidInfo_Check</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">x</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgVidInfo_Check" title="Link to this definition"></a><br /></dt>
<dd><p>Return true if <em>x</em> is a <a class="reference internal" href="#c.pgVidInfo_Type" title="pgVidInfo_Type"><code class="xref c c-data docutils literal notranslate"><span class="pre">pgVidInfo_Type</span></code></a> instance</p>
<p>Will return false if <em>x</em> is a subclass of <a class="reference internal" href="#c.pgVidInfo_Type" title="pgVidInfo_Type"><code class="xref c c-data docutils literal notranslate"><span class="pre">pgVidInfo_Type</span></code></a>.
This macro does not check that <em>x</em> is not <code class="docutils literal notranslate"><span class="pre">NULL</span></code>.</p>
</dd></dl>
</section>
</section>
<br /><br />
<hr />
<a href="https://github.com/pygame/pygame/edit/main/docs/reST/c_api/display.rst" rel="nofollow">Edit on GitHub</a>
<div class="clearer"></div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="event.html" title="API exported by pygame.event"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="color.html" title="Class Color API exported by pygame.color"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">pygame v2.6.0 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../c_api.html" accesskey="U">pygame C API</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">API exported by pygame.display</a></li>
<script type="text/javascript" src="https://www.pygame.org/comment/jquery.plugin.docscomments.js"></script>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2000-2023, pygame developers.
</div>
</body>
</html>

View file

@ -0,0 +1,188 @@
<!DOCTYPE html>
<html lang="en" data-content_root="../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>API exported by pygame.event &#8212; pygame v2.6.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../_static/pygame.css?v=a854c6a8" />
<script src="../_static/documentation_options.js?v=ae39cb24"></script>
<script src="../_static/doctools.js?v=9a2dae69"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<link rel="icon" href="../_static/pygame.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="API exported by pygame._freetype" href="freetype.html" />
<link rel="prev" title="API exported by pygame.display" href="display.html" />
</head><body>
<div class="document">
<div class="header">
<div class="flex-container">
<div class="logo">
<a href="https://www.pygame.org/">
<img src="../_static/pygame_tiny.png" alt="logo image"/>
</a>
<h5>pygame documentation</h5>
</div>
<div class="pagelinks">
<div class="top">
<a href="https://www.pygame.org/">Pygame Home</a> ||
<a href="../index.html">Help Contents</a> ||
<a href="../genindex.html">Reference Index</a>
<form action="../search.html" method="get" style="display:inline;float:right;">
<input name="q" value="" type="text">
<input value="search" type="submit">
</form>
</div>
<hr style="color:black;border-bottom:none;border-style: dotted;border-bottom-style:none;">
<p class="bottom"><strong>Most useful stuff</strong>:
<a href="../ref/color.html">Color</a> |
<a href="../ref/display.html">display</a> |
<a href="../ref/draw.html">draw</a> |
<a href="../ref/event.html">event</a> |
<a href="../ref/font.html">font</a> |
<a href="../ref/image.html">image</a> |
<a href="../ref/key.html">key</a> |
<a href="../ref/locals.html">locals</a> |
<a href="../ref/mixer.html">mixer</a> |
<a href="../ref/mouse.html">mouse</a> |
<a href="../ref/rect.html">Rect</a> |
<a href="../ref/surface.html">Surface</a> |
<a href="../ref/time.html">time</a> |
<a href="../ref/music.html">music</a> |
<a href="../ref/pygame.html">pygame</a>
</p>
<p class="bottom"><strong>Advanced stuff</strong>:
<a href="../ref/cursors.html">cursors</a> |
<a href="../ref/joystick.html">joystick</a> |
<a href="../ref/mask.html">mask</a> |
<a href="../ref/sprite.html">sprite</a> |
<a href="../ref/transform.html">transform</a> |
<a href="../ref/bufferproxy.html">BufferProxy</a> |
<a href="../ref/freetype.html">freetype</a> |
<a href="../ref/gfxdraw.html">gfxdraw</a> |
<a href="../ref/midi.html">midi</a> |
<a href="../ref/pixelarray.html">PixelArray</a> |
<a href="../ref/pixelcopy.html">pixelcopy</a> |
<a href="../ref/sndarray.html">sndarray</a> |
<a href="../ref/surfarray.html">surfarray</a> |
<a href="../ref/math.html">math</a>
</p>
<p class="bottom"><strong>Other</strong>:
<a href="../ref/camera.html">camera</a> |
<a href="../ref/sdl2_controller.html#module-pygame._sdl2.controller">controller</a> |
<a href="../ref/examples.html">examples</a> |
<a href="../ref/fastevent.html">fastevent</a> |
<a href="../ref/scrap.html">scrap</a> |
<a href="../ref/tests.html">tests</a> |
<a href="../ref/touch.html">touch</a> |
<a href="../ref/pygame.html#module-pygame.version">version</a>
</p>
</div>
</div>
</div>
<div class="documentwrapper">
<div class="body" role="main">
<section id="api-exported-by-pygame-event">
<section id="src-c-event-c">
<h2>src_c/event.c<a class="headerlink" href="#src-c-event-c" title="Link to this heading"></a></h2>
<p>The extension module <a class="tooltip reference internal" href="../ref/event.html#module-pygame.event" title=""><code class="xref py py-mod docutils literal notranslate"><span class="pre">pygame.event</span></code><span class="tooltip-content">pygame module for interacting with events and queues</span></a>.</p>
<p>Header file: src_c/include/pygame.h</p>
<dl class="c type">
<dt class="sig sig-object c" id="c.pgEventObject">
<span class="k"><span class="pre">type</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgEventObject</span></span></span><a class="headerlink" href="#c.pgEventObject" title="Link to this definition"></a><br /></dt>
<dd><p>The <code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.event.EventType</span></code> object C struct.</p>
<dl class="c member">
<dt class="sig sig-object c" id="c.pgEventObject.type">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">type</span></span></span><a class="headerlink" href="#c.pgEventObject.type" title="Link to this definition"></a><br /></dt>
<dd><p>The event type code.</p>
</dd></dl>
</dd></dl>
<dl class="c type">
<dt class="sig sig-object c" id="c.pgEvent_Type">
<span class="k"><span class="pre">type</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgEvent_Type</span></span></span><a class="headerlink" href="#c.pgEvent_Type" title="Link to this definition"></a><br /></dt>
<dd><p>The pygame event object type <code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.event.EventType</span></code>.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgEvent_Check">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgEvent_Check</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">x</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgEvent_Check" title="Link to this definition"></a><br /></dt>
<dd><p>Return true if <em>x</em> is a pygame event instance</p>
<p>Will return false if <em>x</em> is a subclass of event.
This is a macro. No check is made that <em>x</em> is not <code class="docutils literal notranslate"><span class="pre">NULL</span></code>.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgEvent_New">
<span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pgEvent_New</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">SDL_Event</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">event</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgEvent_New" title="Link to this definition"></a><br /></dt>
<dd><p>Return a new pygame event instance for the SDL <em>event</em>.
If <em>event</em> is <code class="docutils literal notranslate"><span class="pre">NULL</span></code> then create an empty event object.
On failure raise a Python exception and return <code class="docutils literal notranslate"><span class="pre">NULL</span></code>.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgEvent_New2">
<span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pgEvent_New2</span></span></span><span class="sig-paren">(</span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">type</span></span>, <span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">dict</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgEvent_New2" title="Link to this definition"></a><br /></dt>
<dd><p>Return a new pygame event instance of SDL <em>type</em> and with
attribute dictionary <em>dict</em>.
If <cite>dict</cite> is <code class="docutils literal notranslate"><span class="pre">NULL</span></code> an empty attribute dictionary is created.
On failure raise a Python exception and return <code class="docutils literal notranslate"><span class="pre">NULL</span></code>.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgEvent_FillUserEvent">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgEvent_FillUserEvent</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="#c.pgEventObject" title="pgEventObject"><span class="n"><span class="pre">pgEventObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">e</span></span>, <span class="n"><span class="pre">SDL_Event</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">event</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgEvent_FillUserEvent" title="Link to this definition"></a><br /></dt>
<dd><p>Fill SDL event <em>event</em> with information from pygame user event instance <em>e</em>.
Return <code class="docutils literal notranslate"><span class="pre">0</span></code> on success, <code class="docutils literal notranslate"><span class="pre">-1</span></code> otherwise.</p>
</dd></dl>
</section>
</section>
<br /><br />
<hr />
<a href="https://github.com/pygame/pygame/edit/main/docs/reST/c_api/event.rst" rel="nofollow">Edit on GitHub</a>
<div class="clearer"></div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="freetype.html" title="API exported by pygame._freetype"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="display.html" title="API exported by pygame.display"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">pygame v2.6.0 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../c_api.html" accesskey="U">pygame C API</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">API exported by pygame.event</a></li>
<script type="text/javascript" src="https://www.pygame.org/comment/jquery.plugin.docscomments.js"></script>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2000-2023, pygame developers.
</div>
</body>
</html>

View file

@ -0,0 +1,176 @@
<!DOCTYPE html>
<html lang="en" data-content_root="../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>API exported by pygame._freetype &#8212; pygame v2.6.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../_static/pygame.css?v=a854c6a8" />
<script src="../_static/documentation_options.js?v=ae39cb24"></script>
<script src="../_static/doctools.js?v=9a2dae69"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<link rel="icon" href="../_static/pygame.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="API exported by pygame.mixer" href="mixer.html" />
<link rel="prev" title="API exported by pygame.event" href="event.html" />
</head><body>
<div class="document">
<div class="header">
<div class="flex-container">
<div class="logo">
<a href="https://www.pygame.org/">
<img src="../_static/pygame_tiny.png" alt="logo image"/>
</a>
<h5>pygame documentation</h5>
</div>
<div class="pagelinks">
<div class="top">
<a href="https://www.pygame.org/">Pygame Home</a> ||
<a href="../index.html">Help Contents</a> ||
<a href="../genindex.html">Reference Index</a>
<form action="../search.html" method="get" style="display:inline;float:right;">
<input name="q" value="" type="text">
<input value="search" type="submit">
</form>
</div>
<hr style="color:black;border-bottom:none;border-style: dotted;border-bottom-style:none;">
<p class="bottom"><strong>Most useful stuff</strong>:
<a href="../ref/color.html">Color</a> |
<a href="../ref/display.html">display</a> |
<a href="../ref/draw.html">draw</a> |
<a href="../ref/event.html">event</a> |
<a href="../ref/font.html">font</a> |
<a href="../ref/image.html">image</a> |
<a href="../ref/key.html">key</a> |
<a href="../ref/locals.html">locals</a> |
<a href="../ref/mixer.html">mixer</a> |
<a href="../ref/mouse.html">mouse</a> |
<a href="../ref/rect.html">Rect</a> |
<a href="../ref/surface.html">Surface</a> |
<a href="../ref/time.html">time</a> |
<a href="../ref/music.html">music</a> |
<a href="../ref/pygame.html">pygame</a>
</p>
<p class="bottom"><strong>Advanced stuff</strong>:
<a href="../ref/cursors.html">cursors</a> |
<a href="../ref/joystick.html">joystick</a> |
<a href="../ref/mask.html">mask</a> |
<a href="../ref/sprite.html">sprite</a> |
<a href="../ref/transform.html">transform</a> |
<a href="../ref/bufferproxy.html">BufferProxy</a> |
<a href="../ref/freetype.html">freetype</a> |
<a href="../ref/gfxdraw.html">gfxdraw</a> |
<a href="../ref/midi.html">midi</a> |
<a href="../ref/pixelarray.html">PixelArray</a> |
<a href="../ref/pixelcopy.html">pixelcopy</a> |
<a href="../ref/sndarray.html">sndarray</a> |
<a href="../ref/surfarray.html">surfarray</a> |
<a href="../ref/math.html">math</a>
</p>
<p class="bottom"><strong>Other</strong>:
<a href="../ref/camera.html">camera</a> |
<a href="../ref/sdl2_controller.html#module-pygame._sdl2.controller">controller</a> |
<a href="../ref/examples.html">examples</a> |
<a href="../ref/fastevent.html">fastevent</a> |
<a href="../ref/scrap.html">scrap</a> |
<a href="../ref/tests.html">tests</a> |
<a href="../ref/touch.html">touch</a> |
<a href="../ref/pygame.html#module-pygame.version">version</a>
</p>
</div>
</div>
</div>
<div class="documentwrapper">
<div class="body" role="main">
<section id="api-exported-by-pygame-freetype">
<section id="src-c-freetype-c">
<h2>src_c/_freetype.c<a class="headerlink" href="#src-c-freetype-c" title="Link to this heading"></a></h2>
<p>This extension module defines Python type <a class="tooltip reference internal" href="../ref/freetype.html#pygame.freetype.Font" title=""><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.freetype.Font</span></code><span class="tooltip-content">Create a new Font instance from a supported font file.</span></a>.</p>
<p>Header file: src_c/include/pygame_freetype.h</p>
<dl class="c type">
<dt class="sig sig-object c" id="c.pgFontObject">
<span class="k"><span class="pre">type</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgFontObject</span></span></span><a class="headerlink" href="#c.pgFontObject" title="Link to this definition"></a><br /></dt>
<dd><p>The <a class="reference internal" href="../ref/freetype.html#pygame.freetype.Font" title="pygame.freetype.Font"><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.freetype.Font</span></code></a> instance C struct.</p>
</dd></dl>
<dl class="c type">
<dt class="sig sig-object c" id="c.pgFont_Type">
<span class="k"><span class="pre">type</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgFont_Type</span></span></span><a class="headerlink" href="#c.pgFont_Type" title="Link to this definition"></a><br /></dt>
<dd><p>The <a class="reference internal" href="../ref/freetype.html#pygame.freetype.Font" title="pygame.freetype.Font"><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.freetype.Font</span></code></a> Python type.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgFont_New">
<span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pgFont_New</span></span></span><span class="sig-paren">(</span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">filename</span></span>, <span class="kt"><span class="pre">long</span></span><span class="w"> </span><span class="n"><span class="pre">font_index</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgFont_New" title="Link to this definition"></a><br /></dt>
<dd><p>Open the font file with path <em>filename</em> and return a new
new <a class="reference internal" href="../ref/freetype.html#pygame.freetype.Font" title="pygame.freetype.Font"><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.freetype.Font</span></code></a> instance for that font.
Set <em>font_index</em> to <code class="docutils literal notranslate"><span class="pre">0</span></code> unless the file contains multiple, indexed, fonts.
On error raise a Python exception and return <code class="docutils literal notranslate"><span class="pre">NULL</span></code>.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgFont_Check">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgFont_Check</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">x</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgFont_Check" title="Link to this definition"></a><br /></dt>
<dd><p>Return true if <em>x</em> is a <a class="reference internal" href="../ref/freetype.html#pygame.freetype.Font" title="pygame.freetype.Font"><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.freetype.Font</span></code></a> instance.
Will return false for a subclass of <code class="xref py py-class docutils literal notranslate"><span class="pre">Font</span></code>.
This is a macro. No check is made that <em>x</em> is not <code class="docutils literal notranslate"><span class="pre">NULL</span></code>.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgFont_IS_ALIVE">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgFont_IS_ALIVE</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgFont_IS_ALIVE" title="Link to this definition"></a><br /></dt>
<dd><p>Return true if <a class="reference internal" href="../ref/freetype.html#pygame.freetype.Font" title="pygame.freetype.Font"><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.freetype.Font</span></code></a> object <code class="docutils literal notranslate"><span class="pre">o</span></code>
is an open font file.
This is a macro. No check is made that <em>o</em> is not <code class="docutils literal notranslate"><span class="pre">NULL</span></code>
or not a <code class="xref py py-class docutils literal notranslate"><span class="pre">Font</span></code> instance.</p>
</dd></dl>
</section>
</section>
<br /><br />
<hr />
<a href="https://github.com/pygame/pygame/edit/main/docs/reST/c_api/freetype.rst" rel="nofollow">Edit on GitHub</a>
<div class="clearer"></div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="mixer.html" title="API exported by pygame.mixer"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="event.html" title="API exported by pygame.event"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">pygame v2.6.0 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../c_api.html" accesskey="U">pygame C API</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">API exported by pygame._freetype</a></li>
<script type="text/javascript" src="https://www.pygame.org/comment/jquery.plugin.docscomments.js"></script>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2000-2023, pygame developers.
</div>
</body>
</html>

View file

@ -0,0 +1,209 @@
<!DOCTYPE html>
<html lang="en" data-content_root="../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>API exported by pygame.mixer &#8212; pygame v2.6.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../_static/pygame.css?v=a854c6a8" />
<script src="../_static/documentation_options.js?v=ae39cb24"></script>
<script src="../_static/doctools.js?v=9a2dae69"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<link rel="icon" href="../_static/pygame.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Class Rect API exported by pygame.rect" href="rect.html" />
<link rel="prev" title="API exported by pygame._freetype" href="freetype.html" />
</head><body>
<div class="document">
<div class="header">
<div class="flex-container">
<div class="logo">
<a href="https://www.pygame.org/">
<img src="../_static/pygame_tiny.png" alt="logo image"/>
</a>
<h5>pygame documentation</h5>
</div>
<div class="pagelinks">
<div class="top">
<a href="https://www.pygame.org/">Pygame Home</a> ||
<a href="../index.html">Help Contents</a> ||
<a href="../genindex.html">Reference Index</a>
<form action="../search.html" method="get" style="display:inline;float:right;">
<input name="q" value="" type="text">
<input value="search" type="submit">
</form>
</div>
<hr style="color:black;border-bottom:none;border-style: dotted;border-bottom-style:none;">
<p class="bottom"><strong>Most useful stuff</strong>:
<a href="../ref/color.html">Color</a> |
<a href="../ref/display.html">display</a> |
<a href="../ref/draw.html">draw</a> |
<a href="../ref/event.html">event</a> |
<a href="../ref/font.html">font</a> |
<a href="../ref/image.html">image</a> |
<a href="../ref/key.html">key</a> |
<a href="../ref/locals.html">locals</a> |
<a href="../ref/mixer.html">mixer</a> |
<a href="../ref/mouse.html">mouse</a> |
<a href="../ref/rect.html">Rect</a> |
<a href="../ref/surface.html">Surface</a> |
<a href="../ref/time.html">time</a> |
<a href="../ref/music.html">music</a> |
<a href="../ref/pygame.html">pygame</a>
</p>
<p class="bottom"><strong>Advanced stuff</strong>:
<a href="../ref/cursors.html">cursors</a> |
<a href="../ref/joystick.html">joystick</a> |
<a href="../ref/mask.html">mask</a> |
<a href="../ref/sprite.html">sprite</a> |
<a href="../ref/transform.html">transform</a> |
<a href="../ref/bufferproxy.html">BufferProxy</a> |
<a href="../ref/freetype.html">freetype</a> |
<a href="../ref/gfxdraw.html">gfxdraw</a> |
<a href="../ref/midi.html">midi</a> |
<a href="../ref/pixelarray.html">PixelArray</a> |
<a href="../ref/pixelcopy.html">pixelcopy</a> |
<a href="../ref/sndarray.html">sndarray</a> |
<a href="../ref/surfarray.html">surfarray</a> |
<a href="../ref/math.html">math</a>
</p>
<p class="bottom"><strong>Other</strong>:
<a href="../ref/camera.html">camera</a> |
<a href="../ref/sdl2_controller.html#module-pygame._sdl2.controller">controller</a> |
<a href="../ref/examples.html">examples</a> |
<a href="../ref/fastevent.html">fastevent</a> |
<a href="../ref/scrap.html">scrap</a> |
<a href="../ref/tests.html">tests</a> |
<a href="../ref/touch.html">touch</a> |
<a href="../ref/pygame.html#module-pygame.version">version</a>
</p>
</div>
</div>
</div>
<div class="documentwrapper">
<div class="body" role="main">
<section id="api-exported-by-pygame-mixer">
<section id="src-c-mixer-c">
<h2>src_c/mixer.c<a class="headerlink" href="#src-c-mixer-c" title="Link to this heading"></a></h2>
<p>Python types and module startup/shutdown functions defined in the
<a class="tooltip reference internal" href="../ref/mixer.html#module-pygame.mixer" title=""><code class="xref py py-mod docutils literal notranslate"><span class="pre">pygame.mixer</span></code><span class="tooltip-content">pygame module for loading and playing sounds</span></a> extension module.</p>
<p>Header file: src_c/include/pygame_mixer.h</p>
<dl class="c type">
<dt class="sig sig-object c" id="c.pgSoundObject">
<span class="k"><span class="pre">type</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgSoundObject</span></span></span><a class="headerlink" href="#c.pgSoundObject" title="Link to this definition"></a><br /></dt>
<dd><p>The <a class="reference internal" href="../ref/mixer.html#pygame.mixer.Sound" title="pygame.mixer.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.mixer.Sound</span></code></a> instance C structure.</p>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c" id="c.pgSound_Type">
<span class="n"><span class="pre">PyTypeObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pgSound_Type</span></span></span><a class="headerlink" href="#c.pgSound_Type" title="Link to this definition"></a><br /></dt>
<dd><p>The <a class="reference internal" href="../ref/mixer.html#pygame.mixer.Sound" title="pygame.mixer.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.mixer.Sound</span></code></a> Python type.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgSound_New">
<span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pgSound_New</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">Mix_Chunk</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">chunk</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgSound_New" title="Link to this definition"></a><br /></dt>
<dd><p>Return a new <a class="reference internal" href="../ref/mixer.html#pygame.mixer.Sound" title="pygame.mixer.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.mixer.Sound</span></code></a> instance for the SDL mixer chunk <em>chunk</em>.
On failure, raise a Python exception and return <code class="docutils literal notranslate"><span class="pre">NULL</span></code>.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgSound_Check">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgSound_Check</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">obj</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgSound_Check" title="Link to this definition"></a><br /></dt>
<dd><p>Return true if <em>obj</em> is an instance of type <a class="reference internal" href="#c.pgSound_Type" title="pgSound_Type"><code class="xref c c-data docutils literal notranslate"><span class="pre">pgSound_Type</span></code></a>,
but not a <a class="reference internal" href="#c.pgSound_Type" title="pgSound_Type"><code class="xref c c-data docutils literal notranslate"><span class="pre">pgSound_Type</span></code></a> subclass instance.
A macro.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgSound_AsChunk">
<span class="n"><span class="pre">Mix_Chunk</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pgSound_AsChunk</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">x</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgSound_AsChunk" title="Link to this definition"></a><br /></dt>
<dd><p>Return the SDL <code class="xref c c-type docutils literal notranslate"><span class="pre">Mix_Chunk</span></code> struct associated with the
<a class="reference internal" href="#c.pgSound_Type" title="pgSound_Type"><code class="xref c c-data docutils literal notranslate"><span class="pre">pgSound_Type</span></code></a> instance <em>x</em>.
A macro that does no <code class="docutils literal notranslate"><span class="pre">NULL</span></code> or Python type check on <em>x</em>.</p>
</dd></dl>
<dl class="c type">
<dt class="sig sig-object c" id="c.pgChannelObject">
<span class="k"><span class="pre">type</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgChannelObject</span></span></span><a class="headerlink" href="#c.pgChannelObject" title="Link to this definition"></a><br /></dt>
<dd><p>The <a class="reference internal" href="../ref/mixer.html#pygame.mixer.Channel" title="pygame.mixer.Channel"><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.mixer.Channel</span></code></a> instance C structure.</p>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c" id="c.pgChannel_Type">
<span class="n"><span class="pre">PyTypeObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pgChannel_Type</span></span></span><a class="headerlink" href="#c.pgChannel_Type" title="Link to this definition"></a><br /></dt>
<dd><p>The <a class="reference internal" href="../ref/mixer.html#pygame.mixer.Channel" title="pygame.mixer.Channel"><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.mixer.Channel</span></code></a> Python type.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgChannel_New">
<span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pgChannel_New</span></span></span><span class="sig-paren">(</span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">channelnum</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgChannel_New" title="Link to this definition"></a><br /></dt>
<dd><p>Return a new <a class="reference internal" href="../ref/mixer.html#pygame.mixer.Channel" title="pygame.mixer.Channel"><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.mixer.Channel</span></code></a> instance for the SDL mixer
channel <em>channelnum</em>.
On failure, raise a Python exception and return <code class="docutils literal notranslate"><span class="pre">NULL</span></code>.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgChannel_Check">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgChannel_Check</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">obj</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgChannel_Check" title="Link to this definition"></a><br /></dt>
<dd><p>Return true if <em>obj</em> is an instance of type <a class="reference internal" href="#c.pgChannel_Type" title="pgChannel_Type"><code class="xref c c-data docutils literal notranslate"><span class="pre">pgChannel_Type</span></code></a>,
but not a <a class="reference internal" href="#c.pgChannel_Type" title="pgChannel_Type"><code class="xref c c-data docutils literal notranslate"><span class="pre">pgChannel_Type</span></code></a> subclass instance.
A macro.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgChannel_AsInt">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgChannel_AsInt</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">x</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgChannel_AsInt" title="Link to this definition"></a><br /></dt>
<dd><p>Return the SDL mixer music channel number associated with <a class="reference internal" href="#c.pgChannel_Type" title="pgChannel_Type"><code class="xref c c-type docutils literal notranslate"><span class="pre">pgChannel_Type</span></code></a> instance <em>x</em>.
A macro that does no <code class="docutils literal notranslate"><span class="pre">NULL</span></code> or Python type check on <em>x</em>.</p>
</dd></dl>
</section>
</section>
<br /><br />
<hr />
<a href="https://github.com/pygame/pygame/edit/main/docs/reST/c_api/mixer.rst" rel="nofollow">Edit on GitHub</a>
<div class="clearer"></div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="rect.html" title="Class Rect API exported by pygame.rect"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="freetype.html" title="API exported by pygame._freetype"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">pygame v2.6.0 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../c_api.html" accesskey="U">pygame C API</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">API exported by pygame.mixer</a></li>
<script type="text/javascript" src="https://www.pygame.org/comment/jquery.plugin.docscomments.js"></script>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2000-2023, pygame developers.
</div>
</body>
</html>

View file

@ -0,0 +1,204 @@
<!DOCTYPE html>
<html lang="en" data-content_root="../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Class Rect API exported by pygame.rect &#8212; pygame v2.6.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../_static/pygame.css?v=a854c6a8" />
<script src="../_static/documentation_options.js?v=ae39cb24"></script>
<script src="../_static/doctools.js?v=9a2dae69"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<link rel="icon" href="../_static/pygame.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="API exported by pygame.rwobject" href="rwobject.html" />
<link rel="prev" title="API exported by pygame.mixer" href="mixer.html" />
</head><body>
<div class="document">
<div class="header">
<div class="flex-container">
<div class="logo">
<a href="https://www.pygame.org/">
<img src="../_static/pygame_tiny.png" alt="logo image"/>
</a>
<h5>pygame documentation</h5>
</div>
<div class="pagelinks">
<div class="top">
<a href="https://www.pygame.org/">Pygame Home</a> ||
<a href="../index.html">Help Contents</a> ||
<a href="../genindex.html">Reference Index</a>
<form action="../search.html" method="get" style="display:inline;float:right;">
<input name="q" value="" type="text">
<input value="search" type="submit">
</form>
</div>
<hr style="color:black;border-bottom:none;border-style: dotted;border-bottom-style:none;">
<p class="bottom"><strong>Most useful stuff</strong>:
<a href="../ref/color.html">Color</a> |
<a href="../ref/display.html">display</a> |
<a href="../ref/draw.html">draw</a> |
<a href="../ref/event.html">event</a> |
<a href="../ref/font.html">font</a> |
<a href="../ref/image.html">image</a> |
<a href="../ref/key.html">key</a> |
<a href="../ref/locals.html">locals</a> |
<a href="../ref/mixer.html">mixer</a> |
<a href="../ref/mouse.html">mouse</a> |
<a href="../ref/rect.html">Rect</a> |
<a href="../ref/surface.html">Surface</a> |
<a href="../ref/time.html">time</a> |
<a href="../ref/music.html">music</a> |
<a href="../ref/pygame.html">pygame</a>
</p>
<p class="bottom"><strong>Advanced stuff</strong>:
<a href="../ref/cursors.html">cursors</a> |
<a href="../ref/joystick.html">joystick</a> |
<a href="../ref/mask.html">mask</a> |
<a href="../ref/sprite.html">sprite</a> |
<a href="../ref/transform.html">transform</a> |
<a href="../ref/bufferproxy.html">BufferProxy</a> |
<a href="../ref/freetype.html">freetype</a> |
<a href="../ref/gfxdraw.html">gfxdraw</a> |
<a href="../ref/midi.html">midi</a> |
<a href="../ref/pixelarray.html">PixelArray</a> |
<a href="../ref/pixelcopy.html">pixelcopy</a> |
<a href="../ref/sndarray.html">sndarray</a> |
<a href="../ref/surfarray.html">surfarray</a> |
<a href="../ref/math.html">math</a>
</p>
<p class="bottom"><strong>Other</strong>:
<a href="../ref/camera.html">camera</a> |
<a href="../ref/sdl2_controller.html#module-pygame._sdl2.controller">controller</a> |
<a href="../ref/examples.html">examples</a> |
<a href="../ref/fastevent.html">fastevent</a> |
<a href="../ref/scrap.html">scrap</a> |
<a href="../ref/tests.html">tests</a> |
<a href="../ref/touch.html">touch</a> |
<a href="../ref/pygame.html#module-pygame.version">version</a>
</p>
</div>
</div>
</div>
<div class="documentwrapper">
<div class="body" role="main">
<section id="class-rect-api-exported-by-pygame-rect">
<section id="src-c-rect-c">
<h2>src_c/rect.c<a class="headerlink" href="#src-c-rect-c" title="Link to this heading"></a></h2>
<p>This extension module defines Python type <a class="tooltip reference internal" href="../ref/rect.html#pygame.Rect" title=""><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.Rect</span></code><span class="tooltip-content">pygame object for storing rectangular coordinates</span></a>.</p>
<p>Header file: src_c/include/pygame.h</p>
<dl class="c type">
<dt class="sig sig-object c" id="c.pgRectObject">
<span class="k"><span class="pre">type</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgRectObject</span></span></span><a class="headerlink" href="#c.pgRectObject" title="Link to this definition"></a><br /></dt>
<dd><dl class="c member">
<dt class="sig sig-object c" id="c.pgRectObject.r">
<span class="n"><span class="pre">SDL_Rect</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">r</span></span></span><a class="headerlink" href="#c.pgRectObject.r" title="Link to this definition"></a><br /></dt>
<dd></dd></dl>
<p>The Pygame rectangle type instance.</p>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c" id="c.pgRect_Type">
<span class="n"><span class="pre">PyTypeObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pgRect_Type</span></span></span><a class="headerlink" href="#c.pgRect_Type" title="Link to this definition"></a><br /></dt>
<dd><p>The Pygame rectangle object type pygame.Rect.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgRect_AsRect">
<span class="n"><span class="pre">SDL_Rect</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgRect_AsRect</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">obj</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgRect_AsRect" title="Link to this definition"></a><br /></dt>
<dd><p>A macro to access the SDL_Rect field of a <a class="reference internal" href="../ref/rect.html#pygame.Rect" title="pygame.Rect"><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.Rect</span></code></a> instance.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgRect_New">
<span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pgRect_New</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">SDL_Rect</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">r</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgRect_New" title="Link to this definition"></a><br /></dt>
<dd><p>Return a new <a class="reference internal" href="../ref/rect.html#pygame.Rect" title="pygame.Rect"><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.Rect</span></code></a> instance from the SDL_Rect <em>r</em>.
On failure, raise a Python exception and return <em>NULL</em>.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgRect_New4">
<span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pgRect_New4</span></span></span><span class="sig-paren">(</span><span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">x</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">y</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">w</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">h</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgRect_New4" title="Link to this definition"></a><br /></dt>
<dd><p>Return a new pygame.Rect instance with position (<em>x</em>, <em>y</em>) and
size (<em>w</em>, <em>h</em>).
On failure raise a Python exception and return <em>NULL</em>.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgRect_FromObject">
<span class="n"><span class="pre">SDL_Rect</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pgRect_FromObject</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">obj</span></span>, <span class="n"><span class="pre">SDL_Rect</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">temp</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgRect_FromObject" title="Link to this definition"></a><br /></dt>
<dd><p>Translate a Python rectangle representation as a Pygame <code class="xref c c-type docutils literal notranslate"><span class="pre">SDL_Rect</span></code>.
A rectangle can be a length 4 sequence integers (x, y, w, h),
or a length 2 sequence of position (x, y) and size (w, h),
or a length 1 tuple containing a rectangle representation,
or have a method <em>rect</em> that returns a rectangle.
Pass a pointer to a locally declared <code class="xref c c-type docutils literal notranslate"><span class="pre">SDL_Rect</span></code> as <em>temp</em>.
Do not rely on this being filled in; use the function's return value instead.
On success, return a pointer to a <code class="xref c c-type docutils literal notranslate"><span class="pre">SDL_Rect</span></code> representation
of the rectangle, else return <em>NULL</em>.
No Python exceptions are raised.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgRect_Normalize">
<span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgRect_Normalize</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">SDL_Rect</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">rect</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgRect_Normalize" title="Link to this definition"></a><br /></dt>
<dd><p>Normalize the given rect. A rect with a negative size (negative width and/or
height) will be adjusted to have a positive size.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgRect_Check">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgRect_Check</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">obj</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgRect_Check" title="Link to this definition"></a><br /></dt>
<dd><p>A macro to check if <em>obj</em> is a <a class="reference internal" href="../ref/rect.html#pygame.Rect" title="pygame.Rect"><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.Rect</span></code></a> instance.</p>
</dd></dl>
</section>
</section>
<br /><br />
<hr />
<a href="https://github.com/pygame/pygame/edit/main/docs/reST/c_api/rect.rst" rel="nofollow">Edit on GitHub</a>
<div class="clearer"></div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="rwobject.html" title="API exported by pygame.rwobject"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="mixer.html" title="API exported by pygame.mixer"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">pygame v2.6.0 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../c_api.html" accesskey="U">pygame C API</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Class Rect API exported by pygame.rect</a></li>
<script type="text/javascript" src="https://www.pygame.org/comment/jquery.plugin.docscomments.js"></script>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2000-2023, pygame developers.
</div>
</body>
</html>

View file

@ -0,0 +1,200 @@
<!DOCTYPE html>
<html lang="en" data-content_root="../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>API exported by pygame.rwobject &#8212; pygame v2.6.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../_static/pygame.css?v=a854c6a8" />
<script src="../_static/documentation_options.js?v=ae39cb24"></script>
<script src="../_static/doctools.js?v=9a2dae69"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<link rel="icon" href="../_static/pygame.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Class Surface API exported by pygame.surface" href="surface.html" />
<link rel="prev" title="Class Rect API exported by pygame.rect" href="rect.html" />
</head><body>
<div class="document">
<div class="header">
<div class="flex-container">
<div class="logo">
<a href="https://www.pygame.org/">
<img src="../_static/pygame_tiny.png" alt="logo image"/>
</a>
<h5>pygame documentation</h5>
</div>
<div class="pagelinks">
<div class="top">
<a href="https://www.pygame.org/">Pygame Home</a> ||
<a href="../index.html">Help Contents</a> ||
<a href="../genindex.html">Reference Index</a>
<form action="../search.html" method="get" style="display:inline;float:right;">
<input name="q" value="" type="text">
<input value="search" type="submit">
</form>
</div>
<hr style="color:black;border-bottom:none;border-style: dotted;border-bottom-style:none;">
<p class="bottom"><strong>Most useful stuff</strong>:
<a href="../ref/color.html">Color</a> |
<a href="../ref/display.html">display</a> |
<a href="../ref/draw.html">draw</a> |
<a href="../ref/event.html">event</a> |
<a href="../ref/font.html">font</a> |
<a href="../ref/image.html">image</a> |
<a href="../ref/key.html">key</a> |
<a href="../ref/locals.html">locals</a> |
<a href="../ref/mixer.html">mixer</a> |
<a href="../ref/mouse.html">mouse</a> |
<a href="../ref/rect.html">Rect</a> |
<a href="../ref/surface.html">Surface</a> |
<a href="../ref/time.html">time</a> |
<a href="../ref/music.html">music</a> |
<a href="../ref/pygame.html">pygame</a>
</p>
<p class="bottom"><strong>Advanced stuff</strong>:
<a href="../ref/cursors.html">cursors</a> |
<a href="../ref/joystick.html">joystick</a> |
<a href="../ref/mask.html">mask</a> |
<a href="../ref/sprite.html">sprite</a> |
<a href="../ref/transform.html">transform</a> |
<a href="../ref/bufferproxy.html">BufferProxy</a> |
<a href="../ref/freetype.html">freetype</a> |
<a href="../ref/gfxdraw.html">gfxdraw</a> |
<a href="../ref/midi.html">midi</a> |
<a href="../ref/pixelarray.html">PixelArray</a> |
<a href="../ref/pixelcopy.html">pixelcopy</a> |
<a href="../ref/sndarray.html">sndarray</a> |
<a href="../ref/surfarray.html">surfarray</a> |
<a href="../ref/math.html">math</a>
</p>
<p class="bottom"><strong>Other</strong>:
<a href="../ref/camera.html">camera</a> |
<a href="../ref/sdl2_controller.html#module-pygame._sdl2.controller">controller</a> |
<a href="../ref/examples.html">examples</a> |
<a href="../ref/fastevent.html">fastevent</a> |
<a href="../ref/scrap.html">scrap</a> |
<a href="../ref/tests.html">tests</a> |
<a href="../ref/touch.html">touch</a> |
<a href="../ref/pygame.html#module-pygame.version">version</a>
</p>
</div>
</div>
</div>
<div class="documentwrapper">
<div class="body" role="main">
<section id="api-exported-by-pygame-rwobject">
<section id="src-c-rwobject-c">
<h2>src_c/rwobject.c<a class="headerlink" href="#src-c-rwobject-c" title="Link to this heading"></a></h2>
<p>This extension module implements functions for wrapping a Python file like
object in a <code class="xref c c-type docutils literal notranslate"><span class="pre">SDL_RWops</span></code> struct for SDL file access.</p>
<p>Header file: src_c/include/pygame.h</p>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgRWops_FromObject">
<span class="n"><span class="pre">SDL_RWops</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pgRWops_FromObject</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">obj</span></span>, <span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">extptr</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgRWops_FromObject" title="Link to this definition"></a><br /></dt>
<dd><p>Return a SDL_RWops struct filled to access <em>obj</em>.
If <em>obj</em> is a string then let SDL open the file it names.
Otherwise, if <em>obj</em> is a Python file-like object then use its <code class="docutils literal notranslate"><span class="pre">read</span></code>, <code class="docutils literal notranslate"><span class="pre">write</span></code>,
<code class="docutils literal notranslate"><span class="pre">seek</span></code>, <code class="docutils literal notranslate"><span class="pre">tell</span></code>, and <code class="docutils literal notranslate"><span class="pre">close</span></code> methods. If threads are available,
the Python GIL is acquired before calling any of the <em>obj</em> methods.
If you want to see the file extension, you can pass in a char double pointer
that will be populated to a dynamically allocated string or NULL. Caller is
responsible for freeing the extension string. It is safe to pass NULL if you
don't care about the file extension. On error raise a Python exception and
return <code class="docutils literal notranslate"><span class="pre">NULL</span></code>. If NULL is returned, the extptr will not be populated with
dynamic memory, it is not necessary to free in that error handling.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgRWops_FromFileObject">
<span class="n"><span class="pre">SDL_RWops</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pgRWops_FromFileObject</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">obj</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgRWops_FromFileObject" title="Link to this definition"></a><br /></dt>
<dd><p>Return a SDL_RWops struct filled to access the Python file-like object <em>obj</em>.
Uses its <code class="docutils literal notranslate"><span class="pre">read</span></code>, <code class="docutils literal notranslate"><span class="pre">write</span></code>, <code class="docutils literal notranslate"><span class="pre">seek</span></code>, <code class="docutils literal notranslate"><span class="pre">tell</span></code>, and <code class="docutils literal notranslate"><span class="pre">close</span></code> methods.
If threads are available, the Python GIL is acquired before calling any of the <em>obj</em> methods.
On error raise a Python exception and return <code class="docutils literal notranslate"><span class="pre">NULL</span></code>.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgRWops_IsFileObject">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgRWops_IsFileObject</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">SDL_RWops</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">rw</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgRWops_IsFileObject" title="Link to this definition"></a><br /></dt>
<dd><p>Return true if <em>rw</em> is a Python file-like object wrapper returned by <a class="reference internal" href="#c.pgRWops_FromObject" title="pgRWops_FromObject"><code class="xref c c-func docutils literal notranslate"><span class="pre">pgRWops_FromObject()</span></code></a>
or <a class="reference internal" href="#c.pgRWops_FromFileObject" title="pgRWops_FromFileObject"><code class="xref c c-func docutils literal notranslate"><span class="pre">pgRWops_FromFileObject()</span></code></a>.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgRWops_ReleaseObject">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgRWops_ReleaseObject</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">SDL_RWops</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">context</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgRWops_ReleaseObject" title="Link to this definition"></a><br /></dt>
<dd><p>Free a SDL_RWops struct. If it is attached to a Python file-like object, decrement its
refcount. Otherwise, close the file handle.
Return 0 on success. On error, raise a Python exception and return a negative value.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pg_EncodeFilePath">
<span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pg_EncodeFilePath</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">obj</span></span>, <span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">eclass</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pg_EncodeFilePath" title="Link to this definition"></a><br /></dt>
<dd><p>Return the file path <em>obj</em> as a byte string properly encoded for the OS.
Null bytes are forbidden in the encoded file path.
On error raise a Python exception and return <code class="docutils literal notranslate"><span class="pre">NULL</span></code>,
using <em>eclass</em> as the exception type if it is not <code class="docutils literal notranslate"><span class="pre">NULL</span></code>.
If <em>obj</em> is <code class="docutils literal notranslate"><span class="pre">NULL</span></code> assume an exception was already raised and pass it on.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pg_EncodeString">
<span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pg_EncodeString</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">obj</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">encoding</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">errors</span></span>, <span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">eclass</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pg_EncodeString" title="Link to this definition"></a><br /></dt>
<dd><p>Return string <em>obj</em> as an encoded byte string.
The C string arguments <em>encoding</em> and <em>errors</em> are the same as for
<code class="xref c c-func docutils literal notranslate"><span class="pre">PyUnicode_AsEncodedString()</span></code>.
On error raise a Python exception and return <code class="docutils literal notranslate"><span class="pre">NULL</span></code>,
using <em>eclass</em> as the exception type if it is not <code class="docutils literal notranslate"><span class="pre">NULL</span></code>.
If <em>obj</em> is <code class="docutils literal notranslate"><span class="pre">NULL</span></code> assume an exception was already raised and pass it on.</p>
</dd></dl>
</section>
</section>
<br /><br />
<hr />
<a href="https://github.com/pygame/pygame/edit/main/docs/reST/c_api/rwobject.rst" rel="nofollow">Edit on GitHub</a>
<div class="clearer"></div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="surface.html" title="Class Surface API exported by pygame.surface"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="rect.html" title="Class Rect API exported by pygame.rect"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">pygame v2.6.0 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../c_api.html" accesskey="U">pygame C API</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">API exported by pygame.rwobject</a></li>
<script type="text/javascript" src="https://www.pygame.org/comment/jquery.plugin.docscomments.js"></script>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2000-2023, pygame developers.
</div>
</body>
</html>

View file

@ -0,0 +1,153 @@
<!DOCTYPE html>
<html lang="en" data-content_root="../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Slots and c_api - Making functions and data available from other modules &#8212; pygame v2.6.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../_static/pygame.css?v=a854c6a8" />
<script src="../_static/documentation_options.js?v=ae39cb24"></script>
<script src="../_static/doctools.js?v=9a2dae69"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<link rel="icon" href="../_static/pygame.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="High level API exported by pygame.base" href="base.html" />
<link rel="prev" title="pygame C API" href="../c_api.html" />
</head><body>
<div class="document">
<div class="header">
<div class="flex-container">
<div class="logo">
<a href="https://www.pygame.org/">
<img src="../_static/pygame_tiny.png" alt="logo image"/>
</a>
<h5>pygame documentation</h5>
</div>
<div class="pagelinks">
<div class="top">
<a href="https://www.pygame.org/">Pygame Home</a> ||
<a href="../index.html">Help Contents</a> ||
<a href="../genindex.html">Reference Index</a>
<form action="../search.html" method="get" style="display:inline;float:right;">
<input name="q" value="" type="text">
<input value="search" type="submit">
</form>
</div>
<hr style="color:black;border-bottom:none;border-style: dotted;border-bottom-style:none;">
<p class="bottom"><strong>Most useful stuff</strong>:
<a href="../ref/color.html">Color</a> |
<a href="../ref/display.html">display</a> |
<a href="../ref/draw.html">draw</a> |
<a href="../ref/event.html">event</a> |
<a href="../ref/font.html">font</a> |
<a href="../ref/image.html">image</a> |
<a href="../ref/key.html">key</a> |
<a href="../ref/locals.html">locals</a> |
<a href="../ref/mixer.html">mixer</a> |
<a href="../ref/mouse.html">mouse</a> |
<a href="../ref/rect.html">Rect</a> |
<a href="../ref/surface.html">Surface</a> |
<a href="../ref/time.html">time</a> |
<a href="../ref/music.html">music</a> |
<a href="../ref/pygame.html">pygame</a>
</p>
<p class="bottom"><strong>Advanced stuff</strong>:
<a href="../ref/cursors.html">cursors</a> |
<a href="../ref/joystick.html">joystick</a> |
<a href="../ref/mask.html">mask</a> |
<a href="../ref/sprite.html">sprite</a> |
<a href="../ref/transform.html">transform</a> |
<a href="../ref/bufferproxy.html">BufferProxy</a> |
<a href="../ref/freetype.html">freetype</a> |
<a href="../ref/gfxdraw.html">gfxdraw</a> |
<a href="../ref/midi.html">midi</a> |
<a href="../ref/pixelarray.html">PixelArray</a> |
<a href="../ref/pixelcopy.html">pixelcopy</a> |
<a href="../ref/sndarray.html">sndarray</a> |
<a href="../ref/surfarray.html">surfarray</a> |
<a href="../ref/math.html">math</a>
</p>
<p class="bottom"><strong>Other</strong>:
<a href="../ref/camera.html">camera</a> |
<a href="../ref/sdl2_controller.html#module-pygame._sdl2.controller">controller</a> |
<a href="../ref/examples.html">examples</a> |
<a href="../ref/fastevent.html">fastevent</a> |
<a href="../ref/scrap.html">scrap</a> |
<a href="../ref/tests.html">tests</a> |
<a href="../ref/touch.html">touch</a> |
<a href="../ref/pygame.html#module-pygame.version">version</a>
</p>
</div>
</div>
</div>
<div class="documentwrapper">
<div class="body" role="main">
<section id="slots-and-c-api-making-functions-and-data-available-from-other-modules">
<p>One example is pg_RGBAFromObj where the implementation is defined in base.c, and also exported in base.c (and _pygame.h).</p>
<p>base.c has this exposing the pg_RGBAFromObj function to the <cite>c_api</cite> structure:</p>
<blockquote>
<div><p>c_api[12] = pg_RGBAFromObj;</p>
</div></blockquote>
<p>Then in src_c/include/_pygame.h there is an</p>
<blockquote>
<div><p>#define pg_RGBAFromObj.</p>
</div></blockquote>
<p>Also in _pygame.h, it needs to define the number of slots the base module uses. This is PYGAMEAPI_BASE_NUMSLOTS. So if you were adding another function, you need to increment this PYGAMEAPI_BASE_NUMSLOTS number.</p>
<p>Then to use the pg_RGBAFromObj in other files,</p>
<ol class="arabic">
<li><p>include the &quot;pygame.h&quot; file,</p></li>
<li><p>they have to make sure base is imported with:</p>
<blockquote>
<div><p>import_pygame_base();</p>
</div></blockquote>
</li>
</ol>
<p>Examples that use pg_RGBAFromObj are: _freetype.c, color.c, gfxdraw.c, and surface.c.</p>
</section>
<br /><br />
<hr />
<a href="https://github.com/pygame/pygame/edit/main/docs/reST/c_api/slots.rst" rel="nofollow">Edit on GitHub</a>
<div class="clearer"></div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="base.html" title="High level API exported by pygame.base"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="../c_api.html" title="pygame C API"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">pygame v2.6.0 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../c_api.html" accesskey="U">pygame C API</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Slots and c_api - Making functions and data available from other modules</a></li>
<script type="text/javascript" src="https://www.pygame.org/comment/jquery.plugin.docscomments.js"></script>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2000-2023, pygame developers.
</div>
</body>
</html>

View file

@ -0,0 +1,198 @@
<!DOCTYPE html>
<html lang="en" data-content_root="../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Class Surface API exported by pygame.surface &#8212; pygame v2.6.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../_static/pygame.css?v=a854c6a8" />
<script src="../_static/documentation_options.js?v=ae39cb24"></script>
<script src="../_static/doctools.js?v=9a2dae69"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<link rel="icon" href="../_static/pygame.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="API exported by pygame.surflock" href="surflock.html" />
<link rel="prev" title="API exported by pygame.rwobject" href="rwobject.html" />
</head><body>
<div class="document">
<div class="header">
<div class="flex-container">
<div class="logo">
<a href="https://www.pygame.org/">
<img src="../_static/pygame_tiny.png" alt="logo image"/>
</a>
<h5>pygame documentation</h5>
</div>
<div class="pagelinks">
<div class="top">
<a href="https://www.pygame.org/">Pygame Home</a> ||
<a href="../index.html">Help Contents</a> ||
<a href="../genindex.html">Reference Index</a>
<form action="../search.html" method="get" style="display:inline;float:right;">
<input name="q" value="" type="text">
<input value="search" type="submit">
</form>
</div>
<hr style="color:black;border-bottom:none;border-style: dotted;border-bottom-style:none;">
<p class="bottom"><strong>Most useful stuff</strong>:
<a href="../ref/color.html">Color</a> |
<a href="../ref/display.html">display</a> |
<a href="../ref/draw.html">draw</a> |
<a href="../ref/event.html">event</a> |
<a href="../ref/font.html">font</a> |
<a href="../ref/image.html">image</a> |
<a href="../ref/key.html">key</a> |
<a href="../ref/locals.html">locals</a> |
<a href="../ref/mixer.html">mixer</a> |
<a href="../ref/mouse.html">mouse</a> |
<a href="../ref/rect.html">Rect</a> |
<a href="../ref/surface.html">Surface</a> |
<a href="../ref/time.html">time</a> |
<a href="../ref/music.html">music</a> |
<a href="../ref/pygame.html">pygame</a>
</p>
<p class="bottom"><strong>Advanced stuff</strong>:
<a href="../ref/cursors.html">cursors</a> |
<a href="../ref/joystick.html">joystick</a> |
<a href="../ref/mask.html">mask</a> |
<a href="../ref/sprite.html">sprite</a> |
<a href="../ref/transform.html">transform</a> |
<a href="../ref/bufferproxy.html">BufferProxy</a> |
<a href="../ref/freetype.html">freetype</a> |
<a href="../ref/gfxdraw.html">gfxdraw</a> |
<a href="../ref/midi.html">midi</a> |
<a href="../ref/pixelarray.html">PixelArray</a> |
<a href="../ref/pixelcopy.html">pixelcopy</a> |
<a href="../ref/sndarray.html">sndarray</a> |
<a href="../ref/surfarray.html">surfarray</a> |
<a href="../ref/math.html">math</a>
</p>
<p class="bottom"><strong>Other</strong>:
<a href="../ref/camera.html">camera</a> |
<a href="../ref/sdl2_controller.html#module-pygame._sdl2.controller">controller</a> |
<a href="../ref/examples.html">examples</a> |
<a href="../ref/fastevent.html">fastevent</a> |
<a href="../ref/scrap.html">scrap</a> |
<a href="../ref/tests.html">tests</a> |
<a href="../ref/touch.html">touch</a> |
<a href="../ref/pygame.html#module-pygame.version">version</a>
</p>
</div>
</div>
</div>
<div class="documentwrapper">
<div class="body" role="main">
<section id="class-surface-api-exported-by-pygame-surface">
<section id="src-c-surface-c">
<h2>src_c/surface.c<a class="headerlink" href="#src-c-surface-c" title="Link to this heading"></a></h2>
<p>This extension module defines Python type <a class="tooltip reference internal" href="../ref/surface.html#pygame.Surface" title=""><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.Surface</span></code><span class="tooltip-content">pygame object for representing images</span></a>.</p>
<p>Header file: src_c/include/pygame.h</p>
<dl class="c type">
<dt class="sig sig-object c" id="c.pgSurfaceObject">
<span class="k"><span class="pre">type</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgSurfaceObject</span></span></span><a class="headerlink" href="#c.pgSurfaceObject" title="Link to this definition"></a><br /></dt>
<dd><p>A <a class="reference internal" href="../ref/surface.html#pygame.Surface" title="pygame.Surface"><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.Surface</span></code></a> instance.</p>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c" id="c.pgSurface_Type">
<span class="n"><span class="pre">PyTypeObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pgSurface_Type</span></span></span><a class="headerlink" href="#c.pgSurface_Type" title="Link to this definition"></a><br /></dt>
<dd><p>The <a class="reference internal" href="../ref/surface.html#pygame.Surface" title="pygame.Surface"><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.Surface</span></code></a> Python type.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgSurface_Check">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgSurface_Check</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">x</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgSurface_Check" title="Link to this definition"></a><br /></dt>
<dd><p>Return true if <em>x</em> is a <a class="reference internal" href="../ref/surface.html#pygame.Surface" title="pygame.Surface"><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.Surface</span></code></a> instance</p>
<p>Will return false if <em>x</em> is a subclass of <cite>Surface</cite>.
This is a macro. No check is made that <em>x</em> is not <em>NULL</em>.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgSurface_New">
<a class="reference internal" href="#c.pgSurfaceObject" title="pgSurfaceObject"><span class="n"><span class="pre">pgSurfaceObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pgSurface_New</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">SDL_Surface</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">s</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgSurface_New" title="Link to this definition"></a><br /></dt>
<dd><p>Return a new new pygame surface instance for SDL surface <em>s</em>.
Return <em>NULL</em> on error.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgSurface_New2">
<a class="reference internal" href="#c.pgSurfaceObject" title="pgSurfaceObject"><span class="n"><span class="pre">pgSurfaceObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pgSurface_New2</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">SDL_Surface</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">s</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">owner</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgSurface_New2" title="Link to this definition"></a><br /></dt>
<dd><p>Return a new new pygame surface instance for SDL surface <em>s</em>.
If owner is true, the surface will be freed when the python object is destroyed.
Return <em>NULL</em> on error.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgSurface_AsSurface">
<span class="n"><span class="pre">SDL_Surface</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pgSurface_AsSurface</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">x</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgSurface_AsSurface" title="Link to this definition"></a><br /></dt>
<dd><p>Return a pointer the SDL surface represented by the pygame Surface instance
<em>x</em>.</p>
<p>This is a macro. Argument <em>x</em> is assumed to be a Surface, or subclass of
Surface, instance.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgSurface_Blit">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgSurface_Blit</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">dstobj</span></span>, <span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">srcobj</span></span>, <span class="n"><span class="pre">SDL_Rect</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">dstrect</span></span>, <span class="n"><span class="pre">SDL_Rect</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">srcrect</span></span>, <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="n"><span class="pre">the_args</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgSurface_Blit" title="Link to this definition"></a><br /></dt>
<dd><p>Blit the <em>srcrect</em> portion of Surface <em>srcobj</em> onto Surface <em>dstobj</em> at <em>srcobj</em></p>
<p>Argument <em>the_args</em> indicates the type of blit to perform:
Normal blit (<code class="docutils literal notranslate"><span class="pre">0</span></code>), <code class="docutils literal notranslate"><span class="pre">PYGAME_BLEND_ADD</span></code>, <code class="docutils literal notranslate"><span class="pre">PYGAME_BLEND_SUB</span></code>,
<code class="docutils literal notranslate"><span class="pre">PYGAME_BLEND_SUB</span></code>, <code class="docutils literal notranslate"><span class="pre">PYGAME_BLEND_MULT</span></code>, <code class="docutils literal notranslate"><span class="pre">PYGAME_BLEND_MIN</span></code>,
<code class="docutils literal notranslate"><span class="pre">PYGAME_BLEND_MAX</span></code>, <code class="docutils literal notranslate"><span class="pre">PYGAME_BLEND_RGBA_ADD</span></code>, <code class="docutils literal notranslate"><span class="pre">PYGAME_BLEND_RGBA_SUB</span></code>,
<code class="docutils literal notranslate"><span class="pre">PYGAME_BLEND_RGBA_MULT</span></code>, <code class="docutils literal notranslate"><span class="pre">PYGAME_BLEND_RGBA_MIN</span></code>,
<code class="docutils literal notranslate"><span class="pre">PYGAME_BLEND_RGBA_MAX</span></code>, <code class="docutils literal notranslate"><span class="pre">PYGAME_BLEND_ALPHA_SDL2</span></code> and <code class="docutils literal notranslate"><span class="pre">PYGAME_BLEND_PREMULTIPLIED</span></code>.
Argument <em>dstrect</em> is updated to the actual area on <em>dstobj</em> affected
by the blit.</p>
<p>The C version of the <a class="reference internal" href="../ref/surface.html#pygame.Surface.blit" title="pygame.Surface.blit"><code class="xref py py-meth docutils literal notranslate"><span class="pre">pygame.Surface.blit()</span></code></a> method.
Return <code class="docutils literal notranslate"><span class="pre">0</span></code> on success, <code class="docutils literal notranslate"><span class="pre">-1</span></code> or <code class="docutils literal notranslate"><span class="pre">-2`</span></code> on an exception.</p>
</dd></dl>
</section>
</section>
<br /><br />
<hr />
<a href="https://github.com/pygame/pygame/edit/main/docs/reST/c_api/surface.rst" rel="nofollow">Edit on GitHub</a>
<div class="clearer"></div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="surflock.html" title="API exported by pygame.surflock"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="rwobject.html" title="API exported by pygame.rwobject"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">pygame v2.6.0 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../c_api.html" accesskey="U">pygame C API</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Class Surface API exported by pygame.surface</a></li>
<script type="text/javascript" src="https://www.pygame.org/comment/jquery.plugin.docscomments.js"></script>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2000-2023, pygame developers.
</div>
</body>
</html>

View file

@ -0,0 +1,227 @@
<!DOCTYPE html>
<html lang="en" data-content_root="../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>API exported by pygame.surflock &#8212; pygame v2.6.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../_static/pygame.css?v=a854c6a8" />
<script src="../_static/documentation_options.js?v=ae39cb24"></script>
<script src="../_static/doctools.js?v=9a2dae69"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<link rel="icon" href="../_static/pygame.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="API exported by pygame.version" href="version.html" />
<link rel="prev" title="Class Surface API exported by pygame.surface" href="surface.html" />
</head><body>
<div class="document">
<div class="header">
<div class="flex-container">
<div class="logo">
<a href="https://www.pygame.org/">
<img src="../_static/pygame_tiny.png" alt="logo image"/>
</a>
<h5>pygame documentation</h5>
</div>
<div class="pagelinks">
<div class="top">
<a href="https://www.pygame.org/">Pygame Home</a> ||
<a href="../index.html">Help Contents</a> ||
<a href="../genindex.html">Reference Index</a>
<form action="../search.html" method="get" style="display:inline;float:right;">
<input name="q" value="" type="text">
<input value="search" type="submit">
</form>
</div>
<hr style="color:black;border-bottom:none;border-style: dotted;border-bottom-style:none;">
<p class="bottom"><strong>Most useful stuff</strong>:
<a href="../ref/color.html">Color</a> |
<a href="../ref/display.html">display</a> |
<a href="../ref/draw.html">draw</a> |
<a href="../ref/event.html">event</a> |
<a href="../ref/font.html">font</a> |
<a href="../ref/image.html">image</a> |
<a href="../ref/key.html">key</a> |
<a href="../ref/locals.html">locals</a> |
<a href="../ref/mixer.html">mixer</a> |
<a href="../ref/mouse.html">mouse</a> |
<a href="../ref/rect.html">Rect</a> |
<a href="../ref/surface.html">Surface</a> |
<a href="../ref/time.html">time</a> |
<a href="../ref/music.html">music</a> |
<a href="../ref/pygame.html">pygame</a>
</p>
<p class="bottom"><strong>Advanced stuff</strong>:
<a href="../ref/cursors.html">cursors</a> |
<a href="../ref/joystick.html">joystick</a> |
<a href="../ref/mask.html">mask</a> |
<a href="../ref/sprite.html">sprite</a> |
<a href="../ref/transform.html">transform</a> |
<a href="../ref/bufferproxy.html">BufferProxy</a> |
<a href="../ref/freetype.html">freetype</a> |
<a href="../ref/gfxdraw.html">gfxdraw</a> |
<a href="../ref/midi.html">midi</a> |
<a href="../ref/pixelarray.html">PixelArray</a> |
<a href="../ref/pixelcopy.html">pixelcopy</a> |
<a href="../ref/sndarray.html">sndarray</a> |
<a href="../ref/surfarray.html">surfarray</a> |
<a href="../ref/math.html">math</a>
</p>
<p class="bottom"><strong>Other</strong>:
<a href="../ref/camera.html">camera</a> |
<a href="../ref/sdl2_controller.html#module-pygame._sdl2.controller">controller</a> |
<a href="../ref/examples.html">examples</a> |
<a href="../ref/fastevent.html">fastevent</a> |
<a href="../ref/scrap.html">scrap</a> |
<a href="../ref/tests.html">tests</a> |
<a href="../ref/touch.html">touch</a> |
<a href="../ref/pygame.html#module-pygame.version">version</a>
</p>
</div>
</div>
</div>
<div class="documentwrapper">
<div class="body" role="main">
<section id="api-exported-by-pygame-surflock">
<section id="src-c-surflock-c">
<h2>src_c/surflock.c<a class="headerlink" href="#src-c-surflock-c" title="Link to this heading"></a></h2>
<p>This extension module implements SDL surface locking for the
<a class="tooltip reference internal" href="../ref/surface.html#pygame.Surface" title=""><code class="xref py py-class docutils literal notranslate"><span class="pre">pygame.Surface</span></code><span class="tooltip-content">pygame object for representing images</span></a> type.</p>
<p>Header file: src_c/include/pygame.h</p>
<dl class="c type">
<dt class="sig sig-object c" id="c.pgLifetimeLockObject">
<span class="k"><span class="pre">type</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgLifetimeLockObject</span></span></span><a class="headerlink" href="#c.pgLifetimeLockObject" title="Link to this definition"></a><br /></dt>
<dd><dl class="c member">
<dt class="sig sig-object c" id="c.pgLifetimeLockObject.surface">
<span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">surface</span></span></span><a class="headerlink" href="#c.pgLifetimeLockObject.surface" title="Link to this definition"></a><br /></dt>
<dd><p>An SDL locked pygame surface.</p>
</dd></dl>
<dl class="c member">
<dt class="sig sig-object c" id="c.pgLifetimeLockObject.lockobj">
<span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">lockobj</span></span></span><a class="headerlink" href="#c.pgLifetimeLockObject.lockobj" title="Link to this definition"></a><br /></dt>
<dd><p>The Python object which owns the lock on the surface.
This field does not own a reference to the object.</p>
</dd></dl>
<p>The lifetime lock type instance.
A lifetime lock pairs a locked pygame surface with
the Python object that locked the surface for modification.
The lock is removed automatically when the lifetime lock instance
is garbage collected.</p>
</dd></dl>
<dl class="c var">
<dt class="sig sig-object c" id="c.pgLifetimeLock_Type">
<span class="n"><span class="pre">PyTypeObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pgLifetimeLock_Type</span></span></span><a class="headerlink" href="#c.pgLifetimeLock_Type" title="Link to this definition"></a><br /></dt>
<dd><p>The pygame internal surflock lifetime lock object type.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgLifetimeLock_Check">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgLifetimeLock_Check</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">x</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgLifetimeLock_Check" title="Link to this definition"></a><br /></dt>
<dd><p>Return true if Python object <em>x</em> is a <a class="reference internal" href="#c.pgLifetimeLock_Type" title="pgLifetimeLock_Type"><code class="xref c c-data docutils literal notranslate"><span class="pre">pgLifetimeLock_Type</span></code></a> instance,
false otherwise.
This will return false on <a class="reference internal" href="#c.pgLifetimeLock_Type" title="pgLifetimeLock_Type"><code class="xref c c-data docutils literal notranslate"><span class="pre">pgLifetimeLock_Type</span></code></a> subclass instances as well.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgSurface_Prep">
<span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgSurface_Prep</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="surface.html#c.pgSurfaceObject" title="pgSurfaceObject"><span class="n"><span class="pre">pgSurfaceObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">surfobj</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgSurface_Prep" title="Link to this definition"></a><br /></dt>
<dd><p>If <em>surfobj</em> is a subsurface, then lock the parent surface with <em>surfobj</em>
the owner of the lock.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgSurface_Unprep">
<span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgSurface_Unprep</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="surface.html#c.pgSurfaceObject" title="pgSurfaceObject"><span class="n"><span class="pre">pgSurfaceObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">surfobj</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgSurface_Unprep" title="Link to this definition"></a><br /></dt>
<dd><p>If <em>surfobj</em> is a subsurface, then release its lock on the parent surface.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgSurface_Lock">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgSurface_Lock</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="surface.html#c.pgSurfaceObject" title="pgSurfaceObject"><span class="n"><span class="pre">pgSurfaceObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">surfobj</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgSurface_Lock" title="Link to this definition"></a><br /></dt>
<dd><p>Lock pygame surface <em>surfobj</em>, with <em>surfobj</em> owning its own lock.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgSurface_LockBy">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgSurface_LockBy</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="surface.html#c.pgSurfaceObject" title="pgSurfaceObject"><span class="n"><span class="pre">pgSurfaceObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">surfobj</span></span>, <span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">lockobj</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgSurface_LockBy" title="Link to this definition"></a><br /></dt>
<dd><p>Lock pygame surface <em>surfobj</em> with Python object <em>lockobj</em> the owning
the lock.</p>
<p>The surface will keep a weak reference to object <em>lockobj</em>,
and eventually remove the lock on itself if <em>lockobj</em> is garbage collected.
However, it is best if <em>lockobj</em> also keep a reference to the locked surface
and call to <a class="reference internal" href="#c.pgSurface_UnLockBy" title="pgSurface_UnLockBy"><code class="xref c c-func docutils literal notranslate"><span class="pre">pgSurface_UnLockBy()</span></code></a> when finished with the surface.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgSurface_UnLock">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgSurface_UnLock</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="surface.html#c.pgSurfaceObject" title="pgSurfaceObject"><span class="n"><span class="pre">pgSurfaceObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">surfobj</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgSurface_UnLock" title="Link to this definition"></a><br /></dt>
<dd><p>Remove the pygame surface <em>surfobj</em> object's lock on itself.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgSurface_UnLockBy">
<span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pgSurface_UnLockBy</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="surface.html#c.pgSurfaceObject" title="pgSurfaceObject"><span class="n"><span class="pre">pgSurfaceObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">surfobj</span></span>, <span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">lockobj</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgSurface_UnLockBy" title="Link to this definition"></a><br /></dt>
<dd><p>Remove the lock on pygame surface <em>surfobj</em> owned by Python object <em>lockobj</em>.</p>
</dd></dl>
<dl class="c function">
<dt class="sig sig-object c" id="c.pgSurface_LockLifetime">
<span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">pgSurface_LockLifetime</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">surfobj</span></span>, <span class="n"><span class="pre">PyObject</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">lockobj</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.pgSurface_LockLifetime" title="Link to this definition"></a><br /></dt>
<dd><p>Lock pygame surface <em>surfobj</em> for Python object <em>lockobj</em> and return a
new <a class="reference internal" href="#c.pgLifetimeLock_Type" title="pgLifetimeLock_Type"><code class="xref c c-data docutils literal notranslate"><span class="pre">pgLifetimeLock_Type</span></code></a> instance for the lock.</p>
<p>This function is not called anywhere within pygame.
It and pgLifetimeLock_Type are candidates for removal.</p>
</dd></dl>
</section>
</section>
<br /><br />
<hr />
<a href="https://github.com/pygame/pygame/edit/main/docs/reST/c_api/surflock.rst" rel="nofollow">Edit on GitHub</a>
<div class="clearer"></div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="version.html" title="API exported by pygame.version"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="surface.html" title="Class Surface API exported by pygame.surface"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">pygame v2.6.0 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../c_api.html" accesskey="U">pygame C API</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">API exported by pygame.surflock</a></li>
<script type="text/javascript" src="https://www.pygame.org/comment/jquery.plugin.docscomments.js"></script>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2000-2023, pygame developers.
</div>
</body>
</html>

View file

@ -0,0 +1,169 @@
<!DOCTYPE html>
<html lang="en" data-content_root="../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>API exported by pygame.version &#8212; pygame v2.6.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../_static/pygame.css?v=a854c6a8" />
<script src="../_static/documentation_options.js?v=ae39cb24"></script>
<script src="../_static/doctools.js?v=9a2dae69"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<link rel="icon" href="../_static/pygame.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="File Path Function Arguments" href="../filepaths.html" />
<link rel="prev" title="API exported by pygame.surflock" href="surflock.html" />
</head><body>
<div class="document">
<div class="header">
<div class="flex-container">
<div class="logo">
<a href="https://www.pygame.org/">
<img src="../_static/pygame_tiny.png" alt="logo image"/>
</a>
<h5>pygame documentation</h5>
</div>
<div class="pagelinks">
<div class="top">
<a href="https://www.pygame.org/">Pygame Home</a> ||
<a href="../index.html">Help Contents</a> ||
<a href="../genindex.html">Reference Index</a>
<form action="../search.html" method="get" style="display:inline;float:right;">
<input name="q" value="" type="text">
<input value="search" type="submit">
</form>
</div>
<hr style="color:black;border-bottom:none;border-style: dotted;border-bottom-style:none;">
<p class="bottom"><strong>Most useful stuff</strong>:
<a href="../ref/color.html">Color</a> |
<a href="../ref/display.html">display</a> |
<a href="../ref/draw.html">draw</a> |
<a href="../ref/event.html">event</a> |
<a href="../ref/font.html">font</a> |
<a href="../ref/image.html">image</a> |
<a href="../ref/key.html">key</a> |
<a href="../ref/locals.html">locals</a> |
<a href="../ref/mixer.html">mixer</a> |
<a href="../ref/mouse.html">mouse</a> |
<a href="../ref/rect.html">Rect</a> |
<a href="../ref/surface.html">Surface</a> |
<a href="../ref/time.html">time</a> |
<a href="../ref/music.html">music</a> |
<a href="../ref/pygame.html">pygame</a>
</p>
<p class="bottom"><strong>Advanced stuff</strong>:
<a href="../ref/cursors.html">cursors</a> |
<a href="../ref/joystick.html">joystick</a> |
<a href="../ref/mask.html">mask</a> |
<a href="../ref/sprite.html">sprite</a> |
<a href="../ref/transform.html">transform</a> |
<a href="../ref/bufferproxy.html">BufferProxy</a> |
<a href="../ref/freetype.html">freetype</a> |
<a href="../ref/gfxdraw.html">gfxdraw</a> |
<a href="../ref/midi.html">midi</a> |
<a href="../ref/pixelarray.html">PixelArray</a> |
<a href="../ref/pixelcopy.html">pixelcopy</a> |
<a href="../ref/sndarray.html">sndarray</a> |
<a href="../ref/surfarray.html">surfarray</a> |
<a href="../ref/math.html">math</a>
</p>
<p class="bottom"><strong>Other</strong>:
<a href="../ref/camera.html">camera</a> |
<a href="../ref/sdl2_controller.html#module-pygame._sdl2.controller">controller</a> |
<a href="../ref/examples.html">examples</a> |
<a href="../ref/fastevent.html">fastevent</a> |
<a href="../ref/scrap.html">scrap</a> |
<a href="../ref/tests.html">tests</a> |
<a href="../ref/touch.html">touch</a> |
<a href="../ref/pygame.html#module-pygame.version">version</a>
</p>
</div>
</div>
</div>
<div class="documentwrapper">
<div class="body" role="main">
<section id="api-exported-by-pygame-version">
<section id="src-py-version-py">
<h2>src_py/version.py<a class="headerlink" href="#src-py-version-py" title="Link to this heading"></a></h2>
<p>Header file: src_c/include/pygame.h</p>
<p>Version information can be retrieved at compile-time using these macros.</p>
<div class="versionadded">
<p><span class="versionmodified added">New in pygame 1.9.5.</span></p>
</div>
<dl class="c macro">
<dt class="sig sig-object c" id="c.PG_MAJOR_VERSION">
<span class="sig-name descname"><span class="n"><span class="pre">PG_MAJOR_VERSION</span></span></span><a class="headerlink" href="#c.PG_MAJOR_VERSION" title="Link to this definition"></a><br /></dt>
<dd></dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.PG_MINOR_VERSION">
<span class="sig-name descname"><span class="n"><span class="pre">PG_MINOR_VERSION</span></span></span><a class="headerlink" href="#c.PG_MINOR_VERSION" title="Link to this definition"></a><br /></dt>
<dd></dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.PG_PATCH_VERSION">
<span class="sig-name descname"><span class="n"><span class="pre">PG_PATCH_VERSION</span></span></span><a class="headerlink" href="#c.PG_PATCH_VERSION" title="Link to this definition"></a><br /></dt>
<dd></dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.PG_VERSIONNUM">
<span class="sig-name descname"><span class="n"><span class="pre">PG_VERSIONNUM</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">MAJOR</span></span>, <span class="n"><span class="pre">MINOR</span></span>, <span class="n"><span class="pre">PATCH</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PG_VERSIONNUM" title="Link to this definition"></a><br /></dt>
<dd><p>Returns an integer representing the given version.</p>
</dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.PG_VERSION_ATLEAST">
<span class="sig-name descname"><span class="n"><span class="pre">PG_VERSION_ATLEAST</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">MAJOR</span></span>, <span class="n"><span class="pre">MINOR</span></span>, <span class="n"><span class="pre">PATCH</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PG_VERSION_ATLEAST" title="Link to this definition"></a><br /></dt>
<dd><p>Returns true if the current version is at least equal
to the specified version.</p>
</dd></dl>
</section>
</section>
<br /><br />
<hr />
<a href="https://github.com/pygame/pygame/edit/main/docs/reST/c_api/version.rst" rel="nofollow">Edit on GitHub</a>
<div class="clearer"></div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="../filepaths.html" title="File Path Function Arguments"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="surflock.html" title="API exported by pygame.surflock"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">pygame v2.6.0 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../c_api.html" accesskey="U">pygame C API</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">API exported by pygame.version</a></li>
<script type="text/javascript" src="https://www.pygame.org/comment/jquery.plugin.docscomments.js"></script>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2000-2023, pygame developers.
</div>
</body>
</html>