~canonical-dx-team/ubuntu/maverick/gtk+2.0/menuproxy

« back to all changes in this revision

Viewing changes to docs/reference/gdk-pixbuf/xml/refcounting.xml

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-05-04 12:24:25 UTC
  • mfrom: (1.1.21 upstream)
  • Revision ID: james.westby@ubuntu.com-20070504122425-0m8midgzrp40y8w2
Tags: 2.10.12-1ubuntu1
* Sync with Debian
* New upstream version:
  Fixed bugs:
  - 379414 file chooser warnings when changing path in the entry
  - 418585 GtkFileChooserDefault sizing code is not DPI independent
  - 419568 Crash in search if start with special letter
  - 435062 build dies with icon cache validation
  - 379399 Segfault to call gtk_print_operation_run twice.
  - 387889 cups backend has problems when there are too many printers
  - 418531 invalid read to gtkicontheme.c gtk_icon_theme_lookup_icon...
  - 423916 crash in color scheme code
  - 424042 Segmentation fault while quickly pressing Alt+arrows
  - 415260 Protect against negative indices when setting values in G...
  - 419171 XGetVisualInfo() may not set nxvisuals
  - 128852 Gdk cursors don't look good on win32
  - 344657 Ctrl-H doesn't toggle "Show Hidden Files" setting
  - 345345 PrintOperation::paginate is not emitted for class handler
  - 347567 GtkPrintOperation::end-print is not emitted if it's cance...
  - 369112 gtk_ui_manager_add_ui should accept unnamed separator
  - 392015 Selected menu item invisible on Windows Vista
  - 399253 MS-Windows Theme Bottom Tab placement rendering glitches
  - 399425 gtk_input_dialog_fill_axes() adds child to gtkscrolledwin...
  - 403251 [patch] little memory leak in GtkPrintJob
  - 403267 [patch] memory leak in GtkPageSetupUnixDialog
  - 403470 MS-Windows Theme tab placement other than on top leaks a ...
  - 404506 Windows system fonts that have multi-byte font names cann...
  - 405089 Incorrect window placement for GtkEventBox private window
  - 405515 Minor leak in gtkfilesystemmodel.c
  - 405539 gdk_pixbuf_save() for PNG saver can return FALSE without ...
  - 415681 gdk_window_clear_area includes an extra line and column o...
  - 418219 GtkRecentChooser should apply filter before sorting and c...
  - 418403 Scroll to printer after selecting it from settings
  - 421985 _gtk_print_operation_platform_backend_launch_preview
  - 421990 gtk_print_job_get_surface
  - 421993 gtk_print_operation_init
  - 423064 Conditional jump or move depends on uninitialised value(s...
  - 423722 Fix printing header in gtk-demo
  - 424168 gtk_print_operation_run on async preview
  - 425655 Don't install gtk+-unix-print-2.0.pc on non-UNIX platforms
  - 425786 GDK segfaults if XineramaQueryScreens fails
  - 428665 Lpr Backend gets stuck in infinite loop during gtk_enumer...
  - 429902 GtkPrintOperation leaks cairo contextes
  - 431997 First delay of GdkPixbufAnimationIter is wrong
  - 433242 Inconsistent scroll arrow position calculations
  - 433972 Placing gtk.Expander inside a gtk.TextView() changes gtk....
  - 434261 _gtk_toolbar_elide_underscores incorrectly handles some s...
  - 383354 ctrl-L should make 'Location' entry disappear
  - 418673 gtk_recent_manager_add_item
  - 429732 gtk_accel_group_finalize accesses invalid memory
  - 435028 WM_CLIENT_LEADER is wrong on the leader_window
  - 431067 Background of the header window is not updated
  - 338843 add recent files support inside the ui manager
  - 148535 add drop shadow to menus, tooltips, etc. under Windows XP
* debian/control.in:
  - Conflicts on ubuntulooks (<= 0.9.11-1)
* debian/patches/15_default-fallback-icon-theme.patch:
  - patch from Debian, fallback on gnome icon theme

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<refentry id="gdk-pixbuf-refcounting">
 
2
<refmeta>
 
3
<refentrytitle role="top_of_page">Reference Counting and Memory Mangement</refentrytitle>
 
4
<manvolnum>3</manvolnum>
 
5
<refmiscinfo>GDK-PIXBUF Library</refmiscinfo>
 
6
</refmeta>
 
7
 
 
8
<refnamediv>
 
9
<refname>Reference Counting and Memory Mangement</refname>
 
10
<refpurpose>
 
11
Functions for reference counting and memory management on pixbufs.</refpurpose>
 
12
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
 
13
</refnamediv>
 
14
 
 
15
<refsynopsisdiv role="synopsis">
 
16
<title role="synopsis.title">Synopsis</title>
 
17
 
 
18
<synopsis>
 
19
 
 
20
#include &lt;gdk-pixbuf/gdk-pixbuf.h&gt;
 
21
 
 
22
 
 
23
<link linkend="GdkPixbuf">GdkPixbuf</link>*          <link linkend="gdk-pixbuf-ref">gdk_pixbuf_ref</link>                      (<link linkend="GdkPixbuf">GdkPixbuf</link> *pixbuf);
 
24
<link linkend="void">void</link>                <link linkend="gdk-pixbuf-unref">gdk_pixbuf_unref</link>                    (<link linkend="GdkPixbuf">GdkPixbuf</link> *pixbuf);
 
25
<link linkend="void">void</link>                (<link linkend="GdkPixbufDestroyNotify">*GdkPixbufDestroyNotify</link>)           (<link linkend="guchar">guchar</link> *pixels,
 
26
                                                         <link linkend="gpointer">gpointer</link> data);
 
27
</synopsis>
 
28
</refsynopsisdiv>
 
29
 
 
30
 
 
31
 
 
32
 
 
33
 
 
34
 
 
35
 
 
36
 
 
37
 
 
38
<refsect1 role="desc">
 
39
<title role="desc.title">Description</title>
 
40
  <para>
 
41
    <link linkend="GdkPixbuf"><type>GdkPixbuf</type></link> structures are reference counted.  This means that an
 
42
    application can share a single pixbuf among many parts of the
 
43
    code.  When a piece of the program needs to keep a pointer to a
 
44
    pixbuf, it should add a reference to it by calling <link linkend="g-object-ref"><function>g_object_ref()</function></link>.
 
45
    When it no longer needs the pixbuf, it should subtract a reference
 
46
    by calling <link linkend="g-object-unref"><function>g_object_unref()</function></link>.  The pixbuf will be destroyed when
 
47
    its reference count drops to zero.  Newly-created <link linkend="GdkPixbuf"><type>GdkPixbuf</type></link>
 
48
    structures start with a reference count of one.
 
49
  </para>
 
50
 
 
51
  <note>
 
52
    <para>
 
53
      As <link linkend="GdkPixbuf"><type>GdkPixbuf</type></link> is derived from <link linkend="GObject"><type>GObject</type></link> now, <link linkend="gdk-pixbuf-ref"><function>gdk_pixbuf_ref()</function></link> and
 
54
      <link linkend="gdk-pixbuf-unref"><function>gdk_pixbuf_unref()</function></link> are deprecated in favour of <link linkend="g-object-ref"><function>g_object_ref()</function></link>
 
55
      and <link linkend="g-object-unref"><function>g_object_unref()</function></link> resp.
 
56
    </para>
 
57
  </note>
 
58
 
 
59
  <para>
 
60
    <emphasis>Finalizing</emphasis> a pixbuf means to free its pixel
 
61
    data and to free the <link linkend="GdkPixbuf"><type>GdkPixbuf</type></link> structure itself.  Most of the
 
62
    library functions that create <link linkend="GdkPixbuf"><type>GdkPixbuf</type></link> structures create the
 
63
    pixel data by themselves and define the way it should be freed;
 
64
    you do not need to worry about those.  The only function that lets
 
65
    you specify how to free the pixel data is
 
66
    <link linkend="gdk-pixbuf-new-from-data"><function>gdk_pixbuf_new_from_data()</function></link>.  Since you pass it a pre-allocated
 
67
    pixel buffer, you must also specify a way to free that data.  This
 
68
    is done with a function of type <link linkend="GdkPixbufDestroyNotify"><type>GdkPixbufDestroyNotify</type></link>.  When a
 
69
    pixbuf created with <link linkend="gdk-pixbuf-new-from-data"><function>gdk_pixbuf_new_from_data()</function></link> is finalized, your
 
70
    destroy notification function will be called, and it is its
 
71
    responsibility to free the pixel array.
 
72
  </para>
 
73
</refsect1>
 
74
 
 
75
<refsect1 role="details">
 
76
<title role="details.title">Details</title>
 
77
<refsect2>
 
78
<title><anchor id="gdk-pixbuf-ref" role="function" condition="deprecated:Use g_object_ref()."/>gdk_pixbuf_ref ()</title>
 
79
<indexterm role="deprecated"><primary>gdk_pixbuf_ref</primary></indexterm><programlisting><link linkend="GdkPixbuf">GdkPixbuf</link>*          gdk_pixbuf_ref                      (<link linkend="GdkPixbuf">GdkPixbuf</link> *pixbuf);</programlisting>
 
80
<warning><para><literal>gdk_pixbuf_ref</literal> is deprecated and should not be used in newly-written code. Use <link linkend="g-object-ref"><function>g_object_ref()</function></link>.</para></warning>
 
81
<para>
 
82
Adds a reference to a pixbuf.</para>
 
83
  <para>
 
84
 
 
85
  </para><variablelist role="params">
 
86
<varlistentry><term><parameter>pixbuf</parameter>&nbsp;:</term>
 
87
<listitem><simpara> A pixbuf.
 
88
</simpara></listitem></varlistentry>
 
89
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> The same as the <parameter>pixbuf</parameter> argument.
 
90
 
 
91
</simpara></listitem></varlistentry>
 
92
</variablelist></refsect2>
 
93
<refsect2>
 
94
<title><anchor id="gdk-pixbuf-unref" role="function" condition="deprecated:Use g_object_unref()."/>gdk_pixbuf_unref ()</title>
 
95
<indexterm role="deprecated"><primary>gdk_pixbuf_unref</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_pixbuf_unref                    (<link linkend="GdkPixbuf">GdkPixbuf</link> *pixbuf);</programlisting>
 
96
<warning><para><literal>gdk_pixbuf_unref</literal> is deprecated and should not be used in newly-written code. Use <link linkend="g-object-unref"><function>g_object_unref()</function></link>.</para></warning>
 
97
<para>
 
98
Removes a reference from a pixbuf.</para>
 
99
<para>
 
100
 
 
101
</para><variablelist role="params">
 
102
<varlistentry><term><parameter>pixbuf</parameter>&nbsp;:</term>
 
103
<listitem><simpara> A pixbuf.
 
104
</simpara></listitem></varlistentry>
 
105
</variablelist></refsect2>
 
106
<refsect2>
 
107
<title><anchor id="GdkPixbufDestroyNotify" role="function"/>GdkPixbufDestroyNotify ()</title>
 
108
<indexterm><primary>GdkPixbufDestroyNotify</primary></indexterm><programlisting><link linkend="void">void</link>                (*GdkPixbufDestroyNotify)           (<link linkend="guchar">guchar</link> *pixels,
 
109
                                                         <link linkend="gpointer">gpointer</link> data);</programlisting>
 
110
  <para>
 
111
    A function of this type is responsible for freeing the pixel array
 
112
    of a pixbuf.  The <link linkend="gdk-pixbuf-new-from-data"><function>gdk_pixbuf_new_from_data()</function></link> function lets you
 
113
    pass in a pre-allocated pixel array so that a pixbuf can be
 
114
    created from it; in this case you will need to pass in a function
 
115
    of <link linkend="GdkPixbufDestroyNotify"><type>GdkPixbufDestroyNotify</type></link> so that the pixel data can be freed
 
116
    when the pixbuf is finalized.
 
117
  </para><variablelist role="params">
 
118
<varlistentry><term><parameter>pixels</parameter>&nbsp;:</term>
 
119
<listitem><simpara>The pixel array of the pixbuf that is being finalized.
 
120
</simpara></listitem></varlistentry>
 
121
<varlistentry><term><parameter>data</parameter>&nbsp;:</term>
 
122
<listitem><simpara>User closure data.
 
123
 
 
124
 
 
125
</simpara></listitem></varlistentry>
 
126
</variablelist></refsect2>
 
127
 
 
128
</refsect1>
 
129
 
 
130
 
 
131
 
 
132
<refsect1>
 
133
<title>See Also</title>
 
134
  <para>
 
135
    <link linkend="GdkPixbuf"><type>GdkPixbuf</type></link>, <link linkend="gdk-pixbuf-new-from-data"><function>gdk_pixbuf_new_from_data()</function></link>.
 
136
  </para>
 
137
</refsect1>
 
138
 
 
139
</refentry>