summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2002-10-02 22:30:37 +0000
committerOwen Taylor <otaylor@src.gnome.org>2002-10-02 22:30:37 +0000
commit6cb79658c2a64d01f6e488f065eb2d265be97414 (patch)
treee22737293757c5de6c32d8d4a440923fce99b9c3 /gdk
parented521b3cfd21763c8e049148dc004c24d0785ad6 (diff)
downloadgtk+-6cb79658c2a64d01f6e488f065eb2d265be97414.tar.gz
Export _gdk_draw_pixbuf as gdk_draw_pixbuf(), rename the _draw_pixbuf
Wed Oct 2 17:46:53 2002 Owen Taylor <otaylor@redhat.com> * gdk/gdkdrawable.h gdk/gdkinternals.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/gdkdrawable.c: Export _gdk_draw_pixbuf as gdk_draw_pixbuf(), rename the _draw_pixbuf virtual function to draw_pixbuf. (#60582) * gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable[_alpha]): Note that these functions are obsolete in the docs. * gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable): Remove all the sanity checks now we make it clear that it is obsolete name for gdk_draw_pixbuf(). * gdk/gdkpixmap.c gtk/gtkcellrendererpixbuf.c gtk/gtkimage.c gtk/gtkpixmap.c demos/testpixbuf-scale.c demos/testpixbuf.c tests/testrgb.c: Use gdk_draw_pixbuf() everywhere. * gtk/gtklabel.c (gtk_label_set_mnemonic_widget): Fix some warnings. * gdk/gdkinternals.h (struct _GdkEventPrivate): Fix missed bit from last gdk_event_get_screen() change. * gdk/gdkevents.c: Couple of small fixes.i
Diffstat (limited to 'gdk')
-rw-r--r--gdk/gdkdraw.c12
-rw-r--r--gdk/gdkdrawable.h36
-rw-r--r--gdk/gdkevents.c4
-rw-r--r--gdk/gdkinternals.h19
-rw-r--r--gdk/gdkpixbuf-render.c36
-rw-r--r--gdk/gdkpixmap.c16
-rw-r--r--gdk/gdkwindow.c32
-rw-r--r--gdk/x11/gdkdrawable-x11.c10
8 files changed, 75 insertions, 90 deletions
diff --git a/gdk/gdkdraw.c b/gdk/gdkdraw.c
index db8d11df99..fe7520263d 100644
--- a/gdk/gdkdraw.c
+++ b/gdk/gdkdraw.c
@@ -96,7 +96,7 @@ gdk_drawable_class_init (GdkDrawableClass *klass)
/* Default implementation for clip and visible region is the same */
klass->get_clip_region = gdk_drawable_real_get_visible_region;
klass->get_visible_region = gdk_drawable_real_get_visible_region;
- klass->_draw_pixbuf = gdk_drawable_real_draw_pixbuf;
+ klass->draw_pixbuf = gdk_drawable_real_draw_pixbuf;
}
/* Manipulation of drawables
@@ -584,7 +584,7 @@ gdk_draw_image (GdkDrawable *drawable,
}
/**
- * _gdk_draw_pixbuf:
+ * gdk_draw_pixbuf:
* @drawable: Destination drawable.
* @gc: a #GdkGC, used for clipping, or %NULL
* @pixbuf: a #GdkPixbuf
@@ -607,7 +607,7 @@ gdk_draw_image (GdkDrawable *drawable,
* to the X server, and may be somewhat slow.
**/
void
-_gdk_draw_pixbuf (GdkDrawable *drawable,
+gdk_draw_pixbuf (GdkDrawable *drawable,
GdkGC *gc,
GdkPixbuf *pixbuf,
gint src_x,
@@ -629,9 +629,9 @@ _gdk_draw_pixbuf (GdkDrawable *drawable,
if (height == -1)
height = gdk_pixbuf_get_height (pixbuf);
- GDK_DRAWABLE_GET_CLASS (drawable)->_draw_pixbuf (drawable, gc, pixbuf,
- src_x, src_y, dest_x, dest_y, width, height,
- dither, x_dither, y_dither);
+ GDK_DRAWABLE_GET_CLASS (drawable)->draw_pixbuf (drawable, gc, pixbuf,
+ src_x, src_y, dest_x, dest_y, width, height,
+ dither, x_dither, y_dither);
}
void
diff --git a/gdk/gdkdrawable.h b/gdk/gdkdrawable.h
index 32982ddfc0..6200dc7424 100644
--- a/gdk/gdkdrawable.h
+++ b/gdk/gdkdrawable.h
@@ -134,18 +134,18 @@ struct _GdkDrawableClass
gint *composite_x_offset,
gint *composite_y_offset);
- void (*_draw_pixbuf) (GdkDrawable *drawable,
- GdkGC *gc,
- GdkPixbuf *pixbuf,
- gint src_x,
- gint src_y,
- gint dest_x,
- gint dest_y,
- gint width,
- gint height,
- GdkRgbDither dither,
- gint x_dither,
- gint y_dither);
+ void (*draw_pixbuf) (GdkDrawable *drawable,
+ GdkGC *gc,
+ GdkPixbuf *pixbuf,
+ gint src_x,
+ gint src_y,
+ gint dest_x,
+ gint dest_y,
+ gint width,
+ gint height,
+ GdkRgbDither dither,
+ gint x_dither,
+ gint y_dither);
GdkImage* (*_copy_to_image) (GdkDrawable *drawable,
GdkImage *image,
gint src_x,
@@ -288,6 +288,18 @@ void gdk_draw_lines (GdkDrawable *drawable,
GdkGC *gc,
GdkPoint *points,
gint npoints);
+void gdk_draw_pixbuf (GdkDrawable *drawable,
+ GdkGC *gc,
+ GdkPixbuf *pixbuf,
+ gint src_x,
+ gint src_y,
+ gint dest_x,
+ gint dest_y,
+ gint width,
+ gint height,
+ GdkRgbDither dither,
+ gint x_dither,
+ gint y_dither);
void gdk_draw_glyphs (GdkDrawable *drawable,
GdkGC *gc,
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c
index ab93e69361..ca3088cad2 100644
--- a/gdk/gdkevents.c
+++ b/gdk/gdkevents.c
@@ -286,6 +286,8 @@ gdk_event_is_allocated (GdkEvent *event)
{
if (event_hash)
return g_hash_table_lookup (event_hash, event) != NULL;
+
+ return FALSE;
}
/**
@@ -414,7 +416,7 @@ gdk_event_free (GdkEvent *event)
break;
}
- g_hash_table_remove (event_chunk, event);
+ g_hash_table_remove (event_hash, event);
g_mem_chunk_free (event_chunk, event);
}
diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h
index d322e10348..a0255ca07d 100644
--- a/gdk/gdkinternals.h
+++ b/gdk/gdkinternals.h
@@ -155,8 +155,9 @@ typedef enum
struct _GdkEventPrivate
{
- GdkEvent event;
- guint flags;
+ GdkEvent event;
+ guint flags;
+ GdkScreen *screen;
};
extern GdkEventFunc _gdk_event_func; /* Callback for events */
@@ -202,20 +203,6 @@ GdkImage *_gdk_image_get_scratch (GdkScreen *screen,
gint *x,
gint *y);
-/* Will most likely be exported in the future
- */
-void _gdk_draw_pixbuf (GdkDrawable *drawable,
- GdkGC *gc,
- GdkPixbuf *pixbuf,
- gint src_x,
- gint src_y,
- gint dest_x,
- gint dest_y,
- gint width,
- gint height,
- GdkRgbDither dither,
- gint x_dither,
- gint y_dither);
GdkImage *_gdk_drawable_copy_to_image (GdkDrawable *drawable,
GdkImage *image,
gint src_x,
diff --git a/gdk/gdkpixbuf-render.c b/gdk/gdkpixbuf-render.c
index 08ef3c4f33..ef920b8b66 100644
--- a/gdk/gdkpixbuf-render.c
+++ b/gdk/gdkpixbuf-render.c
@@ -22,7 +22,6 @@
#include <config.h>
#include <gdk/gdk.h>
-#include "gdkinternals.h" /* _gdk_draw_pixbuf() */
#include "gdk-pixbuf-private.h"
#include "gdkpixbuf.h"
#include "gdkscreen.h"
@@ -164,6 +163,8 @@ gdk_pixbuf_render_threshold_alpha (GdkPixbuf *pixbuf,
* base position change, as in scrolling. The dither matrix has to be shifted
* for consistent visual results. If you do not have any of these cases, the
* dither offsets can be both zero.
+ *
+ * This function is obsolete. Use gdk_draw_pixbuf() instead.
**/
void
gdk_pixbuf_render_to_drawable (GdkPixbuf *pixbuf,
@@ -175,28 +176,9 @@ gdk_pixbuf_render_to_drawable (GdkPixbuf *pixbuf,
GdkRgbDither dither,
int x_dither, int y_dither)
{
- g_return_if_fail (GDK_IS_PIXBUF (pixbuf));
- g_return_if_fail (pixbuf->colorspace == GDK_COLORSPACE_RGB);
- g_return_if_fail (pixbuf->n_channels == 3 || pixbuf->n_channels == 4);
- g_return_if_fail (pixbuf->bits_per_sample == 8);
-
- g_return_if_fail (drawable != NULL);
-
- if (width == -1)
- width = pixbuf->width;
- if (height == -1)
- height = pixbuf->height;
-
- g_return_if_fail (width >= 0 && height >= 0);
- g_return_if_fail (src_x >= 0 && src_x + width <= pixbuf->width);
- g_return_if_fail (src_y >= 0 && src_y + height <= pixbuf->height);
-
- if (width == 0 || height == 0)
- return;
-
- _gdk_draw_pixbuf (drawable, gc, pixbuf,
- src_x, src_y, dest_x, dest_y, width, height,
- dither, x_dither, y_dither);
+ gdk_draw_pixbuf (drawable, gc, pixbuf,
+ src_x, src_y, dest_x, dest_y, width, height,
+ dither, x_dither, y_dither);
}
@@ -224,6 +206,8 @@ gdk_pixbuf_render_to_drawable (GdkPixbuf *pixbuf,
*
* On older X servers, rendering pixbufs with an alpha channel involves round trips
* to the X server, and may be somewhat slow.
+ *
+ * This function is obsolete. Use gdk_draw_pixbuf() instead.
**/
void
gdk_pixbuf_render_to_drawable_alpha (GdkPixbuf *pixbuf,
@@ -236,9 +220,9 @@ gdk_pixbuf_render_to_drawable_alpha (GdkPixbuf *pixbuf,
GdkRgbDither dither,
int x_dither, int y_dither)
{
- _gdk_draw_pixbuf (drawable, NULL, pixbuf,
- src_x, src_y, dest_x, dest_y, width, height,
- dither, x_dither, y_dither);
+ gdk_draw_pixbuf (drawable, NULL, pixbuf,
+ src_x, src_y, dest_x, dest_y, width, height,
+ dither, x_dither, y_dither);
}
/**
diff --git a/gdk/gdkpixmap.c b/gdk/gdkpixmap.c
index a6004b55f7..af90a7546a 100644
--- a/gdk/gdkpixmap.c
+++ b/gdk/gdkpixmap.c
@@ -200,7 +200,7 @@ gdk_pixmap_class_init (GdkPixmapObjectClass *klass)
drawable_class->draw_lines = gdk_pixmap_draw_lines;
drawable_class->draw_glyphs = gdk_pixmap_draw_glyphs;
drawable_class->draw_image = gdk_pixmap_draw_image;
- drawable_class->_draw_pixbuf = gdk_pixmap_draw_pixbuf;
+ drawable_class->draw_pixbuf = gdk_pixmap_draw_pixbuf;
drawable_class->get_depth = gdk_pixmap_real_get_depth;
drawable_class->get_screen = gdk_pixmap_real_get_screen;
drawable_class->get_size = gdk_pixmap_real_get_size;
@@ -402,9 +402,9 @@ gdk_pixmap_draw_pixbuf (GdkDrawable *drawable,
{
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
- _gdk_draw_pixbuf (private->impl, gc, pixbuf,
- src_x, src_y, dest_x, dest_y, width, height,
- dither, x_dither, y_dither);
+ gdk_draw_pixbuf (private->impl, gc, pixbuf,
+ src_x, src_y, dest_x, dest_y, width, height,
+ dither, x_dither, y_dither);
}
static void
@@ -528,10 +528,10 @@ gdk_pixmap_colormap_new_from_pixbuf (GdkColormap *colormap,
render_pixbuf = pixbuf;
tmp_gc = gdk_gc_new (pixmap);
- gdk_pixbuf_render_to_drawable (render_pixbuf, pixmap, tmp_gc, 0, 0, 0, 0,
- gdk_pixbuf_get_width (render_pixbuf),
- gdk_pixbuf_get_height (render_pixbuf),
- GDK_RGB_DITHER_NORMAL, 0, 0);
+ gdk_draw_pixbuf (pixmap, tmp_gc, render_pixbuf, 0, 0, 0, 0,
+ gdk_pixbuf_get_width (render_pixbuf),
+ gdk_pixbuf_get_height (render_pixbuf),
+ GDK_RGB_DITHER_NORMAL, 0, 0);
g_object_unref (tmp_gc);
if (render_pixbuf != pixbuf)
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 5ed1ac0658..320b5dff5f 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -240,7 +240,7 @@ gdk_window_class_init (GdkWindowObjectClass *klass)
drawable_class->draw_lines = gdk_window_draw_lines;
drawable_class->draw_glyphs = gdk_window_draw_glyphs;
drawable_class->draw_image = gdk_window_draw_image;
- drawable_class->_draw_pixbuf = gdk_window_draw_pixbuf;
+ drawable_class->draw_pixbuf = gdk_window_draw_pixbuf;
drawable_class->get_depth = gdk_window_real_get_depth;
drawable_class->get_screen = gdk_window_real_get_screen;
drawable_class->get_size = gdk_window_real_get_size;
@@ -1945,16 +1945,16 @@ gdk_window_draw_pixbuf (GdkDrawable *drawable,
if (private->paint_stack)
{
GdkWindowPaint *paint = private->paint_stack->data;
- _gdk_draw_pixbuf (paint->pixmap, gc, pixbuf, src_x, src_y,
- dest_x - x_offset, dest_y - y_offset,
- width, height,
- dither, x_dither - x_offset, y_dither - y_offset);
+ gdk_draw_pixbuf (paint->pixmap, gc, pixbuf, src_x, src_y,
+ dest_x - x_offset, dest_y - y_offset,
+ width, height,
+ dither, x_dither - x_offset, y_dither - y_offset);
}
else
- _gdk_draw_pixbuf (private->impl, gc, pixbuf, src_x, src_y,
- dest_x - x_offset, dest_y - y_offset,
- width, height,
- dither, x_dither, y_dither);
+ gdk_draw_pixbuf (private->impl, gc, pixbuf, src_x, src_y,
+ dest_x - x_offset, dest_y - y_offset,
+ width, height,
+ dither, x_dither, y_dither);
RESTORE_GC (gc);
}
@@ -1966,16 +1966,16 @@ gdk_window_draw_pixbuf (GdkDrawable *drawable,
if (private->paint_stack)
{
GdkWindowPaint *paint = private->paint_stack->data;
- _gdk_draw_pixbuf (paint->pixmap, gc, pixbuf, src_x, src_y,
- dest_x - x_offset, dest_y - y_offset,
- width, height,
+ gdk_draw_pixbuf (paint->pixmap, gc, pixbuf, src_x, src_y,
+ dest_x - x_offset, dest_y - y_offset,
+ width, height,
dither, x_dither - x_offset, y_dither - y_offset);
}
else
- _gdk_draw_pixbuf (private->impl, gc, pixbuf, src_x, src_y,
- dest_x - x_offset, dest_y - y_offset,
- width, height,
- dither, x_dither, y_dither);
+ gdk_draw_pixbuf (private->impl, gc, pixbuf, src_x, src_y,
+ dest_x - x_offset, dest_y - y_offset,
+ width, height,
+ dither, x_dither, y_dither);
}
}
diff --git a/gdk/x11/gdkdrawable-x11.c b/gdk/x11/gdkdrawable-x11.c
index 868c348d0c..d6ec59332d 100644
--- a/gdk/x11/gdkdrawable-x11.c
+++ b/gdk/x11/gdkdrawable-x11.c
@@ -202,7 +202,7 @@ gdk_drawable_impl_x11_class_init (GdkDrawableImplX11Class *klass)
drawable_class->draw_glyphs = gdk_x11_draw_glyphs;
drawable_class->draw_image = gdk_x11_draw_image;
#ifdef HAVE_XFT
- drawable_class->_draw_pixbuf = gdk_x11_draw_pixbuf;
+ drawable_class->draw_pixbuf = gdk_x11_draw_pixbuf;
#endif /* HAVE_XFT */
drawable_class->set_colormap = gdk_x11_set_colormap;
@@ -1339,10 +1339,10 @@ gdk_x11_draw_pixbuf (GdkDrawable *drawable,
(dither == GDK_RGB_DITHER_MAX && gdk_drawable_get_depth (drawable) != 24))
{
GdkDrawable *wrapper = GDK_DRAWABLE_IMPL_X11 (drawable)->wrapper;
- GDK_DRAWABLE_CLASS (parent_class)->_draw_pixbuf (wrapper, gc, pixbuf,
- src_x, src_y, dest_x, dest_y,
- width, height,
- dither, x_dither, y_dither);
+ GDK_DRAWABLE_CLASS (parent_class)->draw_pixbuf (wrapper, gc, pixbuf,
+ src_x, src_y, dest_x, dest_y,
+ width, height,
+ dither, x_dither, y_dither);
return;
}