projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a couple of visibility specifiers that were missing
[ardour.git]
/
libs
/
gtkmm2ext
/
cairocell.cc
diff --git
a/libs/gtkmm2ext/cairocell.cc
b/libs/gtkmm2ext/cairocell.cc
index 97c806752ad8af99371b002fb0e99606307347d9..c449cae5920ed1d4dcc07f0221512c0795ea14cb 100644
(file)
--- a/
libs/gtkmm2ext/cairocell.cc
+++ b/
libs/gtkmm2ext/cairocell.cc
@@
-25,6
+25,7
@@
#include "gtkmm2ext/utils.h"
using std::string;
#include "gtkmm2ext/utils.h"
using std::string;
+using std::vector;
using std::map;
using std::max;
using std::cerr;
using std::map;
using std::max;
using std::cerr;
@@
-39,43
+40,43
@@
CairoFontDescription::CairoFontDescription (Pango::FontDescription& fd)
switch (fd.get_style()) {
case Pango::STYLE_NORMAL:
switch (fd.get_style()) {
case Pango::STYLE_NORMAL:
- slant = Cairo::FONT_SLANT_NORMAL;
+
_
slant = Cairo::FONT_SLANT_NORMAL;
break;
case Pango::STYLE_OBLIQUE:
break;
case Pango::STYLE_OBLIQUE:
- slant = Cairo::FONT_SLANT_OBLIQUE;
+
_
slant = Cairo::FONT_SLANT_OBLIQUE;
break;
case Pango::STYLE_ITALIC:
break;
case Pango::STYLE_ITALIC:
- slant = Cairo::FONT_SLANT_ITALIC;
+
_
slant = Cairo::FONT_SLANT_ITALIC;
break;
}
switch (fd.get_weight()) {
case Pango::WEIGHT_ULTRALIGHT:
break;
}
switch (fd.get_weight()) {
case Pango::WEIGHT_ULTRALIGHT:
- weight = Cairo::FONT_WEIGHT_NORMAL;
+
_
weight = Cairo::FONT_WEIGHT_NORMAL;
break;
case Pango::WEIGHT_LIGHT:
break;
case Pango::WEIGHT_LIGHT:
- weight = Cairo::FONT_WEIGHT_NORMAL;
+
_
weight = Cairo::FONT_WEIGHT_NORMAL;
break;
case Pango::WEIGHT_NORMAL:
break;
case Pango::WEIGHT_NORMAL:
- weight = Cairo::FONT_WEIGHT_NORMAL;
+
_
weight = Cairo::FONT_WEIGHT_NORMAL;
break;
case Pango::WEIGHT_SEMIBOLD:
break;
case Pango::WEIGHT_SEMIBOLD:
- weight = Cairo::FONT_WEIGHT_BOLD;
+
_
weight = Cairo::FONT_WEIGHT_BOLD;
break;
case Pango::WEIGHT_BOLD:
break;
case Pango::WEIGHT_BOLD:
- weight = Cairo::FONT_WEIGHT_BOLD;
+
_
weight = Cairo::FONT_WEIGHT_BOLD;
break;
case Pango::WEIGHT_ULTRABOLD:
break;
case Pango::WEIGHT_ULTRABOLD:
- weight = Cairo::FONT_WEIGHT_BOLD;
+
_
weight = Cairo::FONT_WEIGHT_BOLD;
break;
case Pango::WEIGHT_HEAVY:
break;
case Pango::WEIGHT_HEAVY:
- weight = Cairo::FONT_WEIGHT_BOLD;
+
_
weight = Cairo::FONT_WEIGHT_BOLD;
break;
}
break;
}
@@
-132,7
+133,7
@@
void
CairoTextCell::set_size (Cairo::RefPtr<Cairo::Context>& context)
{
const uint32_t lim = (uint32_t) ceil (_width_chars);
CairoTextCell::set_size (Cairo::RefPtr<Cairo::Context>& context)
{
const uint32_t lim = (uint32_t) ceil (_width_chars);
-
char buf[lim+1]
;
+
vector<char> buf(lim+1)
;
uint32_t n;
double max_width = 0.0;
double max_height = 0.0;
uint32_t n;
double max_width = 0.0;
double max_height = 0.0;
@@
-149,7
+150,7
@@
CairoTextCell::set_size (Cairo::RefPtr<Cairo::Context>& context)
buf[n] = '0' + digit;
}
buf[n] = '0' + digit;
}
- context->get_text_extents (
buf
, ext);
+ context->get_text_extents (
&buf[0]
, ext);
max_width = max (ext.width + ext.x_bearing, max_width);
max_height = max (ext.height, max_height);
max_width = max (ext.width + ext.x_bearing, max_width);
max_height = max (ext.height, max_height);
@@
-211,7
+212,6
@@
CairoEditableText::CairoEditableText (boost::shared_ptr<CairoFontDescription> fo
set_flags (Gtk::CAN_FOCUS);
set_can_default (true);
set_flags (Gtk::CAN_FOCUS);
set_can_default (true);
- set_receives_default (true);
}
CairoEditableText::~CairoEditableText ()
}
CairoEditableText::~CairoEditableText ()
@@
-232,13
+232,13
@@
CairoEditableText::on_scroll_event (GdkEventScroll* ev)
}
bool
}
bool
-CairoEditableText::on_focus_in_event (GdkEventFocus*
ev
)
+CairoEditableText::on_focus_in_event (GdkEventFocus*)
{
return false;
}
bool
{
return false;
}
bool
-CairoEditableText::on_focus_out_event (GdkEventFocus*
ev
)
+CairoEditableText::on_focus_out_event (GdkEventFocus*)
{
if (editing_cell) {
queue_draw_cell (editing_cell);
{
if (editing_cell) {
queue_draw_cell (editing_cell);
@@
-287,7
+287,14
@@
CairoEditableText::set_text (CairoTextCell* cell, const string& text)
bool
CairoEditableText::on_expose_event (GdkEventExpose* ev)
{
bool
CairoEditableText::on_expose_event (GdkEventExpose* ev)
{
- Cairo::RefPtr<Cairo::Context> context = get_window()->create_cairo_context();
+ Glib::RefPtr<Gdk::Window> win = get_window ();
+
+ if (!win) {
+ std::cerr << "CET: no window to draw on\n";
+ return false;
+ }
+
+ Cairo::RefPtr<Cairo::Context> context = win->create_cairo_context();
if (cells.empty()) {
return true;
if (cells.empty()) {
return true;