23 #include "pannableTab.rcd" 24 #include "pannableTab.xcd" 26 #include "variablePane.rcd" 27 #include "variablePane.xcd" 28 #include "variableType.rcd" 38 const ecolab::cairo::Surface surf
39 (cairo_recording_surface_create(CAIRO_CONTENT_COLOR_ALPHA,NULL));
40 cairo_move_to(surf.cairo(),0,0);
44 cairo_recording_surface_ink_extents(surf.surface(),&l,&t,&
m_width,&
m_height);
83 const unsigned typicalHeight=38;
93 for (
auto& v:
cminsky().variableValues)
95 if (v.first.empty() ||
selection.contains(v.second->type())==0)
continue;
96 vars.emplace_back(*v.second);
101 while (
vars.size()<gridSize)
vars.emplace_back();
102 if (surface.get()) surface->requestRedraw();
108 cairo_t* cairo=surface->cairo();
109 for (
auto& i:
vars) i.reset(cairo);
110 cairo_identity_matrix(cairo);
113 return surface.get();
120 cairo_identity_matrix(surface->cairo());
121 cairo_translate(surface->cairo(), x+
offsx, y+
offsy);
void update()
update variables from model, using previous height value
void addVariable(const std::string &name, VariableType::Type type)
item or wire obtained by get*At() calls
std::string uqName(const std::string &name)
extract unqualified portion of name
std::set< Type > selection
const VariableBase & variable() const
Creation and access to the minskyTCL_obj object, which has code to record whenever Minsky's state cha...
bool redraw(int, int, int width, int height) override
const Minsky & cminsky()
const version to help in const correctness
CLASSDESC_ACCESS_EXPLICIT_INSTANTIATION(minsky::VariablePaneBase)
void moveCursorTo(double, double) override
move current cursor to x,y
VariablePaneCell & cell(unsigned row, unsigned col) override
return reference to cell row, col. Reference is valid until next call to cell()
classdesc::Exclude< std::vector< VariablePaneCell > > vars
void updateWithHeight(unsigned height)
update variables from model, given a window of height pixels
Minsky & minsky()
global minsky object
void draw()
render the cairo image