prepend underscore (gdk_pixbuf_get_named_module): prepend underscore

2001-02-18  Havoc Pennington  <hp@pobox.com>

	* gdk-pixbuf-io.c (gdk_pixbuf_load_module): prepend underscore
	(gdk_pixbuf_get_named_module): prepend underscore
	(gdk_pixbuf_get_module): prepend underscore

2001-02-18  Havoc Pennington  <hp@pobox.com>

	* gdk-pixbuf/Makefile.am (IGNORE_HFILES): add gdk-pixbuf-marshal.h

	* gdk-pixbuf/gdk-pixbuf-sections.txt: fixes
This commit is contained in:
Havoc Pennington 2001-02-20 02:59:30 +00:00 committed by Havoc Pennington
parent 0f9fadbec2
commit 131aac575f
15 changed files with 90 additions and 738 deletions

View File

@ -1,3 +1,9 @@
2001-02-18 Havoc Pennington <hp@pobox.com>
* gdk-pixbuf/Makefile.am (IGNORE_HFILES): add gdk-pixbuf-marshal.h
* gdk-pixbuf/gdk-pixbuf-sections.txt: fixes
Sun Feb 11 22:16:34 2001 Owen Taylor <otaylor@redhat.com>
* */Makefile.am: Use the new snazzy mother-of-all-gtk-doc-makefiles.

View File

