Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xgc(1) [debian man page]

XGC(1)							      General Commands Manual							    XGC(1)

NAME
xgc - X graphics demo SYNOPSIS
xgc [-toolkitoption ...] DESCRIPTION
The xgc program demonstrates various features of the X graphics primitives. In X, most of the details about the graphics to be generated are stored in a resource called a graphics context (GC). The xgc program provides a user interface for setting various GC components. Pressing the "Run" button causes these results to be displayed in the large drawing window on the right. Timing information is displayed in the window immediately below. The items in the upper left hand window work as follows: Function - specify the logical function with which primitives will drawn. The most usual setting is "set", i.e. simply to render pixels without regard to what has been drawn before. LineStyle - specify whether lines should be drawn solid in foreground, dashed in foreground or alternating foreground and background. CapStyle - specify the appearance of the ends of a line. JoinStyle - specify the appearance of joints between consecutive lines drawn within a single graphics primitive. FillStyle - specify whether lines, text and fill requests are solid, tiled with a pixmap or stippled. FillRule - specifies the rule used to fill polygons. The EvenOdd rule means that if areas overlap an odd number of times, they are not drawn. Winding rule means that overlapping areas are always filled, regardless of how many times they overlap. ArcMode - specifies the rule for filling of arcs. The boundary of the arc is either a Chord or two radii. planemask - specifies which planes of the drawing window are modified. By default, all planes are modified. dashlist - specifies a pattern to be used when drawing dashed lines. Line Width - specifies the width in pixels of lines to be drawn. Zero means to draw using the server's fastest algorithm with a line width of one pixel. Font - specifies the font to be used for text primitives. Foreground and Background - specify the pixel values to be applied when drawing primitives. The Foreground value is used as the pixel value for set bits in the source in all primitives. The Background value is used as the pixel value for unset bits in the source when using Copy Plane, drawing lines with LineStyle of DoubleDash and filling with FillStyle of OpaqueStippled. Percentage of Test - scrollbar permits specifying only a percentage of the test to be run. The number at the left indicates the current setting, which defaults to 100%. The window labeled "Test" permits choice of one a number of graphics primitive tests, including Points, Segments, Lines, Arcs and Filled Arcs, 8-bit Text and Image Text, Rectangles and Filled Rectangles, Image draws, as well as Copy Plane and Copy Area. The window to the right of this has buttons which permit record/playback of the primitives rendered. OPTIONS
Xgc accepts all of the standard X Toolkit command line options. X DEFAULTS
This program accepts the usual defaults for toolkit applications. ENVIRONMENT
DISPLAY to get the default host and display number. XENVIRONMENT to get the name of a resource file that overrides the global resources stored in the RESOURCE_MANAGER property. SEE ALSO
X(7) BUGS
This program isn't really finished yet, but it probably never will be, since it only demonstrates the original X11 core protocol rendering operations, which few modern programs use anymore. AUTHORS
Dan Schmidt, MIT X Version 11 xgc 1.0.3 XGC(1)

Check Out this Related Man Page

xcb_change_gc(3)						   XCB Requests 						  xcb_change_gc(3)

