
Class documentation.

$Ident: This file is part of the 'Gt-library' 1.0.0 $
$Copyright: (C) 1997 by Gran Gustafsson $

-------------------------------------------------------------------------

** GtGC **
----------

Name:       GtGC
Superclass: GtBase
Include:    gtgc.h


  This class encapsulates a X GC in a private or shared object. The widgets
that only draw in the standard Gt colors uses the shared object feature to
significantly reduce the number of GtGC objects in use by a program. The
shared GtGC must not be changed in any way after it is created or the
changes will be reflected upon all other users of the shared object.


Tags for GtGC:
--------------

  Name                   ISGR  Type            Defaults
  -----------------------------------------------------
  GT_Display            (I.G.) (GtDisplay *)   NULL
  GT_Drawable           (I.G.) (GtDrawable *)  DefaultRootWindow()
  GT_Function           (ISG.) (long)          GXcopy
  GT_PlaneMask          (ISG.) (long)          All planes
  GT_Foreground         (ISG.) (ulong)         0
  GT_Background         (ISG.) (ulong)         1
  GT_LineWidth          (ISG.) (long)          0
  GT_LineStyle          (ISG.) (long)          LineSolid
  GT_CapStyle           (ISG.) (long)          CapButt
  GT_JoinStyle          (ISG.) (long)          JoinMiter
  GT_FillStyle          (ISG.) (long)          FillSolid
  GT_FillRule           (ISG.) (long)          EvenOddRule
  GT_Tile               (ISG.) (GtPixmap *)    NULL
  GT_Stipple            (ISG.) (GtPixmap *)    NULL
  GT_TStipXOrigin       (ISG.) (long)          0
  GT_TStipYOrigin       (ISG.) (long)          0
  GT_Font               (ISG.) (GtFont *)      NULL
  GT_SubWinMode         (ISG.) (long)          ClipByChildrean
  GT_GraphExpose        (ISG.) (long)          TRUE
  GT_ClipXOrigin        (ISG.) (long)          0
  GT_ClipYOrigin        (ISG.) (long)          0
  GT_ClipMask           (ISG.) (GtPixmap *)    NULL
  GT_DashOffset         (ISG.) (long)          0
  GT_DashList           (IS..) (long)          4
  GT_ArcMode            (ISG.) (long)          ArcPieSlice
  GT_DontFreeX          (I.G.) (sbool)         FALSE
  GT_XGC                (I.G.) (GC)            0

  
  Any tag from the list above that is not described below sets a value in a
XGCValue structure. The tags have names closely resembling those of the
entries in the XGCValue structure. Some names have been shortened though and
some tags take encapsulated Gt objects instead of X resources but otherwise
they should work correspondingly.


  * GT_Display
    This tag provide the GtDisplay object to for the GtGC to use. It is
    not normally used since the GtDisplay object is provided as an argument
    to the special "Init()" method of this class.

  
  * GT_Drawable
    The GtDrawable object provided by this tag is the kind of drawable that
    this GtGC will be able to draw in. If no GtDrawable is provided the
    default root window will be used to create a GtGC that can be used in
    any normal window (or pixmap with matching attributes).


  * GT_DontFreeX
    If this tag is true the encapsulated GC is not destroy when the
    GtGC object is destroyed.


  * GT_XGC
    This tag provide a X GC to encapsulate. The "GT_DontFreeX" tag is
    by default true if this tag is used in initializing the GtGC.

    NOTE: All features of the encapsulation may not work correctly for
    objects using the "GT_XGC" tag in initialization.


Callbacks for GtGC:
-------------------

  ** NONE DEFINED **
  

Methods for GtGC:
-----------------

   -- User methods --
   
  void SetForeground(ulong col)
  void SetBackground(ulong col)
  void SetPlaneMask(ulong msk)
  void SetFunction(int func)
  void SetState(ulong fg,ulong bg,int func,ulong msk)
  void SetArcMode(int am)
  void SetSubWinMode(int sm)
  void SetGraphicsExposures(sbool ge)
  void SetFont(GtFont *fnt)
  void SetFillStyle(int fs)
  void SetFillRule(int fr)
  void SetLineAttributes(unsigned int width,int lstyle,int cstyle,int jstyle)
  void SetDashes(int off,char *dlist,int nr)
  void SetClipOrigin(int cxp,int cyp)
  void SetClipMask(GtPixmap *pix)
  void SetClipRectangles(int cxp,int cyp,XRectangle *rects,int nr,int order)
  void SetTile(GtPixmap *pix)
  void SetStipple(GtPixmap *pix)
  void SetTSOrigin(int txp,int typ)
  
  void CopyArea(GtDrawable *s,GtDrawable *d,int sx,int sy,int w,
                  int h,int dx,int dy)
  void CopyPlane(GtDrawable *s,GtDrawable *d,int sx,int sy,int w,
                   int h,int dx,int dy,ulong plane)
  void DrawPoint(GtDrawable *d,int x,int y)
  void DrawPoints(GtDrawable *d,XPoint *xps,int nr,int md)
  void DrawLine(GtDrawable *d,int x1,int y1,int x2,int y2)
  void DrawLines(GtDrawable *d,XPoint *xps,int nr,int md)
  void DrawSegments(GtDrawable *d,XSegment *xseg,int nr)
  void DrawRectangle(GtDrawable *d,int x,int y,ulong w,
                       ulong h,sbool fill)
  void DrawRectangles(GtDrawable *d,XRectangle *xrc,
                        int nr,sbool fill)
  void DrawArc(GtDrawable *d,int x,int y,ulong w,ulong h,
                 int a1,int a2,sbool fill)
  void DrawArcs(GtDrawable *d,XArc *xac,int nr,sbool fill)
  void FillPolygon(GtDrawable *d,XPoint *xps,int nr,
                     int shp,int md)
  void DrawText(GtDrawable *d,int x,int y,XTextItem *xtxt,
                  int nr)
  void DrawString(GtDrawable *d,int x,int y,char *str,int len,
                    sbool fill)
  
  GC XGC(void)

   -- GtBase methods --
   
  Init, Set, Get, GetClass, IsSubClassOf, InitV, SetV, GetV, GetA,
  PrtErrHeader

 ----------------------------------------------------------------------------

  The Set* methods will use the corresponding X function to set an attribute
  of the GtGC object in a faster way then with tags. The arguments are
  mostly the same as for the X function but some use Gt objects
  encapsulating a X resource instead of the X resource directly.
  
 ----------------------------------------------------------------------------

  The Copy*, Draw* and Fill* methods are the standard X drawing functions
  encapsulated by the object. One major difference from the X drawing
  functions is that where X uses one unfilled and one filled version of a
  function, Gt uses only one method with a boolean argument for filling or
  no filling.
  
 ----------------------------------------------------------------------------

  GC XGC(void)

    - <result> : X GC encapsulated by the object.
    
    This method returns the encapsulated X GC of the object.
    