@ -25,6 +25,7 @@ CFILE_GLOB=$(top_srcdir)/gdk-pixbuf/*.c $(top_srcdir)/contrib/gdk-pixbuf-xlib/*.
# Header files to ignore when scanning
IGNORE_HFILES= \
pixops \
gdk-pixbuf-marshal.h \
gdk-pixbuf-xlib-private.h \
gdk-pixbuf-i18n.h \
gdk-pixbuf-private.h

View File

@ -1,11 +1,8 @@
<INCLUDE>gdk-pixbuf/gdk-pixbuf.h</INCLUDE>
<SECTION>
<TITLE>Initialization and Versions</TITLE>
<TITLE>Versioning</TITLE>
<FILE>initialization_versions</FILE>
gdk_pixbuf_init
gdk_pixbuf_preinit
gdk_pixbuf_postinit
<SUBSECTION>
gdk_pixbuf_version
@ -146,9 +143,9 @@ ModuleUpdatedNotifyFunc
ModuleFrameDoneNotifyFunc
ModuleAnimationDoneNotifyFunc
GdkPixbufModule
gdk_pixbuf_get_module
gdk_pixbuf_get_named_module
gdk_pixbuf_load_module
_gdk_pixbuf_get_module
_gdk_pixbuf_get_named_module
_gdk_pixbuf_load_module
</SECTION>
<SECTION>

View File

@ -1,66 +0,0 @@
<ARG>
<NAME>GnomeCanvasPixbuf::pixbuf</NAME>
<TYPE>gpointer</TYPE>
<FLAGS>rw</FLAGS>
</ARG>
<ARG>
<NAME>GnomeCanvasPixbuf::width</NAME>
<TYPE>gdouble</TYPE>
<FLAGS>rw</FLAGS>
</ARG>
<ARG>
<NAME>GnomeCanvasPixbuf::width_set</NAME>
<TYPE>gboolean</TYPE>
<FLAGS>rw</FLAGS>
</ARG>
<ARG>
<NAME>GnomeCanvasPixbuf::width_in_pixels</NAME>
<TYPE>gboolean</TYPE>
<FLAGS>rw</FLAGS>
</ARG>
<ARG>
<NAME>GnomeCanvasPixbuf::height</NAME>
<TYPE>gdouble</TYPE>
<FLAGS>rw</FLAGS>
</ARG>
<ARG>
<NAME>GnomeCanvasPixbuf::height_set</NAME>
<TYPE>gboolean</TYPE>
<FLAGS>rw</FLAGS>
</ARG>
<ARG>
<NAME>GnomeCanvasPixbuf::height_in_pixels</NAME>
<TYPE>gboolean</TYPE>
<FLAGS>rw</FLAGS>
</ARG>
<ARG>
<NAME>GnomeCanvasPixbuf::x</NAME>
<TYPE>gdouble</TYPE>
<FLAGS>rw</FLAGS>
</ARG>
<ARG>
<NAME>GnomeCanvasPixbuf::x_in_pixels</NAME>
<TYPE>gboolean</TYPE>
<FLAGS>rw</FLAGS>
</ARG>
<ARG>
<NAME>GnomeCanvasPixbuf::y</NAME>
<TYPE>gdouble</TYPE>
<FLAGS>rw</FLAGS>
</ARG>
<ARG>
<NAME>GnomeCanvasPixbuf::y_in_pixels</NAME>
<TYPE>gboolean</TYPE>
<FLAGS>rw</FLAGS>
</ARG>

View File

@ -1,4 +0,0 @@
GtkObject
GdkPixbufLoader
GnomeCanvasItem
GnomeCanvasPixbuf

View File

@ -128,6 +128,8 @@ Application-driven progressive image loading.
</para>
@loader:
@error:
@Returns:
<!-- ##### SIGNAL GdkPixbufLoader::area-updated ##### -->

View File

@ -42,193 +42,6 @@ Drawables to Pixbufs
gdk-pixbuf-io
<!-- ##### SECTION ./tmpl/gdk-pixbuf-loader.sgml:Long_Description ##### -->
<para>
#GdkPixbufLoader provides a way for applications to drive the
process of loading an image, by letting them send the image data
directly to the loader instead of having the loader read the data
from a file. Applications can use this functionality instead of
gdk_pixbuf_new_from_file() when they need to parse image data in
small chunks. For example, it should be used when reading an
image from a (potentially) slow network connection, or when
loading an extremely large file.
</para>
<para>
To use #GdkPixbufLoader to load an image, just create a new one,
and call gdk_pixbuf_loader_write() to send the data to it. When
done, gdk_pixbuf_loader_close() should be called to end the stream
and finalize everything. The loader will emit two important
signals throughout the process. The first, "<link
linkend="GdkPixbufLoader-area-prepared">area_prepared</link>",
will be called as soon as the image has enough information to
determine the size of the image to be used. It will pass a
@GdkPixbuf in. If you want to use it, you can simply ref it. In
addition, no actual information will be passed in yet, so the
pixbuf can be safely filled with any temporary graphics (or an
initial color) as needed. You can also call the
gdk_pixbuf_loader_get_pixbuf() once this signal has been emitted
and get the same pixbuf.
</para>
<para>
The other signal, "<link
linkend="GdkPixbufLoader-area-updated">area_updated</link>" gets
called every time a region is updated. This way you can update a
partially completed image. Note that you do not know anything
about the completeness of an image from the area updated. For
example, in an interlaced image, you need to make several passes
before the image is done loading.
</para>
<refsect2>
<title>Loading an animation</title>
<para>
Loading an animation is a little more complex then loading an
image. In addition to the above signals, there is also a "<link
linkend="GdkPixbufLoader-frame-done">frame_done</link>" signal,
as well as an "<link
linkend="GdkPixbufLoader-animation-done">animation_done</link>"
signal. The first lets the application know that it is dealing
with an animation, instead of a static image. It also passes a
#GdkPixbufFrame in the signal. As before, if you want to keep
the frame, you need to ref it. Once the first "<link
linkend="GdkPixbufLoader-frame-done">frame_done</link>" signal
has been emitted, you can call gdk_pixbuf_loader_get_animation()
to get the #GdkPixbufAnimation struct. Each subsequent frame
goes through a similar lifecycle. For example "<link
linkend="GdkPixbufLoader-area-prepared">area_prepared</link>" is
re-emitted. Then "<link
linkend="GdkPixbufLoader-area-updated">area_updated</link>" is
emitted as many times as necessary. Finally, "<link
linkend="GdkPixbufLoader-animation-done">animation_done</link>"
is emitted as soon as all frames are done.
</para>
</refsect2>
<!-- ##### SECTION ./tmpl/gdk-pixbuf-loader.sgml:See_Also ##### -->
<para>
gdk_pixbuf_new_from_file()
</para>
<!-- ##### SECTION ./tmpl/gdk-pixbuf-loader.sgml:Short_Description ##### -->
Application-driven progressive image loading.
<!-- ##### SECTION ./tmpl/gdk-pixbuf-loader.sgml:Title ##### -->
GdkPixbufLoader
<!-- ##### SECTION ./tmpl/gdk-pixbuf-xlib-from-drawables.sgml:Long_Description ##### -->
<para>
The functions in this section allow you to take the image data
from an X drawable and dump it into a #GdkPixbuf. This can be
used for screenshots and other special effects. Note that these
operations can be expensive, since the image data has to be
transferred from the X server to the client program and converted.
</para>
<para>
These functions are analogous to those for the Gdk version of
&gdk-pixbuf;.
</para>
<!-- ##### SECTION ./tmpl/gdk-pixbuf-xlib-from-drawables.sgml:See_Also ##### -->
<para>
</para>
<!-- ##### SECTION ./tmpl/gdk-pixbuf-xlib-from-drawables.sgml:Short_Description ##### -->
Getting parts of an X drawable's image data into a pixbuf.
<!-- ##### SECTION ./tmpl/gdk-pixbuf-xlib-from-drawables.sgml:Title ##### -->
X Drawables to Pixbufs
<!-- ##### SECTION ./tmpl/gdk-pixbuf-xlib-init.sgml: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>
<!-- ##### SECTION ./tmpl/gdk-pixbuf-xlib-init.sgml:See_Also ##### -->
<para>
XlibRGB
</para>
<!-- ##### SECTION ./tmpl/gdk-pixbuf-xlib-init.sgml:Short_Description ##### -->
Initializing the &gdk-pixbuf; Xlib library.
<!-- ##### SECTION ./tmpl/gdk-pixbuf-xlib-init.sgml:Title ##### -->
&gdk-pixbuf; Xlib initialization
<!-- ##### SECTION ./tmpl/gdk-pixbuf-xlib-rendering.sgml:Long_Description ##### -->
<para>
The &gdk-pixbuf; Xlib library provides several convenience
functions to render pixbufs to X drawables. It uses XlibRGB to
render the image data.
</para>
<para>
These functions are analogous to those for the Gdk version of
&gdk-pixbuf;.
</para>
<!-- ##### SECTION ./tmpl/gdk-pixbuf-xlib-rendering.sgml:See_Also ##### -->
<para>
</para>
<!-- ##### SECTION ./tmpl/gdk-pixbuf-xlib-rendering.sgml:Short_Description ##### -->
Rendering a pixbuf to an X drawable.
<!-- ##### SECTION ./tmpl/gdk-pixbuf-xlib-rendering.sgml:Title ##### -->
Xlib Rendering
<!-- ##### SECTION ./tmpl/gdk-pixbuf-xlib-rgb.sgml:Long_Description ##### -->
<para>
The XlibRGB set of functions is a port of the GdkRGB library to
use plain Xlib and X drawables. You can use these functions to
render RGB buffers into drawables very quickly with high-quality
dithering.
</para>
<!-- ##### SECTION ./tmpl/gdk-pixbuf-xlib-rgb.sgml:See_Also ##### -->
<para>
GdkRGB
</para>
<!-- ##### SECTION ./tmpl/gdk-pixbuf-xlib-rgb.sgml:Short_Description ##### -->
Functions for rendering RGB buffers to X drawables.
<!-- ##### SECTION ./tmpl/gdk-pixbuf-xlib-rgb.sgml:Title ##### -->
XlibRGB
<!-- ##### SECTION ./tmpl/gnome-canvas-pixbuf.sgml:Long_Description ##### -->
<para>
This canvas item displays #GdkPixbuf images. It handles full
@ -412,26 +225,6 @@ Canvas item to display #GdkPixbuf images.
GnomeCanvasPixbuf
<!-- ##### SECTION ./tmpl/module_interface.sgml:Long_Description ##### -->
<para>
</para>
<!-- ##### SECTION ./tmpl/module_interface.sgml:See_Also ##### -->
<para>
</para>
<!-- ##### SECTION ./tmpl/module_interface.sgml:Short_Description ##### -->
<!-- ##### SECTION ./tmpl/module_interface.sgml:Title ##### -->
Module Interface
<!-- ##### SECTION ./tmpl/rendering.sgml:Long_Description ##### -->
<para>
The &gdk-pixbuf; library provides several convenience functions to
@ -471,80 +264,6 @@ Rendering a pixbuf to a GDK drawable.
Rendering
<!-- ##### SECTION ./tmpl/scaling.sgml: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;
gdk_window_set_back_pixmap (widget->window, NULL, FALSE);
dest = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, event->area.width, event->area.height);
gdk_pixbuf_composite_color (pixbuf, dest,
0, 0, event->area.width, event->area.height,
-event->area.x, -event->area.y,
(double) widget->allocation.width / gdk_pixbuf_get_width (pixbuf),
(double) widget->allocation.height / gdk_pixbuf_get_height (pixbuf),
GDK_INTERP_BILINEAR, 255,
event->area.x, event->area.y, 16, 0xaaaaaa, 0x555555);
gdk_pixbuf_render_to_drawable (dest, widget->window, widget->style->fg_gc[GTK_STATE_NORMAL],
0, 0, event->area.x, event->area.y,
event->area.width, event->area.height,
GDK_RGB_DITHER_NORMAL, event->area.x, event->area.y);
gdk_pixbuf_unref (dest);
return TRUE;
}
</programlisting>
<!-- ##### SECTION ./tmpl/scaling.sgml:See_Also ##### -->
<para>
GdkRGB
</para>
<!-- ##### SECTION ./tmpl/scaling.sgml:Short_Description ##### -->
Scaling pixbufs and scaling and compositing pixbufs
<!-- ##### SECTION ./tmpl/scaling.sgml:Title ##### -->
Scaling
<!-- ##### SECTION ./tmpl/xlib-from-drawables.sgml:Long_Description ##### -->
<para>
The functions in this section allow you to take the image data
@ -695,75 +414,6 @@ XlibRGB
@pixbuf: The pixbuf that is losing its last reference.
@data: User closure data.
<!-- ##### SIGNAL GdkPixbufLoader::animation-done ##### -->
<para>
This signal is emitted when an animation is done loading.
</para>
@gdkpixbufloader: the object which received the signal.
@loader: Loader which emitted the signal.
<!-- ##### SIGNAL GdkPixbufLoader::area-prepared ##### -->
<para>
This signal is emitted when the pixbuf loader has been fed the
initial amount of data that is required to figure out the size and
format of the image that it will create. After this signal is
emitted, applications can call gdk_pixbuf_loader_get_pixbuf() to
fetch the partially-loaded pixbuf.
</para>
@gdkpixbufloader: the object which received the signal.
@loader: Loader which emitted the signal.
<!-- ##### SIGNAL GdkPixbufLoader::area-updated ##### -->
<para>
This signal is emitted when a significant area of the image being
loaded has been updated. Normally it means that a complete
scanline has been read in, but it could be a different area as
well. Applications can use this signal to know when to repaint
areas of an image that is being loaded.
</para>
@gdkpixbufloader: the object which received the signal.
@arg1:
@arg2:
@arg3:
@arg4:
@loader: Loader which emitted the signal.
@x: X offset of upper-left corner of the updated area.
@y: Y offset of upper-left corner of the updated area.
@width: Width of updated area.
@height: Height of updated area.
<!-- ##### SIGNAL GdkPixbufLoader::closed ##### -->
<para>
This signal is emitted when gdk_pixbuf_loader_close() is called.
It can be used by different parts of an application to receive
notification when an image loader is closed by the code that
drives it.
</para>
@gdkpixbufloader: the object which received the signal.
@loader: Loader which emitted the signal.
<!--
Local variables:
mode: sgml
sgml-parent-document: ("../gdk-pixbuf.sgml" "book" "refsect2" "")
End:
-->
<!-- ##### SIGNAL GdkPixbufLoader::frame-done ##### -->
<para>
This signal is emitted when a frame is done loading. It will be
emitted for each frame in an animation data stream.
</para>
@gdkpixbufloader: the object which received the signal.
@arg1:
@loader: Loader which emitted the signal.
@frame: Frame which just completed loading.
<!-- ##### ARG GnomeCanvasPixbuf:height ##### -->
<para>
Indicates the height the pixbuf will be scaled to. This argument
@ -975,12 +625,41 @@ sgml-parent-document: ("../gdk-pixbuf.sgml" "book" "refsect2" "")
End:
-->
<!-- ##### FUNCTION _gdk_pixbuf_get_module ##### -->
<para>
</para>
@buffer:
@size:
@filename:
@error:
@Returns:
<!-- ##### FUNCTION _gdk_pixbuf_get_named_module ##### -->
<para>
</para>
@name:
@error:
@Returns:
<!-- ##### FUNCTION gdk_pixbuf_init ##### -->
<para>
</para>
<!-- ##### FUNCTION _gdk_pixbuf_load_module ##### -->
<para>
</para>
@image_module:
@error:
@Returns:
<!-- ##### FUNCTION gdk_pixbuf_new_from_art_pixbuf ##### -->
<para>

View File

@ -70,35 +70,3 @@ Module Interface
@load_animation:
@save:
<!-- ##### FUNCTION gdk_pixbuf_get_module ##### -->
<para>
</para>
@buffer:
@size:
@filename:
@error:
@Returns:
<!-- ##### FUNCTION gdk_pixbuf_get_named_module ##### -->
<para>
</para>
@name:
@error:
@Returns:
<!-- ##### FUNCTION gdk_pixbuf_load_module ##### -->
<para>
</para>
@image_module:
@error:
@Returns:

View File

@ -223,6 +223,16 @@ Free previously allocated colors.
@ncolors: the number of colors in @colors.
<!-- ##### FUNCTION gdk_colormap_query_color ##### -->
<para>
</para>
@colormap:
@pixel:
@result:
<!-- ##### FUNCTION gdk_colormap_get_visual ##### -->
<para>
Return the visual for which a given colormap was created.

View File

@ -23,55 +23,6 @@ routines for allocating colors (deprecated).
Color Contexts
<!-- ##### SECTION ./tmpl/colors.sgml:Long_Description ##### -->
<para>
These functions are used to modify colormaps.
A colormap is an object that contains the mapping
between the color values stored in memory and
the RGB values that are used to display color
values. In general, colormaps only contain
significant information for pseudo-color visuals,
but even for other visual types, a colormap object
is required in some circumstances.
</para>
<para>
There are a couple of special colormaps that can
be retrieved. The system colormap (retrieved
with gdk_colormap_get_system()) is the default
colormap of the system. If you are using GdkRGB,
there is another colormap that is important - the
colormap in which GdkRGB works, retrieved with
gdk_rgb_get_cmap(). However, when using GdkRGB,
it is not generally necessary to allocate colors
directly.
</para>
<para>
In previous revisions of this interface, a number
of functions that take a #GdkColormap parameter
were replaced with functions whose names began
with "gdk_colormap_". This process will probably
be extended somewhat in the future -
gdk_color_white(), gdk_color_black(), and
gdk_color_change() will probably become aliases.
</para>
<!-- ##### SECTION ./tmpl/colors.sgml:See_Also ##### -->
<para>
</para>
<!-- ##### SECTION ./tmpl/colors.sgml:Short_Description ##### -->
manipulation of colors and colormaps.
<!-- ##### SECTION ./tmpl/colors.sgml:Title ##### -->
Colormaps and Colors
<!-- ##### SECTION ./tmpl/cursors.sgml:Long_Description ##### -->
<para>
@ -878,26 +829,6 @@ Key Values
Pango Interaction
<!-- ##### SECTION ./tmpl/pixbufs.sgml:Long_Description ##### -->
<para>
</para>
<!-- ##### SECTION ./tmpl/pixbufs.sgml:See_Also ##### -->
<para>
</para>
<!-- ##### SECTION ./tmpl/pixbufs.sgml:Short_Description ##### -->
<!-- ##### SECTION ./tmpl/pixbufs.sgml:Title ##### -->
Pixbufs
<!-- ##### SECTION ./tmpl/properties.sgml:Long_Description ##### -->
<para>
Each window under X can have any number of associated
@ -1019,155 +950,6 @@ simple graphical data types.
Points, Rectangles and Regions
<!-- ##### SECTION ./tmpl/rgb.sgml:Long_Description ##### -->
<para>
GdkRgb converts RGB, grayscale, and colormapped images into the native
window pixel format and displays them. It takes care of colormaps,
visuals, dithering, and management of the temporary buffers.
</para>
<para>
You must call gdk_rgb_init() before using any GdkRgb functionality. If
you fail to do so, expect coredumps. All Gtk+ widgets that use GdkRgb
(including #GtkPreview) call gdk_rgb_init() in their class_init method.
Thus, if you use GdkRgb only indirectly, you don't need to worry
about it.
</para>
<para>
GdkRgb tries to use the system default visual and colormap, but
doesn't always succeed. Thus, you have to be prepared to install the
visual and colormap generated by GdkRgb. The following code sequence
(before any widgets are created) should work in most applications:
</para>
<informalexample>
<programlisting>
gdk_rgb_init ();
gtk_widget_set_default_colormap (gdk_rgb_get_cmap ());
gtk_widget_set_default_visual (gdk_rgb_get_visual ());
</programlisting>
</informalexample>
<para>
You can also push the colormap and visual, but in general it doesn't
work unless the push wraps the window creation call. If you wrap the
push around a widget which is embedded in a window without the GdkRgb
colormap and visual, it probably won't work, and is likely to cause
colormap flashing, as well.
</para>
<para>
On 8-bit systems, the colormaps used by Imlib and GdkRgb may
conflict. There is no good general solution to this other than phasing
out the dependence on Imlib.
</para>
<para>
You can set the threshold for installing colormaps with
gdk_rgb_set_min_colors (). The default is 5x5x5 (125). If a colorcube
of this size or larger can be allocated in the default colormap, then
that's done. Otherwise, GdkRgb creates its own private colormap.
Setting it to 0 means that it always tries to use the default
colormap, and setting it to 216 means that it always creates a private
one if it cannot allocate the 6x6x6 colormap in the default. If you
always want a private colormap (to avoid consuming too many colormap
entries for other apps, say), you can use gdk_rgb_set_install(TRUE).
Setting the value greater than 216 exercises a bug in older versions
of GdkRgb. Note, however, that setting it to 0 doesn't let you get
away with ignoring the colormap and visual - a colormap is always
created in grayscale and direct color modes, and the visual is changed
in cases where a "better" visual than the default is available.
</para>
<example>
<title>A simple example program using GdkRGB.</title>
<programlisting>
#include &lt;gtk/gtk.h&gt;
#define IMAGE_WIDTH 256
#define IMAGE_HEIGHT 256
guchar rgbbuf[IMAGE_WIDTH * IMAGE_HEIGHT * 3];
gboolean on_darea_expose (GtkWidget *widget,
GdkEventExpose *event,
gpointer user_data);
int
main (int argc, char *argv[])
{
GtkWidget *window, *darea;
gint x, y;
guchar *pos;
gtk_init (&amp;argc, &amp;argv);
gdk_rgb_init ();
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
darea = gtk_drawing_area_new ();
gtk_drawing_area_size (GTK_DRAWING_AREA (darea), IMAGE_WIDTH, IMAGE_HEIGHT);
gtk_container_add (GTK_CONTAINER (window), darea);
gtk_signal_connect (GTK_OBJECT (darea), "expose-event",
GTK_SIGNAL_FUNC (on_darea_expose), NULL);
gtk_widget_show_all (window);
/* Set up the RGB buffer. */
pos = rgbbuf;
for (y = 0; y < IMAGE_HEIGHT; y++)
{
for (x = 0; x < IMAGE_WIDTH; x++)
{
*pos++ = x - x % 32; /* Red. */
*pos++ = (x / 32) * 4 + y - y % 32; /* Green. */
*pos++ = y - y % 32; /* Blue. */
}
}
gtk_main ();
return 0;
}
gboolean
on_darea_expose (GtkWidget *widget,
GdkEventExpose *event,
gpointer user_data)
{
gdk_draw_rgb_image (widget->window, widget->style->fg_gc[GTK_STATE_NORMAL],
0, 0, IMAGE_WIDTH, IMAGE_HEIGHT,
GDK_RGB_DITHER_MAX, rgbbuf, IMAGE_WIDTH * 3);
}
</programlisting>
</example>
<!-- ##### SECTION ./tmpl/rgb.sgml:See_Also ##### -->
<para>
<variablelist>
<varlistentry>
<term>#GdkColor</term>
<listitem><para>The underlying Gdk mechanism for allocating
colors.</para></listitem>
</varlistentry>
</variablelist>
</para>
<!-- ##### SECTION ./tmpl/rgb.sgml:Short_Description ##### -->
displays RGB images (as well as grayscale and colormapped) to
the native window.
<!-- ##### SECTION ./tmpl/rgb.sgml:Title ##### -->
GdkRGB
<!-- ##### SECTION ./tmpl/selections.sgml:Long_Description ##### -->
<para>
The X selection mechanism provides a way to transfer
@ -1243,36 +1025,7 @@ Threads
<!-- ##### SECTION ./tmpl/visuals.sgml:Long_Description ##### -->
<para>
The way that the data stored on the screen is stored
in memory can vary considerably between different X
servers; some X servers even support multiple formats
used simultaneously. An X <firstterm>visual</firstterm>
represents a particular format for screen data.
It includes information about the number of bits
used for each color, the way the bits are translated
into an RGB value for display, and the way the bits
are stored in memory.
</para>
<para>
There are several standard visuals. The visual returned
by gdk_visual_get_system() is the system's default
visual. gdk_rgb_get_visual() return the visual most
suited to displaying full-color image data. If you
use the calls in GdkRGB, you should create your windows
using this visual (and the colormap returned by
gdk_rgb_get_colormap()).
</para>
<para>
A number of functions are provided for determining
the "best" available visual. For the purposes of
making this determination, higher bit depths are
considered better, and for visuals of the same
bit depth, %GDK_VISUAL_PSEUDO_COLOR is preferred at
8bpp, otherwise, the visual types are ranked in the
order of (highest to lowest) %GDK_VISUAL_DIRECT_COLOR,
%GDK_VISUAL_TRUE_COLOR, %GDK_VISUAL_PSEUDO_COLOR,
%GDK_VISUAL_STATIC_COLOR, %GDK_VISUAL_GRAYSCALE,
then %GDK_VISUAL_STATIC_GRAY.
</para>
@ -1283,7 +1036,7 @@ then %GDK_VISUAL_STATIC_GRAY.
<!-- ##### SECTION ./tmpl/visuals.sgml:Short_Description ##### -->
manipulation of visuals.
<!-- ##### SECTION ./tmpl/visuals.sgml:Title ##### -->

