next up previous index
Next: ProTcXl Commands Up: ProTcXl 2.1 User Previous: ProTcXl Prolog Predicates

Xlib Predicates

    All Xlib coordinates are integers interpreted as pixels. Note that unlike Tk, Xlib specifies rectangles using the upper left point and width and height.

 
inside(+X, +Y, +Cover, +List)
Succeeds if the point (X, Y) lies inside the rectangle Cover, specified as a list [Xc, Yc, Width, Height] and inside the polygon whose boundary is specified as a list of point List =   [X1, Y1, X2, Y2, ... ].

 

xlib_arc(+XID, +X, +Y, +Width, +Height, +Angle1, +Angle2)
Draw an arc inside the Tk window XID.   The arc is generally a part of an ellipse drawn inside a rectangle specified with (X, Y, Width, Height). Both Angle1 and Angle2 are numbers which specify angles measured in degrees. Angle1 specifies the starting point for the arc and is measured from the three-o-clock position counterclockwise. Angle2 is the end point and is measured from the starting point counterclockwise. Only the outline of the arc will be drawn, using the current foreground colour.

 

xlib_background(+XID, +Color)
Sets the background colour for the Xlib operations in the Tk window with the handle XID. Color is a string in any of the format accepted by Tk, e.g. "purple", "#fd142a".

 

xlib_change_gc(+XID, +Resource, +Value)
Change the specified resource of the Xlib graphics context   of the Tk window XID. Resource is an integer or an atom denoting a resource, e.g. xGCForeground, Value is the new value recognised by Xlib. This predicate links directly the Xlib call XChangeGC  .

 

xlib_clear(+XID, +X, +Y, +Width, +Height)
Clear the specified area of the Tk window XID, i.e. fill it with the current background colour.

 

xlib_color(+XID, +TkColor, -XColor)
Convert the specified Tk colour to an Xlib colour specification. TkColor is a string denoting a colour in any format recognised by Tk, e.g. "red" or "#f13". XColor is an integer which can be used e.g. in xlib_change_gc/3   or in direct Xlib calls.

 

xlib_arc(+XID, +X, +Y, +Width, +Height, +Angle1, +Angle2)
Draw an arc inside the Tk window XID.   The arc is generally a part of an ellipse drawn inside a rectangle specified with (X, Y, Width, Height). Both Angle1 and Angle2 are numbers which specify angles measured in degrees. Angle1 specifies the starting point for the arc and is measured from the three-o-clock position counterclockwise. Angle2 is the end point and is measured from the starting point counterclockwise. The arc will have no outline and will be filled with the current foreground colour.

 

xlib_fill_rectangle(+XID, +X, +Y, +Width, +Height)
Draw the specified rectangle on the Tk window XID. The rectangle will be filled with the current foreground colour and will have no outline.

 

xlib_flush(+XID)
The X server queue is buffered so that an Xlib function call may not necessarily have an immediate effect on the display. This predicate will flush the X server queue and force all requests in it to be sent to the server and executed. Note that too much flushing can slow the application down.

 

xlib_font(+XID, +Font)
Make the specified font available in the Tk window XID so that subsequent calls to xlib_string/4  , xlib_image_string/4   or direct Xlib string calls will use this font.

 

xlib_foreground(+XID, +Color)
Sets the foreground colour for the Xlib operations in the Tk window with the handle XID. Color is a string in any of the format accepted by Tk, e.g. "purple", "#fd142a".

 

xlib_function(+XID, +Function)
Set the Function parameter of the graphics context   of the Tk window XID. The function parameter specifies how the new drawing is being combined with the current display, it can be e.g. xGXAnd, xGXinvert, xGCCopy etc.

 

xlib_id(+XID, -Display, -Drawable, -GC)
Return the display, drawable and graphics context to a given Tk window XID. These parameters can then be used in direct Xlib calls which draw on this window.

 

xlib_image_string(+XID, +Text, +X, +Y)
Draw the text Text on the Tk window XID at the position (X, Y). Text can be an atom, string or a number. The text will be drawn using the font specified previously with xlib_font/2   with the current foreground and background colours. This predicate calls the Xlib function XDrawImageString   and so it draws the text as well as the background, but it does not use all graphics context items like xlib_string/4  .

 

xlib_init(+TkWindowName, -XID)
Return the Xlib handle XID to a given Tk window. TkWindowName is the full name of a Tk widget. The handle can then be used in other ProTcXl Xlib calls. This predicate creates a new graphics context which is then being used for all subsequent Xlib operations on this window.

 

xlib_line(+XID, +X1, +Y1, +X2, +Y2)
Draw a line on the Tk window XID using the current graphics context setting which can be set e.g. by xlib_line_attributes/5  .

 

xlib_line_attributes(+XID, +Width, +LineStyle, +CapStyle, +JoinStyle)
Set the line attributes in the graphics context   of the Tk window XID.   Width is the line width in pixels, 0 means to use the fast algorithm for drawing a line of one pixel width. LineStyle is one of xLineSolid, xLineOnOffDash or xLineDoubleDash. CapStyle is one of xCapNotLast, xCapButt, xCapRound or xCapProjecting. JoinStyle is one of xJoinRound, xJoinMiter or xJoinBevel.

 

xlib_pixmap(+XID, +Image, -Pixmap
  Convert the Tk Image into a X11 pixmap. Image is the name of an existing Tk image that has been previously created using e.g. image   create photo  . Pixmap is the ID of an X11 Pixmap which can be used e.g. in xlib_change_gc/3   or in direct Xlib calls.

 

xlib_polygon(+XID, +List, +OffX, +OffY, +FX, +FY, +Xpose, +Border, +Fill)
Draw a polygon on the Tk window XID.   The polygon is specified as a flat list of integer point coordinates List = [X1, Y1, X2, Y2, ...]. Before drawing, all point coordinates will be transformed as follows: If Border is a non-negative integer specifying an X colour, usually obtained by xlib_color/3  , the polygon will have an outline drawn in that colour, otherwise, if it is -1, the outline will not be drawn. If Fill is a non-negative integer specifying an X colour, the polygon will be filled with this colour. When it is -1, the polygon will not be filled.

 

xlib_query_pointer(+XID, -X, -Y)
Return the position of the mouse pointer relative to the upper left   corner of the Tk window XID.

 

xlib_rectangle(+XID, +X, +Y, +Width, +Height)
Draw a rectangle on the Tk window XID. Only the outline of the rectangle will be drawn, using the current foreground colour of XID.

 

xlib_string(+XID, +Text, +X, +Y)
Draw the text Text on the Tk window XID at the position (X, Y). Text can be an atom, string or a number. The text will be drawn using the font specified previously with xlib_font/2  . This predicate calls the Xlib function XDrawString which means that only the foreground is drawn, using all graphics context items, the background stays unchanged. To draw strings which replace the previous image use xlib_image_string/4  .

 

xlib_tkwin(+XID, -TkWin)
Return the pointer to the Tk_Window structure of the Tk window with the handle XID. This value can be used for subsequent direct calls of various Tk internal functions which require it.

 

 

xlib_warp_pointer(+XID, +X, +Y)
Move the mouse pointer to the given position on the screen.   The coordinates are specified relative to the upper left corner of the Tk window XID. This predicate should be used with care, because moving the pointer without user intervention may be confusing for the user. The previous position of the pointer can be saved using xlib_query_pointer/3   and then restored.



next up previous index
Next: ProTcXl Commands Up: ProTcXl 2.1 User Previous: ProTcXl Prolog Predicates



Micha Meier
Tue Jul 2 09:49:39 MET DST 1996