00001
00002
00003 #ifndef _LIBGNOMECANVASMM_ITEM_H
00004 #define _LIBGNOMECANVASMM_ITEM_H
00005
00006
00007 #include <glibmm.h>
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #include <gtkmm/object.h>
00035 #include <gdkmm/cursor.h>
00036 #include <libgnomecanvas/gnome-canvas.h>
00037
00038 #include <libgnomecanvasmm/point.h>
00039 #include <libgnomecanvasmm/affinetrans.h>
00040 #include <libgnomecanvasmm/properties.h>
00041
00042
00043 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00044 typedef struct _GnomeCanvasItem GnomeCanvasItem;
00045 typedef struct _GnomeCanvasItemClass GnomeCanvasItemClass;
00046 #endif
00047
00048
00049 namespace Gnome
00050 {
00051
00052 namespace Canvas
00053 { class Item_Class; }
00054
00055 }
00056 namespace Gnome
00057 {
00058
00059 namespace Canvas
00060 {
00061
00062 class Canvas;
00063 class Group;
00064
00065
00066 class Item : public Gtk::Object
00067 {
00068 public:
00069 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00070 typedef Item CppObjectType;
00071 typedef Item_Class CppClassType;
00072 typedef GnomeCanvasItem BaseObjectType;
00073 typedef GnomeCanvasItemClass BaseClassType;
00074 #endif
00075
00076 virtual ~Item();
00077
00078 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00079
00080 private:
00081 friend class Item_Class;
00082 static CppClassType item_class_;
00083
00084
00085 Item(const Item&);
00086 Item& operator=(const Item&);
00087
00088 protected:
00089 explicit Item(const Glib::ConstructParams& construct_params);
00090 explicit Item(GnomeCanvasItem* castitem);
00091
00092 #endif
00093
00094 public:
00095 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00096 static GType get_type() G_GNUC_CONST;
00097 static GType get_base_type() G_GNUC_CONST;
00098 #endif
00099
00101 GnomeCanvasItem* gobj() { return reinterpret_cast<GnomeCanvasItem*>(gobject_); }
00102
00104 const GnomeCanvasItem* gobj() const { return reinterpret_cast<GnomeCanvasItem*>(gobject_); }
00105
00106
00107 public:
00108
00109
00110 protected:
00111
00112
00113
00114 virtual bool on_event(GdkEvent* p1);
00115
00116
00117 private:
00118
00119
00120 public:
00121
00122
00123
00131 void move(double dx, double dy);
00132
00133
00134
00135
00136
00142 void raise(int positions);
00143
00144
00145
00146
00147
00153 void lower(int positions);
00154
00155
00156
00159 void raise_to_top();
00160
00161
00162
00165 void lower_to_bottom();
00166
00167
00168
00169
00170
00171 int grab(unsigned int event_mask, const Gdk::Cursor& cursor, guint32 etime);
00172 int grab(unsigned int event_mask, guint32 etime);
00173
00174
00175
00176
00177
00178
00183 void ungrab(guint32 etime);
00184
00185
00186
00187
00193 void w2i(double& x, double& y);
00194
00200 void i2w(double& x, double& y);
00201
00202
00203
00204
00209 void grab_focus();
00210
00211
00212
00213
00221 void get_bounds(double& x1, double& y1, double& x2, double& y2) const;
00222
00223
00224
00227 void show();
00228
00229
00230
00234 void hide();
00235
00236
00237 void affine_relative(const Art::AffineTrans &affine);
00238
00239
00240
00241 void affine_absolute(const Art::AffineTrans &affine);
00242
00243
00244
00245
00246 Art::AffineTrans get_i2w_affine() const;
00247
00248
00249
00250
00251 Art::AffineTrans get_i2c_affine() const;
00252
00253
00259 void reparent(Group& new_group);
00260
00262 Canvas* get_canvas() const;
00263
00264 virtual void update_vfunc(double* affine, ArtSVP* clip_path, int flags);
00265 virtual void realize_vfunc();
00266 virtual void unrealize_vfunc();
00267 virtual void map_vfunc();
00268 virtual void unmap_vfunc();
00269 virtual ArtUta* coverage_vfunc();
00270 virtual void draw_vfunc(const Glib::RefPtr<Gdk::Drawable>& drawable, int x, int y, int width, int height);
00271 virtual void render_vfunc(GnomeCanvasBuf* buf);
00272 virtual double point_vfunc(double x, double y, int cx, int cy, GnomeCanvasItem** actual_item);
00273 virtual void bounds_vfunc(double* x1, double* y1, double* x2, double* y2);
00274
00275
00276
00277
00278
00279 Glib::SignalProxy1< bool,GdkEvent* > signal_event();
00280
00281
00282 Group* get_parent_group();
00283 const Group* get_parent_group() const;
00284
00291 Glib::PropertyProxy<Group*> property_parent() ;
00292
00299 Glib::PropertyProxy_ReadOnly<Group*> property_parent() const;
00300
00301
00302 protected:
00303
00304
00305 void item_construct(Group& group);
00306
00307
00308
00309 void item_construct(Group& group, const gchar* first_arg_name,
00310 va_list ap);
00311
00312
00313 void set(const gchar* first_arg_name, ...);
00314
00315
00316
00317
00321 void request_update();
00322
00323
00326 void reset_bounds();
00327
00334 void update_svp(ArtSVP **p_svp, ArtSVP *new_svp);
00335
00342 void update_svp_clip(ArtSVP **p_svp, ArtSVP *new_svp, ArtSVP *clip_svp);
00343
00347 void request_redraw_svp(const ArtSVP* svp);
00348
00356 void update_bbox(int x1, int y1, int x2, int y2);
00357
00358
00359 };
00360
00361 }
00362 }
00363
00364
00365 namespace Glib
00366 {
00372 Gnome::Canvas::Item* wrap(GnomeCanvasItem* object, bool take_copy = false);
00373 }
00374
00375
00376 #endif
00377