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
00112
00113
virtual bool on_event(GdkEvent* p1);
00114
00115
00116
private:
00117
00118
00119
public:
00120
00121
00122
00130
void move(
double dx,
double dy);
00131
00132
00133
00134
00135
00141
void raise(
int positions);
00142
00143
00144
00145
00146
00152
void lower(
int positions);
00153
00154
00155
00158
void raise_to_top();
00159
00160
00161
00164
void lower_to_bottom();
00165
00166
00167
00168
00169
00170
int grab(
unsigned int event_mask,
const Gdk::Cursor& cursor, guint32 etime);
00171
int grab(
unsigned int event_mask, guint32 etime);
00172
00173
00174
00175
00176
00177
00182
void ungrab(guint32 etime);
00183
00184
00185
00186
00192
void w2i(
double& x,
double& y);
00193
00199
void i2w(
double& x,
double& y);
00200
00201
00202
00203
00208
void grab_focus();
00209
00210
00211
00212
00220
void get_bounds(
double& x1,
double& y1,
double& x2,
double& y2)
const;
00221
00222
00223
00226
void show();
00227
00228
00229
00233
void hide();
00234
00235
00236
void affine_relative(
const Art::AffineTrans &affine);
00237
00238
00239
00240
void affine_absolute(
const Art::AffineTrans &affine);
00241
00242
00243
00244
00245
Art::AffineTrans get_i2w_affine() const;
00246
00247
00248
00249
00250 Art::AffineTrans get_i2c_affine() const;
00251
00252
00258
void reparent(
Group& new_group);
00259
00261
Canvas* get_canvas() const;
00262
00263 virtual
void update_vfunc(
double* affine, ArtSVP* clip_path,
int flags);
00264 virtual
void realize_vfunc();
00265 virtual
void unrealize_vfunc();
00266 virtual
void map_vfunc();
00267 virtual
void unmap_vfunc();
00268 virtual ArtUta* coverage_vfunc();
00269 virtual
void draw_vfunc(const Glib::RefPtr<Gdk::Drawable>& drawable,
int x,
int y,
int width,
int height);
00270 virtual
void render_vfunc(GnomeCanvasBuf* buf);
00271 virtual
double point_vfunc(
double x,
double y,
int cx,
int cy, GnomeCanvasItem** actual_item);
00272 virtual
void bounds_vfunc(
double* x1,
double* y1,
double* x2,
double* y2);
00273
00274
00275
00276
00277
00278 Glib::SignalProxy1<
bool,GdkEvent* > signal_event();
00279
00280
00285 Glib::PropertyProxy<
Group*> property_parent() ;
00286
00291 Glib::PropertyProxy_ReadOnly<
Group*> property_parent() const;
00292
00293
00294 protected:
00295
00296
00297
void item_construct(
Group& group);
00298
00299
00300
00301
void item_construct(
Group& group, const gchar* first_arg_name,
00302 va_list ap);
00303
00304
00305
void set(const gchar* first_arg_name, ...);
00306
00307
00308
00309
00313
void request_update();
00314
00315
00318
void reset_bounds();
00319
00326
void update_svp(ArtSVP **p_svp, ArtSVP *new_svp);
00327
00334
void update_svp_clip(ArtSVP **p_svp, ArtSVP *new_svp, ArtSVP *clip_svp);
00335
00339
void request_redraw_svp(const ArtSVP* svp);
00340
00348
void update_bbox(
int x1,
int y1,
int x2,
int y2);
00349
00350
00351 };
00352
00353 }
00354 }
00355
00356 namespace Glib
00357 {
00363
Gnome::Canvas::Item*
wrap(GnomeCanvasItem* object,
bool take_copy =
false);
00364 }
00365
#endif
00366