00001
00002
00003 #ifndef _LIBGNOMECANVASMM_ITEM_H
00004 #define _LIBGNOMECANVASMM_ITEM_H
00005
00006 #include <glibmm.h>
00007
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 #include <gtkmm/object.h>
00034 #include <gdkmm/cursor.h>
00035 #include <libgnomecanvas/gnome-canvas.h>
00036
00037 #include <libgnomecanvasmm/point.h>
00038 #include <libgnomecanvasmm/affinetrans.h>
00039 #include <libgnomecanvasmm/properties.h>
00040
00041
00042 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00043 typedef struct _GnomeCanvasItem GnomeCanvasItem;
00044 typedef struct _GnomeCanvasItemClass GnomeCanvasItemClass;
00045 #endif
00046
00047
00048 namespace Gnome
00049 {
00050
00051 namespace Canvas
00052 { class Item_Class; }
00053
00054 }
00055 namespace Gnome
00056 {
00057
00058 namespace Canvas
00059 {
00060
00061 class Canvas;
00062 class Group;
00063
00064
00065 class Item : public Gtk::Object
00066 {
00067 public:
00068 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00069 typedef Item CppObjectType;
00070 typedef Item_Class CppClassType;
00071 typedef GnomeCanvasItem BaseObjectType;
00072 typedef GnomeCanvasItemClass BaseClassType;
00073 #endif
00074
00075 virtual ~Item();
00076
00077 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00078
00079 private:
00080 friend class Item_Class;
00081 static CppClassType item_class_;
00082
00083
00084 Item(const Item&);
00085 Item& operator=(const Item&);
00086
00087 protected:
00088 explicit Item(const Glib::ConstructParams& construct_params);
00089 explicit Item(GnomeCanvasItem* castitem);
00090
00091 #endif
00092
00093 public:
00094 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00095 static GType get_type() G_GNUC_CONST;
00096 static GType get_base_type() G_GNUC_CONST;
00097 #endif
00098
00100 GnomeCanvasItem* gobj() { return reinterpret_cast<GnomeCanvasItem*>(gobject_); }
00101
00103 const GnomeCanvasItem* gobj() const { return reinterpret_cast<GnomeCanvasItem*>(gobject_); }
00104
00105
00106 public:
00107
00108
00109 protected:
00110
00111 virtual void update_vfunc(double* affine, ArtSVP* clip_path, int flags);
00112 virtual void realize_vfunc();
00113 virtual void unrealize_vfunc();
00114 virtual void map_vfunc();
00115 virtual void unmap_vfunc();
00116 virtual ArtUta* coverage_vfunc();
00117 virtual void draw_vfunc(GdkDrawable* drawable, int x, int y, int width, int height);
00118 virtual void render_vfunc(GnomeCanvasBuf* buf);
00119 virtual double point_vfunc(double x, double y, int cx, int cy, GnomeCanvasItem** actual_item);
00120 virtual void bounds_vfunc(double* x1, double* y1, double* x2, double* y2);
00121
00122
00123 virtual bool on_event(GdkEvent* p1);
00124
00125
00126 private:
00127
00128
00129 public:
00130
00131
00132
00140 void move(double dx, double dy);
00141
00142
00143
00144
00145
00151 void raise(int positions);
00152
00153
00154
00155
00156
00162 void lower(int positions);
00163
00164
00165
00168 void raise_to_top();
00169
00170
00171
00174 void lower_to_bottom();
00175
00176
00177
00178
00179
00180 int grab(unsigned int event_mask, const Gdk::Cursor& cursor, guint32 etime);
00181 int grab(unsigned int event_mask, guint32 etime);
00182
00183
00184
00185
00186
00187
00192 void ungrab(guint32 etime);
00193
00194
00195
00196
00202 void w2i(double& x, double& y);
00203
00209 void i2w(double& x, double& y);
00210
00211
00212
00213
00218 void grab_focus();
00219
00220
00221
00222
00230 void get_bounds(double& x1, double& y1, double& x2, double& y2) const;
00231
00232
00233
00236 void show();
00237
00238
00239
00243 void hide();
00244
00245
00246 void affine_relative(const Art::AffineTrans &affine);
00247
00248
00249
00250 void affine_absolute(const Art::AffineTrans &affine);
00251
00252
00253
00254
00255 Art::AffineTrans get_i2w_affine() const;
00256
00257
00258
00259
00260 Art::AffineTrans get_i2c_affine() const;
00261
00262
00268 void reparent(Group& new_group);
00269
00271 Canvas* get_canvas() const;
00272
00273
00274
00275
00276
00281 Glib::SignalProxy1<bool,GdkEvent*> signal_event();
00282
00283
00289 Glib::PropertyProxy<Group*> property_parent();
00290
00291
00292 protected:
00293
00294
00295 void item_construct(Group& group);
00296
00297
00298
00299 void item_construct(Group& group, const gchar* first_arg_name,
00300 va_list ap);
00301
00302
00303 void set(const gchar* first_arg_name, ...);
00304
00305
00306
00307
00311 void request_update();
00312
00313
00316 void reset_bounds();
00317
00324 void update_svp(ArtSVP **p_svp, ArtSVP *new_svp);
00325
00332 void update_svp_clip(ArtSVP **p_svp, ArtSVP *new_svp, ArtSVP *clip_svp);
00333
00337 void request_redraw_svp(const ArtSVP* svp);
00338
00346 void update_bbox(int x1, int y1, int x2, int y2);
00347
00348
00349 };
00350
00351 }
00352 }
00353
00354 namespace Glib
00355 {
00357 Gnome::Canvas::Item* wrap(GnomeCanvasItem* object, bool take_copy = false);
00358 }
00359 #endif
00360