NAME
xcb_change_gc - change graphics context components SYNOPSIS
#include <xcb/xproto.h> Request function xcb_void_cookie_t xcb_change_gc(xcb_connection_t *conn, xcb_gcontext_t gc, uint32_t value_mask, const uint32_t *value_list); REQUEST ARGUMENTS
conn The XCB connection to X11. gc The graphics context to change. value_mask One of the following values: XCB_GC_FUNCTION TODO: Refer to GX XCB_GC_PLANE_MASK In graphics operations, given a source and destination pixel, the result is computed bitwise on corresponding bits of the pixels; that is, a Boolean operation is performed in each bit plane. The plane-mask restricts the operation to a subset of planes, so the result is: ((src FUNC dst) AND plane-mask) OR (dst AND (NOT plane-mask)) XCB_GC_FOREGROUND Foreground colorpixel. XCB_GC_BACKGROUND Background colorpixel. XCB_GC_LINE_WIDTH The line-width is measured in pixels and can be greater than or equal to one, a wide line, or the special value zero, a thin line. XCB_GC_LINE_STYLE The line-style defines which sections of a line are drawn: Solid The full path of the line is drawn. DoubleDash The full path of the line is drawn, but the even dashes are filled differently than the odd dashes (see fill-style), with Butt cap-style used where even and odd dashes meet. OnOffDash Only the even dashes are drawn, and cap-style applies to all internal ends of the individual dashes (except NotLast is treated as Butt). XCB_GC_CAP_STYLE The cap-style defines how the endpoints of a path are drawn: NotLast The result is equivalent to Butt, except that for a line-width of zero the final endpoint is not drawn. Butt The result is square at the endpoint (perpendicular to the slope of the line) with no projection beyond. Round The result is a circular arc with its diameter equal to the line- width, centered on the endpoint; it is equivalent to Butt for line-width zero. Projecting The result is square at the end, but the path continues beyond the endpoint for a distance equal to half the line-width; it is equivalent to Butt for line-width zero. XCB_GC_JOIN_STYLE The join-style defines how corners are drawn for wide lines: Miter The outer edges of the two lines ex- tend to meet at an angle. However, if the angle is less than 11 degrees, a Bevel join-style is used instead. Round The result is a circular arc with a diameter equal to the line-width, centered on the joinpoint. Bevel The result is Butt endpoint styles, and then the triangular notch is filled. XCB_GC_FILL_STYLE The fill-style defines the contents of the source for line, text, and fill requests. For all text and fill requests (for example, PolyText8, PolyText16, PolyFillRectangle, FillPoly, and PolyFillArc) as well as for line requests with line-style Solid, (for example, PolyLine, PolySegment, PolyRectangle, PolyArc) and for the even dashes for line re- quests with line-style OnOffDash or DoubleDash: Solid Foreground Tiled Tile OpaqueStippled A tile with the same width and height as stipple but with background everywhere stipple has a zero and with foreground everywhere stipple has a one Stippled Foreground masked by stipple For the odd dashes for line requests with line-style DoubleDash: Solid Background Tiled Same as for even dashes OpaqueStippled Same as for even dashes Stippled Background masked by stipple XCB_GC_FILL_RULE XCB_GC_TILE The tile/stipple represents an infinite two-dimensional plane with the tile/stipple replicated in all dimensions. When that plane is superimposed on the drawable for use in a graphics operation, the upper-left corner of some instance of the tile/stipple is at the coordinates within the drawable specified by the tile/stipple origin. The tile/stipple and clip origins are interpreted relative to the origin of whatever destination drawable is specified in a graphics re- quest. The tile pixmap must have the same root and depth as the gcontext (or a Match error results). The stipple pixmap must have depth one and must have the same root as the gcontext (or a Match error results). For fill-style Stip- pled (but not fill-style OpaqueStippled), the stipple pattern is tiled in a single plane and acts as an additional clip mask to be ANDed with the clip-mask. Any size pixmap can be used for tiling or stippling, although some sizes may be faster to use than others. XCB_GC_STIPPLE The tile/stipple represents an infinite two-dimensional plane with the tile/stipple replicated in all dimensions. When that plane is superimposed on the drawable for use in a graphics operation, the upper-left corner of some instance of the tile/stipple is at the coordinates within the drawable specified by the tile/stipple origin. The tile/stipple and clip origins are interpreted relative to the origin of whatever destination drawable is specified in a graphics re- quest. The tile pixmap must have the same root and depth as the gcontext (or a Match error results). The stipple pixmap must have depth one and must have the same root as the gcontext (or a Match error results). For fill-style Stip- pled (but not fill-style OpaqueStippled), the stipple pattern is tiled in a single plane and acts as an additional clip mask to be ANDed with the clip-mask. Any size pixmap can be used for tiling or stippling, although some sizes may be faster to use than others. XCB_GC_TILE_STIPPLE_ORIGIN_X TODO XCB_GC_TILE_STIPPLE_ORIGIN_Y TODO XCB_GC_FONT Which font to use for the ImageText8 and ImageText16 requests. XCB_GC_SUBWINDOW_MODE For ClipByChildren, both source and destination windows are additionally clipped by all viewable InputOutput children. For IncludeInferiors, neither source nor destination window is clipped by inferiors. This will result in including sub- window contents in the source and drawing through subwindow boundaries of the destination. The use of IncludeInferiors with a source or destination window of one depth with mapped inferiors of differing depth is not illegal, but the se- mantics is undefined by the core protocol. XCB_GC_GRAPHICS_EXPOSURES Whether ExposureEvents should be generated (1) or not (0). The default is 1. XCB_GC_CLIP_ORIGIN_X TODO XCB_GC_CLIP_ORIGIN_Y TODO XCB_GC_CLIP_MASK The clip-mask restricts writes to the destination drawable. Only pixels where the clip-mask has bits set to 1 are drawn. Pixels are not drawn outside the area covered by the clip-mask or where the clip-mask has bits set to 0. The clip-mask affects all graphics requests, but it does not clip sources. The clip-mask origin is interpreted relative to the origin of whatever destination drawable is specified in a graphics request. If a pixmap is specified as the clip- mask, it must have depth 1 and have the same root as the gcontext (or a Match error results). If clip-mask is None, then pixels are always drawn, regardless of the clip origin. The clip-mask can also be set with the SetClipRectangles request. XCB_GC_DASH_OFFSET TODO XCB_GC_DASH_LIST TODO XCB_GC_ARC_MODE TODO value_list Values for each of the components specified in the bitmask value_mask. The order has to correspond to the order of possible val- ue_mask bits. See the example. DESCRIPTION
Changes the components specified by value_mask for the specified graphics context. RETURN VALUE
Returns an xcb_void_cookie_t. Errors (if any) have to be handled in the event loop. If you want to handle errors directly with xcb_request_check instead, use xcb_change_gc_checked. See xcb-requests(3) for details. ERRORS
xcb_pixmap_error_t TODO: reasons? xcb_alloc_error_t The X server could not allocate the requested resources (no memory?). xcb_value_error_t TODO: reasons? xcb_gc_error_t TODO: reasons? xcb_font_error_t TODO: reasons? xcb_match_error_t TODO: reasons? EXAMPLE
/* * Changes the foreground color component of the specified graphics context. * */ void my_example(xcb_connection *conn, xcb_gcontext_t gc, uint32_t fg, uint32_t bg) { /* C99 allows us to use a compact way of changing a single component: */ xcb_change_gc(conn, gc, XCB_GC_FOREGROUND, (uint32_t[]){ fg }); /* The more explicit way. Beware that the order of values is important! */ uint32_t mask = 0; mask |= XCB_GC_FOREGROUND; mask |= XCB_GC_BACKGROUND; uint32_t values[] = { fg, bg }; xcb_change_gc(conn, gc, mask, values); xcb_flush(conn); } SEE ALSO
xcb-requests(3), xcb-examples(3) AUTHOR
Generated from xproto.xml. Contact xcb@lists.freedesktop.org for corrections and improvements. XCB
2014-06-10 xcb_change_gc(3)
Man Page