Minsky: 3.17.0
minsky::CairoRenderer Struct Reference

#include <minskyCairoRenderer.h>

Inheritance diagram for minsky::CairoRenderer:
Inheritance graph
Collaboration diagram for minsky::CairoRenderer:
Collaboration graph

Public Member Functions

 CairoRenderer (cairo_t *cairo)
 

Static Public Member Functions

static ecolab::Pango & pango (CAPIRenderer *r)
 
static void s_showText (CAPIRenderer *c, const char *s)
 
static void s_setTextExtents (CAPIRenderer *c, const char *s)
 
static double s_textWidth (CAPIRenderer *c)
 
static double s_textHeight (CAPIRenderer *c)
 

Public Attributes

ecolab::Pango m_pango
 

Detailed Description

Definition at line 27 of file minskyCairoRenderer.h.

Constructor & Destructor Documentation

◆ CairoRenderer()

minsky::CairoRenderer::CairoRenderer ( cairo_t *  cairo)
inline

Definition at line 52 of file minskyCairoRenderer.h.

References s_setTextExtents(), s_showText(), s_textHeight(), and s_textWidth().

52  : ravel::CairoRenderer(cairo), m_pango(cairo) {
53  showText=s_showText;
54  setTextExtents=s_setTextExtents;
55  textWidth=s_textWidth;
56  textHeight=s_textHeight;
57  }
static void s_showText(CAPIRenderer *c, const char *s)
static void s_setTextExtents(CAPIRenderer *c, const char *s)
static double s_textHeight(CAPIRenderer *c)
static double s_textWidth(CAPIRenderer *c)
Here is the call graph for this function:

Member Function Documentation

◆ pango()

static ecolab::Pango& minsky::CairoRenderer::pango ( CAPIRenderer *  r)
inlinestatic

Definition at line 31 of file minskyCairoRenderer.h.

References m_pango.

Referenced by s_setTextExtents(), s_showText(), s_textHeight(), and s_textWidth().

31 {return static_cast<CairoRenderer*>(r)->m_pango;}
CairoRenderer(cairo_t *cairo)
Here is the caller graph for this function:

◆ s_setTextExtents()

static void minsky::CairoRenderer::s_setTextExtents ( CAPIRenderer *  c,
const char *  s 
)
inlinestatic

Definition at line 47 of file minskyCairoRenderer.h.

References pango().

Referenced by CairoRenderer().

48  {pango(c).setText(s);}
static ecolab::Pango & pango(CAPIRenderer *r)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_showText()

static void minsky::CairoRenderer::s_showText ( CAPIRenderer *  c,
const char *  s 
)
inlinestatic

Definition at line 33 of file minskyCairoRenderer.h.

References pango().

Referenced by CairoRenderer().

34  {
35  double x,y;
36  cairo_get_current_point(cairo(c),&x,&y);
37  pango(c).setText(s);
38  // paint a partially obscure white rectange to make the text pop
39  cairo_save(cairo(c));
40  cairo_rectangle(cairo(c),x,y,pango(c).width(),pango(c).height());
41  cairo_set_source_rgba(cairo(c),1,1,1,0.3);
42  cairo_fill(cairo(c));
43  cairo_restore(cairo(c));
44  cairo_move_to(cairo(c),x,y);
45  pango(c).show();
46  }
static ecolab::Pango & pango(CAPIRenderer *r)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_textHeight()

static double minsky::CairoRenderer::s_textHeight ( CAPIRenderer *  c)
inlinestatic

Definition at line 50 of file minskyCairoRenderer.h.

References pango().

Referenced by CairoRenderer().

50 {return pango(c).height();}
static ecolab::Pango & pango(CAPIRenderer *r)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_textWidth()

static double minsky::CairoRenderer::s_textWidth ( CAPIRenderer *  c)
inlinestatic

Definition at line 49 of file minskyCairoRenderer.h.

References pango().

Referenced by CairoRenderer().

49 {return pango(c).width();}
static ecolab::Pango & pango(CAPIRenderer *r)
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_pango

ecolab::Pango minsky::CairoRenderer::m_pango

Definition at line 29 of file minskyCairoRenderer.h.

Referenced by pango().


The documentation for this struct was generated from the following file: