⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gdk-properties-and-atoms.html

📁 最新gtk中文资料集
💻 HTML
📖 第 1 页 / 共 5 页
字号:
                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gulong">gulong</a> length,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> pdelete,                                                         <a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom">GdkAtom</a> *actual_property_type,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> *actual_format,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> *actual_length,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guchar">guchar</a> **data);</pre><p>Retrieves a portion of the contents of a property. If theproperty does not exist, then the function returns <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>,and <a class="link" href="gdk-Properties-and-Atoms.html#GDK-NONE:CAPS"><code class="literal">GDK_NONE</code></a> will be stored in <em class="parameter"><code>actual_property_type</code></em>.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>The <code class="function">XGetWindowProperty()</code> function that <a class="link" href="gdk-Properties-and-Atoms.html#gdk-property-get"><code class="function">gdk_property_get()</code></a>uses has a very confusing and complicated set of semantics.  Unfortunately, <a class="link" href="gdk-Properties-and-Atoms.html#gdk-property-get"><code class="function">gdk_property_get()</code></a> makes the situationworse instead of better (the semantics should be consideredundefined), and also prints warnings to stderr in cases where itshould return a useful error to the program. You are advised to use <code class="function">XGetWindowProperty()</code> directly until a replacement function for <a class="link" href="gdk-Properties-and-Atoms.html#gdk-property-get"><code class="function">gdk_property_get()</code></a>is provided. </p></div><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>window</code></em>&#160;:</span></p></td><td>a <a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>property</code></em>&#160;:</span></p></td><td>the property to retrieve.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>type</code></em>&#160;:</span></p></td><td>the desired property type, or <a class="link" href="gdk-Properties-and-Atoms.html#GDK-NONE:CAPS"><code class="literal">GDK_NONE</code></a>, if any type of data       is acceptable. If this does not match the actual       type, then <em class="parameter"><code>actual_format</code></em> and <em class="parameter"><code>actual_length</code></em> will       be filled in, a warning will be printed to stderr       and no data will be returned.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>offset</code></em>&#160;:</span></p></td><td>the offset into the property at which to begin         retrieving data, in 4 byte units.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>length</code></em>&#160;:</span></p></td><td>the length of the data to retrieve in bytes.  Data is         considered to be retrieved in 4 byte chunks, so <em class="parameter"><code>length</code></em>          will be rounded up to the next highest 4 byte boundary          (so be careful not to pass a value that might overflow           when rounded up).</td></tr><tr><td><p><span class="term"><em class="parameter"><code>pdelete</code></em>&#160;:</span></p></td><td>if <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, delete the property after retrieving the          data.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>actual_property_type</code></em>&#160;:</span></p></td><td>location to store the actual type of                        the property.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>actual_format</code></em>&#160;:</span></p></td><td>location to store the actual return format of the                data; either 8, 16 or 32 bits.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>actual_length</code></em>&#160;:</span></p></td><td>location to store the length of the retrieved data, in                bytes.  Data returned in the 32 bit format is stored                in a long variable, so the actual number of 32 bit                elements should be be calculated via                <em class="parameter"><code>actual_length</code></em>/sizeof(glong) to ensure portability to                64 bit systems.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td><td>location to store a pointer to the data. The retrieved       data should be freed with <ahref="/usr/share/gtk-doc/html/glib/glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a> when you are finished       using it.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td><ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if data was sucessfully received and stored          in <em class="parameter"><code>data</code></em>, otherwise <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3275862"></a><h3><a name="gdk-property-change"></a>gdk_property_change ()</h3><a class="indexterm" name="id3275875"></a><pre class="programlisting">void                gdk_property_change                 (<a class="link" href="gdk-Windows.html#GdkWindow">GdkWindow</a> *window,                                                         <a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom">GdkAtom</a> property,                                                         <a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom">GdkAtom</a> type,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> format,                                                         <a class="link" href="gdk-Properties-and-Atoms.html#GdkPropMode">GdkPropMode</a> mode,                                                         const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guchar">guchar</a> *data,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> nelements);</pre><p>Changes the contents of a property on a window.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>window</code></em>&#160;:</span></p></td><td>a <a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>property</code></em>&#160;:</span></p></td><td>the property to change.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>type</code></em>&#160;:</span></p></td><td>the new type for the property. If <em class="parameter"><code>mode</code></em> is       <a class="link" href="gdk-Properties-and-Atoms.html#GDK-PROP-MODE-PREPEND:CAPS"><code class="literal">GDK_PROP_MODE_PREPEND</code></a> or <a class="link" href="gdk-Properties-and-Atoms.html#GDK-PROP-MODE-APPEND:CAPS"><code class="literal">GDK_PROP_MODE_APPEND</code></a>, then this        must match the existing type or an error will occur.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>format</code></em>&#160;:</span></p></td><td>the new format for the property. If <em class="parameter"><code>mode</code></em> is         <a class="link" href="gdk-Properties-and-Atoms.html#GDK-PROP-MODE-PREPEND:CAPS"><code class="literal">GDK_PROP_MODE_PREPEND</code></a> or <a class="link" href="gdk-Properties-and-Atoms.html#GDK-PROP-MODE-APPEND:CAPS"><code class="literal">GDK_PROP_MODE_APPEND</code></a>, then this          must match the existing format or an error will occur.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>mode</code></em>&#160;:</span></p></td><td>a value describing how the new data is to be combined       with the current data.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td><td>the data       (a <code class="literal">guchar *</code>        <code class="literal">gushort *</code>, or         <code class="literal">gulong *</code>, depending on <em class="parameter"><code>format</code></em>), cast to a         <code class="literal">guchar *</code>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>nelements</code></em>&#160;:</span></p></td><td>the number of elements of size determined by the format,            contained in <em class="parameter"><code>data</code></em>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3276161"></a><h3><a name="GdkPropMode"></a>enum GdkPropMode</h3><a class="indexterm" name="id3276174"></a><pre class="programlisting">typedef enum{  GDK_PROP_MODE_REPLACE,  GDK_PROP_MODE_PREPEND,  GDK_PROP_MODE_APPEND} GdkPropMode;</pre><p>Describes how existing data is combined with new data whenusing <a class="link" href="gdk-Properties-and-Atoms.html#gdk-property-change"><code class="function">gdk_property_change()</code></a>.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><a name="GDK-PROP-MODE-REPLACE:CAPS"></a><code class="literal">GDK_PROP_MODE_REPLACE</code></span></p></td><td>the new data replaces the existing data.</td></tr><tr><td><p><span class="term"><a name="GDK-PROP-MODE-PREPEND:CAPS"></a><code class="literal">GDK_PROP_MODE_PREPEND</code></span></p></td><td>the new data is prepended to the existing data.</td></tr><tr><td><p><span class="term"><a name="GDK-PROP-MODE-APPEND:CAPS"></a><code class="literal">GDK_PROP_MODE_APPEND</code></span></p></td><td>the new data is appended to the existing data.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3276275"></a><h3><a name="gdk-property-delete"></a>gdk_property_delete ()</h3><a class="indexterm" name="id3276289"></a><pre class="programlisting">void                gdk_property_delete                 (<a class="link" href="gdk-Windows.html#GdkWindow">GdkWindow</a> *window,                                                         <a class="link" href="gdk-Properties-and-Atoms.html#GdkAtom">GdkAtom</a> property);</pre><p>Deletes a property from a window.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>window</code></em>&#160;:</span></p></td><td>a <a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>property</code></em>&#160;:</span></p></td><td>the property to delete.</td></tr></tbody></table></div></div></div><div class="refsect1" lang="en"><a name="id3276366"></a><div class="refsect2" lang="en"><a name="id3276367"></a></div><hr><div class="refsect2" lang="en"><a name="id3276368"></a></div></div></div></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -