diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-05-01 13:01:37 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-05-01 13:01:37 -0400 |
commit | ebb1271b6f666dadcaf6a73a6cb81231a70d8ad7 (patch) | |
tree | 5fd8928dfe3070b09b3371cd30d01e563bfb382f /gtk2_ardour | |
parent | 35842fd5eed8b28f2a89c5d88895351dc8511c76 (diff) | |
parent | 5e2e8e2cae0f807ba071d564d3a74086933afca1 (diff) |
Merge branch 'license-fix' of https://github.com/adiknoth/ardour
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/canvas-imageframe.c | 586 | ||||
-rw-r--r-- | gtk2_ardour/canvas-imageframe.h | 87 | ||||
-rw-r--r-- | gtk2_ardour/imageframe.cc | 190 | ||||
-rw-r--r-- | gtk2_ardour/imageframe.h | 15 |
4 files changed, 14 insertions, 864 deletions
diff --git a/gtk2_ardour/canvas-imageframe.c b/gtk2_ardour/canvas-imageframe.c deleted file mode 100644 index 3654836c79..0000000000 --- a/gtk2_ardour/canvas-imageframe.c +++ /dev/null @@ -1,586 +0,0 @@ -/* Image item type for GnomeCanvas widget - * - * GnomeCanvas is basically a port of the Tk toolkit's most excellent canvas widget. Tk is - * copyrighted by the Regents of the University of California, Sun Microsystems, and other parties. - * - * Copyright (C) 1998 The Free Software Foundation - * - * Author: Federico Mena <federico@nuclecu.unam.mx> - */ - - -#include <string.h> /* for memcpy() */ -#include <math.h> -#include <stdio.h> -#include "libart_lgpl/art_misc.h" -#include "libart_lgpl/art_affine.h" -#include "libart_lgpl/art_pixbuf.h" -#include "libart_lgpl/art_rgb_pixbuf_affine.h" -#include "canvas-imageframe.h" -#include <libgnomecanvas/gnome-canvas-util.h> -#include "gettext.h" -#define _(Text) dgettext (PACKAGE,Text) - -//GTK2FIX -//#include <libgnomecanvas/gnome-canvastypebuiltins.h> - - -enum { - PROP_0, - PROP_PIXBUF, - PROP_X, - PROP_Y, - PROP_WIDTH, - PROP_HEIGHT, - PROP_DRAWWIDTH, - PROP_ANCHOR -}; - - -static void gnome_canvas_imageframe_class_init(GnomeCanvasImageFrameClass* class) ; -static void gnome_canvas_imageframe_init(GnomeCanvasImageFrame* image) ; -static void gnome_canvas_imageframe_destroy(GtkObject* object) ; -static void gnome_canvas_imageframe_set_property(GObject* object, - guint prop_id, - const GValue *value, - GParamSpec *pspec); -static void gnome_canvas_imageframe_get_property(GObject* object, - guint prop_id, - GValue *value, - GParamSpec *pspec); -static void gnome_canvas_imageframe_update(GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flags) ; -static void gnome_canvas_imageframe_realize(GnomeCanvasItem *item) ; -static void gnome_canvas_imageframe_unrealize(GnomeCanvasItem *item) ; -static void gnome_canvas_imageframe_draw(GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width, int height) ; -static double gnome_canvas_imageframe_point(GnomeCanvasItem *item, double x, double y, int cx, int cy, GnomeCanvasItem **actual_item) ; -static void gnome_canvas_imageframe_bounds(GnomeCanvasItem *item, double *x1, double *y1, double *x2, double *y2) ; -static void gnome_canvas_imageframe_render(GnomeCanvasItem *item, GnomeCanvasBuf *buf) ; - -static GnomeCanvasItemClass *parent_class; - - -GType -gnome_canvas_imageframe_get_type (void) -{ - static GType imageframe_type = 0; - - if (!imageframe_type) { - GtkTypeInfo imageframe_info = { - "GnomeCanvasImageFrame", - sizeof (GnomeCanvasImageFrame), - sizeof (GnomeCanvasImageFrameClass), - (GtkClassInitFunc) gnome_canvas_imageframe_class_init, - (GtkObjectInitFunc) gnome_canvas_imageframe_init, - NULL, /* reserved_1 */ - NULL, /* reserved_2 */ - (GtkClassInitFunc) NULL - }; - - imageframe_type = gtk_type_unique (gnome_canvas_item_get_type (), &imageframe_info); - } - - return imageframe_type; -} - -static void -gnome_canvas_imageframe_class_init (GnomeCanvasImageFrameClass *class) -{ - GObjectClass *gobject_class; - GtkObjectClass *object_class; - GnomeCanvasItemClass *item_class; - - gobject_class = (GObjectClass *) class; - object_class = (GtkObjectClass *) class; - item_class = (GnomeCanvasItemClass *) class; - - parent_class = gtk_type_class (gnome_canvas_item_get_type ()); - - gobject_class->set_property = gnome_canvas_imageframe_set_property; - gobject_class->get_property = gnome_canvas_imageframe_get_property; - - g_object_class_install_property (gobject_class, - PROP_PIXBUF, - g_param_spec_pointer ("pixbuf", - _("pixbuf"), - _("the pixbuf"), - G_PARAM_WRITABLE)); - g_object_class_install_property (gobject_class, - PROP_X, - g_param_spec_double ("x", - _("x"), - _("x coordinate of upper left corner of rect"), - -G_MAXDOUBLE, - G_MAXDOUBLE, - 0.0, - G_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, - PROP_Y, - g_param_spec_double ("y", - _("y"), - _("y coordinate of upper left corner of rect "), - -G_MAXDOUBLE, - G_MAXDOUBLE, - 0.0, - G_PARAM_READWRITE)); - g_object_class_install_property (gobject_class, - PROP_WIDTH, - g_param_spec_double ("width", - _("width"), - _("the width"), - -G_MAXDOUBLE, - G_MAXDOUBLE, - 0.0, - G_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, - PROP_DRAWWIDTH, - g_param_spec_double ("drawwidth", - _("drawwidth"), - _("drawn width"), - -G_MAXDOUBLE, - G_MAXDOUBLE, - 0.0, - G_PARAM_READWRITE)); - g_object_class_install_property (gobject_class, - PROP_HEIGHT, - g_param_spec_double ("height", - _("height"), - _("the height"), - -G_MAXDOUBLE, - G_MAXDOUBLE, - 0.0, - G_PARAM_READWRITE)); - g_object_class_install_property (gobject_class, - PROP_ANCHOR, - g_param_spec_enum ("anchor", - _("anchor"), - _("the anchor"), - GTK_TYPE_ANCHOR_TYPE, - GTK_ANCHOR_NW, - G_PARAM_READWRITE)); - - object_class->destroy = gnome_canvas_imageframe_destroy; - - item_class->update = gnome_canvas_imageframe_update; - item_class->realize = gnome_canvas_imageframe_realize; - item_class->unrealize = gnome_canvas_imageframe_unrealize; - item_class->draw = gnome_canvas_imageframe_draw; - item_class->point = gnome_canvas_imageframe_point; - item_class->bounds = gnome_canvas_imageframe_bounds; - item_class->render = gnome_canvas_imageframe_render; -} - -static void -gnome_canvas_imageframe_init (GnomeCanvasImageFrame *image) -{ - image->x = 0.0; - image->y = 0.0; - image->width = 0.0; - image->height = 0.0; - image->drawwidth = 0.0; - image->anchor = GTK_ANCHOR_CENTER; -} - -static void -gnome_canvas_imageframe_destroy (GtkObject *object) -{ - GnomeCanvasImageFrame *image; - - g_return_if_fail (object != NULL); - g_return_if_fail (GNOME_CANVAS_IS_CANVAS_IMAGEFRAME (object)); - - image = GNOME_CANVAS_IMAGEFRAME (object); - - image->cwidth = 0; - image->cheight = 0; - - if (image->pixbuf) - { - art_pixbuf_free (image->pixbuf); - image->pixbuf = NULL; - } - - if(GTK_OBJECT_CLASS (parent_class)->destroy) - { - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); - } -} - -/* Get's the image bounds expressed as item-relative coordinates. */ -static void -get_bounds_item_relative (GnomeCanvasImageFrame *image, double *px1, double *py1, double *px2, double *py2) -{ - GnomeCanvasItem *item; - double x, y; - - item = GNOME_CANVAS_ITEM (image); - - /* Get item coordinates */ - - x = image->x; - y = image->y; - - /* Anchor image */ - - switch (image->anchor) { - case GTK_ANCHOR_NW: - case GTK_ANCHOR_W: - case GTK_ANCHOR_SW: - break; - - case GTK_ANCHOR_N: - case GTK_ANCHOR_CENTER: - case GTK_ANCHOR_S: - x -= image->width / 2; - break; - - case GTK_ANCHOR_NE: - case GTK_ANCHOR_E: - case GTK_ANCHOR_SE: - x -= image->width; - break; - } - - switch (image->anchor) { - case GTK_ANCHOR_NW: - case GTK_ANCHOR_N: - case GTK_ANCHOR_NE: - break; - - case GTK_ANCHOR_W: - case GTK_ANCHOR_CENTER: - case GTK_ANCHOR_E: - y -= image->height / 2; - break; - - case GTK_ANCHOR_SW: - case GTK_ANCHOR_S: - case GTK_ANCHOR_SE: - y -= image->height; - break; - } - - /* Bounds */ - - *px1 = x; - *py1 = y; - *px2 = x + image->width; - *py2 = y + image->height; -} - -static void -gnome_canvas_imageframe_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - GnomeCanvasItem *item; - GnomeCanvasImageFrame *image; - int update; - int calc_bounds; - - item = GNOME_CANVAS_ITEM (object); - image = GNOME_CANVAS_IMAGEFRAME (object); - - update = FALSE; - calc_bounds = FALSE; - - switch (prop_id) { - case PROP_PIXBUF: - if (item->canvas->aa && g_value_get_pointer (value)) { - if (image->pixbuf != NULL) - art_pixbuf_free (image->pixbuf); - image->pixbuf = g_value_get_pointer (value); - } - update = TRUE; - break; - - case PROP_X: - image->x = g_value_get_double (value); - update = TRUE; - break; - - case PROP_Y: - image->y = g_value_get_double (value); - update = TRUE; - break; - - case PROP_WIDTH: - image->width = fabs (g_value_get_double (value)); - update = TRUE; - break; - - case PROP_HEIGHT: - image->height = fabs (g_value_get_double (value)); - update = TRUE; - break; - - case PROP_DRAWWIDTH: - image->drawwidth = fabs (g_value_get_double (value)); - update = TRUE; - break; - - case PROP_ANCHOR: - image->anchor = g_value_get_enum (value); - update = TRUE; - break; - - default: - break; - } - - if (update) - gnome_canvas_item_request_update (item); -} - -static void -gnome_canvas_imageframe_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - GnomeCanvasImageFrame *image; - - image = GNOME_CANVAS_IMAGEFRAME (object); - - switch (prop_id) { - - case PROP_X: - g_value_set_double (value, image->x); - break; - - case PROP_Y: - g_value_set_double (value, image->y); - break; - - case PROP_WIDTH: - g_value_set_double (value, image->width); - break; - - case PROP_HEIGHT: - g_value_set_double (value, image->height); - break; - - case PROP_DRAWWIDTH: - g_value_set_double (value, image->drawwidth); - break; - - case PROP_ANCHOR: - g_value_set_enum (value, image->anchor); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -gnome_canvas_imageframe_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flags) -{ - GnomeCanvasImageFrame *image; - ArtDRect i_bbox, c_bbox; - int w = 0; - int h = 0; - - image = GNOME_CANVAS_IMAGEFRAME (item); - - if (parent_class->update) - (* parent_class->update) (item, affine, clip_path, flags); - - /* only works for non-rotated, non-skewed transforms */ - image->cwidth = (int) (image->width * affine[0] + 0.5); - image->cheight = (int) (image->height * affine[3] + 0.5); - - if (image->pixbuf) { - image->need_recalc = TRUE ; - } - - get_bounds_item_relative (image, &i_bbox.x0, &i_bbox.y0, &i_bbox.x1, &i_bbox.y1); - art_drect_affine_transform (&c_bbox, &i_bbox, affine); - - /* these values only make sense in the non-rotated, non-skewed case */ - image->cx = c_bbox.x0; - image->cy = c_bbox.y0; - - /* add a fudge factor */ - c_bbox.x0--; - c_bbox.y0--; - c_bbox.x1++; - c_bbox.y1++; - - gnome_canvas_update_bbox (item, c_bbox.x0, c_bbox.y0, c_bbox.x1, c_bbox.y1); - - if (image->pixbuf) { - w = image->pixbuf->width; - h = image->pixbuf->height; - } - - image->affine[0] = (affine[0] * image->width) / w; - image->affine[1] = (affine[1] * image->height) / h; - image->affine[2] = (affine[2] * image->width) / w; - image->affine[3] = (affine[3] * image->height) / h; - image->affine[4] = i_bbox.x0 * affine[0] + i_bbox.y0 * affine[2] + affine[4]; - image->affine[5] = i_bbox.x0 * affine[1] + i_bbox.y0 * affine[3] + affine[5]; -} - -static void -gnome_canvas_imageframe_realize (GnomeCanvasItem *item) -{ - GnomeCanvasImageFrame *image; - - image = GNOME_CANVAS_IMAGEFRAME (item); - - if (parent_class->realize) - (* parent_class->realize) (item); - -} - -static void -gnome_canvas_imageframe_unrealize (GnomeCanvasItem *item) -{ - GnomeCanvasImageFrame *image; - - image = GNOME_CANVAS_IMAGEFRAME(item); - - if (parent_class->unrealize) - (* parent_class->unrealize) (item); -} - -static void -recalc_if_needed (GnomeCanvasImageFrame *image) -{} - -static void -gnome_canvas_imageframe_draw (GnomeCanvasItem *item, GdkDrawable *drawable, - int x, int y, int width, int height) -{ -} - -static double -gnome_canvas_imageframe_point (GnomeCanvasItem *item, double x, double y, - int cx, int cy, GnomeCanvasItem **actual_item) -{ - GnomeCanvasImageFrame *image; - int x1, y1, x2, y2; - int dx, dy; - - image = GNOME_CANVAS_IMAGEFRAME (item); - - *actual_item = item; - - recalc_if_needed (image); - - x1 = image->cx - item->canvas->close_enough; - y1 = image->cy - item->canvas->close_enough; - x2 = image->cx + image->cwidth - 1 + item->canvas->close_enough; - y2 = image->cy + image->cheight - 1 + item->canvas->close_enough; - - /* Hard case: is point inside image's gravity region? */ - - //if ((cx >= x1) && (cy >= y1) && (cx <= x2) && (cy <= y2)) - //return dist_to_mask (image, cx, cy) / item->canvas->pixels_per_unit; - - /* Point is outside image */ - - x1 += item->canvas->close_enough; - y1 += item->canvas->close_enough; - x2 -= item->canvas->close_enough; - y2 -= item->canvas->close_enough; - - if (cx < x1) - dx = x1 - cx; - else if (cx > x2) - dx = cx - x2; - else - dx = 0; - - if (cy < y1) - dy = y1 - cy; - else if (cy > y2) - dy = cy - y2; - else - dy = 0; - - return sqrt (dx * dx + dy * dy) / item->canvas->pixels_per_unit; -} - -static void -gnome_canvas_imageframe_bounds (GnomeCanvasItem *item, double *x1, double *y1, double *x2, double *y2) -{ - GnomeCanvasImageFrame *image; - - image = GNOME_CANVAS_IMAGEFRAME (item); - - *x1 = image->x; - *y1 = image->y; - - switch (image->anchor) { - case GTK_ANCHOR_NW: - case GTK_ANCHOR_W: - case GTK_ANCHOR_SW: - break; - - case GTK_ANCHOR_N: - case GTK_ANCHOR_CENTER: - case GTK_ANCHOR_S: - *x1 -= image->width / 2.0; - break; - - case GTK_ANCHOR_NE: - case GTK_ANCHOR_E: - case GTK_ANCHOR_SE: - *x1 -= image->width; - break; - } - - switch (image->anchor) { - case GTK_ANCHOR_NW: - case GTK_ANCHOR_N: - case GTK_ANCHOR_NE: - break; - - case GTK_ANCHOR_W: - case GTK_ANCHOR_CENTER: - case GTK_ANCHOR_E: - *y1 -= image->height / 2.0; - break; - - case GTK_ANCHOR_SW: - case GTK_ANCHOR_S: - case GTK_ANCHOR_SE: - *y1 -= image->height; - break; - } - - *x2 = *x1 + image->width; - *y2 = *y1 + image->height; -} - -static void -gnome_canvas_imageframe_render (GnomeCanvasItem *item, GnomeCanvasBuf *buf) -{ - GnomeCanvasImageFrame *image; - - image = GNOME_CANVAS_IMAGEFRAME (item); - - gnome_canvas_buf_ensure_buf (buf); - -#ifdef VERBOSE - { - char str[128]; - art_affine_to_string (str, image->affine); - g_print ("gnome_canvas_imageframe_render %s\n", str); - } -#endif - - art_rgb_pixbuf_affine (buf->buf, - buf->rect.x0, buf->rect.y0, buf->rect.x1, buf->rect.y1, - buf->buf_rowstride, - image->pixbuf, - image->affine, - ART_FILTER_NEAREST, NULL); - - buf->is_bg = 0; -} diff --git a/gtk2_ardour/canvas-imageframe.h b/gtk2_ardour/canvas-imageframe.h deleted file mode 100644 index 8cfb6e273a..0000000000 --- a/gtk2_ardour/canvas-imageframe.h +++ /dev/null @@ -1,87 +0,0 @@ -/* Image item type for GnomeCanvas widget - * - * GnomeCanvas is basically a port of the Tk toolkit's most excellent canvas widget. Tk is - * copyrighted by the Regents of the University of California, Sun Microsystems, and other parties. - * - * Copyright (C) 1998 The Free Software Foundation - * - * Author: Federico Mena <federico@nuclecu.unam.mx> - */ - - -#ifndef __GNOME_CANVAS_IMAGEFRAME_H__ -#define __GNOME_CANVAS_IMAGEFRAME_H__ - -#include <stdint.h> - -#include <libgnomecanvas/libgnomecanvas.h> -#include <gtk/gtkenums.h> - -#ifdef __cplusplus -extern "C" { -#endif -#include <libart_lgpl/art_misc.h> -#ifdef __cplusplus -} -#endif - -#include <libart_lgpl/art_pixbuf.h> - - -G_BEGIN_DECLS - - -/* Image item for the canvas. Images are positioned by anchoring them to a point. - * The following arguments are available: - * - * name type read/write description - * ------------------------------------------------------------------------------------------ - * pixbuf ArtPixBuf* W Pointer to an ArtPixBuf (aa-mode) - * x double RW X coordinate of anchor point - * y double RW Y coordinate of anchor point - * width double RW Width to scale image to, in canvas units - * height double RW Height to scale image to, in canvas units - * drawwidth double RW Width to scale image to, in canvas units - * anchor GtkAnchorType RW Anchor side for the image - */ - - -#define GNOME_CANVAS_TYPE_CANVAS_IMAGEFRAME (gnome_canvas_imageframe_get_type ()) -#define GNOME_CANVAS_IMAGEFRAME(obj) (GTK_CHECK_CAST ((obj), GNOME_CANVAS_TYPE_CANVAS_IMAGEFRAME, GnomeCanvasImageFrame)) -#define GNOME_CANVAS_IMAGEFRAME_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GNOME_CANVAS_TYPE_CANVAS_IMAGEFRAME, GnomeCanvasImageFrameClass)) -#define GNOME_CANVAS_IS_CANVAS_IMAGEFRAME(obj) (GTK_CHECK_TYPE ((obj), GNOME_CANVAS_TYPE_CANVAS_IMAGEFRAME)) -#define GNOME_CANVAS_IS_CANVAS_IMAGEFRAME_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GNOME_CANVAS_TYPE_CANVAS_IMAGEFRAME)) - - -typedef struct _GnomeCanvasImageFrame GnomeCanvasImageFrame; -typedef struct _GnomeCanvasImageFrameClass GnomeCanvasImageFrameClass; - -struct _GnomeCanvasImageFrame { - GnomeCanvasItem item; - - double x, y; /* Position at anchor, item relative */ - double width, height; /* Size of image, item relative */ - double drawwidth ; /* the amount of the image we draw width-wise (0-drawwidth)*/ - GtkAnchorType anchor; /* Anchor side for image */ - - int cx, cy; /* Top-left canvas coordinates for display */ - int cwidth, cheight; /* Rendered size in pixels */ - - uint32_t need_recalc : 1; /* Do we need to rescale the image? */ - - ArtPixBuf *pixbuf; /* A pixbuf, for aa rendering */ - double affine[6]; /* The item -> canvas affine */ -}; - -struct _GnomeCanvasImageFrameClass { - GnomeCanvasItemClass parent_class; -}; - - -/* Standard Gtk function */ -GtkType gnome_canvas_imageframe_get_type (void); - - -G_END_DECLS - -#endif diff --git a/gtk2_ardour/imageframe.cc b/gtk2_ardour/imageframe.cc deleted file mode 100644 index ac30511864..0000000000 --- a/gtk2_ardour/imageframe.cc +++ /dev/null @@ -1,190 +0,0 @@ -// Generated by gtkmmproc -- DO NOT MODIFY! - -#include "imageframe.h" -#include "imageframe_p.h" -#include <libgnomecanvasmm/private/shape_p.h> - - -/* rect.c - * - * Copyright (C) 1998 EMC Capital Management Inc. - * Developed by Havoc Pennington <hp@pobox.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -namespace Gnome -{ - -namespace Canvas -{ - -ImageFrame::ImageFrame(Group& parentx, ArtPixBuf* pbuf, double x, double y, Gtk::AnchorType anchor, double w, double h) -: Item(GNOME_CANVAS_ITEM(g_object_new(get_type(),0))) -{ - item_construct(parentx); - set("pixbuf", pbuf, "x", x,"y", y,"width", w,"height", h, 0); -} - -ImageFrame::ImageFrame(Group& parentx) -: Item(GNOME_CANVAS_ITEM(g_object_new(get_type(),0))) -{ - item_construct(parentx); -} - -} /* namespace Canvas */ -} /* namespace Gnome */ - - -namespace -{ -} // anonymous namespace - - -namespace Glib -{ - -Gnome::Canvas::ImageFrame* wrap(GnomeCanvasImageFrame* object, bool take_copy) -{ - return dynamic_cast<Gnome::Canvas::ImageFrame *> (Glib::wrap_auto ((GObject*)(object), take_copy)); -} - -} /* namespace Glib */ - -namespace Gnome -{ - -namespace Canvas -{ - - -/* The *_Class implementation: */ - -const Glib::Class& ImageFrame_Class::init() -{ - if(!gtype_) // create the GType if necessary - { - // Glib::Class has to know the class init function to clone custom types. - class_init_func_ = &ImageFrame_Class::class_init_function; - - // This is actually just optimized away, apparently with no harm. - // Make sure that the parent type has been created. - //CppClassParent::CppObjectType::get_type(); - - // Create the wrapper type, with the same class/instance size as the base type. - register_derived_type(gnome_canvas_imageframe_get_type()); - - // Add derived versions of interfaces, if the C type implements any interfaces: - } - - return *this; -} - -void ImageFrame_Class::class_init_function(void* g_class, void* class_data) -{ - BaseClassType *const klass = static_cast<BaseClassType*>(g_class); - CppClassParent::class_init_function(klass, class_data); - -} - -Glib::ObjectBase* ImageFrame_Class::wrap_new(GObject* o) -{ - return manage(new ImageFrame((GnomeCanvasImageFrame*)(o))); - -} - -/* The implementation: */ - -ImageFrame::ImageFrame(const Glib::ConstructParams& construct_params) -: Item(construct_params) -{ - } - -ImageFrame::ImageFrame(GnomeCanvasImageFrame* castitem) -: Item ((GnomeCanvasItem*)(castitem)) -{ -} - -ImageFrame::~ImageFrame() -{ - destroy_(); -} - -ImageFrame::CppClassType ImageFrame::rect_class_; // initialize static member - -GType ImageFrame::get_type() -{ - return rect_class_.init().get_type(); -} - -GType ImageFrame::get_base_type() -{ - return gnome_canvas_imageframe_get_type(); -} - -Glib::PropertyProxy<double> ImageFrame::property_x() -{ - return Glib::PropertyProxy<double> (this, "x"); -} -Glib::PropertyProxy_ReadOnly<double> ImageFrame::property_x() const -{ - return Glib::PropertyProxy_ReadOnly<double> (this, "x"); -} -Glib::PropertyProxy<double> ImageFrame::property_y() -{ - return Glib::PropertyProxy<double> (this, "y"); -} -Glib::PropertyProxy_ReadOnly<double> ImageFrame::property_y() const -{ - return Glib::PropertyProxy_ReadOnly<double> (this, "y"); -} -Glib::PropertyProxy<double> ImageFrame::property_width() -{ - return Glib::PropertyProxy<double> (this, "width"); -} -Glib::PropertyProxy_ReadOnly<double> ImageFrame::property_width() const -{ - return Glib::PropertyProxy_ReadOnly<double> (this, "width"); -} -Glib::PropertyProxy<double> ImageFrame::property_drawwidth() -{ - return Glib::PropertyProxy<double> (this, "drawwidth"); -} -Glib::PropertyProxy_ReadOnly<double> ImageFrame::property_drawwidth() const -{ - return Glib::PropertyProxy_ReadOnly<double> (this, "drawwidth"); -} -Glib::PropertyProxy<double> ImageFrame::property_height() -{ - return Glib::PropertyProxy<double> (this, "height"); -} -Glib::PropertyProxy_ReadOnly<double> ImageFrame::property_height() const -{ - return Glib::PropertyProxy_ReadOnly<double> (this, "height"); -} -Glib::PropertyProxy<Gtk::AnchorType> ImageFrame::property_anchor() -{ - return Glib::PropertyProxy<Gtk::AnchorType>(this, "anchor"); -} -Glib::PropertyProxy_ReadOnly<Gtk::AnchorType> ImageFrame::property_anchor() const -{ - return Glib::PropertyProxy_ReadOnly<Gtk::AnchorType>(this, "anchor"); -} - - - -} // namespace Canvas - -} // namespace Gnome diff --git a/gtk2_ardour/imageframe.h b/gtk2_ardour/imageframe.h index 466d0804f5..a752cdbce0 100644 --- a/gtk2_ardour/imageframe.h +++ b/gtk2_ardour/imageframe.h @@ -27,10 +27,23 @@ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include <stdint.h> #include <libgnomecanvasmm/item.h> #include <libgnomecanvasmm/group.h> #include <libgnomecanvasmm/shape.h> -#include "canvas-imageframe.h" + +#include <libgnomecanvas/libgnomecanvas.h> +#include <gtk/gtkenums.h> + +#ifdef __cplusplus +extern "C" { +#endif +#include <libart_lgpl/art_misc.h> +#ifdef __cplusplus +} +#endif + +#include <libart_lgpl/art_pixbuf.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS |