Commit 53d7e430 authored by Tim Janik's avatar Tim Janik Committed by Tim Janik

get rid of object_signal:: GtkObject argument uses, use GObject

Tue Dec 12 08:24:42 2000  Tim Janik  <timj@gtk.org>

        * gtk/testgtk.c:
        (create_tooltips):
        (create_statusbar): get rid of object_signal:: GtkObject argument uses,
        use GObject swapped_signal:: properties instead.

        * gtk/gtkcellrenderertoggle.c:
        * gtk/gtkcellrenderertextpixbuf.c:
        * gtk/gtkcellrenderertext.c:
        * gtk/gtkcellrendererpixbuf.c:
        * gtk/gtkcellrenderer.c:
        * gtk/gtktreeviewcolumn.c: s/[sg]et_param/[sg]et_property/, fixed
        missing warnings for invalid property ids, install properties
        with g_object_class_install_property() now.

        * gtk/gtksignal.c:
        (gtk_signal_emit): let g_signal_emit_valist() collect the values for us.
parent 0cdc00ec
Tue Dec 12 08:24:42 2000 Tim Janik <timj@gtk.org>
* gtk/testgtk.c:
(create_tooltips):
(create_statusbar): get rid of object_signal:: GtkObject argument uses,
use GObject swapped_signal:: properties instead.
* gtk/gtkcellrenderertoggle.c:
* gtk/gtkcellrenderertextpixbuf.c:
* gtk/gtkcellrenderertext.c:
* gtk/gtkcellrendererpixbuf.c:
* gtk/gtkcellrenderer.c:
* gtk/gtktreeviewcolumn.c: s/[sg]et_param/[sg]et_property/, fixed
missing warnings for invalid property ids, install properties
with g_object_class_install_property() now.
* gtk/gtksignal.c:
(gtk_signal_emit): let g_signal_emit_valist() collect the values for us.
Wed Oct 25 14:17:43 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.[ch] (gtk_widget_is_focus): Add a function
......
Tue Dec 12 08:24:42 2000 Tim Janik <timj@gtk.org>
* gtk/testgtk.c:
(create_tooltips):
(create_statusbar): get rid of object_signal:: GtkObject argument uses,
use GObject swapped_signal:: properties instead.
* gtk/gtkcellrenderertoggle.c:
* gtk/gtkcellrenderertextpixbuf.c:
* gtk/gtkcellrenderertext.c:
* gtk/gtkcellrendererpixbuf.c:
* gtk/gtkcellrenderer.c:
* gtk/gtktreeviewcolumn.c: s/[sg]et_param/[sg]et_property/, fixed
missing warnings for invalid property ids, install properties
with g_object_class_install_property() now.
* gtk/gtksignal.c:
(gtk_signal_emit): let g_signal_emit_valist() collect the values for us.
Wed Oct 25 14:17:43 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.[ch] (gtk_widget_is_focus): Add a function
......
Tue Dec 12 08:24:42 2000 Tim Janik <timj@gtk.org>
* gtk/testgtk.c:
(create_tooltips):
(create_statusbar): get rid of object_signal:: GtkObject argument uses,
use GObject swapped_signal:: properties instead.
* gtk/gtkcellrenderertoggle.c:
* gtk/gtkcellrenderertextpixbuf.c:
* gtk/gtkcellrenderertext.c:
* gtk/gtkcellrendererpixbuf.c:
* gtk/gtkcellrenderer.c:
* gtk/gtktreeviewcolumn.c: s/[sg]et_param/[sg]et_property/, fixed
missing warnings for invalid property ids, install properties
with g_object_class_install_property() now.
* gtk/gtksignal.c:
(gtk_signal_emit): let g_signal_emit_valist() collect the values for us.
Wed Oct 25 14:17:43 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.[ch] (gtk_widget_is_focus): Add a function
......
Tue Dec 12 08:24:42 2000 Tim Janik <timj@gtk.org>
* gtk/testgtk.c:
(create_tooltips):
(create_statusbar): get rid of object_signal:: GtkObject argument uses,
use GObject swapped_signal:: properties instead.
* gtk/gtkcellrenderertoggle.c:
* gtk/gtkcellrenderertextpixbuf.c:
* gtk/gtkcellrenderertext.c:
* gtk/gtkcellrendererpixbuf.c:
* gtk/gtkcellrenderer.c:
* gtk/gtktreeviewcolumn.c: s/[sg]et_param/[sg]et_property/, fixed
missing warnings for invalid property ids, install properties
with g_object_class_install_property() now.
* gtk/gtksignal.c:
(gtk_signal_emit): let g_signal_emit_valist() collect the values for us.
Wed Oct 25 14:17:43 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.[ch] (gtk_widget_is_focus): Add a function
......
Tue Dec 12 08:24:42 2000 Tim Janik <timj@gtk.org>
* gtk/testgtk.c:
(create_tooltips):
(create_statusbar): get rid of object_signal:: GtkObject argument uses,
use GObject swapped_signal:: properties instead.
* gtk/gtkcellrenderertoggle.c:
* gtk/gtkcellrenderertextpixbuf.c:
* gtk/gtkcellrenderertext.c:
* gtk/gtkcellrendererpixbuf.c:
* gtk/gtkcellrenderer.c:
* gtk/gtktreeviewcolumn.c: s/[sg]et_param/[sg]et_property/, fixed
missing warnings for invalid property ids, install properties
with g_object_class_install_property() now.
* gtk/gtksignal.c:
(gtk_signal_emit): let g_signal_emit_valist() collect the values for us.
Wed Oct 25 14:17:43 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.[ch] (gtk_widget_is_focus): Add a function
......
Tue Dec 12 08:24:42 2000 Tim Janik <timj@gtk.org>
* gtk/testgtk.c:
(create_tooltips):
(create_statusbar): get rid of object_signal:: GtkObject argument uses,
use GObject swapped_signal:: properties instead.
* gtk/gtkcellrenderertoggle.c:
* gtk/gtkcellrenderertextpixbuf.c:
* gtk/gtkcellrenderertext.c:
* gtk/gtkcellrendererpixbuf.c:
* gtk/gtkcellrenderer.c:
* gtk/gtktreeviewcolumn.c: s/[sg]et_param/[sg]et_property/, fixed
missing warnings for invalid property ids, install properties
with g_object_class_install_property() now.
* gtk/gtksignal.c:
(gtk_signal_emit): let g_signal_emit_valist() collect the values for us.
Wed Oct 25 14:17:43 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.[ch] (gtk_widget_is_focus): Add a function
......
Tue Dec 12 08:24:42 2000 Tim Janik <timj@gtk.org>
* gtk/testgtk.c:
(create_tooltips):
(create_statusbar): get rid of object_signal:: GtkObject argument uses,
use GObject swapped_signal:: properties instead.
* gtk/gtkcellrenderertoggle.c:
* gtk/gtkcellrenderertextpixbuf.c:
* gtk/gtkcellrenderertext.c:
* gtk/gtkcellrendererpixbuf.c:
* gtk/gtkcellrenderer.c:
* gtk/gtktreeviewcolumn.c: s/[sg]et_param/[sg]et_property/, fixed
missing warnings for invalid property ids, install properties
with g_object_class_install_property() now.
* gtk/gtksignal.c:
(gtk_signal_emit): let g_signal_emit_valist() collect the values for us.
Wed Oct 25 14:17:43 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.[ch] (gtk_widget_is_focus): Add a function
......
<!-- ##### SECTION Title ##### -->
Animations
animation
<!-- ##### SECTION Short_Description ##### -->
Animations as multi-frame structures.
<!-- ##### SECTION Long_Description ##### -->
<para>
The &gdk-pixbuf; library provides a simple mechanism to load and
represent animations, primarily animated GIF files. Animations
are represented as lists of #GdkPixbufFrame structures. Each
frame structure contains a #GdkPixbuf structure and information
about the frame's overlay mode and duration.
</para>
<para>
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
#GdkPixbufLoader
</para>
<para>
</para>
<!-- ##### ENUM GdkPixbufFrameAction ##### -->
<para>
Each animation frame can have several things happen to it when the
next frame is displayed. The #GdkPixbufFrameAction determines
this. These are essentially the overlay modes supported by GIF
animations.
</para>
@GDK_PIXBUF_FRAME_RETAIN: The previous image should remain displayed,
and will potentially be occluded by the new frame.
@GDK_PIXBUF_FRAME_DISPOSE: The animation will be reverted to the state
before the frame was shown.
@GDK_PIXBUF_FRAME_REVERT: The animation will be reverted to the first
frame.
<para>
</para>
@GDK_PIXBUF_FRAME_RETAIN:
@GDK_PIXBUF_FRAME_DISPOSE:
@GDK_PIXBUF_FRAME_REVERT:
<!-- ##### STRUCT GdkPixbufFrame ##### -->
<para>
This structure describes a frame in a #GdkPixbufAnimation. Each
frame consists of a #GdkPixbuf, an offset of the frame within the
animation's bounding box, a duration, and an overlay mode or
action.
</para>
<para>
</para>
<!-- ##### STRUCT GdkPixbufAnimation ##### -->
<para>
This structure describes an animation, which is represented as a
list of #GdkPixbufFrame structures.
</para>
<para>
</para>
<!-- ##### FUNCTION gdk_pixbuf_animation_new_from_file ##### -->
......@@ -154,11 +142,6 @@ frame.
</para>
@frame:
@Returns: <!--
Local variables:
mode: sgml
sgml-parent-document: ("../gdk-pixbuf.sgml" "book" "refsect2" "")
End:
-->
@Returns:
<!-- ##### SECTION Title ##### -->
Image Data in Memory
creating
<!-- ##### SECTION Short_Description ##### -->
Creating a pixbuf from image data that is already in memory.
<!-- ##### SECTION Long_Description ##### -->
<para>
The most basic way to create a pixbuf is to wrap an existing pixel
buffer with a #GdkPixbuf structure. You can use the
gdk_pixbuf_new_from_data() function to do this You need to specify
the destroy notification function that will be called when the
data buffer needs to be freed; this will happen when a #GdkPixbuf
is finalized by the reference counting functions If you have a
chunk of static data compiled into your application, you can pass
in #NULL as the destroy notification function so that the data
will not be freed.
</para>
<para>
The gdk_pixbuf_new() function can be used as a convenience to
create a pixbuf with an empty buffer. This is equivalent to
allocating a data buffer using malloc() and then wrapping it with
gdk_pixbuf_new_from_data(). The gdk_pixbuf_new() function will
compute an optimal rowstride so that rendering can be performed
with an efficient algorithm.
</para>
<para>
As a special case, you can use the gdk_pixbuf_new_from_xpm_data()
function to create a pixbuf from inline XPM image data.
</para>
<para>
You can also copy an existing pixbuf with the gdk_pixbuf_copy()
function. This is not the same as just doing a gdk_pixbuf_ref()
on the old pixbuf; the copy function will actually duplicate the
pixel data in memory and create a new #GdkPixbuf structure for it.
</para>
<para>
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
gdk_pixbuf_finalize().
</para>
<para>
</para>
<!-- ##### FUNCTION gdk_pixbuf_new ##### -->
<para>
......@@ -100,11 +73,6 @@ Creating a pixbuf from image data that is already in memory.
</para>
@pixbuf:
@Returns: <!--
Local variables:
mode: sgml
sgml-parent-document: ("../gdk-pixbuf.sgml" "book" "refsect2" "")
End:
-->
@Returns:
<!-- ##### SECTION Title ##### -->
File Loading
file-loading
<!-- ##### SECTION Short_Description ##### -->
Loading a pixbuf from a file.
<!-- ##### SECTION Long_Description ##### -->
<para>
The &gdk-pixbuf; library provides a simple mechanism for loading
an image from a file in synchronous fashion. This means that the
library takes control of the application while the file is being
loaded; from the user's point of view, the application will block
until the image is done loading.
</para>
<para>
This interface can be used by applications in which blocking is
acceptable while an image is being loaded. It can also be used to
load small images in general. Applications that need progressive
loading can use the #GdkPixbufLoader functionality instead.
</para>
<para>
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
#GdkPixbufLoader.
</para>
<para>
</para>
<!-- ##### FUNCTION gdk_pixbuf_new_from_file ##### -->
<para>
......@@ -32,11 +23,6 @@ Loading a pixbuf from a file.
@filename:
@error:
@Returns: <!--
Local variables:
mode: sgml
sgml-parent-document: ("../gdk-pixbuf.sgml" "book" "refsect2" "")
End:
-->
@Returns:
......@@ -9,11 +9,13 @@ file-saving
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### FUNCTION gdk_pixbuf_savev ##### -->
<para>
......
<!-- ##### SECTION Title ##### -->
&gdk-pixbuf; Xlib initialization
gdk-pixbuf-xlib-init
<!-- ##### SECTION Short_Description ##### -->
Initializing the &gdk-pixbuf; Xlib library.
<!-- ##### SECTION Long_Description ##### -->
<para>
In addition to the normal Gdk-specific functions, the &gdk-pixbuf;
package provides a small library that lets Xlib-only applications
use #GdkPixbuf structures and render them to X drawables. The
functions in this section are used to initialize the &gdk-pixbuf;
Xlib library. This library must be initialized near the beginning
or the program or before calling any of the other &gdk-pixbuf;
Xlib functions; it cannot be initialized automatically since
Xlib-only applications do not call gdk_rgb_init() like GNOME
applications do.
</para>
<para>
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
XlibRGB
</para>
<para>
</para>
<!-- ##### FUNCTION gdk_pixbuf_xlib_init ##### -->
<para>
......@@ -38,11 +32,6 @@ Initializing the &gdk-pixbuf; Xlib library.
@display:
@screen_num:
@prefDepth: <!--
Local variables:
mode: sgml
sgml-parent-document: ("../gdk-pixbuf.sgml" "book" "refsect2" "")
End:
-->
@prefDepth:
<!-- ##### SECTION Title ##### -->
The GdkPixbuf Structure
gdk-pixbuf
<!-- ##### SECTION Short_Description ##### -->
Information that describes an image.
<!-- ##### SECTION Long_Description ##### -->
<para>
</para>
<para>
The <structname>GdkPixbuf</structname> structure contains
information that describes an image in memory.
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<para>
</para>
<!-- ##### ENUM GdkPixbufError ##### -->
<para>
......@@ -35,39 +36,24 @@ Information that describes an image.
<!-- ##### ENUM GdkColorspace ##### -->
<para>
This enumeration defines the color spaces that are supported by
the &gdk-pixbuf; library. Currently only RGB is supported.
</para>
<para>
@GDK_COLORSPACE_RGB: Indicates a red/green/blue additive color space.
</para>
@GDK_COLORSPACE_RGB:
<!-- ##### ENUM GdkPixbufAlphaMode ##### -->
<para>
These values can be passed to
gdk_pixbuf_render_to_drawable_alpha() to control how the alpha
chanel of an image should be handled. This function can create a
bilevel clipping mask (black and white) and use it while painting
the image. In the future, when the X Window System gets an alpha
channel extension, it will be possible to do full alpha
compositing onto arbitrary drawables. For now both cases fall
back to a bilevel clipping mask.
</para>
@GDK_PIXBUF_ALPHA_BILEVEL: A bilevel clipping mask (black and white)
will be created and used to draw the image. Pixels below 0.5 opacity
will be considered fully transparent, and all others will be
considered fully opaque.
@GDK_PIXBUF_ALPHA_FULL: For now falls back to #GDK_PIXBUF_ALPHA_BILEVEL.
In the future it will do full alpha compositing.
<para>
</para>
@GDK_PIXBUF_ALPHA_BILEVEL:
@GDK_PIXBUF_ALPHA_FULL:
<!-- ##### STRUCT GdkPixbuf ##### -->
<para>
This is the main structure in the &gdk-pixbuf; library. It is
used to represent images. It contains information about the
image's pixel data, its color space, bits per sample, width and
height, and the rowstride or number of bytes between rows.
</para>
<para>
</para>
<!-- ##### FUNCTION gdk_pixbuf_get_colorspace ##### -->
......@@ -139,11 +125,6 @@ In the future it will do full alpha compositing.
</para>
@pixbuf:
@Returns: <!--
Local variables:
mode: sgml
sgml-parent-document: ("../gdk-pixbuf.sgml" "book" "refsect2" "")
End:
-->
@Returns:
......@@ -9,11 +9,13 @@ Initialization and Versions
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### FUNCTION gdk_pixbuf_init ##### -->
<para>
......
......@@ -9,11 +9,13 @@ Module Interface
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### USER_FUNCTION ModulePreparedNotifyFunc ##### -->
<para>
......
<!-- ##### SECTION Title ##### -->
Reference Counting and Memory Mangement
refcounting
<!-- ##### SECTION Short_Description ##### -->
Functions to perform reference counting and memory management on a
#GdkPixbuf.
<!-- ##### SECTION Long_Description ##### -->
<para>
#GdkPixbuf structures are reference counted. This means that
an application can share a single pixbuf among many parts of the
code. When a piece of the program needs to keep a pointer to a
pixbuf, it should add a reference to it. When it no longer needs
the pixbuf, it should subtract a reference. The pixbuf will be
destroyed when its reference count drops to zero. Newly-created
#GdkPixbuf structures start with a reference count of one.
</para>
<para>
<emphasis>Finalizing</emphasis> a pixbuf means to free its pixel
data and to free the #GdkPixbuf structure itself. Most of the
library functions that create #GdkPixbuf structures create the
pixel data by themselves and define the way it should be freed;
you do not need to worry about those. The only function that lets
you specify how to free the pixel data is
gdk_pixbuf_new_from_data(). Since you pass it a pre-allocated
pixel buffer, you must also specify a way to free that data. This
is done with a function of type #GdkPixbufDestroyNotify. When a
pixbuf created with gdk_pixbuf_new_from_data() is finalized, your
destroy notification function will be called, and it is its
responsibility to free the pixel array.
</para>
<para>
As an extension to traditional reference counting, #GdkPixbuf
structures support defining a handler for the last unref
operation. If gdk_pixbuf_unref() is called on a #GdkPixbuf
structure that has a reference count of 1, i.e. its last
reference, then the pixbuf's last unref handler function will be
called. It is up to this function to determine whether to
finalize the pixbuf using gdk_pixbuf_finalize() or to just
continue execution. This can be used to implement a pixbuf cache
efficiently; please see the programmer's documentation for
details.
</para>
<!-- FIXME: link the last sentence above to the relevant section of
the programmer's docs.
-->
<para>
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
#GdkPixbuf, gdk_pixbuf_new_from_data().
</para>
<para>
</para>
<!-- ##### USER_FUNCTION GdkPixbufDestroyNotify ##### -->
<para>
A function of this type is responsible for freeing the pixel array
of a pixbuf. The gdk_pixbuf_new_from_data() function lets you
pass in a pre-allocated pixel array so that a pixbuf can be
created from it; in this case you will need to pass in a function
of #GdkPixbufDestroyNotify so that the pixel data can be freed
when the pixbuf is finalized.
</para>
<para>
</para>
@pixels: The pixel array of the pixbuf that is being finalized.
@data: User closure data.
@pixels:
@data:
<!-- ##### FUNCTION gdk_pixbuf_ref ##### -->
<para>
<para>
</para>
</para>
@pixbuf:
@Returns:
......
<!-- ##### SECTION Title ##### -->
Scaling
scaling
<!-- ##### SECTION Short_Description ##### -->
Scaling pixbufs and scaling and compositing pixbufs
<!-- ##### SECTION Long_Description ##### -->
<para>
The &gdk-pixbuf; contains functions to scale pixbufs, to scale
pixbufs and composite against an existing image, and to scale
pixbufs and composite against a solid color or checkerboard.
Compositing a checkerboard is a common way to show an image with
an alpha channel in image-viewing and editing software.
</para>
<para>
Since the full-featured functions (gdk_pixbuf_scale(),
gdk_pixbuf_composite(), and gdk_pixbuf_composite_color()) are
rather complex to use and have many arguments, two simple
convenience functions are provided, gdk_pixbuf_scale_simple() and
gdk_pixbuf_composite_color_simple() which create a new pixbuf of a
given size, scale an original image to fit, and then return the
new pixmap.
</para>
<para>
The following example demonstrates handling an expose event by
rendering the appropriate area of a source image (which is scaled
to fit the widget) onto the widget's window. The source image is
rendered against a checkerboard, which provides a visual
representation of the alpha channel if the image has one. If the
image doesn't have an alpha channel, calling
gdk_pixbuf_composite_color() function has exactly the same effect
as calling gdk_pixbuf_scale().
</para>
<programlisting>
gboolean
expose_cb (GtkWidget *widget, GdkEventExpose *event, gpointer data)
{
GdkPixbuf *dest;