Merge important bits from canvas-image.h into imageframe.h
[ardour.git] / gtk2_ardour / imageframe.h
1 // -*- c++ -*-
2 #ifndef _LIBGNOMECANVASMM_IMAGEFRAME_H
3 #define _LIBGNOMECANVASMM_IMAGEFRAME_H
4
5 #include <glibmm.h>
6
7
8 /* rect.h
9  *
10  * Copyright (C) 1998 EMC Capital Management Inc.
11  * Developed by Havoc Pennington <hp@pobox.com>
12  *
13  * Copyright (C) 1999 The Gtk-- Development Team
14  *
15  * This library is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU Library General Public
17  * License as published by the Free Software Foundation; either
18  * version 2 of the License, or (at your option) any later version.
19  *
20  * This library is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
23  * Library General Public License for more details.
24  *
25  * You should have received a copy of the GNU Library General Public
26  * License along with this library; if not, write to the Free
27  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28  */
29
30 #include <stdint.h>
31 #include <libgnomecanvasmm/item.h>
32 #include <libgnomecanvasmm/group.h>
33 #include <libgnomecanvasmm/shape.h>
34
35 #include <libgnomecanvas/libgnomecanvas.h>
36 #include <gtk/gtkenums.h>
37
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 #include <libart_lgpl/art_misc.h>
42 #ifdef __cplusplus
43 }
44 #endif
45
46 #include <libart_lgpl/art_pixbuf.h>
47
48
49 #ifndef DOXYGEN_SHOULD_SKIP_THIS
50 typedef struct _GnomeCanvasImageFrame GnomeCanvasImageFrame;
51 typedef struct _GnomeCanvasImageFrameClass GnomeCanvasImageFrameClass;
52 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
53
54
55 namespace Gnome
56 {
57
58 namespace Canvas
59 { class ImageFrame_Class; } // namespace Canvas
60
61 } // namespace Gnome
62 namespace Gnome
63 {
64
65 namespace Canvas
66 {
67
68 //class Group;
69
70
71 class ImageFrame : public Item
72 {
73   public:
74 #ifndef DOXYGEN_SHOULD_SKIP_THIS
75   typedef ImageFrame CppObjectType;
76   typedef ImageFrame_Class CppClassType;
77   typedef GnomeCanvasImageFrame BaseObjectType;
78   typedef GnomeCanvasImageFrameClass BaseClassType;
79 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
80
81   virtual ~ImageFrame();
82
83 #ifndef DOXYGEN_SHOULD_SKIP_THIS
84
85 private:
86   friend class ImageFrame_Class;
87   static CppClassType rect_class_;
88
89   // noncopyable
90   ImageFrame(const ImageFrame&);
91   ImageFrame& operator=(const ImageFrame&);
92
93 protected:
94   explicit ImageFrame(const Glib::ConstructParams& construct_params);
95   explicit ImageFrame(GnomeCanvasImageFrame* castitem);
96
97 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
98
99 public:
100 #ifndef DOXYGEN_SHOULD_SKIP_THIS
101   static GType get_type()      G_GNUC_CONST;
102   static GType get_base_type() G_GNUC_CONST;
103 #endif
104
105   ///Provides access to the underlying C GtkObject.
106   GnomeCanvasImageFrame*       gobj()       { return reinterpret_cast<GnomeCanvasImageFrame*>(gobject_); }
107
108   ///Provides access to the underlying C GtkObject.
109   const GnomeCanvasImageFrame* gobj() const { return reinterpret_cast<GnomeCanvasImageFrame*>(gobject_); }
110
111
112 public:
113   //C++ methods used to invoke GTK+ virtual functions:
114
115 protected:
116   //GTK+ Virtual Functions (override these to change behaviour):
117
118   //Default Signal Handlers::
119
120
121 private:
122
123
124 public:
125     ImageFrame(Group& parentx, ArtPixBuf* pbuf, double x, double y, Gtk::AnchorType anchor, double w, double h);
126     explicit ImageFrame(Group& parent);
127
128     Glib::PropertyProxy<double> property_x();
129     Glib::PropertyProxy_ReadOnly<double> property_x() const;
130     Glib::PropertyProxy<double> property_y();
131     Glib::PropertyProxy_ReadOnly<double> property_y() const;
132     Glib::PropertyProxy<double> property_width();
133     Glib::PropertyProxy_ReadOnly<double> property_width() const;
134     Glib::PropertyProxy<double> property_drawwidth();
135     Glib::PropertyProxy_ReadOnly<double> property_drawwidth() const;
136     Glib::PropertyProxy<double> property_height();
137     Glib::PropertyProxy_ReadOnly<double> property_height() const;
138     Glib::PropertyProxy<Gtk::AnchorType> property_anchor() ;
139     Glib::PropertyProxy_ReadOnly<Gtk::AnchorType> property_anchor() const;
140
141 };
142
143 } /* namespace Canvas */
144 } /* namespace Gnome */
145
146 namespace Glib
147 {
148   /** @relates Gnome::Canvas::ImageFrame
149    * @param object The C instance
150    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
151    * @result A C++ instance that wraps this C instance.
152    */
153   Gnome::Canvas::ImageFrame* wrap(GnomeCanvasImageFrame* object, bool take_copy = false);
154 }
155 #endif /* _LIBGNOMECANVASMM_IMAGEFRAME_H */
156