// -*- c++ -*-
//  Generated by gtkmmproc from ./../object.gen_h -- DO NOT MODIFY!
#ifndef _GTKMM_OBJECT_H
#define _GTKMM_OBJECT_H

/* $Id: object.gen_h,v 1.81 2000/03/27 20:39:32 kenelson Exp $ */


/* object.h
 *
 * Copyright (C) 1998-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.
 */

/* this file is critical for our compile times, no #includes to this
   header, please */
#include <gtk--/base.h>
#include <gtk/gtkobject.h>

void gtkmm_object_destroy(GtkObject* o);

namespace Gtk {
class Object;
class Object_Class;
}
namespace Gtk { Gtk::Object *wrap (GtkObject *o); }
namespace Gtk
{

class ArgBase;

class Widget;

//: The base class of the whole hierarchy
class Object : public Base
{

public:
  typedef Object          CppObjectType;
  typedef Object_Class    CppClassType;
  typedef GtkObject           BaseObjectType;
  typedef GtkObjectClass      BaseClassType;

private:
  friend class Object_Class;
  static CppClassType object_class;

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

protected:
  void   initialize_class();
  explicit Object(GtkObject *castitem);

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

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

  virtual ~Object();

private:

private:
  friend class Gtk::Widget;
  //WRAP_METHOD(void gtk_object_destroy(GtkObject *object),void destroy_());

public:

  guint* signals() { return GTK_OBJECT_SIGNALS (gtkobj()); }
  gint nsignals() { return GTK_OBJECT_NSIGNALS (gtkobj()); }

  guint type() { return GTK_OBJECT_TYPE (gtkobj()); }

  //: destroy object
  //- This can be used to tell toplevel widgets that they should
  //- die if they are managed().  You should never connect a slot
  //- which references "this" because destroy is called during
  //- dtor.

  void destroy_();


  void set_user_data(gpointer data);

  gpointer get_user_data() const;



  void set_data(const string& key,gpointer data);

  gpointer get_data(const string& key) const;

  gpointer get_data_by_id(GQuark data_id) const;

  // These are really dangerous.  Do we really need them?
  //      vector<Gtk_ArgBase*>* getv(guint n_args);
  //      void setv                 (const vector<Gtk_ArgBase*> &args);

  //      static void add_arg_type  (const string &arg_name,
  //    			     GtkType	 arg_type,
  //    			     guint		 arg_flags,
  //    			     guint		 arg_id);





  void set_data_full(const string& key,gpointer data,GtkDestroyNotify destroy);



  void set_data_by_id(GQuark data_id,gpointer data);





  void set_data_by_id_full(GQuark data_id,gpointer data,GtkDestroyNotify destroy);


  void remove_data(const string& key);

  void remove_no_notify(const string& key);

  void remove_data_by_id(GQuark data_id);

  void remove_no_notify_by_id(GQuark data_id);

#ifdef SIGC_CXX_FRIEND_TEMPLATES
  //    protected:
#endif
  // This binds the C++ object to C  (internal function!)
  virtual void set_dynamic();

protected:
  GtkObject *gtkobject;

  // hooks for libsigc++
  virtual void reference();
  virtual void unreference();

  // flag to indicate we have a reference.
  bool referenced_;
  bool destroyed_;

  //void global_dtor();

  static void destroy_notify_(gpointer s);





  void weakref(GtkDestroyNotify notify,gpointer data);




  void weakunref(GtkDestroyNotify notify,gpointer data);

  static void gtkmm_sigsegv(const char *name);

protected:
  void set_type(GtkType type);

public:

  union
    {
      CppObjectType * object_self;
      Gtk::EmitProxySignal0<void,CppObjectType,BaseObjectType,0,&gtkmm_object_destroy> destroy;
    };

protected:
  // impl functions

};

// internal for automatic conversions
inline GtkObject* unwrap(Gtk::Object*o) { return o?o->gtkobj():0; }


}


//+ PROPERTIES(gtkobject)
//. name: flags
//. type: guint32
//. get:
//. set:
//. desc: 32 bits of flags. GtkObject only uses 4 of these bits and
//. GtkWidget uses the rest. This is done because structs are
//. aligned on 4 or 8 byte boundaries. If a new bitfield were
//. used in GtkWidget much space would be wasted.
//.

//. name: ref_count
//. type: guint
//. get:
//. set:
//. desc: reference count.
//. refer to the file docs/refcounting.txt on this issue.
//.

//. name: object_data
//. type: GData*
//. get:
//. set:
//. desc: A list of keyed data pointers, used for e.g. the list of signal
//. handlers or an object's user_data.
//.

#endif
