diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-04-04 00:32:52 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-04-04 00:32:52 -0400 |
commit | aaea166135ace01709f7e0be64f40be80f4107ec (patch) | |
tree | 0e794ef7a723e4aaf909b841a6816e405b4ceca1 /libs/canvas/fill.cc | |
parent | 1d8bac08c0c00d44e22c581768a275e1b21a99a7 (diff) |
initial commit of hand merging, plus getting "ancient" waf script to work correctly
Diffstat (limited to 'libs/canvas/fill.cc')
-rw-r--r-- | libs/canvas/fill.cc | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/libs/canvas/fill.cc b/libs/canvas/fill.cc new file mode 100644 index 0000000000..6a424d8c63 --- /dev/null +++ b/libs/canvas/fill.cc @@ -0,0 +1,61 @@ +#include "ardour/utils.h" + +#include "pbd/xml++.h" +#include "pbd/compose.h" +#include "pbd/convert.h" + +#include "canvas/fill.h" +#include "canvas/utils.h" + +using namespace std; +using namespace ArdourCanvas; + +Fill::Fill (Group* parent) + : Item (parent) + , _fill_color (0x000000ff) + , _fill (true) +{ + +} + +void +Fill::set_fill_color (Color color) +{ + begin_change (); + + _fill_color = color; + + end_change (); +} + +void +Fill::set_fill (bool fill) +{ + begin_change (); + + _fill = fill; + + end_change (); +} + +void +Fill::setup_fill_context (Cairo::RefPtr<Cairo::Context> context) const +{ + set_source_rgba (context, _fill_color); +} + +void +Fill::add_fill_state (XMLNode* node) const +{ + node->add_property ("fill-color", string_compose ("%1", _fill_color)); + node->add_property ("fill", _fill ? "yes" : "no"); +} + +void +Fill::set_fill_state (XMLNode const * node) +{ + _fill_color = atoll (node->property("fill-color")->value().c_str()); + _fill = PBD::string_is_affirmative (node->property("fill")->value ().c_str()); + + _bounding_box_dirty = true; +} |