1999-08-16 18:51:52 +00:00
|
|
|
<!-- ##### SECTION Title ##### -->
|
|
|
|
Drawing Primitives
|
|
|
|
|
|
|
|
<!-- ##### SECTION Short_Description ##### -->
|
2002-11-23 23:02:10 +00:00
|
|
|
Functions for drawing points, lines, arcs, and text
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
<!-- ##### SECTION Long_Description ##### -->
|
|
|
|
<para>
|
2001-02-12 17:50:13 +00:00
|
|
|
These functions provide support for drawing points, lines, arcs and text
|
|
|
|
onto what are called 'drawables'. Drawables, as the name suggests, are things
|
|
|
|
which support drawing onto them, and are either #GdkWindow or #GdkPixmap
|
|
|
|
objects.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
Many of the drawing operations take a #GdkGC argument, which represents a
|
|
|
|
graphics context. This #GdkGC contains a number of drawing attributes such
|
|
|
|
as foreground color, background color and line width, and is used to reduce
|
|
|
|
the number of arguments needed for each drawing operation. See the
|
|
|
|
<link linkend="gdk-Graphics-Contexts">Graphics Contexts</link> section for
|
|
|
|
more information.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
2003-09-11 22:09:38 +00:00
|
|
|
<para id="pango-data-structures">
|
|
|
|
Some of the drawing operations take Pango data structures like #PangoContext,
|
|
|
|
#PangoLayout or #PangoLayoutLine as arguments. If you're using GTK+, the ususal
|
|
|
|
way to obtain these structures is via gtk_widget_create_pango_context() or
|
|
|
|
gtk_widget_create_pango_layout().
|
|
|
|
</para>
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
<!-- ##### SECTION See_Also ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2005-06-20 22:06:27 +00:00
|
|
|
<!-- ##### SECTION Stability_Level ##### -->
|
|
|
|
|
|
|
|
|
2000-09-07 18:17:06 +00:00
|
|
|
<!-- ##### STRUCT GdkDrawable ##### -->
|
2002-12-17 02:07:57 +00:00
|
|
|
<para>
|
2001-11-28 19:05:58 +00:00
|
|
|
An opaque structure representing an object that can be
|
|
|
|
drawn onto. This can be a #GdkPixmap, a #GdkBitmap,
|
|
|
|
or a #GdkWindow.
|
2000-09-07 18:17:06 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_drawable_ref ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@drawable:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_drawable_unref ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@drawable:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_drawable_set_data ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@drawable:
|
|
|
|
@key:
|
|
|
|
@data:
|
|
|
|
@destroy_func:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_drawable_get_data ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@drawable:
|
|
|
|
@key:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
2002-04-30 18:07:51 +00:00
|
|
|
<!-- ##### FUNCTION gdk_drawable_get_display ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@drawable:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_drawable_get_screen ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@drawable:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
2000-09-07 18:17:06 +00:00
|
|
|
<!-- ##### FUNCTION gdk_drawable_get_visual ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@drawable:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_drawable_set_colormap ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@drawable:
|
|
|
|
@colormap:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_drawable_get_colormap ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@drawable:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_drawable_get_depth ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@drawable:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_drawable_get_size ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@drawable:
|
|
|
|
@width:
|
|
|
|
@height:
|
|
|
|
|
|
|
|
|
2001-02-20 05:21:44 +00:00
|
|
|
<!-- ##### FUNCTION gdk_drawable_get_clip_region ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@drawable:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_drawable_get_visible_region ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@drawable:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
2000-02-01 04:27:56 +00:00
|
|
|
<!-- ##### FUNCTION gdk_draw_point ##### -->
|
1999-08-16 18:51:52 +00:00
|
|
|
<para>
|
|
|
|
</para>
|
|
|
|
|
2002-11-01 00:45:32 +00:00
|
|
|
@drawable:
|
|
|
|
@gc:
|
|
|
|
@x:
|
|
|
|
@y:
|
2000-02-01 04:27:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_draw_points ##### -->
|
1999-08-16 18:51:52 +00:00
|
|
|
<para>
|
|
|
|
</para>
|
|
|
|
|
2002-11-01 00:45:32 +00:00
|
|
|
@drawable:
|
|
|
|
@gc:
|
|
|
|
@points:
|
|
|
|
@npoints:
|
1999-08-28 20:47:33 +00:00
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
|
2000-02-01 04:27:56 +00:00
|
|
|
<!-- ##### FUNCTION gdk_draw_line ##### -->
|
1999-08-16 18:51:52 +00:00
|
|
|
<para>
|
|
|
|
</para>
|
|
|
|
|
2002-11-02 18:18:50 +00:00
|
|
|
@drawable:
|
2002-11-01 00:45:32 +00:00
|
|
|
@gc:
|
2002-11-08 19:41:50 +00:00
|
|
|
@x1_:
|
|
|
|
@y1_:
|
|
|
|
@x2_:
|
|
|
|
@y2_:
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
2000-02-01 04:27:56 +00:00
|
|
|
<!-- ##### FUNCTION gdk_draw_lines ##### -->
|
1999-08-16 18:51:52 +00:00
|
|
|
<para>
|
|
|
|
</para>
|
|
|
|
|
2002-11-01 00:45:32 +00:00
|
|
|
@drawable:
|
|
|
|
@gc:
|
|
|
|
@points:
|
2001-02-12 17:50:13 +00:00
|
|
|
lines.
|
2002-11-01 00:45:32 +00:00
|
|
|
@npoints:
|
2000-02-01 04:27:56 +00:00
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
|
Documentation fixes.
Sun Oct 13 18:50:14 2002 Soeren Sandmann <sandmann@daimi.au.dk>
* gtkmenu.c, gtkmenu.sgml, gtkitemfactory.c, gdkwindow.c,
gtkwindow.c, gtkpaned.sgml, gtkdialog.c, gtkbox.h, gtkbutton.sgml,
gtktreemodel.sgml,gtktable.sgml, gtktable.c:
Documentation fixes.
#85719, #90759, #95169, Owen Taylor;
#89221, Yao Zhang, Matthias Clasen;
#95592, Joost Faassen;
#92637, Vitaly Tishkov;
#94616, Ben Martin;
#94772, sbaillie@bigpond.net.au;
2002-10-13 17:17:14 +00:00
|
|
|
<!-- ##### FUNCTION gdk_draw_pixbuf ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@drawable:
|
|
|
|
@gc:
|
|
|
|
@pixbuf:
|
|
|
|
@src_x:
|
|
|
|
@src_y:
|
|
|
|
@dest_x:
|
|
|
|
@dest_y:
|
|
|
|
@width:
|
|
|
|
@height:
|
|
|
|
@dither:
|
|
|
|
@x_dither:
|
|
|
|
@y_dither:
|
|
|
|
|
|
|
|
|
2000-02-01 04:27:56 +00:00
|
|
|
<!-- ##### FUNCTION gdk_draw_segments ##### -->
|
1999-08-16 18:51:52 +00:00
|
|
|
<para>
|
|
|
|
</para>
|
|
|
|
|
2002-11-01 00:45:32 +00:00
|
|
|
@drawable:
|
|
|
|
@gc:
|
|
|
|
@segs:
|
|
|
|
@nsegs:
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
2000-02-01 04:27:56 +00:00
|
|
|
<!-- ##### STRUCT GdkSegment ##### -->
|
1999-08-16 18:51:52 +00:00
|
|
|
<para>
|
2001-02-12 17:50:13 +00:00
|
|
|
Specifies the start and end point of a line for use by the gdk_draw_segments()
|
|
|
|
function.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-02-12 17:50:13 +00:00
|
|
|
@x1: the x coordinate of the start point.
|
|
|
|
@y1: the y coordinate of the start point.
|
|
|
|
@x2: the x coordinate of the end point.
|
|
|
|
@y2: the y coordinate of the end point.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_draw_rectangle ##### -->
|
|
|
|
<para>
|
1999-08-28 20:47:33 +00:00
|
|
|
</para>
|
2001-02-12 17:50:13 +00:00
|
|
|
<note>
|
|
|
|
<para>
|
|
|
|
</para>
|
|
|
|
</note>
|
1999-08-16 18:51:52 +00:00
|
|
|
|
2002-11-01 00:45:32 +00:00
|
|
|
@drawable:
|
|
|
|
@gc:
|
|
|
|
@filled:
|
|
|
|
@x:
|
|
|
|
@y:
|
|
|
|
@width:
|
|
|
|
@height:
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_draw_arc ##### -->
|
|
|
|
<para>
|
|
|
|
</para>
|
|
|
|
|
2002-11-01 00:45:32 +00:00
|
|
|
@drawable:
|
|
|
|
@gc:
|
|
|
|
@filled:
|
|
|
|
@x:
|
|
|
|
@y:
|
|
|
|
@width:
|
|
|
|
@height:
|
|
|
|
@angle1:
|
|
|
|
@angle2:
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_draw_polygon ##### -->
|
|
|
|
<para>
|
|
|
|
</para>
|
|
|
|
|
2002-11-01 00:45:32 +00:00
|
|
|
@drawable:
|
|
|
|
@gc:
|
|
|
|
@filled:
|
|
|
|
@points:
|
|
|
|
@npoints:
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
2004-11-21 16:24:58 +00:00
|
|
|
<!-- ##### FUNCTION gdk_draw_trapezoids ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@drawable:
|
|
|
|
@gc:
|
|
|
|
@trapezoids:
|
|
|
|
@n_trapezoids:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### STRUCT GdkTrapezoid ##### -->
|
|
|
|
<para>
|
2004-12-15 17:34:54 +00:00
|
|
|
Specifies a trapezpoid for use by the gdk_draw_trapezoids().
|
|
|
|
The trapezoids used here have parallel, horizontal top and
|
|
|
|
bottom edges.
|
2004-11-21 16:24:58 +00:00
|
|
|
</para>
|
|
|
|
|
2004-12-15 17:34:54 +00:00
|
|
|
@y1: the y coordinate of the start point.
|
|
|
|
@x11: the x coordinate of the top left corner
|
|
|
|
@x21: the x coordinate of the top right corner
|
2004-12-16 18:21:44 +00:00
|
|
|
@y2: the y coordinate of the end point.
|
2004-12-15 17:34:54 +00:00
|
|
|
@x12: the x coordinate of the bottom left corner
|
|
|
|
@x22: the x coordinate of the bottom right corner
|
2004-11-21 16:24:58 +00:00
|
|
|
|
2000-09-07 18:17:06 +00:00
|
|
|
<!-- ##### FUNCTION gdk_draw_glyphs ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@drawable:
|
|
|
|
@gc:
|
|
|
|
@font:
|
|
|
|
@x:
|
|
|
|
@y:
|
|
|
|
@glyphs:
|
|
|
|
|
|
|
|
|
2004-11-21 16:24:58 +00:00
|
|
|
<!-- ##### FUNCTION gdk_draw_glyphs_transformed ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@drawable:
|
|
|
|
@gc:
|
|
|
|
@matrix:
|
|
|
|
@font:
|
|
|
|
@x:
|
|
|
|
@y:
|
|
|
|
@glyphs:
|
|
|
|
|
|
|
|
|
2000-09-07 18:17:06 +00:00
|
|
|
<!-- ##### FUNCTION gdk_draw_layout_line ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@drawable:
|
|
|
|
@gc:
|
|
|
|
@x:
|
|
|
|
@y:
|
|
|
|
@line:
|
|
|
|
|
|
|
|
|
2001-02-20 05:21:44 +00:00
|
|
|
<!-- ##### FUNCTION gdk_draw_layout_line_with_colors ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@drawable:
|
|
|
|
@gc:
|
|
|
|
@x:
|
|
|
|
@y:
|
|
|
|
@line:
|
|
|
|
@foreground:
|
|
|
|
@background:
|
|
|
|
|
|
|
|
|
2000-09-07 18:17:06 +00:00
|
|
|
<!-- ##### FUNCTION gdk_draw_layout ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@drawable:
|
|
|
|
@gc:
|
|
|
|
@x:
|
|
|
|
@y:
|
|
|
|
@layout:
|
|
|
|
|
|
|
|
|
2001-02-20 05:21:44 +00:00
|
|
|
<!-- ##### FUNCTION gdk_draw_layout_with_colors ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@drawable:
|
|
|
|
@gc:
|
|
|
|
@x:
|
|
|
|
@y:
|
|
|
|
@layout:
|
|
|
|
@foreground:
|
|
|
|
@background:
|
|
|
|
|
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
<!-- ##### FUNCTION gdk_draw_string ##### -->
|
|
|
|
<para>
|
|
|
|
</para>
|
|
|
|
|
2002-11-01 00:45:32 +00:00
|
|
|
@drawable:
|
|
|
|
@font:
|
|
|
|
@gc:
|
|
|
|
@x:
|
|
|
|
@y:
|
2002-11-02 18:18:50 +00:00
|
|
|
@string:
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_draw_text ##### -->
|
|
|
|
<para>
|
|
|
|
</para>
|
|
|
|
|
2002-11-01 00:45:32 +00:00
|
|
|
@drawable:
|
|
|
|
@font:
|
|
|
|
@gc:
|
|
|
|
@x:
|
|
|
|
@y:
|
2002-11-02 18:18:50 +00:00
|
|
|
@text:
|
2002-11-01 00:45:32 +00:00
|
|
|
@text_length:
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_draw_text_wc ##### -->
|
|
|
|
<para>
|
|
|
|
</para>
|
|
|
|
|
2002-11-01 00:45:32 +00:00
|
|
|
@drawable:
|
|
|
|
@font:
|
|
|
|
@gc:
|
|
|
|
@x:
|
|
|
|
@y:
|
|
|
|
@text:
|
|
|
|
@text_length:
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
2000-09-07 18:17:06 +00:00
|
|
|
<!-- ##### MACRO gdk_draw_pixmap ##### -->
|
1999-08-16 18:51:52 +00:00
|
|
|
<para>
|
2001-02-12 17:50:13 +00:00
|
|
|
Draws a pixmap, or a part of a pixmap, onto another drawable.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2003-09-11 22:09:38 +00:00
|
|
|
@Deprecated: Use gdk_draw_drawable() instead.
|
2002-11-02 18:18:50 +00:00
|
|
|
|
|
|
|
|
2000-09-07 18:17:06 +00:00
|
|
|
<!-- ##### FUNCTION gdk_draw_drawable ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@drawable:
|
|
|
|
@gc:
|
|
|
|
@src:
|
|
|
|
@xsrc:
|
|
|
|
@ysrc:
|
|
|
|
@xdest:
|
|
|
|
@ydest:
|
|
|
|
@width:
|
|
|
|
@height:
|
|
|
|
|
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
<!-- ##### FUNCTION gdk_draw_image ##### -->
|
|
|
|
<para>
|
2002-11-01 00:45:32 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
@drawable:
|
|
|
|
@gc:
|
|
|
|
@image:
|
|
|
|
@xsrc:
|
|
|
|
@ysrc:
|
|
|
|
@xdest:
|
|
|
|
@ydest:
|
|
|
|
@width:
|
|
|
|
@height:
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
2000-11-14 16:36:20 +00:00
|
|
|
<!-- ##### FUNCTION gdk_drawable_get_image ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@drawable:
|
|
|
|
@x:
|
|
|
|
@y:
|
|
|
|
@width:
|
|
|
|
@height:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
2003-12-08 22:55:03 +00:00
|
|
|
<!-- ##### FUNCTION gdk_drawable_copy_to_image ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@drawable:
|
|
|
|
@image:
|
|
|
|
@src_x:
|
|
|
|
@src_y:
|
|
|
|
@dest_x:
|
|
|
|
@dest_y:
|
|
|
|
@width:
|
|
|
|
@height:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|