mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 19:00:08 +00:00
API: remove gdk_draw_point(s)
This commit is contained in:
parent
a9e99e7f5b
commit
9ee5176492
@ -334,8 +334,6 @@ gdk_drawable_get_clip_region
|
||||
gdk_drawable_get_visible_region
|
||||
|
||||
<SUBSECTION>
|
||||
gdk_draw_point
|
||||
gdk_draw_points
|
||||
gdk_draw_rectangle
|
||||
gdk_draw_layout_line
|
||||
gdk_draw_layout_line_with_colors
|
||||
|
@ -127,26 +127,6 @@ or a #GdkWindow.
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_draw_point ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@drawable:
|
||||
@gc:
|
||||
@x:
|
||||
@y:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_draw_points ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@drawable:
|
||||
@gc:
|
||||
@points:
|
||||
@n_points:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_draw_rectangle ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
@ -605,54 +605,6 @@ gdk_directfb_draw_drawable (GdkDrawable *drawable,
|
||||
temp_region_deinit( &clip );
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_directfb_draw_points (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkPoint *points,
|
||||
gint npoints)
|
||||
{
|
||||
GdkDrawableImplDirectFB *impl;
|
||||
cairo_region_t clip;
|
||||
|
||||
DFBRegion region = { points->x, points->y, points->x, points->y };
|
||||
|
||||
D_DEBUG_AT( GDKDFB_Drawable, "%s( %p, %p, %p, %d )\n", G_STRFUNC, drawable, gc, points, npoints );
|
||||
|
||||
if (npoints < 1)
|
||||
return;
|
||||
|
||||
impl = GDK_DRAWABLE_IMPL_DIRECTFB (drawable);
|
||||
|
||||
if (!gdk_directfb_setup_for_drawing (impl, GDK_GC_DIRECTFB (gc)))
|
||||
return;
|
||||
|
||||
gdk_directfb_clip_region (drawable, gc, NULL, &clip);
|
||||
|
||||
while (npoints > 0)
|
||||
{
|
||||
if (cairo_region_contains_point (&clip, points->x, points->y))
|
||||
{
|
||||
impl->surface->FillRectangle (impl->surface,
|
||||
points->x, points->y, 1, 1);
|
||||
|
||||
if (points->x < region.x1)
|
||||
region.x1 = points->x;
|
||||
if (points->x > region.x2)
|
||||
region.x2 = points->x;
|
||||
|
||||
if (points->y < region.y1)
|
||||
region.y1 = points->y;
|
||||
if (points->y > region.y2)
|
||||
region.y2 = points->y;
|
||||
}
|
||||
|
||||
npoints--;
|
||||
points++;
|
||||
}
|
||||
|
||||
temp_region_deinit( &clip );
|
||||
}
|
||||
|
||||
static inline void
|
||||
convert_rgba_pixbuf_to_image (guint32 *src,
|
||||
guint src_pitch,
|
||||
@ -751,7 +703,6 @@ gdk_drawable_impl_directfb_class_init (GdkDrawableImplDirectFBClass *klass)
|
||||
drawable_class->create_gc = _gdk_directfb_gc_new;
|
||||
drawable_class->draw_rectangle = gdk_directfb_draw_rectangle;
|
||||
drawable_class->draw_drawable = gdk_directfb_draw_drawable;
|
||||
drawable_class->draw_points = gdk_directfb_draw_points;
|
||||
|
||||
drawable_class->ref_cairo_surface = gdk_directfb_ref_cairo_surface;
|
||||
drawable_class->set_colormap = gdk_directfb_set_colormap;
|
||||
|
@ -550,8 +550,6 @@ gdk_drawable_get_visible_region
|
||||
gdk_drawable_get_visual
|
||||
gdk_drawable_set_colormap
|
||||
gdk_draw_drawable
|
||||
gdk_draw_point
|
||||
gdk_draw_points
|
||||
gdk_draw_rectangle
|
||||
#endif
|
||||
#endif
|
||||
|
@ -214,33 +214,6 @@ gdk_drawable_get_colormap (GdkDrawable *drawable)
|
||||
/* Drawing
|
||||
*/
|
||||
|
||||
/**
|
||||
* gdk_draw_point:
|
||||
* @drawable: a #GdkDrawable (a #GdkWindow or a #GdkPixmap).
|
||||
* @gc: a #GdkGC.
|
||||
* @x: the x coordinate of the point.
|
||||
* @y: the y coordinate of the point.
|
||||
*
|
||||
* Draws a point, using the foreground color and other attributes of
|
||||
* the #GdkGC.
|
||||
**/
|
||||
void
|
||||
gdk_draw_point (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
gint x,
|
||||
gint y)
|
||||
{
|
||||
GdkPoint point;
|
||||
|
||||
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
|
||||
point.x = x;
|
||||
point.y = y;
|
||||
|
||||
GDK_DRAWABLE_GET_CLASS (drawable)->draw_points (drawable, gc, &point, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_draw_rectangle:
|
||||
* @drawable: a #GdkDrawable (a #GdkWindow or a #GdkPixmap).
|
||||
@ -382,34 +355,6 @@ gdk_draw_drawable (GdkDrawable *drawable,
|
||||
g_object_unref (composite);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_draw_points:
|
||||
* @drawable: a #GdkDrawable (a #GdkWindow or a #GdkPixmap).
|
||||
* @gc: a #GdkGC.
|
||||
* @points: an array of #GdkPoint structures.
|
||||
* @n_points: the number of points to be drawn.
|
||||
*
|
||||
* Draws a number of points, using the foreground color and other
|
||||
* attributes of the #GdkGC.
|
||||
**/
|
||||
void
|
||||
gdk_draw_points (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
const GdkPoint *points,
|
||||
gint n_points)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
|
||||
g_return_if_fail ((points != NULL) && (n_points > 0));
|
||||
g_return_if_fail (GDK_IS_GC (gc));
|
||||
g_return_if_fail (n_points >= 0);
|
||||
|
||||
if (n_points == 0)
|
||||
return;
|
||||
|
||||
GDK_DRAWABLE_GET_CLASS (drawable)->draw_points (drawable, gc,
|
||||
(GdkPoint *) points, n_points);
|
||||
}
|
||||
|
||||
static GdkDrawable *
|
||||
gdk_drawable_real_get_composite_drawable (GdkDrawable *drawable,
|
||||
gint x,
|
||||
|
@ -76,10 +76,6 @@ struct _GdkDrawableClass
|
||||
gint ydest,
|
||||
gint width,
|
||||
gint height);
|
||||
void (*draw_points) (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkPoint *points,
|
||||
gint npoints);
|
||||
|
||||
gint (*get_depth) (GdkDrawable *drawable);
|
||||
void (*get_size) (GdkDrawable *drawable,
|
||||
@ -154,10 +150,6 @@ GdkDisplay* gdk_drawable_get_display (GdkDrawable *drawable);
|
||||
|
||||
/* Drawing
|
||||
*/
|
||||
void gdk_draw_point (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
gint x,
|
||||
gint y);
|
||||
void gdk_draw_rectangle (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
gboolean filled,
|
||||
@ -174,10 +166,6 @@ void gdk_draw_drawable (GdkDrawable *drawable,
|
||||
gint ydest,
|
||||
gint width,
|
||||
gint height);
|
||||
void gdk_draw_points (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
const GdkPoint *points,
|
||||
gint n_points);
|
||||
|
||||
void gdk_draw_layout_line (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
|
@ -323,43 +323,6 @@ gdk_offscreen_window_draw_rectangle (GdkDrawable *drawable,
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_offscreen_window_draw_points (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkPoint *points,
|
||||
gint npoints)
|
||||
{
|
||||
GdkOffscreenWindow *offscreen = GDK_OFFSCREEN_WINDOW (drawable);
|
||||
GdkDrawable *real_drawable = get_real_drawable (offscreen);
|
||||
|
||||
gdk_draw_points (real_drawable,
|
||||
gc,
|
||||
points,
|
||||
npoints);
|
||||
|
||||
|
||||
if (npoints > 0)
|
||||
{
|
||||
int min_x, min_y, max_x, max_y, i;
|
||||
|
||||
min_x = max_x = points[0].x;
|
||||
min_y = max_y = points[0].y;
|
||||
|
||||
for (i = 1; i < npoints; i++)
|
||||
{
|
||||
min_x = MIN (min_x, points[i].x);
|
||||
max_x = MAX (max_x, points[i].x);
|
||||
min_y = MIN (min_y, points[i].y);
|
||||
max_y = MAX (max_y, points[i].y);
|
||||
}
|
||||
|
||||
add_damage (offscreen, min_x, min_y,
|
||||
max_x - min_x + 1,
|
||||
max_y - min_y + 1,
|
||||
FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_offscreen_window_new (GdkWindow *window,
|
||||
GdkScreen *screen,
|
||||
@ -986,7 +949,6 @@ gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
|
||||
|
||||
drawable_class->draw_rectangle = gdk_offscreen_window_draw_rectangle;
|
||||
drawable_class->draw_drawable_with_src = gdk_offscreen_window_draw_drawable;
|
||||
drawable_class->draw_points = gdk_offscreen_window_draw_points;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -51,10 +51,6 @@ static void gdk_pixmap_draw_drawable (GdkDrawable *drawable,
|
||||
gint width,
|
||||
gint height,
|
||||
GdkPixmap *original_src);
|
||||
static void gdk_pixmap_draw_points (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkPoint *points,
|
||||
gint npoints);
|
||||
|
||||
static void gdk_pixmap_real_get_size (GdkDrawable *drawable,
|
||||
gint *width,
|
||||
@ -115,7 +111,6 @@ gdk_pixmap_class_init (GdkPixmapObjectClass *klass)
|
||||
drawable_class->create_gc = gdk_pixmap_create_gc;
|
||||
drawable_class->draw_rectangle = gdk_pixmap_draw_rectangle;
|
||||
drawable_class->draw_drawable_with_src = gdk_pixmap_draw_drawable;
|
||||
drawable_class->draw_points = gdk_pixmap_draw_points;
|
||||
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;
|
||||
@ -234,18 +229,6 @@ gdk_pixmap_draw_drawable (GdkDrawable *drawable,
|
||||
original_src);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_pixmap_draw_points (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkPoint *points,
|
||||
gint npoints)
|
||||
{
|
||||
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
|
||||
|
||||
_gdk_gc_remove_drawable_clip (gc);
|
||||
gdk_draw_points (private->impl, gc, points, npoints);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_pixmap_real_get_size (GdkDrawable *drawable,
|
||||
gint *width,
|
||||
|
@ -246,10 +246,6 @@ static void gdk_window_draw_drawable (GdkDrawable *drawable,
|
||||
gint width,
|
||||
gint height,
|
||||
GdkDrawable *original_src);
|
||||
static void gdk_window_draw_points (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkPoint *points,
|
||||
gint npoints);
|
||||
|
||||
static cairo_surface_t *gdk_window_ref_cairo_surface (GdkDrawable *drawable);
|
||||
static cairo_surface_t *gdk_window_create_cairo_surface (GdkDrawable *drawable,
|
||||
@ -430,7 +426,6 @@ gdk_window_class_init (GdkWindowObjectClass *klass)
|
||||
drawable_class->create_gc = gdk_window_create_gc;
|
||||
drawable_class->draw_rectangle = gdk_window_draw_rectangle;
|
||||
drawable_class->draw_drawable_with_src = gdk_window_draw_drawable;
|
||||
drawable_class->draw_points = gdk_window_draw_points;
|
||||
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;
|
||||
@ -4194,41 +4189,6 @@ gdk_window_draw_drawable (GdkDrawable *drawable,
|
||||
END_DRAW;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_window_draw_points (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkPoint *points,
|
||||
gint npoints)
|
||||
{
|
||||
GdkPoint *new_points;
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (drawable))
|
||||
return;
|
||||
|
||||
BEGIN_DRAW;
|
||||
|
||||
if (x_offset != 0 || y_offset != 0)
|
||||
{
|
||||
gint i;
|
||||
|
||||
new_points = g_new (GdkPoint, npoints);
|
||||
for (i=0; i<npoints; i++)
|
||||
{
|
||||
new_points[i].x = points[i].x - x_offset;
|
||||
new_points[i].y = points[i].y - y_offset;
|
||||
}
|
||||
}
|
||||
else
|
||||
new_points = points;
|
||||
|
||||
gdk_draw_points (impl, gc, new_points, npoints);
|
||||
|
||||
if (new_points != points)
|
||||
g_free (new_points);
|
||||
|
||||
END_DRAW;
|
||||
}
|
||||
|
||||
static cairo_t *
|
||||
setup_backing_rect (GdkWindow *window, GdkWindowPaint *paint, int x_offset_cairo, int y_offset_cairo)
|
||||
{
|
||||
|
@ -265,32 +265,6 @@ gdk_quartz_draw_drawable (GdkDrawable *drawable,
|
||||
src_depth, dest_depth);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_quartz_draw_points (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkPoint *points,
|
||||
gint npoints)
|
||||
{
|
||||
CGContextRef context = gdk_quartz_drawable_get_context (drawable, FALSE);
|
||||
int i;
|
||||
|
||||
if (!context)
|
||||
return;
|
||||
|
||||
_gdk_quartz_gc_update_cg_context (gc, drawable, context,
|
||||
GDK_QUARTZ_CONTEXT_STROKE |
|
||||
GDK_QUARTZ_CONTEXT_FILL);
|
||||
|
||||
/* Just draw 1x1 rectangles */
|
||||
for (i = 0; i < npoints; i++)
|
||||
{
|
||||
CGRect rect = CGRectMake (points[i].x, points[i].y, 1, 1);
|
||||
CGContextFillRect (context, rect);
|
||||
}
|
||||
|
||||
gdk_quartz_drawable_release_context (drawable, context);
|
||||
}
|
||||
|
||||
static inline void
|
||||
gdk_quartz_fix_cap_not_last_line (GdkGCQuartz *private,
|
||||
gint x1,
|
||||
@ -342,7 +316,6 @@ gdk_drawable_impl_quartz_class_init (GdkDrawableImplQuartzClass *klass)
|
||||
drawable_class->create_gc = _gdk_quartz_gc_new;
|
||||
drawable_class->draw_rectangle = gdk_quartz_draw_rectangle;
|
||||
drawable_class->draw_drawable_with_src = gdk_quartz_draw_drawable;
|
||||
drawable_class->draw_points = gdk_quartz_draw_points;
|
||||
|
||||
drawable_class->ref_cairo_surface = gdk_quartz_ref_cairo_surface;
|
||||
|
||||
|
@ -65,10 +65,6 @@ static void gdk_win32_draw_drawable (GdkDrawable *drawable,
|
||||
gint width,
|
||||
gint height,
|
||||
GdkDrawable *original_src);
|
||||
static void gdk_win32_draw_points (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkPoint *points,
|
||||
gint npoints);
|
||||
|
||||
static cairo_surface_t *gdk_win32_ref_cairo_surface (GdkDrawable *drawable);
|
||||
|
||||
@ -101,7 +97,6 @@ _gdk_drawable_impl_win32_class_init (GdkDrawableImplWin32Class *klass)
|
||||
drawable_class->create_gc = _gdk_win32_gc_new;
|
||||
drawable_class->draw_rectangle = gdk_win32_draw_rectangle;
|
||||
drawable_class->draw_drawable_with_src = gdk_win32_draw_drawable;
|
||||
drawable_class->draw_points = gdk_win32_draw_points;
|
||||
|
||||
drawable_class->ref_cairo_surface = gdk_win32_ref_cairo_surface;
|
||||
|
||||
@ -775,37 +770,6 @@ gdk_win32_draw_drawable (GdkDrawable *drawable,
|
||||
xdest, ydest, width, height);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_win32_draw_points (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkPoint *points,
|
||||
gint npoints)
|
||||
{
|
||||
HDC hdc;
|
||||
HGDIOBJ old_pen;
|
||||
int i;
|
||||
|
||||
hdc = gdk_win32_hdc_get (drawable, gc, GDK_GC_FOREGROUND);
|
||||
|
||||
GDK_NOTE (DRAW, g_print ("gdk_win32_draw_points: %s %d points\n",
|
||||
_gdk_win32_drawable_description (drawable),
|
||||
npoints));
|
||||
|
||||
/* The X11 version uses XDrawPoint(), which doesn't use the fill
|
||||
* mode, so don't use generic_draw. But we should use the current
|
||||
* function, so we can't use SetPixel(). Draw single-pixel
|
||||
* rectangles (sigh).
|
||||
*/
|
||||
|
||||
old_pen = SelectObject (hdc, GetStockObject (NULL_PEN));
|
||||
for (i = 0; i < npoints; i++)
|
||||
Rectangle (hdc, points[i].x, points[i].y,
|
||||
points[i].x + 2, points[i].y + 2);
|
||||
|
||||
SelectObject (hdc, old_pen);
|
||||
gdk_win32_hdc_release (drawable, gc, GDK_GC_FOREGROUND);
|
||||
}
|
||||
|
||||
static void
|
||||
blit_from_pixmap (gboolean use_fg_bg,
|
||||
GdkDrawableImplWin32 *dest,
|
||||
|
@ -65,10 +65,6 @@ static void gdk_x11_draw_drawable (GdkDrawable *drawable,
|
||||
gint width,
|
||||
gint height,
|
||||
GdkDrawable *original_src);
|
||||
static void gdk_x11_draw_points (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkPoint *points,
|
||||
gint npoints);
|
||||
|
||||
static cairo_surface_t *gdk_x11_ref_cairo_surface (GdkDrawable *drawable);
|
||||
|
||||
@ -97,7 +93,6 @@ _gdk_drawable_impl_x11_class_init (GdkDrawableImplX11Class *klass)
|
||||
drawable_class->create_gc = _gdk_x11_gc_new;
|
||||
drawable_class->draw_rectangle = gdk_x11_draw_rectangle;
|
||||
drawable_class->draw_drawable_with_src = gdk_x11_draw_drawable;
|
||||
drawable_class->draw_points = gdk_x11_draw_points;
|
||||
|
||||
drawable_class->ref_cairo_surface = gdk_x11_ref_cairo_surface;
|
||||
|
||||
@ -400,49 +395,6 @@ gdk_x11_draw_drawable (GdkDrawable *drawable,
|
||||
src_depth, dest_depth);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_x11_draw_points (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkPoint *points,
|
||||
gint npoints)
|
||||
{
|
||||
GdkDrawableImplX11 *impl;
|
||||
|
||||
impl = GDK_DRAWABLE_IMPL_X11 (drawable);
|
||||
|
||||
|
||||
/* We special-case npoints == 1, because X will merge multiple
|
||||
* consecutive XDrawPoint requests into a PolyPoint request
|
||||
*/
|
||||
if (npoints == 1)
|
||||
{
|
||||
XDrawPoint (GDK_SCREEN_XDISPLAY (impl->screen),
|
||||
impl->xid,
|
||||
GDK_GC_GET_XGC (gc),
|
||||
points[0].x, points[0].y);
|
||||
}
|
||||
else
|
||||
{
|
||||
gint i;
|
||||
XPoint *tmp_points = g_new (XPoint, npoints);
|
||||
|
||||
for (i=0; i<npoints; i++)
|
||||
{
|
||||
tmp_points[i].x = points[i].x;
|
||||
tmp_points[i].y = points[i].y;
|
||||
}
|
||||
|
||||
XDrawPoints (GDK_SCREEN_XDISPLAY (impl->screen),
|
||||
impl->xid,
|
||||
GDK_GC_GET_XGC (gc),
|
||||
tmp_points,
|
||||
npoints,
|
||||
CoordModeOrigin);
|
||||
|
||||
g_free (tmp_points);
|
||||
}
|
||||
}
|
||||
|
||||
static gint
|
||||
gdk_x11_get_depth (GdkDrawable *drawable)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user