mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-14 18:46:34 +01:00
add visibility/export control to libcanvas
This commit is contained in:
parent
b0e4f81eb3
commit
218a4664be
27 changed files with 142 additions and 55 deletions
|
|
@ -19,13 +19,14 @@
|
||||||
#ifndef __CANVAS_ARC_H__
|
#ifndef __CANVAS_ARC_H__
|
||||||
#define __CANVAS_ARC_H__
|
#define __CANVAS_ARC_H__
|
||||||
|
|
||||||
|
#include "canvas/visibility.h"
|
||||||
#include "canvas/item.h"
|
#include "canvas/item.h"
|
||||||
#include "canvas/outline.h"
|
#include "canvas/outline.h"
|
||||||
#include "canvas/fill.h"
|
#include "canvas/fill.h"
|
||||||
|
|
||||||
namespace ArdourCanvas {
|
namespace ArdourCanvas {
|
||||||
|
|
||||||
class Arc : virtual public Item, public Outline, public Fill
|
class LIBCANVAS_API Arc : virtual public Item, public Outline, public Fill
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Arc (Group *);
|
Arc (Group *);
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@
|
||||||
#ifndef __CANVAS_ARROW_H__
|
#ifndef __CANVAS_ARROW_H__
|
||||||
#define __CANVAS_ARROW_H__
|
#define __CANVAS_ARROW_H__
|
||||||
|
|
||||||
|
#include "canvas/visibility.h"
|
||||||
|
|
||||||
#include "canvas/group.h"
|
#include "canvas/group.h"
|
||||||
|
|
||||||
namespace ArdourCanvas {
|
namespace ArdourCanvas {
|
||||||
|
|
@ -43,7 +45,7 @@ class Polygon;
|
||||||
* to draw lines at any angle.
|
* to draw lines at any angle.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Arrow : public Group
|
class LIBCANVAS_API Arrow : public Group
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Arrow (Group *);
|
Arrow (Group *);
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,9 @@
|
||||||
#include <cairomm/context.h>
|
#include <cairomm/context.h>
|
||||||
|
|
||||||
#include "pbd/signals.h"
|
#include "pbd/signals.h"
|
||||||
|
|
||||||
|
#include "canvas/visibility.h"
|
||||||
|
|
||||||
#include "canvas/root_group.h"
|
#include "canvas/root_group.h"
|
||||||
|
|
||||||
namespace ArdourCanvas
|
namespace ArdourCanvas
|
||||||
|
|
@ -51,7 +54,7 @@ class Group;
|
||||||
* rightwards and y increases downwards.
|
* rightwards and y increases downwards.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Canvas
|
class LIBCANVAS_API Canvas
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Canvas ();
|
Canvas ();
|
||||||
|
|
@ -127,7 +130,7 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
/** A canvas which renders onto a GTK EventBox */
|
/** A canvas which renders onto a GTK EventBox */
|
||||||
class GtkCanvas : public Canvas, public Gtk::EventBox
|
class LIBCANVAS_API GtkCanvas : public Canvas, public Gtk::EventBox
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GtkCanvas ();
|
GtkCanvas ();
|
||||||
|
|
@ -179,7 +182,7 @@ private:
|
||||||
* This provides a GtkCanvas that can be scrolled. It does NOT implement the
|
* This provides a GtkCanvas that can be scrolled. It does NOT implement the
|
||||||
* Gtk::Scrollable interface.
|
* Gtk::Scrollable interface.
|
||||||
*/
|
*/
|
||||||
class GtkCanvasViewport : public Gtk::Alignment
|
class LIBCANVAS_API GtkCanvasViewport : public Gtk::Alignment
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GtkCanvasViewport (Gtk::Adjustment &, Gtk::Adjustment &);
|
GtkCanvasViewport (Gtk::Adjustment &, Gtk::Adjustment &);
|
||||||
|
|
|
||||||
|
|
@ -19,11 +19,13 @@
|
||||||
#ifndef __CANVAS_CIRCLE_H__
|
#ifndef __CANVAS_CIRCLE_H__
|
||||||
#define __CANVAS_CIRCLE_H__
|
#define __CANVAS_CIRCLE_H__
|
||||||
|
|
||||||
|
#include "canvas/visibility.h"
|
||||||
|
|
||||||
#include "canvas/arc.h"
|
#include "canvas/arc.h"
|
||||||
|
|
||||||
namespace ArdourCanvas {
|
namespace ArdourCanvas {
|
||||||
|
|
||||||
class Circle : public Arc
|
class LIBCANVAS_API Circle : public Arc
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Circle (Group *);
|
Circle (Group *);
|
||||||
|
|
|
||||||
|
|
@ -19,11 +19,13 @@
|
||||||
#ifndef __CANVAS_CURVE_H__
|
#ifndef __CANVAS_CURVE_H__
|
||||||
#define __CANVAS_CURVE_H__
|
#define __CANVAS_CURVE_H__
|
||||||
|
|
||||||
|
#include "canvas/visibility.h"
|
||||||
|
|
||||||
#include "canvas/poly_item.h"
|
#include "canvas/poly_item.h"
|
||||||
|
|
||||||
namespace ArdourCanvas {
|
namespace ArdourCanvas {
|
||||||
|
|
||||||
class Curve : public PolyItem
|
class LIBCANVAS_API Curve : public PolyItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Curve (Group *);
|
Curve (Group *);
|
||||||
|
|
|
||||||
|
|
@ -24,12 +24,14 @@
|
||||||
#include <map>
|
#include <map>
|
||||||
#include "pbd/debug.h"
|
#include "pbd/debug.h"
|
||||||
|
|
||||||
|
#include "canvas/visibility.h"
|
||||||
|
|
||||||
namespace PBD {
|
namespace PBD {
|
||||||
namespace DEBUG {
|
namespace DEBUG {
|
||||||
extern uint64_t CanvasItems;
|
LIBCANVAS_API extern uint64_t CanvasItems;
|
||||||
extern uint64_t CanvasItemsDirtied;
|
LIBCANVAS_API extern uint64_t CanvasItemsDirtied;
|
||||||
extern uint64_t CanvasEvents;
|
LIBCANVAS_API extern uint64_t CanvasEvents;
|
||||||
extern uint64_t CanvasRender;
|
LIBCANVAS_API extern uint64_t CanvasRender;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -40,13 +42,13 @@ namespace PBD {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace ArdourCanvas {
|
namespace ArdourCanvas {
|
||||||
extern struct timeval epoch;
|
LIBCANVAS_API extern struct timeval epoch;
|
||||||
extern std::map<std::string, struct timeval> last_time;
|
LIBCANVAS_API extern std::map<std::string, struct timeval> last_time;
|
||||||
extern void checkpoint (std::string, std::string);
|
LIBCANVAS_API extern void checkpoint (std::string, std::string);
|
||||||
extern void set_epoch ();
|
LIBCANVAS_API extern void set_epoch ();
|
||||||
extern int render_count;
|
LIBCANVAS_API extern int render_count;
|
||||||
extern int render_depth;
|
LIBCANVAS_API extern int render_depth;
|
||||||
extern int dump_depth;
|
LIBCANVAS_API extern int dump_depth;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -22,11 +22,13 @@
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include "canvas/visibility.h"
|
||||||
#include "canvas/item.h"
|
#include "canvas/item.h"
|
||||||
|
|
||||||
namespace ArdourCanvas {
|
namespace ArdourCanvas {
|
||||||
|
|
||||||
class Fill : virtual public Item
|
class LIBCANVAS_API Fill : virtual public Item
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Fill (Group *);
|
Fill (Group *);
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "canvas/visibility.h"
|
||||||
#include "canvas/group.h"
|
#include "canvas/group.h"
|
||||||
#include "canvas/types.h"
|
#include "canvas/types.h"
|
||||||
|
|
||||||
|
|
@ -26,7 +27,7 @@ class Text;
|
||||||
class Line;
|
class Line;
|
||||||
class Rectangle;
|
class Rectangle;
|
||||||
|
|
||||||
class Flag : public Group
|
class LIBCANVAS_API Flag : public Group
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Flag (Group *, Distance, Color, Color, Duple);
|
Flag (Group *, Distance, Color, Color, Duple);
|
||||||
|
|
|
||||||
|
|
@ -22,13 +22,15 @@
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "canvas/visibility.h"
|
||||||
#include "canvas/item.h"
|
#include "canvas/item.h"
|
||||||
#include "canvas/types.h"
|
#include "canvas/types.h"
|
||||||
#include "canvas/lookup_table.h"
|
#include "canvas/lookup_table.h"
|
||||||
|
|
||||||
namespace ArdourCanvas {
|
namespace ArdourCanvas {
|
||||||
|
|
||||||
class Group : public Item
|
class LIBCANVAS_API Group : public Item
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit Group (Group *);
|
explicit Group (Group *);
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
#include <boost/shared_array.hpp>
|
#include <boost/shared_array.hpp>
|
||||||
|
|
||||||
|
#include "canvas/visibility.h"
|
||||||
#include "canvas/item.h"
|
#include "canvas/item.h"
|
||||||
|
|
||||||
typedef void (*ImageReleaseCallback)(uint8_t *d, void *arg);
|
typedef void (*ImageReleaseCallback)(uint8_t *d, void *arg);
|
||||||
|
|
@ -30,7 +31,7 @@ typedef void (*ImageReleaseCallback)(uint8_t *d, void *arg);
|
||||||
namespace ArdourCanvas {
|
namespace ArdourCanvas {
|
||||||
|
|
||||||
|
|
||||||
class Image : public Item
|
class LIBCANVAS_API Image : public Item
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Image (Group *, Cairo::Format, int width, int height);
|
Image (Group *, Cairo::Format, int width, int height);
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@
|
||||||
|
|
||||||
#include "pbd/signals.h"
|
#include "pbd/signals.h"
|
||||||
|
|
||||||
|
#include "canvas/visibility.h"
|
||||||
#include "canvas/types.h"
|
#include "canvas/types.h"
|
||||||
|
|
||||||
namespace ArdourCanvas
|
namespace ArdourCanvas
|
||||||
|
|
@ -48,7 +49,7 @@ class Rect;
|
||||||
* and all except the `root group' have a pointer to their parent group.
|
* and all except the `root group' have a pointer to their parent group.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Item
|
class LIBCANVAS_API Item
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Item (Canvas *);
|
Item (Canvas *);
|
||||||
|
|
@ -241,7 +242,7 @@ private:
|
||||||
bool _ignore_events;
|
bool _ignore_events;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern std::ostream& operator<< (std::ostream&, const ArdourCanvas::Item&);
|
extern LIBCANVAS_API std::ostream& operator<< (std::ostream&, const ArdourCanvas::Item&);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,13 +20,14 @@
|
||||||
#ifndef __CANVAS_LINE_H__
|
#ifndef __CANVAS_LINE_H__
|
||||||
#define __CANVAS_LINE_H__
|
#define __CANVAS_LINE_H__
|
||||||
|
|
||||||
|
#include "canvas/visibility.h"
|
||||||
#include "canvas/item.h"
|
#include "canvas/item.h"
|
||||||
#include "canvas/outline.h"
|
#include "canvas/outline.h"
|
||||||
#include "canvas/poly_line.h"
|
#include "canvas/poly_line.h"
|
||||||
|
|
||||||
namespace ArdourCanvas {
|
namespace ArdourCanvas {
|
||||||
|
|
||||||
class Line : virtual public Item, public Outline
|
class LIBCANVAS_API Line : virtual public Item, public Outline
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Line (Group *);
|
Line (Group *);
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,12 @@
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "canvas/visibility.h"
|
||||||
#include "canvas/item.h"
|
#include "canvas/item.h"
|
||||||
|
|
||||||
namespace ArdourCanvas {
|
namespace ArdourCanvas {
|
||||||
|
|
||||||
class LineSet : public Item
|
class LIBCANVAS_API LineSet : public Item
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum Orientation {
|
enum Orientation {
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,8 @@
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <boost/multi_array.hpp>
|
#include <boost/multi_array.hpp>
|
||||||
|
|
||||||
|
#include "canvas/visibility.h"
|
||||||
#include "canvas/types.h"
|
#include "canvas/types.h"
|
||||||
|
|
||||||
class OptimizingLookupTableTest;
|
class OptimizingLookupTableTest;
|
||||||
|
|
@ -31,7 +33,7 @@ namespace ArdourCanvas {
|
||||||
class Item;
|
class Item;
|
||||||
class Group;
|
class Group;
|
||||||
|
|
||||||
class LookupTable
|
class LIBCANVAS_API LookupTable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LookupTable (Group const &);
|
LookupTable (Group const &);
|
||||||
|
|
@ -46,7 +48,7 @@ protected:
|
||||||
Group const & _group;
|
Group const & _group;
|
||||||
};
|
};
|
||||||
|
|
||||||
class DumbLookupTable : public LookupTable
|
class LIBCANVAS_API DumbLookupTable : public LookupTable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DumbLookupTable (Group const &);
|
DumbLookupTable (Group const &);
|
||||||
|
|
@ -56,7 +58,7 @@ public:
|
||||||
bool has_item_at_point (Duple const & point) const;
|
bool has_item_at_point (Duple const & point) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class OptimizingLookupTable : public LookupTable
|
class LIBCANVAS_API OptimizingLookupTable : public LookupTable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
OptimizingLookupTable (Group const &, int);
|
OptimizingLookupTable (Group const &, int);
|
||||||
|
|
|
||||||
|
|
@ -21,12 +21,14 @@
|
||||||
#define __CANVAS_OUTLINE_H__
|
#define __CANVAS_OUTLINE_H__
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include "canvas/visibility.h"
|
||||||
#include "canvas/types.h"
|
#include "canvas/types.h"
|
||||||
#include "canvas/item.h"
|
#include "canvas/item.h"
|
||||||
|
|
||||||
namespace ArdourCanvas {
|
namespace ArdourCanvas {
|
||||||
|
|
||||||
class Outline : virtual public Item
|
class LIBCANVAS_API Outline : virtual public Item
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Outline (Group *);
|
Outline (Group *);
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#include <glibmm/refptr.h>
|
#include <glibmm/refptr.h>
|
||||||
|
|
||||||
|
#include "canvas/visibility.h"
|
||||||
#include "canvas/item.h"
|
#include "canvas/item.h"
|
||||||
|
|
||||||
namespace Gdk {
|
namespace Gdk {
|
||||||
|
|
@ -30,7 +31,7 @@ namespace Gdk {
|
||||||
|
|
||||||
namespace ArdourCanvas {
|
namespace ArdourCanvas {
|
||||||
|
|
||||||
class Pixbuf : public Item
|
class LIBCANVAS_API Pixbuf : public Item
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Pixbuf (Group *);
|
Pixbuf (Group *);
|
||||||
|
|
|
||||||
|
|
@ -20,12 +20,13 @@
|
||||||
#ifndef __CANVAS_POLY_ITEM_H__
|
#ifndef __CANVAS_POLY_ITEM_H__
|
||||||
#define __CANVAS_POLY_ITEM_H__
|
#define __CANVAS_POLY_ITEM_H__
|
||||||
|
|
||||||
|
#include "canvas/visibility.h"
|
||||||
#include "canvas/item.h"
|
#include "canvas/item.h"
|
||||||
#include "canvas/outline.h"
|
#include "canvas/outline.h"
|
||||||
|
|
||||||
namespace ArdourCanvas {
|
namespace ArdourCanvas {
|
||||||
|
|
||||||
class PolyItem : virtual public Item, public Outline
|
class LIBCANVAS_API PolyItem : virtual public Item, public Outline
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PolyItem (Group *);
|
PolyItem (Group *);
|
||||||
|
|
|
||||||
|
|
@ -20,12 +20,13 @@
|
||||||
#ifndef __CANVAS_POLY_LINE_H__
|
#ifndef __CANVAS_POLY_LINE_H__
|
||||||
#define __CANVAS_POLY_LINE_H__
|
#define __CANVAS_POLY_LINE_H__
|
||||||
|
|
||||||
|
#include "canvas/visibility.h"
|
||||||
#include "canvas/poly_item.h"
|
#include "canvas/poly_item.h"
|
||||||
#include "canvas/outline.h"
|
#include "canvas/outline.h"
|
||||||
|
|
||||||
namespace ArdourCanvas {
|
namespace ArdourCanvas {
|
||||||
|
|
||||||
class PolyLine : public PolyItem
|
class LIBCANVAS_API PolyLine : public PolyItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PolyLine (Group *);
|
PolyLine (Group *);
|
||||||
|
|
|
||||||
|
|
@ -20,13 +20,14 @@
|
||||||
#ifndef __CANVAS_POLYGON_H__
|
#ifndef __CANVAS_POLYGON_H__
|
||||||
#define __CANVAS_POLYGON_H__
|
#define __CANVAS_POLYGON_H__
|
||||||
|
|
||||||
|
#include "canvas/visibility.h"
|
||||||
#include "canvas/poly_item.h"
|
#include "canvas/poly_item.h"
|
||||||
#include "canvas/outline.h"
|
#include "canvas/outline.h"
|
||||||
#include "canvas/fill.h"
|
#include "canvas/fill.h"
|
||||||
|
|
||||||
namespace ArdourCanvas {
|
namespace ArdourCanvas {
|
||||||
|
|
||||||
class Polygon : public PolyItem, public Fill
|
class LIBCANVAS_API Polygon : public PolyItem, public Fill
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Polygon (Group *);
|
Polygon (Group *);
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
#ifndef __CANVAS_RECTANGLE_H__
|
#ifndef __CANVAS_RECTANGLE_H__
|
||||||
#define __CANVAS_RECTANGLE_H__
|
#define __CANVAS_RECTANGLE_H__
|
||||||
|
|
||||||
|
#include "canvas/visibility.h"
|
||||||
#include "canvas/item.h"
|
#include "canvas/item.h"
|
||||||
#include "canvas/types.h"
|
#include "canvas/types.h"
|
||||||
#include "canvas/outline.h"
|
#include "canvas/outline.h"
|
||||||
|
|
@ -28,7 +29,7 @@
|
||||||
namespace ArdourCanvas
|
namespace ArdourCanvas
|
||||||
{
|
{
|
||||||
|
|
||||||
class Rectangle : virtual public Item, public Outline, public Fill
|
class LIBCANVAS_API Rectangle : virtual public Item, public Outline, public Fill
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Rectangle (Group *);
|
Rectangle (Group *);
|
||||||
|
|
|
||||||
|
|
@ -20,11 +20,12 @@
|
||||||
#ifndef __CANVAS_ROOT_GROUP_H__
|
#ifndef __CANVAS_ROOT_GROUP_H__
|
||||||
#define __CANVAS_ROOT_GROUP_H__
|
#define __CANVAS_ROOT_GROUP_H__
|
||||||
|
|
||||||
#include "group.h"
|
#include "canvas/visibility.h"
|
||||||
|
#include "canvas/group.h"
|
||||||
|
|
||||||
namespace ArdourCanvas {
|
namespace ArdourCanvas {
|
||||||
|
|
||||||
class RootGroup : public Group
|
class LIBCANVAS_API RootGroup : public Group
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
friend class Canvas;
|
friend class Canvas;
|
||||||
|
|
|
||||||
|
|
@ -23,11 +23,12 @@
|
||||||
#include <pangomm/fontdescription.h>
|
#include <pangomm/fontdescription.h>
|
||||||
#include <pangomm/layout.h>
|
#include <pangomm/layout.h>
|
||||||
|
|
||||||
|
#include "canvas/visibility.h"
|
||||||
#include "canvas/item.h"
|
#include "canvas/item.h"
|
||||||
|
|
||||||
namespace ArdourCanvas {
|
namespace ArdourCanvas {
|
||||||
|
|
||||||
class Text : public Item
|
class LIBCANVAS_API Text : public Item
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Text (Group *);
|
Text (Group *);
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,8 @@
|
||||||
|
|
||||||
#include <cairomm/refptr.h>
|
#include <cairomm/refptr.h>
|
||||||
|
|
||||||
|
#include "canvas/visibility.h"
|
||||||
|
|
||||||
namespace Cairo {
|
namespace Cairo {
|
||||||
struct Context;
|
struct Context;
|
||||||
}
|
}
|
||||||
|
|
@ -38,9 +40,9 @@ typedef double Coord;
|
||||||
typedef double Distance;
|
typedef double Distance;
|
||||||
typedef uint32_t Color;
|
typedef uint32_t Color;
|
||||||
|
|
||||||
extern Coord const COORD_MAX;
|
extern LIBCANVAS_API Coord const COORD_MAX;
|
||||||
|
|
||||||
struct Duple
|
struct LIBCANVAS_API Duple
|
||||||
{
|
{
|
||||||
Duple ()
|
Duple ()
|
||||||
: x (0)
|
: x (0)
|
||||||
|
|
@ -59,14 +61,14 @@ struct Duple
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
extern Duple operator- (Duple const &);
|
extern LIBCANVAS_API Duple operator- (Duple const &);
|
||||||
extern Duple operator+ (Duple const &, Duple const &);
|
extern LIBCANVAS_API Duple operator+ (Duple const &, Duple const &);
|
||||||
extern bool operator== (Duple const &, Duple const &);
|
extern LIBCANVAS_API bool operator== (Duple const &, Duple const &);
|
||||||
extern Duple operator- (Duple const &, Duple const &);
|
extern LIBCANVAS_API Duple operator- (Duple const &, Duple const &);
|
||||||
extern Duple operator/ (Duple const &, double);
|
extern LIBCANVAS_API Duple operator/ (Duple const &, double);
|
||||||
extern std::ostream & operator<< (std::ostream &, Duple const &);
|
extern LIBCANVAS_API std::ostream & operator<< (std::ostream &, Duple const &);
|
||||||
|
|
||||||
struct Rect
|
struct LIBCANVAS_API Rect
|
||||||
{
|
{
|
||||||
Rect ()
|
Rect ()
|
||||||
: x0 (0)
|
: x0 (0)
|
||||||
|
|
@ -106,7 +108,7 @@ struct Rect
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
extern std::ostream & operator<< (std::ostream &, Rect const &);
|
extern LIBCANVAS_API std::ostream & operator<< (std::ostream &, Rect const &);
|
||||||
|
|
||||||
typedef std::vector<Duple> Points;
|
typedef std::vector<Duple> Points;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,18 +17,19 @@
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "canvas/visibility.h"
|
||||||
#include "canvas/types.h"
|
#include "canvas/types.h"
|
||||||
|
|
||||||
namespace ArdourCanvas {
|
namespace ArdourCanvas {
|
||||||
|
|
||||||
extern void color_to_hsv (Color color, double& h, double& s, double& v);
|
extern LIBCANVAS_API void color_to_hsv (Color color, double& h, double& s, double& v);
|
||||||
extern Color hsv_to_color (double h, double s, double v, double a);
|
extern LIBCANVAS_API Color hsv_to_color (double h, double s, double v, double a);
|
||||||
|
|
||||||
extern void color_to_rgba (Color, double& r, double& g, double& b, double& a);
|
extern LIBCANVAS_API void color_to_rgba (Color, double& r, double& g, double& b, double& a);
|
||||||
extern Color rgba_to_color (double r, double g, double b, double a);
|
extern LIBCANVAS_API Color rgba_to_color (double r, double g, double b, double a);
|
||||||
|
|
||||||
extern void set_source_rgba (Cairo::RefPtr<Cairo::Context>, Color);
|
extern LIBCANVAS_API void set_source_rgba (Cairo::RefPtr<Cairo::Context>, Color);
|
||||||
|
|
||||||
Distance distance_to_segment_squared (Duple const & p, Duple const & p1, Duple const & p2, double& t, Duple& at);
|
Distance LIBCANVAS_API distance_to_segment_squared (Duple const & p, Duple const & p1, Duple const & p2, double& t, Duple& at);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
45
libs/canvas/canvas/visibility.h
Normal file
45
libs/canvas/canvas/visibility.h
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
/*
|
||||||
|
Copyright (C) 2013 Paul Davis
|
||||||
|
|
||||||
|
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 __libcanvas_visibility_h__
|
||||||
|
#define __libcanvas_visibility_h__
|
||||||
|
|
||||||
|
#if defined(COMPILER_MSVC)
|
||||||
|
#define LIBCANVAS_DLL_IMPORT __declspec(dllimport)
|
||||||
|
#define LIBCANVAS_DLL_EXPORT __declspec(dllexport)
|
||||||
|
#define LIBCANVAS_DLL_LOCAL
|
||||||
|
#else
|
||||||
|
#define LIBCANVAS_DLL_IMPORT __attribute__ ((visibility ("default")))
|
||||||
|
#define LIBCANVAS_DLL_EXPORT __attribute__ ((visibility ("default")))
|
||||||
|
#define LIBCANVAS_DLL_LOCAL __attribute__ ((visibility ("hidden")))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef LIBCANVAS_STATIC // libcanvas is not a DLL
|
||||||
|
#define LIBCANVAS_API
|
||||||
|
#define LIBCANVAS_LOCAL
|
||||||
|
#else
|
||||||
|
#ifdef LIBCANVAS_DLL_EXPORTS // defined if we are building the libcanvas DLL (instead of using it)
|
||||||
|
#define LIBCANVAS_API LIBCANVAS_DLL_EXPORT
|
||||||
|
#else
|
||||||
|
#define LIBCANVAS_API LIBCANVAS_DLL_IMPORT
|
||||||
|
#endif
|
||||||
|
#define LIBCANVAS_LOCAL LIBCANVAS_DLL_LOCAL
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __libcanvas_visibility_h__ */
|
||||||
|
|
@ -28,6 +28,7 @@
|
||||||
|
|
||||||
#include <glibmm/refptr.h>
|
#include <glibmm/refptr.h>
|
||||||
|
|
||||||
|
#include "canvas/visibility.h"
|
||||||
#include "canvas/item.h"
|
#include "canvas/item.h"
|
||||||
#include "canvas/fill.h"
|
#include "canvas/fill.h"
|
||||||
#include "canvas/outline.h"
|
#include "canvas/outline.h"
|
||||||
|
|
@ -44,7 +45,7 @@ class WaveViewTest;
|
||||||
|
|
||||||
namespace ArdourCanvas {
|
namespace ArdourCanvas {
|
||||||
|
|
||||||
class WaveView : virtual public Item, public Outline, public Fill
|
class LIBCANVAS_API WaveView : virtual public Item, public Outline, public Fill
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum Shape {
|
enum Shape {
|
||||||
|
|
|
||||||
|
|
@ -61,12 +61,18 @@ def options(opt):
|
||||||
def configure(conf):
|
def configure(conf):
|
||||||
conf.load ('compiler_cxx')
|
conf.load ('compiler_cxx')
|
||||||
autowaf.configure(conf)
|
autowaf.configure(conf)
|
||||||
|
autowaf.build_version_files(path_prefix+'canvas/version.h', path_prefix+'version.cc',
|
||||||
|
'libcanvas', conf.env['MAJOR'], conf.env['MINOR'], 0,
|
||||||
|
'LIBCANVAS_API', 'canvas/visibility.h')
|
||||||
autowaf.check_pkg(conf, 'cairomm-1.0', uselib_store='CAIROMM', atleast_version='1.8.4')
|
autowaf.check_pkg(conf, 'cairomm-1.0', uselib_store='CAIROMM', atleast_version='1.8.4')
|
||||||
|
|
||||||
def build(bld):
|
def build(bld):
|
||||||
# Library
|
# Library
|
||||||
if bld.is_defined ('INTERNAL_SHARED_LIBS'):
|
if bld.is_defined ('INTERNAL_SHARED_LIBS'):
|
||||||
obj = bld.shlib(features = 'cxx cxxshlib', source=canvas_sources)
|
obj = bld.shlib(features = 'cxx cxxshlib', source=canvas_sources)
|
||||||
|
obj.defines = [ 'LIBCANVAS_DLL_EXPORTS=1' ]
|
||||||
|
obj.cflags = [ '-fvisibility=hidden' ]
|
||||||
|
obj.cxxflags = [ '-fvisibility=hidden' ]
|
||||||
else:
|
else:
|
||||||
obj = bld.stlib(features = 'cxx cxxstlib', source=canvas_sources)
|
obj = bld.stlib(features = 'cxx cxxstlib', source=canvas_sources)
|
||||||
obj.cxxflags = [ '-fPIC' ]
|
obj.cxxflags = [ '-fPIC' ]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue