_weight = Cairo::FONT_WEIGHT_BOLD;
break;
+ /* to silence warnings when compiling with newer pango versions. */
+ default:
+ _weight = Cairo::FONT_WEIGHT_NORMAL;
+ break;
}
face = fd.get_family();
-}
+}
CairoCell::CairoCell (int32_t id)
: _id (id)
for (int digit = 0; digit < 10; digit++) {
for (n = 0; n < lim; ++n) {
- buf[n] = '0' + digit;
+ buf[n] = '0' + digit;
}
-
+
context->get_text_extents (&buf[0], ext);
-
+
max_width = max (ext.width + ext.x_bearing, max_width);
max_height = max (ext.height, max_height);
bsum += ext.x_bearing;
Cairo::TextExtents ext;
_font->apply (context);
-
+
{
const char* buf = "8";
context->get_text_extents (buf, ext);
CairoEditableText::add_cell (CairoCell* cell)
{
cells.push_back (cell);
-
+
CairoTextCell* tc = dynamic_cast<CairoTextCell*>(cell);
if (tc) {
Gtk::Allocation alloc = get_allocation ();
double width = alloc.get_width();
double height = alloc.get_height ();
-
+
if (_draw_bg) {
context->set_source_rgba (bg_r, bg_g, bg_b, bg_a);
if (_corner_radius) {
}
context->fill ();
}
-
+
for (CellMap::iterator i = cells.begin(); i != cells.end(); ++i) {
CairoCell* cell = (*i);
/* is cell inside the expose area?
*/
-
+
if (cell->intersects (ev->area)) {
if (cell == editing_cell) {
context->set_source_rgba (edit_r, edit_b, edit_g, edit_a);
if (!win) {
return;
}
-
+
Cairo::RefPtr<Cairo::Context> context = win->create_cairo_context();
-
+
if (!context) {
return;
}
max_cell_width = 0;
max_cell_height = 0;
-
+
for (CellMap::iterator i = cells.begin(); i != cells.end(); ++i) {
max_cell_width += (*i)->width();
max_cell_height = std::max ((double) (*i)->height(), max_cell_height);