View File

@ -1,3 +1,9 @@
2001-02-18 Havoc Pennington <hp@pobox.com>
* gdk-pixbuf-io.c (gdk_pixbuf_load_module): prepend underscore
(gdk_pixbuf_get_named_module): prepend underscore
(gdk_pixbuf_get_module): prepend underscore
2001-02-19 Havoc Pennington <hp@redhat.com>
* gdk-pixbuf-io.c (gdk_pixbuf_load_module): const fix

View File

@ -140,14 +140,14 @@ gdk_pixbuf_animation_new_from_file (const char *filename,
return NULL;
}
image_module = gdk_pixbuf_get_module (buffer, size, filename, error);
image_module = _gdk_pixbuf_get_module (buffer, size, filename, error);
if (!image_module) {
fclose (f);
return NULL;
}
if (image_module->module == NULL)
if (!gdk_pixbuf_load_module (image_module, error)) {
if (!_gdk_pixbuf_load_module (image_module, error)) {
fclose (f);
return NULL;
}

View File

@ -254,8 +254,8 @@ get_libdir (void)
/* reference to the module to load, it doesn't actually load it */
/* perhaps these actions should be combined in one function */
gboolean
gdk_pixbuf_load_module (GdkPixbufModule *image_module,
GError **error)
_gdk_pixbuf_load_module (GdkPixbufModule *image_module,
GError **error)
{
char *module_name;
char *path;
@ -338,8 +338,8 @@ m_fill_vtable (xpm);
m_fill_vtable (xbm);
gboolean
gdk_pixbuf_load_module (GdkPixbufModule *image_module,
GError **error)
_gdk_pixbuf_load_module (GdkPixbufModule *image_module,
GError **error)
{
ModuleFillVtableFunc fill_vtable = NULL;
image_module->module = (void *) 1;
@ -435,8 +435,8 @@ gdk_pixbuf_load_module (GdkPixbufModule *image_module,
GdkPixbufModule *
gdk_pixbuf_get_named_module (const char *name,
GError **error)
_gdk_pixbuf_get_named_module (const char *name,
GError **error)
{
int i;
@ -455,9 +455,9 @@ gdk_pixbuf_get_named_module (const char *name,
}
GdkPixbufModule *
gdk_pixbuf_get_module (guchar *buffer, guint size,
const gchar *filename,
GError **error)
_gdk_pixbuf_get_module (guchar *buffer, guint size,
const gchar *filename,
GError **error)
{
int i;
@ -530,14 +530,14 @@ gdk_pixbuf_new_from_file (const char *filename,
return NULL;
}
image_module = gdk_pixbuf_get_module (buffer, size, filename, error);
image_module = _gdk_pixbuf_get_module (buffer, size, filename, error);
if (image_module == NULL) {
fclose (f);
return NULL;
}
if (image_module->module == NULL)
if (!gdk_pixbuf_load_module (image_module, error)) {
if (!_gdk_pixbuf_load_module (image_module, error)) {
fclose (f);
return NULL;
}
@ -605,7 +605,7 @@ gdk_pixbuf_new_from_xpm_data (const char **data)
GError *error = NULL;
if (file_formats[XPM_FILE_FORMAT_INDEX].module == NULL) {
if (!gdk_pixbuf_load_module (&file_formats[XPM_FILE_FORMAT_INDEX], &error)) {
if (!_gdk_pixbuf_load_module (&file_formats[XPM_FILE_FORMAT_INDEX], &error)) {
g_warning ("Error loading XPM image loader: %s", error->message);
g_error_free (error);
return FALSE;
@ -671,13 +671,13 @@ gdk_pixbuf_real_save (GdkPixbuf *pixbuf,
{
GdkPixbufModule *image_module = NULL;
image_module = gdk_pixbuf_get_named_module (type, error);
image_module = _gdk_pixbuf_get_named_module (type, error);
if (image_module == NULL)
return FALSE;
if (image_module->module == NULL)
if (!gdk_pixbuf_load_module (image_module, error))
if (!_gdk_pixbuf_load_module (image_module, error))
return FALSE;
if (image_module->save == NULL) {

View File

@ -87,13 +87,13 @@ struct _GdkPixbufModule {
typedef void (* ModuleFillVtableFunc) (GdkPixbufModule *module);
GdkPixbufModule *gdk_pixbuf_get_module (guchar *buffer, guint size,
const gchar *filename,
GError **error);
GdkPixbufModule *gdk_pixbuf_get_named_module (const char *name,
GError **error);
gboolean gdk_pixbuf_load_module (GdkPixbufModule *image_module,
GError **error);
GdkPixbufModule *_gdk_pixbuf_get_module (guchar *buffer, guint size,
const gchar *filename,
GError **error);
GdkPixbufModule *_gdk_pixbuf_get_named_module (const char *name,
GError **error);
gboolean _gdk_pixbuf_load_module (GdkPixbufModule *image_module,
GError **error);

View File

@ -316,23 +316,23 @@ gdk_pixbuf_loader_load_module (GdkPixbufLoader *loader,
if (image_type)
{
priv->image_module = gdk_pixbuf_get_named_module (image_type,
error);
priv->image_module = _gdk_pixbuf_get_named_module (image_type,
error);
}
else
{
g_return_val_if_fail (priv->header_buf_offset > 0, 0);
priv->image_module = gdk_pixbuf_get_module (priv->header_buf,
priv->header_buf_offset,
NULL,
error);
priv->image_module = _gdk_pixbuf_get_module (priv->header_buf,
priv->header_buf_offset,
NULL,
error);
}
if (priv->image_module == NULL)
return 0;
if (priv->image_module->module == NULL)
if (!gdk_pixbuf_load_module (priv->image_module, error))
if (!_gdk_pixbuf_load_module (priv->image_module, error))
return 0;
if (priv->image_module->module == NULL)