/src/wrappers/gdk/library/gdk_drawable.e

http://github.com/tybor/Liberty · Specman e · 554 lines · 101 code · 96 blank · 357 comment · 5 complexity · aa41d493aa861070b3d5b870128e7798 MD5 · raw file

  1. indexing
  2. description: "GDK_DRAWABLE - Drawing Primitives ??????Functions for drawing points, lines, arcs, and text."
  3. copyright: "[
  4. Copyright (C) 2006 eiffel-libraries team, GTK+ team
  5. This library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Lesser General Public License
  7. as published by the Free Software Foundation; either version 2.1 of
  8. the License, or (at your option) any later version.
  9. This library is distributed in the hope that it will be useful, but
  10. WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. Lesser General Public License for more details.
  13. You should have received a copy of the GNU Lesser General Public
  14. License along with this library; if not, write to the Free Software
  15. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  16. 02110-1301 USA
  17. ]"
  18. deferred class GDK_DRAWABLE
  19. -- These functions provide support for drawing points, lines, arcs
  20. -- and text onto what are called 'drawables'. Drawables, as the
  21. -- name suggests, are things which support drawing onto them, and
  22. -- are either GdkWindow or GdkPixmap objects.
  23. -- Many of the drawing operations take a GdkGC argument, which
  24. -- represents a graphics context. This GdkGC contains a number of
  25. -- drawing attributes such as foreground color, background color
  26. -- and line width, and is used to reduce the number of arguments
  27. -- needed for each drawing operation. See the Graphics Contexts
  28. -- section for more information.
  29. -- Some of the drawing operations take Pango data structures like
  30. -- PangoContext, PangoLayout or PangoLayoutLine as arguments. If
  31. -- you're using GTK+, the ususal way to obtain these structures is
  32. -- via gtk_widget_create_pango_context() or
  33. -- gtk_widget_create_pango_layout().
  34. inherit G_OBJECT
  35. insert GDK_DRAWABLE_EXTERNALS
  36. feature
  37. context: CAIRO_CONTEXT is
  38. -- A (newly allocated) context for drawing to drawable.
  39. do
  40. create Result.from_external_pointer (handle)
  41. -- Note: A CAIRO_CONTEXT will automatically call cairo_destroy when
  42. -- disposed. In fact, since it is a REFERENCE_COUNTE when disposed. In
  43. -- fact, since it is a REFERENCE_COUNTED, its memory will be handled by
  44. -- SmartEiffel garbage collector.
  45. end
  46. -- TODO: display: GDK_DISPLAY is
  47. -- the GdkDisplay associated with a GdkDrawable.
  48. -- do
  49. -- create Result.from_external_pointer (gdk_drawable_get_display (handle))
  50. -- end
  51. -- TODO: screen: GDK_SCREEN is
  52. -- the GdkScreen associated with a GdkDrawable.
  53. -- do
  54. -- create Result.from_external_pointer (gdk_drawable_get_screen (handle))
  55. -- end
  56. -- TODO: visual: GDK_VISUAL is
  57. -- the GdkVisual describing the pixel format of drawable.
  58. -- do
  59. -- create Result.from_external_pointer (gdk_drawable_get_visual (handle))
  60. -- end
  61. -- TODO: gdk_drawable_set_colormap ()
  62. -- void gdk_drawable_set_colormap (GdkDrawable *drawable,
  63. -- GdkColormap *colormap);
  64. -- Sets the colormap associated with drawable. Normally this will happen automatically when the drawable is created; you only need to use this function if the drawable-creating function did not have a way to determine the colormap, and you then use drawable operations that require a colormap. The colormap for all drawables and graphics contexts you intend to use together should match. i.e. when using a GdkGC to draw to a drawable, or copying one drawable to another, the colormaps should match.
  65. -- drawable : a GdkDrawable
  66. -- colormap : a GdkColormap
  67. -- gdk_drawable_get_colormap ()
  68. -- GdkColormap* gdk_drawable_get_colormap (GdkDrawable *drawable);
  69. -- Gets the colormap for drawable, if one is set; returns NULL otherwise.
  70. -- drawable : a GdkDrawable
  71. -- Returns : the colormap, or NULL
  72. depth: INTEGER is
  73. -- the bit depth of the drawable, that is, the number of bits
  74. -- that make up a pixel in the drawable's visual. Examples
  75. -- are 8 bits per pixel, 24 bits per pixel, etc.
  76. do
  77. Result := gdk_drawable_get_depth (handle)
  78. end
  79. dimensions: TUPLE [INTEGER, INTEGER] is
  80. -- width and height with the size of drawable. On the X11
  81. -- platform, if drawable is a GdkWindow, the returned size is
  82. -- the size reported in the most-recently-processed configure
  83. -- event, rather than the current size on the X server.
  84. local a_width, a_height: INTEGER
  85. do
  86. gdk_drawable_get_size (handle, $a_width, $a_height)
  87. create Result.make_2 (a_width, a_height)
  88. ensure not_void: Result /= Void
  89. end
  90. width: INTEGER is
  91. -- width of the drawable. On the X11 platform, if drawable is
  92. -- a GdkWindow, the returned size is the size reported in the
  93. -- most-recently-processed configure event, rather than the
  94. -- current size on the X server.
  95. do
  96. gdk_drawable_get_size (handle, $Result, default_pointer)
  97. end
  98. height: INTEGER is
  99. -- height of the drawable. On the X11 platform, if drawable is
  100. -- a GdkWindow, the returned size is the size reported in the
  101. -- most-recently-processed configure event, rather than the
  102. -- current size on the X server.
  103. do
  104. gdk_drawable_get_size (handle, default_pointer, $Result)
  105. end
  106. clip_region: GDK_REGION is
  107. -- the region of a drawable that potentially can be written
  108. -- to by drawing primitives. This region will not take into
  109. -- account the clip region for the GC, and may also not take
  110. -- into account other factors such as if the window is
  111. -- obscured by other windows, but no area outside of this
  112. -- region will be affected by drawing primitives.
  113. do
  114. create Result.from_external_pointer (gdk_drawable_get_clip_region (handle))
  115. end
  116. visible_region: GDK_REGION is
  117. -- the region of a drawable that is potentially visible. This
  118. -- does not necessarily take into account if the window is
  119. -- obscured by other windows, but no area outside of this
  120. -- region is visible.
  121. do
  122. create Result.from_external_pointer (gdk_drawable_get_visible_region (handle))
  123. end
  124. draw_point (a_gc: GDK_GC; an_x, an_y: INTEGER) is
  125. -- Draws a point, using the foreground color and other
  126. -- attributes of the GDK_GC.
  127. do
  128. gdk_draw_point (handle, a_gc.handle, an_x, an_y)
  129. end
  130. -- gdk_draw_points ()
  131. -- void gdk_draw_points (GdkDrawable *drawable,
  132. -- GdkGC *gc,
  133. -- GdkPoint *points,
  134. -- gint npoints);
  135. -- Draws a number of points, using the foreground color and other attributes of the GdkGC.
  136. -- drawable : a GdkDrawable (a GdkWindow or a GdkPixmap).
  137. -- gc : a GdkGC.
  138. -- points : an array of GdkPoint structures.
  139. -- npoints : the number of points to be drawn.
  140. draw_line (a_gc: GDK_GC; x1, y1, x2, y2: INTEGER) is
  141. -- Draws a line, using the foreground color and other attributes
  142. -- of the GdkGC.
  143. do
  144. gdk_draw_line (handle, a_gc.handle, x1, y1, x2, y2)
  145. end
  146. -- gdk_draw_lines ()
  147. -- void gdk_draw_lines (GdkDrawable *drawable,
  148. -- GdkGC *gc,
  149. -- GdkPoint *points,
  150. -- gint npoints);
  151. -- Draws a series of lines connecting the given points. The way in which joins between lines are draw is determined by the GdkCapStyle value in the GdkGC. This can be set with gdk_gc_set_line_attributes().
  152. -- drawable : a GdkDrawable (a GdkWindow or a GdkPixmap).
  153. -- gc : a GdkGC.
  154. -- points : an array of GdkPoint structures specifying the endpoints of the
  155. -- npoints : the size of the points array.
  156. -- gdk_draw_pixbuf ()
  157. -- void gdk_draw_pixbuf (GdkDrawable *drawable,
  158. -- GdkGC *gc,
  159. -- GdkPixbuf *pixbuf,
  160. -- gint src_x,
  161. -- gint src_y,
  162. -- gint dest_x,
  163. -- gint dest_y,
  164. -- gint width,
  165. -- gint height,
  166. -- GdkRgbDither dither,
  167. -- gint x_dither,
  168. -- gint y_dither);
  169. -- Renders a rectangular portion of a pixbuf to a drawable. The destination drawable must have a colormap. All windows have a colormap, however, pixmaps only have colormap by default if they were created with a non-NULL window argument. Otherwise a colormap must be set on them with gdk_drawable_set_colormap().
  170. -- On older X servers, rendering pixbufs with an alpha channel involves round trips to the X server, and may be somewhat slow.
  171. -- The clip mask of gc is ignored, but clip rectangles and clip regions work fine.
  172. -- drawable : Destination drawable.
  173. -- gc : a GdkGC, used for clipping, or NULL
  174. -- pixbuf : a GdkPixbuf
  175. -- src_x : Source X coordinate within pixbuf.
  176. -- src_y : Source Y coordinates within pixbuf.
  177. -- dest_x : Destination X coordinate within drawable.
  178. -- dest_y : Destination Y coordinate within drawable.
  179. -- width : Width of region to render, in pixels, or -1 to use pixbuf width.
  180. -- height : Height of region to render, in pixels, or -1 to use pixbuf height.
  181. -- dither : Dithering mode for GdkRGB.
  182. -- x_dither : X offset for dither.
  183. -- y_dither : Y offset for dither.
  184. -- Since 2.2
  185. -- gdk_draw_segments ()
  186. -- void gdk_draw_segments (GdkDrawable *drawable,
  187. -- GdkGC *gc,
  188. -- GdkSegment *segs,
  189. -- gint nsegs);
  190. -- Draws a number of unconnected lines.
  191. -- drawable : a GdkDrawable (a GdkWindow or a GdkPixmap).
  192. -- gc : a GdkGC.
  193. -- segs : an array of GdkSegment structures specifying the start and end points of the lines to be drawn.
  194. -- nsegs : the number of line segments to draw, i.e. the size of the segs array.
  195. -- GdkSegment
  196. -- typedef struct {
  197. -- gint x1;
  198. -- gint y1;
  199. -- gint x2;
  200. -- gint y2;
  201. -- } GdkSegment;
  202. -- Specifies the start and end point of a line for use by the gdk_draw_segments() function.
  203. -- gint x1; the x coordinate of the start point.
  204. -- gint y1; the y coordinate of the start point.
  205. -- gint x2; the x coordinate of the end point.
  206. -- gint y2; the y coordinate of the end point.
  207. -- gdk_draw_rectangle ()
  208. draw_rectangle (a_gc: GDK_GC; filled: BOOLEAN; an_x, an_y, a_width, a_height: INTEGER) is
  209. -- Draws a rectangular outline or filled rectangle, using the
  210. -- foreground color and other attributes of the GdkGC.
  211. --
  212. -- A rectangle drawn filled is 1 pixel smaller in both dimensions than
  213. -- a rectangle outlined. Calling draw_rectangle (gc, True, 0, 0, 20, 20)
  214. -- results in a filled rectangle 20 pixels wide and 20 pixels high.
  215. -- Calling draw_rectangle (gc, False, 0, 0, 20, 20) results in an
  216. -- outlined rectangle with corners at (0, 0), (0, 20), (20, 20),
  217. -- and (20, 0), which makes it 21 pixels wide and 21 pixels high.
  218. do
  219. gdk_draw_rectangle (handle, a_gc.handle, filled.to_integer,
  220. an_x, an_y, a_width, a_height)
  221. end
  222. draw_arc (a_gc: GDK_GC; a_filled: BOOLEAN; an_x, an_y,
  223. a_width, a_height, angle1, angle2: INTEGER) is
  224. -- Draws an arc or a filled 'pie slice'. The arc is defined by
  225. -- the bounding rectangle of the entire ellipse, and the start
  226. -- and end angles of the part of the ellipse to be drawn.
  227. --
  228. -- a_filled: TRUE if the arc should be filled, producing a 'pie slice'.
  229. -- an_x: the x coordinate of the left edge of the bounding rectangle.
  230. -- an_y: the y coordinate of the top edge of the bounding rectangle.
  231. -- a_width: the width of the bounding rectangle.
  232. -- a_height: the height of the bounding rectangle.
  233. -- angle1: the start angle of the arc, relative to the 3 o'clock
  234. -- position, counter-clockwise, in 1/64ths of a degree.
  235. -- angle2: the end angle of the arc, relative to angle1, in
  236. -- 1/64ths of a degree.
  237. do
  238. gdk_draw_arc (handle, a_gc.handle, a_filled.to_integer, an_x, an_y,
  239. a_width, a_height, angle1, angle2)
  240. end
  241. -- gdk_draw_polygon ()
  242. -- void gdk_draw_polygon (GdkDrawable *drawable,
  243. -- GdkGC *gc,
  244. -- gboolean filled,
  245. -- GdkPoint *points,
  246. -- gint npoints);
  247. -- Draws an outlined or filled polygon.
  248. -- drawable : a GdkDrawable (a GdkWindow or a GdkPixmap).
  249. -- gc : a GdkGC.
  250. -- filled : TRUE if the polygon should be filled. The polygon is closed automatically, connecting the last point to the first point if necessary.
  251. -- points : an array of GdkPoint structures specifying the points making up the polygon.
  252. -- npoints : the number of points.
  253. -- gdk_draw_trapezoids ()
  254. -- void gdk_draw_trapezoids (GdkDrawable *drawable,
  255. -- GdkGC *gc,
  256. -- GdkTrapezoid *trapezoids,
  257. -- gint n_trapezoids);
  258. -- Draws a set of anti-aliased trapezoids. The trapezoids are combined using saturation addition, then drawn over the background as a set. This is low level functionality used internally to implement rotated underlines and backgrouds when rendering a PangoLayout and is likely not useful for applications.
  259. -- drawable : a GdkDrawable
  260. -- gc : a GdkGC
  261. -- trapezoids : an array of GdkTrapezoid structures
  262. -- n_trapezoids : the number of trapezoids to draw
  263. -- Since 2.6
  264. -- GdkTrapezoid
  265. -- typedef struct {
  266. -- double y1, x11, x21, y2, x12, x22;
  267. -- } GdkTrapezoid;
  268. -- Specifies a trapezpoid for use by the gdk_draw_trapezoids(). The trapezoids used here have parallel, horizontal top and bottom edges.
  269. -- double y1; the y coordinate of the start point.
  270. -- double x11; the x coordinate of the top left corner
  271. -- double x21; the x coordinate of the top right corner
  272. -- double y2; the y coordinate of the end point.
  273. -- double x12; the x coordinate of the bottom left corner
  274. -- double x22; the x coordinate of the bottom right corner
  275. -- gdk_draw_glyphs ()
  276. -- void gdk_draw_glyphs (GdkDrawable *drawable,
  277. -- GdkGC *gc,
  278. -- PangoFont *font,
  279. -- gint x,
  280. -- gint y,
  281. -- PangoGlyphString *glyphs);
  282. -- This is a low-level function; 99% of text rendering should be done using gdk_draw_layout() instead.
  283. -- A glyph is a single image in a font. This function draws a sequence of glyphs. To obtain a sequence of glyphs you have to understand a lot about internationalized text handling, which you don't want to understand; thus, use gdk_draw_layout() instead of this function, gdk_draw_layout() handles the details.
  284. -- drawable : a GdkDrawable
  285. -- gc : a GdkGC
  286. -- font : font to be used
  287. -- x : X coordinate of baseline origin
  288. -- y : Y coordinate of baseline origin
  289. -- glyphs : the glyph string to draw
  290. -- gdk_draw_glyphs_transformed ()
  291. -- void gdk_draw_glyphs_transformed (GdkDrawable *drawable,
  292. -- GdkGC *gc,
  293. -- PangoMatrix *matrix,
  294. -- PangoFont *font,
  295. -- gint x,
  296. -- gint y,
  297. -- PangoGlyphString *glyphs);
  298. -- Renders a PangoGlyphString onto a drawable, possibly transforming the layed-out coordinates through a transformation matrix. Note that the transformation matrix for font is not changed, so to produce correct rendering results, the font must have been loaded using a PangoContext with an identical transformation matrix to that passed in to this function.
  299. -- See also gdk_draw_glyphs(), gdk_draw_layout().
  300. -- drawable : a GdkDrawable
  301. -- gc : a GdkGC
  302. -- matrix : a PangoMatrix, or NULL to use an identity transformation
  303. -- font : the font in which to draw the string
  304. -- x : the x position of the start of the string (in Pango units in user space coordinates)
  305. -- y : the y position of the baseline (in Pango units in user space coordinates)
  306. -- glyphs : the glyph string to draw
  307. -- Since 2.6
  308. -- gdk_draw_layout_line ()
  309. -- void gdk_draw_layout_line (GdkDrawable *drawable,
  310. -- GdkGC *gc,
  311. -- gint x,
  312. -- gint y,
  313. -- PangoLayoutLine *line);
  314. -- Render a PangoLayoutLine onto an GDK drawable
  315. -- If the layout's PangoContext has a transformation matrix set, then x and y specify the position of the left edge of the baseline (left is in before-tranform user coordinates) in after-transform device coordinates.
  316. -- drawable : the drawable on which to draw the line
  317. -- gc : base graphics to use
  318. -- x : the x position of start of string (in pixels)
  319. -- y : the y position of baseline (in pixels)
  320. -- line : a PangoLayoutLine
  321. -- gdk_draw_layout_line_with_colors ()
  322. -- void gdk_draw_layout_line_with_colors
  323. -- (GdkDrawable *drawable,
  324. -- GdkGC *gc,
  325. -- gint x,
  326. -- gint y,
  327. -- PangoLayoutLine *line,
  328. -- const GdkColor *foreground,
  329. -- const GdkColor *background);
  330. -- Render a PangoLayoutLine onto a GdkDrawable, overriding the layout's normal colors with foreground and/or background. foreground and background need not be allocated.
  331. -- If the layout's PangoContext has a transformation matrix set, then x and y specify the position of the left edge of the baseline (left is in before-tranform user coordinates) in after-transform device coordinates.
  332. -- drawable : the drawable on which to draw the line
  333. -- gc : base graphics to use
  334. -- x : the x position of start of string (in pixels)
  335. -- y : the y position of baseline (in pixels)
  336. -- line : a PangoLayoutLine
  337. -- foreground : foreground override color, or NULL for none
  338. -- background : background override color, or NULL for none
  339. draw_layout (a_gc: GDK_GC; an_x, an_y: INTEGER; a_layout: PANGO_LAYOUT) is
  340. -- Render a PangoLayout onto a GDK drawable
  341. --
  342. -- If the layout's PANGO_CONTEXT has a transformation matrix set,
  343. -- then an_x and an_y specify the position of the top left corner
  344. -- of the bounding box (in device space) of the transformed layout.
  345. --
  346. -- If you're using GTK+, the usual way to obtain a PANGO_LAYOUT is
  347. -- my_widget.create_pango_layout
  348. require
  349. a_gc /= Void
  350. a_layout /= Void
  351. do
  352. gdk_draw_layout (handle, a_gc.handle, an_x, an_y, a_layout.handle)
  353. end
  354. draw_layout_with_colors (a_gc: GDK_GC; an_x, an_y: INTEGER;
  355. a_layout: PANGO_LAYOUT; a_foreground, a_background: GDK_COLOR) is
  356. -- Render a PANGO_LAYOUT onto a GDK_DRAWABLE, overriding the
  357. -- layout's normal colors with a_foreground and/or a_background.
  358. -- a_foreground and a_background need not be allocated.
  359. --
  360. -- If the layout's PANGO_CONTEXT has a transformation matrix set,
  361. -- then an_x and an_y specify the position of the top left corner
  362. -- of the bounding box (in device space) of the transformed layout.
  363. --
  364. -- If you're using GTK+, the ususal way to obtain a PANGO_LAYOUT
  365. -- is my_widget.create_pango_layout.
  366. require
  367. a_gc /= Void
  368. a_layout /= Void
  369. local
  370. fg_ptr, bg_ptr: POINTER
  371. do
  372. if a_foreground /= Void then fg_ptr := a_foreground.handle end
  373. if a_background /= Void then bg_ptr := a_background.handle end
  374. gdk_draw_layout_with_colors (handle, a_gc.handle, an_x, an_y,
  375. a_layout.handle, fg_ptr, bg_ptr)
  376. end
  377. draw_drawable (a_gc: GDK_GC; a_drawable: GDK_DRAWABLE; xsrc, ysrc, xdest,
  378. ydest, a_width, a_height: INTEGER) is
  379. -- Copies the <width x height> region of a_drawable at coordinates
  380. -- (xsrc, ysrc) to coordinates (xdest, ydest) in Current.
  381. -- a_width and/or a_height may be given as -1, in which case the
  382. -- entire a_drawable drawable will be copied.
  383. --
  384. -- Most fields in a_gc are not used for this operation, but notably
  385. -- the clip mask or clip region will be honored.
  386. --
  387. -- The source and destination drawables must have the same visual
  388. -- and colormap, or errors will result. (On X11, failure to match
  389. -- visual/colormap results in a BadMatch error from the X server.)
  390. -- A common cause of this problem is an attempt to draw a bitmap
  391. -- to a color drawable. The way to draw a bitmap is to set the
  392. -- bitmap as the stipple on the GdkGC, set the fill mode to
  393. -- GDK_STIPPLED, and then draw the rectangle.
  394. require
  395. a_gc /= Void
  396. a_drawable /= Void
  397. do
  398. gdk_draw_drawable (handle, a_gc.handle, a_drawable.handle,
  399. xsrc, ysrc, xdest, ydest, a_width, a_height)
  400. end
  401. -- gdk_draw_image ()
  402. -- void gdk_draw_image (GdkDrawable *drawable,
  403. -- GdkGC *gc,
  404. -- GdkImage *image,
  405. -- gint xsrc,
  406. -- gint ysrc,
  407. -- gint xdest,
  408. -- gint ydest,
  409. -- gint width,
  410. -- gint height);
  411. -- Draws a GdkImage onto a drawable. The depth of the GdkImage must match the depth of the GdkDrawable.
  412. -- drawable : a GdkDrawable (a GdkWindow or a GdkPixmap).
  413. -- gc : a GdkGC.
  414. -- image : the GdkImage to draw.
  415. -- xsrc : the left edge of the source rectangle within image.
  416. -- ysrc : the top of the source rectangle within image.
  417. -- xdest : the x coordinate of the destination within drawable.
  418. -- ydest : the y coordinate of the destination within drawable.
  419. -- width : the width of the area to be copied, or -1 to make the area extend to the right edge of image.
  420. -- height : the height of the area to be copied, or -1 to make the area extend to the bottom edge of image.
  421. -- gdk_drawable_get_image ()
  422. -- GdkImage* gdk_drawable_get_image (GdkDrawable *drawable,
  423. -- gint x,
  424. -- gint y,
  425. -- gint width,
  426. -- gint height);
  427. -- A GdkImage stores client-side image data (pixels). In contrast, GdkPixmap and GdkWindow are server-side objects. gdk_drawable_get_image() obtains the pixels from a server-side drawable as a client-side GdkImage. The format of a GdkImage depends on the GdkVisual of the current display, which makes manipulating GdkImage extremely difficult; therefore, in most cases you should use gdk_pixbuf_get_from_drawable() instead of this lower-level function. A GdkPixbuf contains image data in a canonicalized RGB format, rather than a display-dependent format. Of course, there's a convenience vs. speed tradeoff here, so you'll want to think about what makes sense for your application.
  428. -- x, y, width, and height define the region of drawable to obtain as an image.
  429. -- You would usually copy image data to the client side if you intend to examine the values of individual pixels, for example to darken an image or add a red tint. It would be prohibitively slow to make a round-trip request to the windowing system for each pixel, so instead you get all of them at once, modify them, then copy them all back at once.
  430. -- If the X server or other windowing system backend is on the local machine, this function may use shared memory to avoid copying the image data.
  431. -- If the source drawable is a GdkWindow and partially offscreen or obscured, then the obscured portions of the returned image will contain undefined data.
  432. -- drawable : a GdkDrawable
  433. -- x : x coordinate on drawable
  434. -- y : y coordinate on drawable
  435. -- width : width of region to get
  436. -- height : height or region to get
  437. -- Returns : a GdkImage containing the contents of drawable
  438. -- gdk_drawable_copy_to_image ()
  439. -- GdkImage* gdk_drawable_copy_to_image (GdkDrawable *drawable,
  440. -- GdkImage *image,
  441. -- gint src_x,
  442. -- gint src_y,
  443. -- gint dest_x,
  444. -- gint dest_y,
  445. -- gint width,
  446. -- gint height);
  447. -- Copies a portion of drawable into the client side image structure image. If image is NULL, creates a new image of size width x height and copies into that. See gdk_drawable_get_image() for further details.
  448. -- drawable : a GdkDrawable
  449. -- image : a GdkDrawable, or NULL if a new image should be created.
  450. -- src_x : x coordinate on drawable
  451. -- src_y : y coordinate on drawable
  452. -- dest_x : x coordinate within image. Must be 0 if image is NULL
  453. -- dest_y : y coordinate within image. Must be 0 if image is NULL
  454. -- width : width of region to get
  455. -- height : height or region to get
  456. -- Returns : image, or a new a GdkImage containing the contents of drawable
  457. -- Since 2.4
  458. end