X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fcanvas%2Fstateful_image.cc;h=5f04d9488c0929d2b6391a1643846676886d238d;hb=cf52d6e4b40111eb04b244ec054055a4ec15dbe0;hp=b62da9cc8ccfeb0a535a29bfcca677136b30c754;hpb=e5e12acc5698090f2c0c614385e457cc0b46fbb0;p=ardour.git diff --git a/libs/canvas/stateful_image.cc b/libs/canvas/stateful_image.cc index b62da9cc8c..5f04d9488c 100644 --- a/libs/canvas/stateful_image.cc +++ b/libs/canvas/stateful_image.cc @@ -11,7 +11,7 @@ #include "canvas/stateful_image.h" #include "canvas/utils.h" -#include "i18n.h" +#include "pbd/i18n.h" using namespace ArdourCanvas; using PBD::error; @@ -46,7 +46,7 @@ StatefulImage::render (Rect const & area, Cairo::RefPtr context) Rect self = item_to_window (Rect (0, 0, image->get_width(), image->get_height())); boost::optional draw = self.intersection (area); - + if (!draw) { return; } @@ -89,30 +89,30 @@ int StatefulImage::load_states (const XMLNode& node) { const XMLNodeList& nodes (node.children()); - + _states.clear (); - + for (XMLNodeList::const_iterator i = nodes.begin(); i != nodes.end(); ++i) { State s; States::size_type id; const XMLProperty* prop; - + if ((prop = (*i)->property ("id")) == 0) { error << _("no ID for state") << endmsg; continue; } - sscanf (prop->value().c_str(), "%zd", &id); + sscanf (prop->value().c_str(), "%" G_GSIZE_FORMAT, &id); if ((prop = (*i)->property ("image")) == 0) { error << _("no image for state") << endmsg; continue; } - + if ((s.image = find_image (prop->value())) == 0) { error << string_compose (_("image %1 not found for state"), prop->value()) << endmsg; continue; } - + if (_states.size() < id) { _states.reserve (id); } @@ -139,7 +139,7 @@ StatefulImage::find_image (const std::string& name) name) << endmsg; return ImageHandle(); } - + return Cairo::ImageSurface::create_from_png (path); }