gtk3/docs/reference/gtk/html/gtk3-Stock-Items.html
2020-02-29 14:17:40 +00:00

860 lines
32 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Stock Items: GTK+ 3 Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="GTK+ 3 Reference Manual">
<link rel="up" href="DeprecatedObjects.html" title="Deprecated">
<link rel="prev" href="GtkMisc.html" title="GtkMisc">
<link rel="next" href="gtk3-Themeable-Stock-Images.html" title="Themeable Stock Images">
<meta name="generator" content="GTK-Doc V1.32.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
<a href="#gtk3-Stock-Items.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="DeprecatedObjects.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="GtkMisc.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="gtk3-Themeable-Stock-Images.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="gtk3-Stock-Items"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gtk3-Stock-Items.top_of_page"></a>Stock Items</span></h2>
<p>Stock Items — Prebuilt common menu/toolbar items and corresponding
icons</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="gtk3-Stock-Items.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Stock-Items.html#gtk-stock-add" title="gtk_stock_add ()">gtk_stock_add</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Stock-Items.html#gtk-stock-add-static" title="gtk_stock_add_static ()">gtk_stock_add_static</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GtkStockItem</span> *
</td>
<td class="function_name">
<a class="link" href="gtk3-Stock-Items.html#gtk-stock-item-copy" title="gtk_stock_item_copy ()">gtk_stock_item_copy</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Stock-Items.html#gtk-stock-item-free" title="gtk_stock_item_free ()">gtk_stock_item_free</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GSList</span> *
</td>
<td class="function_name">
<a class="link" href="gtk3-Stock-Items.html#gtk-stock-list-ids" title="gtk_stock_list_ids ()">gtk_stock_list_ids</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Stock-Items.html#gtk-stock-lookup" title="gtk_stock_lookup ()">gtk_stock_lookup</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Stock-Items.html#gtk-stock-set-translate-func" title="gtk_stock_set_translate_func ()">gtk_stock_set_translate_func</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gtk3-Stock-Items.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="other_proto_type">
<col class="other_proto_name">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name">GtkStockItem</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_ABOUT</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_ADD</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_APPLY</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_BOLD</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_CANCEL</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_CAPS_LOCK_WARNING</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_CDROM</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_CLEAR</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_CLOSE</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_COLOR_PICKER</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_CONVERT</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_CONNECT</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_COPY</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_CUT</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_DELETE</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_DIALOG_AUTHENTICATION</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_DIALOG_ERROR</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_DIALOG_INFO</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_DIALOG_QUESTION</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_DIALOG_WARNING</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_DIRECTORY</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_DISCARD</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_DISCONNECT</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_DND</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_DND_MULTIPLE</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_EDIT</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_EXECUTE</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_FILE</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_FIND</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_FIND_AND_REPLACE</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_FLOPPY</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_FULLSCREEN</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_GOTO_BOTTOM</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_GOTO_FIRST</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_GOTO_LAST</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_GOTO_TOP</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_GO_BACK</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_GO_DOWN</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_GO_FORWARD</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_GO_UP</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_HARDDISK</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_HELP</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_HOME</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_INDENT</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_INDEX</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_INFO</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_ITALIC</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_JUMP_TO</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_JUSTIFY_CENTER</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_JUSTIFY_FILL</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_JUSTIFY_LEFT</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_JUSTIFY_RIGHT</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_LEAVE_FULLSCREEN</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_MEDIA_FORWARD</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_MEDIA_NEXT</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_MEDIA_PAUSE</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_MEDIA_PLAY</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_MEDIA_PREVIOUS</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_MEDIA_RECORD</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_MEDIA_REWIND</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_MEDIA_STOP</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_MISSING_IMAGE</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_NETWORK</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_NEW</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_NO</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_OK</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_OPEN</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_ORIENTATION_LANDSCAPE</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_ORIENTATION_PORTRAIT</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_ORIENTATION_REVERSE_LANDSCAPE</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_ORIENTATION_REVERSE_PORTRAIT</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_PAGE_SETUP</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_PASTE</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_PREFERENCES</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_PRINT</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_PRINT_ERROR</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_PRINT_PAUSED</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_PRINT_PREVIEW</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_PRINT_REPORT</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_PRINT_WARNING</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_PROPERTIES</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_QUIT</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_REDO</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_REFRESH</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_REMOVE</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_REVERT_TO_SAVED</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_SAVE</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_SAVE_AS</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_SELECT_ALL</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_SELECT_COLOR</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_SELECT_FONT</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_SORT_ASCENDING</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_SORT_DESCENDING</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_SPELL_CHECK</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_STOP</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_STRIKETHROUGH</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_UNDELETE</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_UNDERLINE</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_UNDO</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_UNINDENT</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_YES</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_ZOOM_100</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_ZOOM_FIT</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_ZOOM_IN</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GTK_STOCK_ZOOM_OUT</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gtk3-Stock-Items.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;gtk/gtk.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="gtk3-Stock-Items.description"></a><h2>Description</h2>
<div class="blockquote"><blockquote class="blockquote"><p>Since GTK+ 3.10, stock items are deprecated. You should instead set
up whatever labels and/or icons you need using normal widget API,
rather than relying on GTK+ providing ready-made combinations of these.</p></blockquote></div>
<p>Stock items represent commonly-used menu or toolbar items such as
“Open” or “Exit”. Each stock item is identified by a stock ID;
stock IDs are just strings, but macros such as <span class="type">GTK_STOCK_OPEN</span> are
provided to avoid typing mistakes in the strings.
Applications can register their own stock items in addition to those
built-in to GTK+.</p>
<p>Each stock ID can be associated with a <span class="type">GtkStockItem</span>, which contains
the user-visible label, keyboard accelerator, and translation domain
of the menu or toolbar item; and/or with an icon stored in a
<a class="link" href="gtk3-Themeable-Stock-Images.html#GtkIconFactory"><span class="type">GtkIconFactory</span></a>. The connection between a
<span class="type">GtkStockItem</span> and stock icons is purely conventional (by virtue of
using the same stock ID); its possible to register a stock item but
no icon, and vice versa. Stock icons may have a RTL variant which gets
used for right-to-left locales.</p>
</div>
<div class="refsect1">
<a name="gtk3-Stock-Items.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gtk-stock-add"></a><h3>gtk_stock_add ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_stock_add (<em class="parameter"><code>const <span class="type">GtkStockItem</span> *items</code></em>,
<em class="parameter"><code><span class="type">guint</span> n_items</code></em>);</pre>
<div class="warning"><p><code class="literal">gtk_stock_add</code> has been deprecated since version 3.10 and should not be used in newly-written code.</p></div>
<p>Registers each of the stock items in <em class="parameter"><code>items</code></em>
. If an item already
exists with the same stock ID as one of the <em class="parameter"><code>items</code></em>
, the old item
gets replaced. The stock items are copied, so GTK+ does not hold
any pointer into <em class="parameter"><code>items</code></em>
and <em class="parameter"><code>items</code></em>
can be freed. Use
<a class="link" href="gtk3-Stock-Items.html#gtk-stock-add-static" title="gtk_stock_add_static ()"><code class="function">gtk_stock_add_static()</code></a> if <em class="parameter"><code>items</code></em>
is persistent and GTK+ need not
copy the array.</p>
<div class="refsect3">
<a name="gtk-stock-add.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>items</p></td>
<td class="parameter_description"><p>a <span class="type">GtkStockItem</span> or array of items. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=n_items]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>n_items</p></td>
<td class="parameter_description"><p>number of <span class="type">GtkStockItem</span> in <em class="parameter"><code>items</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-stock-add-static"></a><h3>gtk_stock_add_static ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_stock_add_static (<em class="parameter"><code>const <span class="type">GtkStockItem</span> *items</code></em>,
<em class="parameter"><code><span class="type">guint</span> n_items</code></em>);</pre>
<div class="warning"><p><code class="literal">gtk_stock_add_static</code> has been deprecated since version 3.10 and should not be used in newly-written code.</p></div>
<p>Same as <a class="link" href="gtk3-Stock-Items.html#gtk-stock-add" title="gtk_stock_add ()"><code class="function">gtk_stock_add()</code></a>, but doesnt copy <em class="parameter"><code>items</code></em>
, so
<em class="parameter"><code>items</code></em>
must persist until application exit.</p>
<div class="refsect3">
<a name="gtk-stock-add-static.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>items</p></td>
<td class="parameter_description"><p>a <span class="type">GtkStockItem</span> or array of <span class="type">GtkStockItem</span>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=n_items]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>n_items</p></td>
<td class="parameter_description"><p>number of items</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-stock-item-copy"></a><h3>gtk_stock_item_copy ()</h3>
<pre class="programlisting"><span class="returnvalue">GtkStockItem</span> *
gtk_stock_item_copy (<em class="parameter"><code>const <span class="type">GtkStockItem</span> *item</code></em>);</pre>
<div class="warning"><p><code class="literal">gtk_stock_item_copy</code> has been deprecated since version 3.10 and should not be used in newly-written code.</p></div>
<p>Copies a stock item, mostly useful for language bindings and not in applications.</p>
<p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-stock-item-copy.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>item</p></td>
<td class="parameter_description"><p>a <span class="type">GtkStockItem</span></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-stock-item-copy.returns"></a><h4>Returns</h4>
<p> a new <span class="type">GtkStockItem</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-stock-item-free"></a><h3>gtk_stock_item_free ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_stock_item_free (<em class="parameter"><code><span class="type">GtkStockItem</span> *item</code></em>);</pre>
<div class="warning"><p><code class="literal">gtk_stock_item_free</code> has been deprecated since version 3.10 and should not be used in newly-written code.</p></div>
<p>Frees a stock item allocated on the heap, such as one returned by
<a class="link" href="gtk3-Stock-Items.html#gtk-stock-item-copy" title="gtk_stock_item_copy ()"><code class="function">gtk_stock_item_copy()</code></a>. Also frees the fields inside the stock item,
if they are not <code class="literal">NULL</code>.</p>
<div class="refsect3">
<a name="gtk-stock-item-free.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>item</p></td>
<td class="parameter_description"><p>a <span class="type">GtkStockItem</span></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-stock-list-ids"></a><h3>gtk_stock_list_ids ()</h3>
<pre class="programlisting"><span class="returnvalue">GSList</span> *
gtk_stock_list_ids (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<div class="warning"><p><code class="literal">gtk_stock_list_ids</code> has been deprecated since version 3.10 and should not be used in newly-written code.</p></div>
<p>Retrieves a list of all known stock IDs added to a <a class="link" href="gtk3-Themeable-Stock-Images.html#GtkIconFactory"><span class="type">GtkIconFactory</span></a>
or registered with <a class="link" href="gtk3-Stock-Items.html#gtk-stock-add" title="gtk_stock_add ()"><code class="function">gtk_stock_add()</code></a>. The list must be freed with <code class="function">g_slist_free()</code>,
and each string in the list must be freed with <code class="function">g_free()</code>.</p>
<div class="refsect3">
<a name="gtk-stock-list-ids.returns"></a><h4>Returns</h4>
<p>a list of known stock IDs. </p>
<p><span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> utf8][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-stock-lookup"></a><h3>gtk_stock_lookup ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gtk_stock_lookup (<em class="parameter"><code>const <span class="type">gchar</span> *stock_id</code></em>,
<em class="parameter"><code><span class="type">GtkStockItem</span> *item</code></em>);</pre>
<div class="warning"><p><code class="literal">gtk_stock_lookup</code> has been deprecated since version 3.10 and should not be used in newly-written code.</p></div>
<p>Fills <em class="parameter"><code>item</code></em>
with the registered values for <em class="parameter"><code>stock_id</code></em>
, returning <code class="literal">TRUE</code>
if <em class="parameter"><code>stock_id</code></em>
was known.</p>
<div class="refsect3">
<a name="gtk-stock-lookup.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>stock_id</p></td>
<td class="parameter_description"><p>a stock item name</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>item</p></td>
<td class="parameter_description"><p>stock item to initialize with values. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-stock-lookup.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if <em class="parameter"><code>item</code></em>
was initialized</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-stock-set-translate-func"></a><h3>gtk_stock_set_translate_func ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_stock_set_translate_func (<em class="parameter"><code>const <span class="type">gchar</span> *domain</code></em>,
<em class="parameter"><code><a class="link" href="GtkActionGroup.html#GtkTranslateFunc" title="GtkTranslateFunc ()"><span class="type">GtkTranslateFunc</span></a> func</code></em>,
<em class="parameter"><code><span class="type">gpointer</span> data</code></em>,
<em class="parameter"><code><span class="type">GDestroyNotify</span> notify</code></em>);</pre>
<div class="warning"><p><code class="literal">gtk_stock_set_translate_func</code> has been deprecated since version 3.10 and should not be used in newly-written code.</p></div>
<p>Sets a function to be used for translating the <em class="parameter"><code>label</code></em>
of
a stock item.</p>
<p>If no function is registered for a translation domain,
<code class="function">g_dgettext()</code> is used.</p>
<p>The function is used for all stock items whose
<em class="parameter"><code>translation_domain</code></em>
matches <em class="parameter"><code>domain</code></em>
. Note that it is possible
to use strings different from the actual gettext translation domain
of your application for this, as long as your <a class="link" href="GtkActionGroup.html#GtkTranslateFunc" title="GtkTranslateFunc ()"><span class="type">GtkTranslateFunc</span></a> uses
the correct domain when calling <code class="function">dgettext()</code>. This can be useful, e.g.
when dealing with message contexts:</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="n">GtkStockItem</span> <span class="n">items</span><span class="p">[]</span> <span class="o">=</span> <span class="p">{</span>
<span class="p">{</span> <span class="n">MY_ITEM1</span><span class="p">,</span> <span class="n">NC_</span><span class="p">(</span><span class="s">&quot;odd items&quot;</span><span class="p">,</span> <span class="s">&quot;Item 1&quot;</span><span class="p">),</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="s">&quot;odd-item-domain&quot;</span> <span class="p">},</span>
<span class="p">{</span> <span class="n">MY_ITEM2</span><span class="p">,</span> <span class="n">NC_</span><span class="p">(</span><span class="s">&quot;even items&quot;</span><span class="p">,</span> <span class="s">&quot;Item 2&quot;</span><span class="p">),</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="s">&quot;even-item-domain&quot;</span> <span class="p">},</span>
<span class="p">};</span>
<span class="n">gchar</span> <span class="o">*</span>
<span class="nf">my_translate_func</span> <span class="p">(</span><span class="k">const</span> <span class="n">gchar</span> <span class="o">*</span><span class="n">msgid</span><span class="p">,</span>
<span class="n">gpointer</span> <span class="n">data</span><span class="p">)</span>
<span class="p">{</span>
<span class="n">gchar</span> <span class="o">*</span><span class="n">msgctxt</span> <span class="o">=</span> <span class="n">data</span><span class="p">;</span>
<span class="k">return</span> <span class="p">(</span><span class="n">gchar</span><span class="o">*</span><span class="p">)</span><span class="n">g_dpgettext2</span> <span class="p">(</span><span class="n">GETTEXT_PACKAGE</span><span class="p">,</span> <span class="n">msgctxt</span><span class="p">,</span> <span class="n">msgid</span><span class="p">);</span>
<span class="p">}</span>
<span class="p">...</span>
<span class="n">gtk_stock_add</span> <span class="p">(</span><span class="n">items</span><span class="p">,</span> <span class="n">G_N_ELEMENTS</span> <span class="p">(</span><span class="n">items</span><span class="p">));</span>
<span class="n">gtk_stock_set_translate_func</span> <span class="p">(</span><span class="s">&quot;odd-item-domain&quot;</span><span class="p">,</span> <span class="n">my_translate_func</span><span class="p">,</span> <span class="s">&quot;odd items&quot;</span><span class="p">);</span>
<span class="n">gtk_stock_set_translate_func</span> <span class="p">(</span><span class="s">&quot;even-item-domain&quot;</span><span class="p">,</span> <span class="n">my_translate_func</span><span class="p">,</span> <span class="s">&quot;even items&quot;</span><span class="p">);</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
<div class="refsect3">
<a name="gtk-stock-set-translate-func.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>domain</p></td>
<td class="parameter_description"><p>the translation domain for which <em class="parameter"><code>func</code></em>
shall be used</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>func</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkActionGroup.html#GtkTranslateFunc" title="GtkTranslateFunc ()"><span class="type">GtkTranslateFunc</span></a> </p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>data</p></td>
<td class="parameter_description"><p>data to pass to <em class="parameter"><code>func</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>notify</p></td>
<td class="parameter_description"><p>a <span class="type">GDestroyNotify</span> that is called when <em class="parameter"><code>data</code></em>
is
no longer needed</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 2.8</p>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.32.1</div>
</body>
</html>