// -*- c++ -*-
//  Generated by gtkmmproc from ./../canvas-item.gen_h -- DO NOT MODIFY!
#ifndef _GNOMEMM_CANVAS_ITEM_H
#define _GNOMEMM_CANVAS_ITEM_H

// -*- C++ -*-
/* $Id: canvas-item.gen_h,v 1.48 2001/06/06 19:16:26 murrayc Exp $ */

/* canvas-item.h
 *
 * Copyright (C) 1998 EMC Capital Management Inc.
 * Developed by Havoc Pennington <hp@pobox.com>
 *
 * Copyright (C) 1999 The Gtk-- Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <gtk--/object.h>
#include <libgnomeui/gnome-canvas.h>

//Art:
#include <gnome--/point.h>
#include <gnome--/affinetrans.h>
#include <gnome--/canvas-property.h>

namespace Gnome {
class CanvasItem;
class CanvasItem_Class;
}
namespace Gtk { Gnome::CanvasItem *wrap (GnomeCanvasItem *o); }
namespace Gnome
{
class Canvas;
class CanvasGroup;
struct CanvasItem_private;

class CanvasItem : public Gtk::Object
{

public:
  typedef CanvasItem          CppObjectType;
  typedef CanvasItem_Class    CppClassType;
  typedef GnomeCanvasItem           BaseObjectType;
  typedef GnomeCanvasItemClass      BaseClassType;

private:
  friend class CanvasItem_Class;
  static CppClassType canvas_item_class;

  CanvasItem(const CanvasItem&);
  CanvasItem& operator=(const CanvasItem&); // not implemented

protected:
  void   initialize_class();
  explicit CanvasItem(GnomeCanvasItem *castitem);

public:
  static GtkType get_type();
  GnomeCanvasItem* gtkobj()             { return (GnomeCanvasItem*)(gtkobject); }
  const GnomeCanvasItem* gtkobj() const { return (GnomeCanvasItem*)(gtkobject); }
  static bool isA(Gtk::Object *checkcast);

  // Hook for proxies
  static const char* const signal_names[];

  virtual ~CanvasItem();

private:

  friend class Gnome::CanvasHelpers::Properties;
public:



  //:  Move an item by the specified amount

  void move(double dx,double dy);

  //: Raise an item in the z-order of its parent group by the specified
  //: number of positions.  If the number is zero, then the item will
  //: be made the topmost of its parent group.

  void raise(int positions);

  //: Lower an item in the z-order of its parent group by the specified
  //: number of positions.  If the number is zero, then the item will be
  //: made the bottommost of its parent group.  */

  void lower(int positions);

  //: Raise an item to the top of its parent group's z-order.

  void raise_to_top();

  //: Lower an item to the bottom of its parent group's z-order

  void lower_to_bottom();

  //: Grab the mouse for the specified item.  Only the events in
  //: event_mask will be reported.  If cursor is non-NULL, it will be
  //: used during the duration of the grab.  Time is a proper X event
  //: time parameter.  Returns the same values as XGrabPointer().
  int grab (unsigned int event_mask, const Gdk_Cursor &cursor, guint32 etime);

  //: deprecated
  int grab (unsigned int event_mask, GdkCursor *cursor, guint32 etime);

  //: Ungrabs the mouse -- the specified item must be the same that was
  //: passed to gnome_canvas_item_grab().  Time is a proper X event
  //: time parameter.

  void ungrab(guint32 etime);

  //: These functions convert from a coordinate system to another.  "w"
  //: is world coordinates and "i" is item coordinates.

  void w2i(double& x,double& y);

  void i2w(double& x,double& y);

  //: Used to send all of the keystroke events to a specific item as well
  //: as GDK_FOCUS_CHANGE events.

  void grab_focus();

  //: Fetch the bounding box of the item.  The bounding box may not be
  //: exactly tight, but the canvas items will do the best they can.




  void get_bounds(double& x1,double& y1,double& x2,double& y2);

  //: Make the item visible

  void show();

  //: Hide the item

  void hide();

  //: Apply a relative affine transformation to the item
  void affine_relative (const Art::AffineTrans &affine);

  //: Apply an absolute affine transformation to the item
  void affine_absolute (const Art::AffineTrans &affine);


  //  // Those are present in the header file but not in the libgnomeui library !
  //  //: Scale an item about a point by the specified factors
  //  WRAP_METHOD(void gnome_canvas_item_scale (GnomeCanvasItem *, double,
  //                                         double, double, double),
  //           void scale(double x, double y, double scale_x, double scale_y));
  //
  //  //: Rotate an item about a point by the specified number of degrees
  //  WRAP_METHOD(void gnome_canvas_item_rotate (GnomeCanvasItem *, double,
  //                                          double, double),
  //           void rotate(double x, double y, double angle));

  //: Gets the affine transform that converts from item-relative
  //: coordinates to world coordinates
  Art::AffineTrans get_i2w_affine() const;

  //: Gets the affine transform that converts from item-relative
  //: coordinates to canvas pixel coordinates
  Art::AffineTrans get_i2c_affine() const;



  //: Returns the canvas we're on.
  Gnome::Canvas* get_canvas() const;

  //: Returns the parent canvas item - could be 0 for root item

  // Commented out for now, because there an interdependency with
  // Gnome::CanvasGroup which I don't know how to solve yet. - GL

  Gnome::CanvasGroup* get_parent() const;


  //: Tell the item to update itself.  The flags are from the update flags
  //: defined above.  The item should update its internal state from its
  //: queued state, recompute and request its repaint area, etc.  The
  //: affine, if used, is a pointer to a 6-element array of doubles.


