JX Application Framework
Loading...
Searching...
No Matches
Public Member Functions | List of all members
JXGC Class Reference

#include <JXGC.h>

Public Member Functions

 JXGC (JXDisplay *display, const Drawable drawable)
 
 ~JXGC ()
 
JXDisplayGetDisplay () const
 
bool GetClipping (JPoint *offset, Region *region, JXImageMask **pixmap)
 
void SetClipRect (const JRect &clipRect)
 
void SetClipRegion (const Region clipRegion)
 
void SetClipPixmap (const JPoint &offset, Pixmap pixmap)
 
void SetClipPixmap (const JPoint &offset, const JXImageMask &mask)
 
void ClearClipping ()
 
void SetDrawingColor (const JColorID color)
 
void SetDrawingFunction (const int function)
 
void SetLineWidth (const JSize width)
 
void DrawDashedLines (const bool on)
 
void SetDashList (const JArray< JSize > &dashList, const JSize offset=0)
 
void SetSubwindowMode (const int mode)
 
void DrawPoint (const Drawable drawable, const JCoordinate x, const JCoordinate y) const
 
void DrawLine (const Drawable drawable, const JCoordinate x1, const JCoordinate y1, const JCoordinate x2, const JCoordinate y2) const
 
void DrawLines (const Drawable drawable, const JSize ptCount, XPoint xpt[]) const
 
void DrawRect (const Drawable drawable, const JCoordinate x, const JCoordinate y, const JCoordinate width, const JCoordinate height) const
 
void FillRect (const Drawable drawable, const JCoordinate x, const JCoordinate y, const JCoordinate width, const JCoordinate height) const
 
void DrawArc (const Drawable drawable, const JCoordinate x, const JCoordinate y, const JCoordinate width, const JCoordinate height, const JFloat startAngle, const JFloat deltaAngle) const
 
void FillArc (const Drawable drawable, const JCoordinate x, const JCoordinate y, const JCoordinate width, const JCoordinate height, const JFloat startAngle, const JFloat deltaAngle) const
 
void FillPolygon (const Drawable drawable, const JSize ptCount, XPoint xpt[]) const
 
void SetFont (const JFontID id)
 
void DrawString (const Drawable drawable, XftDraw *fdrawable, const JCoordinate x, const JCoordinate y, const JString &str) const
 
void CopyPixels (const Drawable source, const JCoordinate src_x, const JCoordinate src_y, const JCoordinate width, const JCoordinate height, const Drawable dest, const JCoordinate dest_x, const JCoordinate dest_y) const
 
void CopyImage (const XImage *source, const JCoordinate src_x, const JCoordinate src_y, const JCoordinate width, const JCoordinate height, const Drawable dest, const JCoordinate dest_x, const JCoordinate dest_y) const
 

Detailed Description

Represents a single X Graphics Context.  We don't provide a convertion
to GC because that would break our buffering of GC settings. (color, etc)
This buffering is important for reducing the number of server calls.

If we are depth 1, drawing in any color other than JXImageMask::kPixelOff
produces "pixel on".  Refer to JXImageMask::ColorToBit().

This class was not designed to be a base class.

Constructor & Destructor Documentation

◆ JXGC()

JXGC::JXGC ( JXDisplay display,
const Drawable  drawable 
)

◆ ~JXGC()

JXGC::~JXGC ( )

Member Function Documentation

◆ ClearClipping()

void JXGC::ClearClipping ( )

◆ CopyImage()

void JXGC::CopyImage ( const XImage *  source,
const JCoordinate  src_x,
const JCoordinate  src_y,
const JCoordinate  width,
const JCoordinate  height,
const Drawable  dest,
const JCoordinate  dest_x,
const JCoordinate  dest_y 
) const

◆ CopyPixels()

