ruby-****@sourc*****
ruby-****@sourc*****
2003年 10月 21日 (火) 05:04:59 JST
------------------------- REMOTE_ADDR = 213.84.35.186 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/?Gdk%3A%3ADrawable ------------------------- = class Gdk::Drawable Gdk::Drawable is the base class for all objects that can accept drawing commands. The Gdk::Drawable interface enables one to draw lines, points, elliptical arcs, rectangles, text, or images. In order to use a Gdk::Drawable, you must also have a Gdk:GC (graphics context) object to control the style of your drawing. The Gdk:GC can control the color, for example. In all of the functions that take a width or height parameter, -1 may be used to indicate that the largest possible meaningful value should be used instead of giving an explicit dimension. == Object Hierarchy * Object * Glib::Instantiable * Glib::Object * Gdk::Drawable == Class Methods == Instance Methods --- visual() Returns the Gdk::Drawable (or derived class) itself. (TODO) * Returns: the Gdk::Drawable (or derived class) itself (TODO) --- colormap() Gets this object's Gdk::Colormap * Returns: the Gdk::Colormap that this object is using --- set_colormap(color) Sets this object's Gdk::Colormap * Returns: self --- depth() Gets the depth of this Gdk::Drawable, in bits per pixel * Returns: a number representing how many bits are used for each pixel --- size() Gets the size of this Gdk::Drawable, as a 2-element array * Returns: a two-element Array representing the width and height of this Gdk::Drawable, respectively --- clip_region() Gets the Gdk::Region used for clipping (restricting drawing to a box) * Returns: the currently active clipping rectangle as a Gdk::Region --- visible_region() Gets the Gdk::Region that is visible * Returns: the visible region as a Gdk::Region --- draw_arc(gc, filled, x, y, w, h, a1, a2) Draws a partial or full arc of an elipse. * gc: a Gdk::GC graphics context to control the drawing style * filled: boolean indicating if this arc should be filled or not * x: X coordinate of the top left corner of the rectangle containing this ellipse * y: Y coordinate of the top left corner of the rectangle containing this ellipse * w: The width, in pixels, of the ellipse, or -1 for the whole region * h: The height, in pixels, of the ellipse, or -1 for the whole region * a1: The start of the arc, relative to the 3 o'clock position, counter-clockwise, in 1/64ths of a degree * a2: The end angle of the arc, relative to the 3 o'clock position, in 1/64ths of a degree * Returns: self --- draw_image(gc, image, xsrc, ysrc, xdst, ydst, w, h) Draws a (rectangular part or whole) Gdk::Image into this Gdk::Drawable. * image: a Gdk::Image object to draw * xsrc: X source coordinate in the image of the upper left corner of the rectangle to copy * ysrc: Y source coordinate in the image of the upper left corner of the rectangle to copy * xdst: X destination coordinate in this Gdk::Drawable of the upper left corner of the rectangle to overwrite with image * ydst: Y destination coordinate in this Gdk::Drawable of the upper left corner of the rectangle to copy * w: width, in pixels, of the rectangle to copy, or -1 for the whole region * h: height, in pixels, of the rectangle to copy, or -1 for the whole region * Returns: self --- draw_glyphs(gc, font, x, y, glyphs) Draws a sequence of language glyphs. (TODO) * Returns: self --- draw_layout(gc, x, y, layout, fg, bg) Draws a Pango::Layout (block of rendered text) * x: X coordinate of the left side of the string * y: Y coordinate of the text rendering baseline * layout: a Pango::Layout containing the rendered single line of text * fg: the foreground Gdk::Color * bg: the foreground Gdk::Color * Returns: self --- draw_layout(gc, x, y, layout) Draws a Pango::Layout (block of rendered text) with default foreground and background * x: X coordinate of the left side of the string * y: Y coordinate of the text rendering baseline * layout: a Pango::Layout containing the rendered single line of text * Returns: self --- draw_layout_line(gc, x, y, line, fg, bg) Draws a Pango::LayoutLine (line of rendered text) * x: X coordinate of the left side of the string * y: Y coordinate of the text rendering baseline * line: a Pango::LayoutLine containing the rendered single line of text * fg: the foreground Gdk::Color * bg: the foreground Gdk::Color * Returns: self --- draw_layout_line(gc, x, y, line) Draws a Pango::LayoutLine (line of rendered text) with default foreground and background * x: X coordinate of the left side of the string * y: Y coordinate of the text rendering baseline * line: a Pango::LayoutLine containing the rendered single line of text * Returns: self --- draw_line(gc, x1, y1, x2, y2) Draws a line. * gc: a Gdk::GC graphics context to control the drawing style * x1: the X coordinate of first endpoint of line * y1: the Y coordinate of first endpoint of line * x2: the X coordinate of second endpoint of line * y2: the Y coordinate of second endpoint of line * Returns: self --- draw_lines(gc, points) Draws a connected sequence of lines. * gc: a Gdk::GC graphics context to control the drawing style * points: a list of points to connect. Each point is represented as an array of two elements, which correspond to the x and y coordinates. This is an Array of these 2-element Array's. * Returns: self --- draw_point(gc, x, y) Draws a point. * gc: a Gdk::GC graphics context to control the drawing style * x: X coordinate of point * y: Y coordinate of point * Returns: self --- draw_points(gc, points) Draws a sequence of points. * gc: a Gdk::GC graphics context to control the drawing style * points: a list of points to draw. Each point is represented as an array of two elements, which correspond to the x and y coordinates. This is an Array of these 2-element Array's. * Returns: self --- draw_polygon(gc, filled, points) Draws a closed polygon. * gc: a Gdk::GC graphics context to control the drawing style * filled: boolean indicating if this rectangle should be filled or outline * points: a list of points corresponding to each vertex in order. Each point is represented as an array of two elements, which correspond to the x and y coordinates. This is an Array of these 2-element Array's. The polygon is closed automatically, connecting the last point to the first point if necessary. * Returns: self --- draw_rectangle(gc, filled, x, y, w, h) Draws a rectangle. * gc: a Gdk::GC graphics context to control the drawing style * filled: boolean indicating if this rectangle should be filled or outline * x: X coordinate of the top left corner of the rectangle * y: Y coordinate of the top left corner of the rectangle * w: The width, in pixels, of the rectangle, or -1 for the whole region * h: The height, in pixels, of the rectangle, or -1 for the whole region * Returns: self --- draw_segments(gc, segments) Draws an arbitrary set of segments. * gc: a Gdk::GC graphics context to control the drawing style * segments: a list of segments to connect. Each segment is represented as an array of four elements, which correspond to the x1, y1, x2, and y2 coordinates of the two endpoints. This is an Array of these 4-element Array's. * Returns: self --- get_image(x, y, w, h) Creates a Gdk::Image from a rectangular area of this Gdk::Drawable * x: X coordinate of the top left corner of the rectangle * y: Y coordinate of the top left corner of the rectangle * w: The width, in pixels, of the rectangle, or -1 for the whole region * h: The height, in pixels, of the rectangle, or -1 for the whole region * Returns: the Gdk::Image that was read from the rectangle --- xid() Returns the X11 (X Window) XID of this Gdk::Drawable, as a number * Returns: the X11 (X Window) XID of this Gdk::Drawable, as a number --- display() Returns the Gdk::Display associated with this object * Returns: the Gdk::Display associated with this object --- screen() Returns the Gdk::Screen associated with this object * Returns: the Gdk::Screen associated with this object * ((<cilibrar>)) (this document started by cilibrar)