//   //: Realize an item -- create GCs, etc.


//   //: Unrealize an item


//   //: Map an item - normally only need by items with their own GdkWindows


//   //: Unmap an item


//   //: Return the microtile coverage of the item


//   //: Draw an item of this type.  (x, y) are the upper-left canvas
//   //: pixel coordinates of the drawable, a temporary pixmap,
//   //: where things get drawn.  (width, height) are the dimensions
//   //: of the drawable.



//   //: Calculate the distance from an item to the specified point.  It
//   //: also returns a canvas item which is the item itself in the case
//   //: of the object being an actual leaf item, or a child in case of
//   //: the object being a canvas group.  (cx, cy) are the canvas pixel
//   //: coordinates that correspond to the item-relative coordinates (x,
//   //: y).

//   SIGNAL_SPEC("point", vfunc,
// 	      double point(double,double,int,int,Gnome::CanvasItem**),
// 	      double point(GnomeCanvasItem*, double,double,int,int,GnomeCanvasItem**));

//   //: Move an item by the specified amount


//   //: Fetch the bounding box of the item


  //: Signal: an event ocurred for an item of this type.  The (x, y)
  //: coordinates are in the canvas world coordinate system.


protected:

  //- For class children use only
  void item_construct(const CanvasGroup &parent);

  //- Unsafe version - can't use a _gtk_string here, C++ doesn't like
  //- classes being passed before ellipses ('...') args
  void item_construct(const CanvasGroup &parent,
                      const gchar* first_arg_name,
                      va_list ap);

  //- Set arguments - For class children use only
  void set(const gchar *first_arg_name, ...);

public:

  union
    {
      CppObjectType * canvas_item_self;
      Gtk::ProxySignal3<void,double*,ArtSVP*,int,CppObjectType,BaseObjectType,0> update;
      Gtk::ProxySignal0<void,CppObjectType,BaseObjectType,1> realize;
      Gtk::ProxySignal0<void,CppObjectType,BaseObjectType,2> unrealize;
      Gtk::ProxySignal0<void,CppObjectType,BaseObjectType,3> map;
      Gtk::ProxySignal0<void,CppObjectType,BaseObjectType,4> unmap;
      Gtk::ProxySignal0<ArtUta*,CppObjectType,BaseObjectType,5> coverage;
      Gtk::ProxySignal5<void,GdkDrawable*,int,int,int,int,CppObjectType,BaseObjectType,6> draw;
      Gtk::ProxySignal2<void,double,double,CppObjectType,BaseObjectType,7> translate;
      Gtk::ProxySignal4<void,double*,double*,double*,double*,CppObjectType,BaseObjectType,8> bounds;
      Gtk::ProxySignal1<gint,GdkEvent*,CppObjectType,BaseObjectType,9> event;
    };

protected:
  // impl functions
    virtual void update_impl(double* p0,ArtSVP* p1,int p2);
    virtual void realize_impl();
    virtual void unrealize_impl();
    virtual void map_impl();
    virtual void unmap_impl();
    virtual ArtUta* coverage_impl();
    virtual void draw_impl(GdkDrawable* p0,int p1,int p2,int p3,int p4);
    virtual void translate_impl(double p0,double p1);
    virtual void bounds_impl(double* p0,double* p1,double* p2,double* p3);
    virtual gint event_impl(GdkEvent* p0);

};

}

#endif