void JXGC::CopyPixels ( const Drawable  source,
const JCoordinate  src_x,
const JCoordinate  src_y,
const JCoordinate  width,
const JCoordinate  height,
const Drawable  dest,
const JCoordinate  dest_x,
const JCoordinate  dest_y 
) const

◆ DrawArc()

void JXGC::DrawArc ( const Drawable  drawable,
const JCoordinate  x,
const JCoordinate  y,
const JCoordinate  width,
const JCoordinate  height,
const JFloat  startAngle,
const JFloat  deltaAngle 
) const

◆ DrawDashedLines()

void JXGC::DrawDashedLines ( const bool  on)

◆ DrawLine()

void JXGC::DrawLine ( const Drawable  drawable,
const JCoordinate  x1,
const JCoordinate  y1,
const JCoordinate  x2,
const JCoordinate  y2 
) const

◆ DrawLines()

void JXGC::DrawLines ( const Drawable  drawable,
const JSize  ptCount,
XPoint  xpt[] 
) const

xpt[0] must be the same as xpt[ptCount-1] in order to close the polygon.

◆ DrawPoint()

void JXGC::DrawPoint ( const Drawable  drawable,
const JCoordinate  x,
const JCoordinate  y 
) const

◆ DrawRect()

void JXGC::DrawRect ( const Drawable  drawable,
const JCoordinate  x,
const JCoordinate  y,
const JCoordinate  width,
const JCoordinate  height 
) const

◆ DrawString()

void JXGC::DrawString ( const Drawable  drawable,
XftDraw *  fdrawable,
const JCoordinate  origX,
const JCoordinate  y,
const JString str 
) const

If the string is too long to be sent to the server in one chunk, we split it up.

◆ FillArc()

void JXGC::FillArc ( const Drawable  drawable,
const JCoordinate  x,
const JCoordinate  y,
const JCoordinate  width,
const JCoordinate  height,
const JFloat  startAngle,
const JFloat  deltaAngle 
) const

◆ FillPolygon()

void JXGC::FillPolygon ( const Drawable  drawable,
const JSize  ptCount,
XPoint  xpt[] 
) const

◆ FillRect()

void JXGC::FillRect ( const Drawable  drawable,
const JCoordinate  x,
const JCoordinate  y,
const JCoordinate  width,
const JCoordinate  height 
) const

◆ GetClipping()

bool JXGC::GetClipping ( JPoint offset,
Region *  region,
JXImageMask **  pixmap 
)

Returns true if we have any clipping set. *region is created, if necessary. *pixmap is set to the current pixmap, if any. Thus, the caller owns the resulting region, but we own the resulting pixmap.

◆ GetDisplay()

JXDisplay * JXGC::GetDisplay ( ) const
inline

◆ SetClipPixmap() [1/2]

void JXGC::SetClipPixmap ( const JPoint offset,
const JXImageMask mask 
)

◆ SetClipPixmap() [2/2]

void JXGC::SetClipPixmap ( const JPoint offset,
Pixmap  pixmap 
)

We take ownership of the pixmap that is passed in.

◆ SetClipRect()

void JXGC::SetClipRect ( const JRect clipRect)

◆ SetClipRegion()

void JXGC::SetClipRegion ( const Region  clipRegion)

We do not take ownership of the clipRegion that is passed in.

◆ SetDashList()

void JXGC::SetDashList ( const JArray< JSize > &  dashList,
const JSize  offset = 0 
)

◆ SetDrawingColor()

void JXGC::SetDrawingColor ( const JColorID  color)

◆ SetDrawingFunction()

void JXGC::SetDrawingFunction ( const int  function)

◆ SetFont()

void JXGC::SetFont ( const JFontID  id)
inline

◆ SetLineWidth()

void JXGC::SetLineWidth ( const JSize  width)

◆ SetSubwindowMode()

void JXGC::SetSubwindowMode ( const int  mode)

Possible arguments are: ClipByChildren, IncludeInferiors


The documentation for this class was generated from the following files: