KVIrc  4.9.2
DeveloperAPIs
Macros | Functions | Variables
KvsObject_painter.cpp File Reference
#include "KvsObject_painter.h"
#include "KvsObject_pixmap.h"
#include "KvsObject_widget.h"
#include "kvi_debug.h"
#include "KviLocale.h"
#include "KviError.h"
#include "KviIconManager.h"
#include "KviMemory.h"
#include <QPrintDialog>
#include <QTextDocument>
#include <QIcon>

Macros

#define align_num   (sizeof(align_tbl) / sizeof(align_tbl[0]))
 
#define brushstyles_num   (sizeof(brushstyles_tbl) / sizeof(brushstyles_tbl[0]))
 
#define composition_num   (sizeof(composition_tbl) / sizeof(composition_tbl[0]))
 
#define KVSO_2ARRAYPARAMETERS(__pXOrArray, __iY)
 
#define KVSO_3OR4ARRAYPARAMETERS(__pCol1OrArray, __iCol2, __iCol3, __iOpacity)
 
#define KVSO_PARAMETERS_PAINTER(__pXOrArray, __iY, __iW, __iH)
 
#define PAINTER_ROTATE(__angle, __axis)
 
#define PAINTER_SCALE(__sX, __sY)
 
#define PAINTER_SHEAR(__sH, __sV)
 
#define PAINTER_TRANSLATE(__x, __y)
 
#define penstyles_num   (sizeof(penstyles_tbl) / sizeof(penstyles_tbl[0]))
 

Functions

 if (m_pPainterPath) delete m_pPainterPath
 
 if (m_pGradient) delete m_pGradient
 
 if (m_pPainter &&!bDonotdeleteinternalqpainter) delete m_pPainter
 
 if (m_pPrinter) delete m_pPrinter
 
 KVSO_CLASS_FUNCTION (painter, setFont)
 
 KVSO_CLASS_FUNCTION (painter, setFontSize)
 
 KVSO_CLASS_FUNCTION (painter, setBackGroundMode)
 
 KVSO_CLASS_FUNCTION (painter, drawLine)
 
 KVSO_CLASS_FUNCTION (painter, drawRect)
 
 KVSO_CLASS_FUNCTION (painter, drawEllipse)
 
 KVSO_CLASS_FUNCTION (painter, drawRoundRect)
 
 KVSO_CLASS_FUNCTION (painter, drawArc)
 
 KVSO_CLASS_FUNCTION (painter, drawChord)
 
 KVSO_CLASS_FUNCTION (painter, setBrush)
 
 KVSO_CLASS_FUNCTION (painter, pen)
 
 KVSO_CLASS_FUNCTION (painter, setPen)
 
 KVSO_CLASS_FUNCTION (painter, drawPie)
 
 KVSO_CLASS_FUNCTION (painter, drawPoint)
 
 KVSO_CLASS_FUNCTION (painter, fontDescent)
 
 KVSO_CLASS_FUNCTION (painter, fontAscent)
 
 KVSO_CLASS_FUNCTION (painter, fontMetricsWidth)
 
 KVSO_CLASS_FUNCTION (painter, fontMetricsHeight)
 
 KVSO_CLASS_FUNCTION (painter, begin)
 
 KVSO_CLASS_FUNCTION (painter, end)
 
 KVSO_CLASS_FUNCTION (painter, beginPdf)
 
 KVSO_CLASS_FUNCTION (painter, drawText)
 
 KVSO_CLASS_FUNCTION (painter, drawPixmap)
 
 KVSO_CLASS_FUNCTION (painter, drawPixmapWithColorEffect)
 
 KVSO_CLASS_FUNCTION (painter, drawPixmapMirrored)
 
 KVSO_CLASS_FUNCTION (painter, rotate)
 
 KVSO_CLASS_FUNCTION (painter, translate)
 
 KVSO_CLASS_FUNCTION (painter, shear)
 
 KVSO_CLASS_FUNCTION (painter, scale)
 
 KVSO_CLASS_FUNCTION (painter, reset)
 
 KVSO_CLASS_FUNCTION (painter, drawHtmlText)
 
 KVSO_CLASS_FUNCTION (painter, htmlTextSize)
 
 KVSO_CLASS_FUNCTION (painter, drawIcon)
 
 KVSO_CLASS_FUNCTION (painter, setOpacity)
 
 KVSO_CLASS_FUNCTION (painter, setTextAntialiasing)
 
 KVSO_CLASS_FUNCTION (painter, setAntialiasing)
 
 KVSO_CLASS_FUNCTION (painter, setSmoothPixmapTransform)
 
 KVSO_CLASS_FUNCTION (painter, setPenJoinStyle)
 
 KVSO_CLASS_FUNCTION (painter, setPenCapStyle)
 
 KVSO_CLASS_FUNCTION (painter, save)
 
 KVSO_CLASS_FUNCTION (painter, restore)
 
 KVSO_CLASS_FUNCTION (painter, setPenStyle)
 
 KVSO_CLASS_FUNCTION (painter, setBrushStyle)
 
 KVSO_CLASS_FUNCTION (painter, setGradientStart)
 
 KVSO_CLASS_FUNCTION (painter, setGradientStop)
 
 KVSO_CLASS_FUNCTION (painter, setGradientColor)
 
 KVSO_CLASS_FUNCTION (painter, setGradientAsBrush)
 
 KVSO_CLASS_FUNCTION (painter, clearGradient)
 
 KVSO_CLASS_FUNCTION (painter, setPenWidth)
 
 KVSO_CLASS_FUNCTION (painter, fillRect)
 
 KVSO_CLASS_FUNCTION (painter, colorNames)
 
 KVSO_CLASS_FUNCTION (painter, painterDeviceWidth)
 
 KVSO_CLASS_FUNCTION (painter, painterDeviceHeight)
 
 KVSO_CLASS_FUNCTION (painter, pathMoveTo)
 
 KVSO_CLASS_FUNCTION (painter, pathLineTo)
 
 KVSO_CLASS_FUNCTION (painter, pathAddText)
 
 KVSO_CLASS_FUNCTION (painter, drawPath)
 
 KVSO_CLASS_FUNCTION (painter, setCompositionMode)
 
 KVSO_CLASS_FUNCTION (painter, resetPath)
 

Variables

const int align_cod []
 
const char *const align_tbl []
 
 bDonotdeleteinternalqpainter = false
 
const Qt::BrushStyle brushstyles_cod []
 
const char *const brushstyles_tbl []
 
const QPainter::CompositionMode composition_cod []
 
const char *const composition_tbl []
 
 m_pDeviceObject = nullptr
 
 m_pGradient = nullptr
 
 m_pPainter = new QPainter()
 
 m_pPainterPath = nullptr
 
 m_pPrinter = nullptr
 
const Qt::PenStyle penstyles_cod []
 
const char *const penstyles_tbl []
 

Macro Definition Documentation

#define align_num   (sizeof(align_tbl) / sizeof(align_tbl[0]))

Referenced by KVSO_CLASS_FUNCTION().

#define brushstyles_num   (sizeof(brushstyles_tbl) / sizeof(brushstyles_tbl[0]))

Referenced by KVSO_CLASS_FUNCTION().

#define composition_num   (sizeof(composition_tbl) / sizeof(composition_tbl[0]))

Referenced by KVSO_CLASS_FUNCTION().

#define KVSO_2ARRAYPARAMETERS (   __pXOrArray,
  __iY 
)

Referenced by KVSO_CLASS_FUNCTION().

#define KVSO_3OR4ARRAYPARAMETERS (   __pCol1OrArray,
  __iCol2,
  __iCol3,
  __iOpacity 
)
#define KVSO_PARAMETERS_PAINTER (   __pXOrArray,
  __iY,
  __iW,
  __iH 
)

Referenced by KVSO_CLASS_FUNCTION().

#define PAINTER_ROTATE (   __angle,
  __axis 
)
Value:
QTransform transform; \
transform.rotate(__angle, __axis); \
m_pPainter->setTransform(transform, true);
m_pPainter
Definition: KvsObject_painter.cpp:611

Referenced by KVSO_CLASS_FUNCTION().

#define PAINTER_SCALE (   __sX,
  __sY 
)
Value:
QTransform transform; \
transform.scale(__sX, __sY); \
m_pPainter->setTransform(transform, true);
m_pPainter
Definition: KvsObject_painter.cpp:611

Referenced by KVSO_CLASS_FUNCTION().

#define PAINTER_SHEAR (   __sH,
  __sV 
)
Value:
QTransform transform; \
transform.shear(__sH, __sV); \
m_pPainter->setTransform(transform, true);
m_pPainter
Definition: KvsObject_painter.cpp:611

Referenced by KVSO_CLASS_FUNCTION().

#define PAINTER_TRANSLATE (   __x,
  __y 
)
Value:
QTransform transform; \
transform.translate(__x, __y); \
m_pPainter->setTransform(transform, true);
m_pPainter
Definition: KvsObject_painter.cpp:611

Referenced by KVSO_CLASS_FUNCTION().

#define penstyles_num   (sizeof(penstyles_tbl) / sizeof(penstyles_tbl[0]))

Referenced by KVSO_CLASS_FUNCTION().

Function Documentation

if ( m_pPainterPath  )
if ( m_pGradient  )
if ( m_pPainter &&!  bDonotdeleteinternalqpainter)
if ( m_pPrinter  )
KVSO_CLASS_FUNCTION ( painter  ,
setFont   
)
KVSO_CLASS_FUNCTION ( painter  ,
setFontSize   
)
KVSO_CLASS_FUNCTION ( painter  ,
setBackGroundMode   
)
KVSO_CLASS_FUNCTION ( painter  ,
drawLine   
)
KVSO_CLASS_FUNCTION ( painter  ,
drawRect   
)
KVSO_CLASS_FUNCTION ( painter  ,
drawEllipse   
)
KVSO_CLASS_FUNCTION ( painter  ,
drawRoundRect   
)
KVSO_CLASS_FUNCTION ( painter  ,
drawArc   
)
KVSO_CLASS_FUNCTION ( painter  ,
drawChord   
)
KVSO_CLASS_FUNCTION ( painter  ,
setBrush   
)
KVSO_CLASS_FUNCTION ( painter  ,
pen   
)
KVSO_CLASS_FUNCTION ( painter  ,
setPen   
)
KVSO_CLASS_FUNCTION ( painter  ,
drawPie   
)
KVSO_CLASS_FUNCTION ( painter  ,
drawPoint   
)
KVSO_CLASS_FUNCTION ( painter  ,
fontDescent   
)

References c, and CHECK_INTERNAL_POINTER.

KVSO_CLASS_FUNCTION ( painter  ,
fontAscent   
)

References c, and CHECK_INTERNAL_POINTER.

KVSO_CLASS_FUNCTION ( painter  ,
fontMetricsWidth   
)
KVSO_CLASS_FUNCTION ( painter  ,
fontMetricsHeight   
)
KVSO_CLASS_FUNCTION ( painter  ,
begin   
)
KVSO_CLASS_FUNCTION ( painter  ,
end   
)

References c, m_pDeviceObject, m_pPrinter, and Q_UNUSED().

KVSO_CLASS_FUNCTION ( painter  ,
beginPdf   
)
KVSO_CLASS_FUNCTION ( painter  ,
drawText   
)
KVSO_CLASS_FUNCTION ( painter  ,
drawPixmap   
)
KVSO_CLASS_FUNCTION ( painter  ,
drawPixmapWithColorEffect   
)
KVSO_CLASS_FUNCTION ( painter  ,
drawPixmapMirrored   
)
KVSO_CLASS_FUNCTION ( painter  ,
rotate   
)
KVSO_CLASS_FUNCTION ( painter  ,
translate   
)
KVSO_CLASS_FUNCTION ( painter  ,
shear   
)
KVSO_CLASS_FUNCTION ( painter  ,
scale   
)
KVSO_CLASS_FUNCTION ( painter  ,
reset   
)
KVSO_CLASS_FUNCTION ( painter  ,
drawHtmlText   
)
KVSO_CLASS_FUNCTION ( painter  ,
htmlTextSize   
)
KVSO_CLASS_FUNCTION ( painter  ,
drawIcon   
)
KVSO_CLASS_FUNCTION ( painter  ,
setOpacity   
)
KVSO_CLASS_FUNCTION ( painter  ,
setTextAntialiasing   
)
KVSO_CLASS_FUNCTION ( painter  ,
setAntialiasing   
)
KVSO_CLASS_FUNCTION ( painter  ,
setSmoothPixmapTransform   
)
KVSO_CLASS_FUNCTION ( painter  ,
setPenJoinStyle   
)
KVSO_CLASS_FUNCTION ( painter  ,
setPenCapStyle   
)
KVSO_CLASS_FUNCTION ( painter  ,
save   
)
KVSO_CLASS_FUNCTION ( painter  ,
restore   
)
KVSO_CLASS_FUNCTION ( painter  ,
setPenStyle   
)
KVSO_CLASS_FUNCTION ( painter  ,
setBrushStyle   
)
KVSO_CLASS_FUNCTION ( painter  ,
setGradientStart   
)
KVSO_CLASS_FUNCTION ( painter  ,
setGradientStop   
)
KVSO_CLASS_FUNCTION ( painter  ,
setGradientColor   
)
KVSO_CLASS_FUNCTION ( painter  ,
setGradientAsBrush   
)
KVSO_CLASS_FUNCTION ( painter  ,
clearGradient   
)

References c, m_pGradient, and Q_UNUSED().

KVSO_CLASS_FUNCTION ( painter  ,
setPenWidth   
)
KVSO_CLASS_FUNCTION ( painter  ,
fillRect   
)
KVSO_CLASS_FUNCTION ( painter  ,
colorNames   
)
KVSO_CLASS_FUNCTION ( painter  ,
painterDeviceWidth   
)

References c, and CHECK_INTERNAL_POINTER.

KVSO_CLASS_FUNCTION ( painter  ,
painterDeviceHeight   
)

References c, and CHECK_INTERNAL_POINTER.

KVSO_CLASS_FUNCTION ( painter  ,
pathMoveTo   
)
KVSO_CLASS_FUNCTION ( painter  ,
pathLineTo   
)
KVSO_CLASS_FUNCTION ( painter  ,
pathAddText   
)
KVSO_CLASS_FUNCTION ( painter  ,
drawPath   
)
KVSO_CLASS_FUNCTION ( painter  ,
setCompositionMode   
)
KVSO_CLASS_FUNCTION ( painter  ,
resetPath   
)

References c, m_pPainterPath, and Q_UNUSED().

Variable Documentation

const int align_cod[]
Initial value:
= {
Qt::AlignLeft,
Qt::AlignRight,
Qt::AlignHCenter,
Qt::AlignTop,
Qt::AlignBottom,
Qt::AlignVCenter,
Qt::AlignCenter,
Qt::TextSingleLine,
Qt::TextExpandTabs,
Qt::TextShowMnemonic,
Qt::TextWordWrap,
Qt::TextIncludeTrailingSpaces
}

Referenced by KVSO_CLASS_FUNCTION().

const char* const align_tbl[]
Initial value:
= {
"Left",
"Right",
"HCenter",
"Top",
"Bottom",
"VCenter",
"Center",
"TextSingleLine",
"TextExpandTabs",
"TextShowMnemonic",
"TextWordWrap",
"TextIncludeTrailingSpaces"
}

Referenced by KVSO_CLASS_FUNCTION().

bDonotdeleteinternalqpainter = false
const Qt::BrushStyle brushstyles_cod[]
Initial value:
= {
Qt::NoBrush,
Qt::SolidPattern,
Qt::Dense1Pattern,
Qt::Dense2Pattern,
Qt::Dense3Pattern,
Qt::Dense4Pattern,
Qt::Dense5Pattern,
Qt::Dense6Pattern,
Qt::Dense7Pattern,
Qt::HorPattern,
Qt::VerPattern,
Qt::CrossPattern,
Qt::BDiagPattern,
Qt::FDiagPattern,
Qt::DiagCrossPattern
}

Referenced by KVSO_CLASS_FUNCTION().

const char* const brushstyles_tbl[]
Initial value:
= {
"NoBrush",
"SolidPattern",
"Dense1Pattern",
"Dense2Pattern",
"Dense3Pattern",
"Dense4Pattern",
"Dense5Pattern",
"Dense6Pattern",
"Dense7Pattern",
"HorPattern",
"VerPattern",
"CrossPattern",
"BDiagPattern",
"FDiagPattern",
"DiagCrossPattern"
}

Referenced by KVSO_CLASS_FUNCTION().

const QPainter::CompositionMode composition_cod[]
Initial value:
= {
QPainter::CompositionMode_SourceOver,
QPainter::CompositionMode_DestinationOver,
QPainter::CompositionMode_Clear,
QPainter::CompositionMode_Source,
QPainter::CompositionMode_Destination,
QPainter::CompositionMode_SourceIn,
QPainter::CompositionMode_DestinationIn,
QPainter::CompositionMode_SourceOut,
QPainter::CompositionMode_DestinationOut,
QPainter::CompositionMode_SourceAtop,
QPainter::CompositionMode_DestinationAtop,
QPainter::CompositionMode_Xor,
QPainter::CompositionMode_Plus,
QPainter::CompositionMode_Multiply,
QPainter::CompositionMode_Screen,
QPainter::CompositionMode_Overlay,
QPainter::CompositionMode_Darken,
QPainter::CompositionMode_Lighten,
QPainter::CompositionMode_ColorDodge,
QPainter::CompositionMode_ColorBurn,
QPainter::CompositionMode_HardLight,
QPainter::CompositionMode_SoftLight,
QPainter::CompositionMode_Difference,
QPainter::CompositionMode_Exclusion,
}

Referenced by KVSO_CLASS_FUNCTION().

const char* const composition_tbl[]
Initial value:
= {
"SourceOver",
"DestinationOver",
"Clear",
"Source",
"Destination",
"SourceIn",
"DestinationIn",
"SourceOut",
"DestinationOut",
"SourceAtop",
"DestinationAtop",
"Xor",
"Plus",
"Multiply",
"Screen",
"Overlay",
"Darken",
"Lighten",
"ColorDodge",
"ColorBurn",
"HardLight",
"SoftLight",
"Difference",
"Exclusion"
}

Referenced by KVSO_CLASS_FUNCTION().

m_pDeviceObject = nullptr

Referenced by KVSO_CLASS_FUNCTION().

m_pGradient = nullptr

Referenced by KVSO_CLASS_FUNCTION().

m_pPainter = new QPainter()
m_pPainterPath = nullptr

Referenced by KVSO_CLASS_FUNCTION().

m_pPrinter = nullptr

Referenced by KVSO_CLASS_FUNCTION().

const Qt::PenStyle penstyles_cod[]
Initial value:
= {
Qt::NoPen,
Qt::SolidLine,
Qt::DashLine,
Qt::DotLine,
Qt::DashDotLine,
Qt::DashDotDotLine
}

Referenced by KVSO_CLASS_FUNCTION().

const char* const penstyles_tbl[]
Initial value:
= {
"noPen",
"solidLine",
"dashLine",
"dotLine",
"dashDotLine",
"dashDotDotLine"
}

Referenced by KVSO_CLASS_FUNCTION().