lots of tweaking and adding debug output including operator<</dump(ostream&) methods to help visualize canvas structure

This commit is contained in:
Paul Davis 2013-04-05 11:27:26 -04:00
parent 7db5d68cdb
commit 07a505b1b2
15 changed files with 188 additions and 23 deletions

View file

@ -1,5 +1,5 @@
/*
Copyright (C) 2011 Paul Davis
Copyright (C) 2011-2013 Paul Davis
Author: Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
@ -15,7 +15,6 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/** @file canvas/canvas.h
@ -92,6 +91,9 @@ public:
_log_renders = log;
}
std::string indent() const;
void dump (std::ostream&) const;
protected:
void queue_draw_item_area (Item *, Rect);
@ -148,7 +150,7 @@ public:
void ungrab ();
Cairo::RefPtr<Cairo::Context> context ();
protected:
bool on_expose_event (GdkEventExpose *);
bool on_button_press_event (GdkEventButton *);
@ -195,4 +197,6 @@ private:
}
std::ostream& operator<< (std::ostream&, const ArdourCanvas::Canvas&);
#endif

View file

@ -25,6 +25,7 @@ namespace ArdourCanvas {
extern void checkpoint (std::string, std::string);
extern void set_epoch ();
extern int render_count;
extern int dump_depth;
}
#endif

View file

@ -34,6 +34,8 @@ public:
void add_items_at_point (Duple, std::vector<Item const *> &) const;
void dump (std::ostream&) const;
static int default_items_per_cell;
protected:

View file

@ -1,3 +1,22 @@
/*
Copyright (C) 2011-2013 Paul Davis
Original Author: Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __CANVAS_ITEM_H__
#define __CANVAS_ITEM_H__
@ -148,8 +167,10 @@ public:
#ifdef CANVAS_COMPATIBILITY
void grab_focus ();
#endif
virtual void dump (std::ostream&) const;
std::string whatami() const;
protected:
void begin_change ();
@ -179,6 +200,9 @@ private:
bool _ignore_events;
};
extern std::ostream& operator<< (std::ostream&, const ArdourCanvas::Item&);
}
#endif

View file

@ -19,6 +19,8 @@ public:
void set (Points const &);
Points const & get () const;
void dump (std::ostream&) const;
protected:
void render_path (Rect const &, Cairo::RefPtr<Cairo::Context>) const;