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 #ifdef GLIBMM_VFUNCS_ENABLED
00110 #endif //GLIBMM_VFUNCS_ENABLED
00111
00112 protected:
00113
00114 #ifdef GLIBMM_VFUNCS_ENABLED
00115 #endif //GLIBMM_VFUNCS_ENABLED
00116
00117
00118 virtual bool on_event(GdkEvent* p1);
00119
00120
00121 private:
00122
00123
00124 public:
00125
00126
00127
00135 void move(double dx, double dy);
00136
00137
00138
00139
00140
00146 void raise(int positions);
00147
00148
00149
00150
00151
00157 void lower(int positions);
00158
00159
00160
00163 void raise_to_top();
00164
00165
00166
00169 void lower_to_bottom();
00170
00171
00172
00173
00174
00175 int grab(unsigned int event_mask, const Gdk::Cursor& cursor, guint32 etime);
00176 int grab(unsigned int event_mask, guint32 etime);
00177
00178
00179
00180
00181
00182
00187 void ungrab(guint32 etime);
00188
00189
00190
00191
00197 void w2i(double& x, double& y);
00198
00204 void i2w(double& x, double& y);
00205
00206
00207
00208
00213 void grab_focus();
00214
00215
00216
00217
00225 void get_bounds(double& x1, double& y1, double& x2, double& y2) const;
00226
00227
00228
00231 void show();
00232
00233
00234
00238 void hide();
00239
00240
00241 void affine_relative(const Art::AffineTrans &affine);
00242
00243
00244
00245 void affine_absolute(const Art::AffineTrans &affine);
00246
00247
00248
00249
00250 Art::AffineTrans get_i2w_affine() const;
00251
00252
00253
00254
00255 Art::AffineTrans get_i2c_affine() const;
00256
00257
00263 void reparent(Group& new_group);
00264
00266 Canvas* get_canvas() const;
00267
00268 #ifdef GLIBMM_VFUNCS_ENABLED
00269 virtual void update_vfunc(double* affine, ArtSVP* clip_path, int flags);
00270 #endif //GLIBMM_VFUNCS_ENABLED
00271
00272 #ifdef GLIBMM_VFUNCS_ENABLED
00273 virtual void realize_vfunc();
00274 #endif //GLIBMM_VFUNCS_ENABLED
00275
00276 #ifdef GLIBMM_VFUNCS_ENABLED
00277 virtual void unrealize_vfunc();
00278 #endif //GLIBMM_VFUNCS_ENABLED
00279
00280 #ifdef GLIBMM_VFUNCS_ENABLED
00281 virtual void map_vfunc();
00282 #endif //GLIBMM_VFUNCS_ENABLED
00283
00284 #ifdef GLIBMM_VFUNCS_ENABLED
00285 virtual void unmap_vfunc();
00286 #endif //GLIBMM_VFUNCS_ENABLED
00287
00288 #ifdef GLIBMM_VFUNCS_ENABLED
00289 virtual ArtUta* coverage_vfunc();
00290 #endif //GLIBMM_VFUNCS_ENABLED
00291
00292 #ifdef GLIBMM_VFUNCS_ENABLED
00293 virtual void draw_vfunc(const Glib::RefPtr<Gdk::Drawable>& drawable, int x, int y, int width, int height);
00294 #endif //GLIBMM_VFUNCS_ENABLED
00295
00296 #ifdef GLIBMM_VFUNCS_ENABLED
00297 virtual void render_vfunc(GnomeCanvasBuf* buf);
00298 #endif //GLIBMM_VFUNCS_ENABLED
00299
00300 #ifdef GLIBMM_VFUNCS_ENABLED
00301 virtual double point_vfunc(double x, double y, int cx, int cy, GnomeCanvasItem** actual_item);
00302 #endif //GLIBMM_VFUNCS_ENABLED
00303
00304 #ifdef GLIBMM_VFUNCS_ENABLED
00305 virtual void bounds_vfunc(double* x1, double* y1, double* x2, double* y2);
00306 #endif //GLIBMM_VFUNCS_ENABLED
00307
00308
00309
00310
00311
00312
00313 Glib::SignalProxy1< bool,GdkEvent* > signal_event();
00314
00315
00316 Group* get_parent_group();
00317 const Group* get_parent_group() const;
00318
00319 #ifdef GLIBMM_PROPERTIES_ENABLED
00320
00326 Glib::PropertyProxy<Group*> property_parent() ;
00327 #endif //#GLIBMM_PROPERTIES_ENABLED
00328
00329 #ifdef GLIBMM_PROPERTIES_ENABLED
00330
00336 Glib::PropertyProxy_ReadOnly<Group*> property_parent() const;
00337 #endif //#GLIBMM_PROPERTIES_ENABLED
00338
00339
00340 protected:
00341
00342
00343 void item_construct(Group& group);
00344
00345
00346
00347 void item_construct(Group& group, const gchar* first_arg_name,
00348 va_list ap);
00349
00350
00351 void set(const gchar* first_arg_name, ...);
00352
00353
00354
00355
00359 void request_update();
00360
00361
00364 void reset_bounds();
00365
00372 void update_svp(ArtSVP **p_svp, ArtSVP *new_svp);
00373
00380 void update_svp_clip(ArtSVP **p_svp, ArtSVP *new_svp, ArtSVP *clip_svp);
00381
00385 void request_redraw_svp(const ArtSVP* svp);
00386
00394 void update_bbox(int x1, int y1, int x2, int y2);
00395
00396
00397 };
00398
00399 }
00400 }
00401
00402
00403 namespace Glib
00404 {
00410 Gnome::Canvas::Item* wrap(GnomeCanvasItem* object, bool take_copy = false);
00411 }
00412
00413
00414 #endif
00415