Blame gtk/gtktypeutils.h

Packit Service fb6fa5
/* GTK - The GIMP Toolkit
Packit Service fb6fa5
 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * This library is free software; you can redistribute it and/or
Packit Service fb6fa5
 * modify it under the terms of the GNU Lesser General Public
Packit Service fb6fa5
 * License as published by the Free Software Foundation; either
Packit Service fb6fa5
 * version 2 of the License, or (at your option) any later version.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * This library is distributed in the hope that it will be useful,
Packit Service fb6fa5
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service fb6fa5
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
Packit Service fb6fa5
 * Lesser General Public License for more details.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * You should have received a copy of the GNU Lesser General Public
Packit Service fb6fa5
 * License along with this library; if not, write to the
Packit Service fb6fa5
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Packit Service fb6fa5
 * Boston, MA 02111-1307, USA.
Packit Service fb6fa5
 */
Packit Service fb6fa5
Packit Service fb6fa5
/*
Packit Service fb6fa5
 * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
Packit Service fb6fa5
 * file for a list of people on the GTK+ Team.  See the ChangeLog
Packit Service fb6fa5
 * files for a list of changes.  These files are distributed with
Packit Service fb6fa5
 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
Packit Service fb6fa5
 */
Packit Service fb6fa5
Packit Service fb6fa5
#ifndef __GTK_TYPE_UTILS_H__
Packit Service fb6fa5
#define __GTK_TYPE_UTILS_H__
Packit Service fb6fa5
Packit Service fb6fa5
#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
Packit Service fb6fa5
#error "Only <gtk/gtk.h> can be included directly."
Packit Service fb6fa5
#endif
Packit Service fb6fa5
Packit Service fb6fa5
/* enum types generated by glib-mkenums
Packit Service fb6fa5
 */
Packit Service fb6fa5
#include <gtk/gtktypebuiltins.h>
Packit Service fb6fa5
Packit Service fb6fa5
G_BEGIN_DECLS
Packit Service fb6fa5
Packit Service fb6fa5
/* urg */
Packit Service fb6fa5
#define GTK_TYPE_IDENTIFIER (gtk_identifier_get_type ())
Packit Service fb6fa5
GType gtk_identifier_get_type (void) G_GNUC_CONST;
Packit Service fb6fa5
Packit Service fb6fa5
/* --- typedefs --- */
Packit Service fb6fa5
/* here we come with some necessary forward declarations for structures and
Packit Service fb6fa5
 * provide some fundamental function signatures
Packit Service fb6fa5
 */
Packit Service fb6fa5
typedef struct _GtkArg	       	     GtkArg;
Packit Service fb6fa5
typedef struct _GtkObject   	     GtkObject; /* object forward declaration */
Packit Service fb6fa5
#if !defined (GTK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION)
Packit Service fb6fa5
typedef gboolean (*GtkFunction)	    (gpointer      data);
Packit Service fb6fa5
typedef void (*GtkCallbackMarshal)  (GtkObject    *object,
Packit Service fb6fa5
				     gpointer      data,
Packit Service fb6fa5
				     guint         n_args,
Packit Service fb6fa5
				     GtkArg       *args);
Packit Service fb6fa5
#endif
Packit Service fb6fa5
Packit Service fb6fa5
/* This used to be defined in gtkitemfactory.h, but moved over here after
Packit Service fb6fa5
 * the complete deprecation of that header
Packit Service fb6fa5
 */
Packit Service fb6fa5
typedef gchar * (*GtkTranslateFunc) (const gchar  *path,
Packit Service fb6fa5
				     gpointer      func_data);
Packit Service fb6fa5
Packit Service fb6fa5
Packit Service fb6fa5
/* Everything below is deprecated and superseded by GType API
Packit Service fb6fa5
 */
Packit Service fb6fa5
Packit Service fb6fa5
#ifndef GTK_DISABLE_DEPRECATED
Packit Service fb6fa5
Packit Service fb6fa5
/* Fundamental Types
Packit Service fb6fa5
 * many of these are just aliases for GLib types to maintain
Packit Service fb6fa5
 * compatibility
Packit Service fb6fa5
 */
Packit Service fb6fa5
Packit Service fb6fa5
#define GTK_TYPE_INVALID G_TYPE_INVALID
Packit Service fb6fa5
#define GTK_TYPE_NONE    G_TYPE_NONE
Packit Service fb6fa5
#define GTK_TYPE_ENUM    G_TYPE_ENUM
Packit Service fb6fa5
#define GTK_TYPE_FLAGS   G_TYPE_FLAGS
Packit Service fb6fa5
Packit Service fb6fa5
/* GtkArg types */
Packit Service fb6fa5
#define GTK_TYPE_CHAR    G_TYPE_CHAR
Packit Service fb6fa5
#define GTK_TYPE_UCHAR   G_TYPE_UCHAR
Packit Service fb6fa5
#define GTK_TYPE_BOOL    G_TYPE_BOOLEAN
Packit Service fb6fa5
#define GTK_TYPE_INT     G_TYPE_INT
Packit Service fb6fa5
#define GTK_TYPE_UINT    G_TYPE_UINT
Packit Service fb6fa5
#define GTK_TYPE_LONG    G_TYPE_LONG
Packit Service fb6fa5
#define GTK_TYPE_ULONG   G_TYPE_ULONG
Packit Service fb6fa5
#define GTK_TYPE_FLOAT   G_TYPE_FLOAT
Packit Service fb6fa5
#define GTK_TYPE_DOUBLE  G_TYPE_DOUBLE
Packit Service fb6fa5
#define GTK_TYPE_STRING  G_TYPE_STRING
Packit Service fb6fa5
#define GTK_TYPE_BOXED   G_TYPE_BOXED
Packit Service fb6fa5
#define GTK_TYPE_POINTER G_TYPE_POINTER
Packit Service fb6fa5
Packit Service fb6fa5
typedef GType GtkFundamentalType;
Packit Service fb6fa5
Packit Service fb6fa5
/* --- type macros --- */
Packit Service fb6fa5
#define GTK_CLASS_NAME(class)		(g_type_name (G_TYPE_FROM_CLASS (class)))
Packit Service fb6fa5
#define GTK_CLASS_TYPE(class)		(G_TYPE_FROM_CLASS (class))
Packit Service fb6fa5
#define GTK_TYPE_IS_OBJECT(type)	(g_type_is_a ((type), GTK_TYPE_OBJECT))
Packit Service fb6fa5
Packit Service fb6fa5
/* outdated macros that really shouldn't e used anymore,
Packit Service fb6fa5
 * use the GLib type system instead
Packit Service fb6fa5
 */
Packit Service fb6fa5
#define	GTK_TYPE_FUNDAMENTAL_LAST        (G_TYPE_LAST_RESERVED_FUNDAMENTAL - 1)
Packit Service fb6fa5
#define	GTK_TYPE_FUNDAMENTAL_MAX         (G_TYPE_FUNDAMENTAL_MAX)
Packit Service fb6fa5
Packit Service fb6fa5
#define	GTK_FUNDAMENTAL_TYPE	G_TYPE_FUNDAMENTAL
Packit Service fb6fa5
#define GTK_STRUCT_OFFSET	G_STRUCT_OFFSET
Packit Service fb6fa5
Packit Service fb6fa5
/* glib macro wrappers (compatibility) */
Packit Service fb6fa5
#define	GTK_CHECK_CAST		G_TYPE_CHECK_INSTANCE_CAST
Packit Service fb6fa5
#define	GTK_CHECK_CLASS_CAST	G_TYPE_CHECK_CLASS_CAST
Packit Service fb6fa5
#define GTK_CHECK_GET_CLASS	G_TYPE_INSTANCE_GET_CLASS
Packit Service fb6fa5
#define	GTK_CHECK_TYPE		G_TYPE_CHECK_INSTANCE_TYPE
Packit Service fb6fa5
#define	GTK_CHECK_CLASS_TYPE	G_TYPE_CHECK_CLASS_TYPE
Packit Service fb6fa5
Packit Service fb6fa5
/* glib type wrappers (compatibility) */
Packit Service fb6fa5
Packit Service fb6fa5
typedef GType                   GtkType;
Packit Service fb6fa5
typedef GTypeInstance           GtkTypeObject;
Packit Service fb6fa5
typedef GTypeClass              GtkTypeClass;
Packit Service fb6fa5
typedef GBaseInitFunc           GtkClassInitFunc;
Packit Service fb6fa5
typedef GInstanceInitFunc       GtkObjectInitFunc;
Packit Service fb6fa5
typedef GSignalCMarshaller      GtkSignalMarshaller;
Packit Service fb6fa5
Packit Service fb6fa5
typedef void (*GtkDestroyNotify)    (gpointer data);
Packit Service fb6fa5
typedef void (*GtkSignalFunc)       (void);
Packit Service fb6fa5
Packit Service fb6fa5
#define GTK_SIGNAL_FUNC(f)	    G_CALLBACK(f)
Packit Service fb6fa5
Packit Service fb6fa5
#endif /* GTK_DISABLE_DEPRECATED */
Packit Service fb6fa5
Packit Service fb6fa5
#if !defined (GTK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION)
Packit Service fb6fa5
Packit Service fb6fa5
/* Used by gtk_container_foreach_unmarshal () */
Packit Service fb6fa5
Packit Service fb6fa5
/* GtkArg, used to hold differently typed values */
Packit Service fb6fa5
struct _GtkArg
Packit Service fb6fa5
{
Packit Service fb6fa5
  GType type;
Packit Service fb6fa5
  gchar *name;
Packit Service fb6fa5
Packit Service fb6fa5
  /* this union only defines the required storage types for
Packit Service fb6fa5
   * the possibile values, thus there is no gint enum_data field,
Packit Service fb6fa5
   * because that would just be a mere alias for gint int_data.
Packit Service fb6fa5
   * use the GTK_VALUE_*() and GTK_RETLOC_*() macros to access
Packit Service fb6fa5
   * the discrete memebers.
Packit Service fb6fa5
   */
Packit Service fb6fa5
  union {
Packit Service fb6fa5
    /* flat values */
Packit Service fb6fa5
    gchar char_data;
Packit Service fb6fa5
    guchar uchar_data;
Packit Service fb6fa5
    gboolean bool_data;
Packit Service fb6fa5
    gint int_data;
Packit Service fb6fa5
    guint uint_data;
Packit Service fb6fa5
    glong long_data;
Packit Service fb6fa5
    gulong ulong_data;
Packit Service fb6fa5
    gfloat float_data;
Packit Service fb6fa5
    gdouble double_data;
Packit Service fb6fa5
    gchar *string_data;
Packit Service fb6fa5
    GtkObject *object_data;
Packit Service fb6fa5
    gpointer pointer_data;
Packit Service fb6fa5
Packit Service fb6fa5
    /* structured values */
Packit Service fb6fa5
    struct {
Packit Service fb6fa5
      GCallback f;
Packit Service fb6fa5
      gpointer d;
Packit Service fb6fa5
    } signal_data;
Packit Service fb6fa5
  } d;
Packit Service fb6fa5
};
Packit Service fb6fa5
Packit Service fb6fa5
/* argument value access macros, these must not contain casts,
Packit Service fb6fa5
 * to allow the usage of these macros in combination with the
Packit Service fb6fa5
 * address operator, e.g. &GTK_VALUE_CHAR (*arg)
Packit Service fb6fa5
 */
Packit Service fb6fa5
#define GTK_VALUE_CHAR(a)	((a).d.char_data)
Packit Service fb6fa5
#define GTK_VALUE_UCHAR(a)	((a).d.uchar_data)
Packit Service fb6fa5
#define GTK_VALUE_BOOL(a)	((a).d.bool_data)
Packit Service fb6fa5
#define GTK_VALUE_INT(a)	((a).d.int_data)
Packit Service fb6fa5
#define GTK_VALUE_UINT(a)	((a).d.uint_data)
Packit Service fb6fa5
#define GTK_VALUE_LONG(a)	((a).d.long_data)
Packit Service fb6fa5
#define GTK_VALUE_ULONG(a)	((a).d.ulong_data)
Packit Service fb6fa5
#define GTK_VALUE_FLOAT(a)	((a).d.float_data)
Packit Service fb6fa5
#define GTK_VALUE_DOUBLE(a)	((a).d.double_data)
Packit Service fb6fa5
#define GTK_VALUE_STRING(a)	((a).d.string_data)
Packit Service fb6fa5
#define GTK_VALUE_ENUM(a)	((a).d.int_data)
Packit Service fb6fa5
#define GTK_VALUE_FLAGS(a)	((a).d.uint_data)
Packit Service fb6fa5
#define GTK_VALUE_BOXED(a)	((a).d.pointer_data)
Packit Service fb6fa5
#define GTK_VALUE_OBJECT(a)	((a).d.object_data)
Packit Service fb6fa5
#define GTK_VALUE_POINTER(a)	((a).d.pointer_data)
Packit Service fb6fa5
#define GTK_VALUE_SIGNAL(a)	((a).d.signal_data)
Packit Service fb6fa5
Packit Service fb6fa5
#endif /* !GTK_DISABLE_DEPRECATED || GTK_COMPILATION */
Packit Service fb6fa5
Packit Service fb6fa5
#ifndef GTK_DISABLE_DEPRECATED
Packit Service fb6fa5
Packit Service fb6fa5
/* return location macros, these all narrow down to
Packit Service fb6fa5
 * pointer types, because return values need to be
Packit Service fb6fa5
 * passed by reference
Packit Service fb6fa5
 */
Packit Service fb6fa5
#define GTK_RETLOC_CHAR(a)	((gchar*)	(a).d.pointer_data)
Packit Service fb6fa5
#define GTK_RETLOC_UCHAR(a)	((guchar*)	(a).d.pointer_data)
Packit Service fb6fa5
#define GTK_RETLOC_BOOL(a)	((gboolean*)	(a).d.pointer_data)
Packit Service fb6fa5
#define GTK_RETLOC_INT(a)	((gint*)	(a).d.pointer_data)
Packit Service fb6fa5
#define GTK_RETLOC_UINT(a)	((guint*)	(a).d.pointer_data)
Packit Service fb6fa5
#define GTK_RETLOC_LONG(a)	((glong*)	(a).d.pointer_data)
Packit Service fb6fa5
#define GTK_RETLOC_ULONG(a)	((gulong*)	(a).d.pointer_data)
Packit Service fb6fa5
#define GTK_RETLOC_FLOAT(a)	((gfloat*)	(a).d.pointer_data)
Packit Service fb6fa5
#define GTK_RETLOC_DOUBLE(a)	((gdouble*)	(a).d.pointer_data)
Packit Service fb6fa5
#define GTK_RETLOC_STRING(a)	((gchar**)	(a).d.pointer_data)
Packit Service fb6fa5
#define GTK_RETLOC_ENUM(a)	((gint*)	(a).d.pointer_data)
Packit Service fb6fa5
#define GTK_RETLOC_FLAGS(a)	((guint*)	(a).d.pointer_data)
Packit Service fb6fa5
#define GTK_RETLOC_BOXED(a)	((gpointer*)	(a).d.pointer_data)
Packit Service fb6fa5
#define GTK_RETLOC_OBJECT(a)	((GtkObject**)	(a).d.pointer_data)
Packit Service fb6fa5
#define GTK_RETLOC_POINTER(a)	((gpointer*)	(a).d.pointer_data)
Packit Service fb6fa5
/* GTK_RETLOC_SIGNAL() - no such thing */
Packit Service fb6fa5
Packit Service fb6fa5
/* type registration, it is recommended to use
Packit Service fb6fa5
 * g_type_register_static() or
Packit Service fb6fa5
 * g_type_register_dynamic() instead
Packit Service fb6fa5
 */
Packit Service fb6fa5
typedef struct _GtkTypeInfo GtkTypeInfo;
Packit Service fb6fa5
Packit Service fb6fa5
struct _GtkTypeInfo
Packit Service fb6fa5
{
Packit Service fb6fa5
  gchar			*type_name;
Packit Service fb6fa5
  guint			 object_size;
Packit Service fb6fa5
  guint			 class_size;
Packit Service fb6fa5
  GtkClassInitFunc	 class_init_func;
Packit Service fb6fa5
  GtkObjectInitFunc	 object_init_func;
Packit Service fb6fa5
  gpointer		 reserved_1;
Packit Service fb6fa5
  gpointer		 reserved_2;
Packit Service fb6fa5
  GtkClassInitFunc	 base_class_init_func;
Packit Service fb6fa5
};
Packit Service fb6fa5
Packit Service fb6fa5
void            gtk_type_init   (GTypeDebugFlags    debug_flags);
Packit Service fb6fa5
GtkType         gtk_type_unique (GtkType            parent_type,
Packit Service fb6fa5
                                 const GtkTypeInfo *gtkinfo);
Packit Service fb6fa5
gpointer        gtk_type_class  (GtkType            type);
Packit Service fb6fa5
gpointer        gtk_type_new    (GtkType            type);
Packit Service fb6fa5
Packit Service fb6fa5
/* --- compatibility defines --- */
Packit Service fb6fa5
#define	gtk_type_name(type)		 g_type_name (type)
Packit Service fb6fa5
#define	gtk_type_from_name(name)	 g_type_from_name (name)
Packit Service fb6fa5
#define	gtk_type_parent(type)		 g_type_parent (type)
Packit Service fb6fa5
#define	gtk_type_is_a(type, is_a_type)	 g_type_is_a ((type), (is_a_type))
Packit Service fb6fa5
Packit Service fb6fa5
/* enum/flags compatibility functions, we strongly
Packit Service fb6fa5
 * recommend to use the glib enum/flags classes directly
Packit Service fb6fa5
 */
Packit Service fb6fa5
typedef GEnumValue  GtkEnumValue;
Packit Service fb6fa5
typedef GFlagsValue GtkFlagValue;
Packit Service fb6fa5
GtkEnumValue*	gtk_type_enum_get_values	(GtkType	 enum_type);
Packit Service fb6fa5
GtkFlagValue*	gtk_type_flags_get_values	(GtkType	 flags_type);
Packit Service fb6fa5
GtkEnumValue*	gtk_type_enum_find_value	(GtkType	 enum_type,
Packit Service fb6fa5
						 const gchar	*value_name);
Packit Service fb6fa5
GtkFlagValue*	gtk_type_flags_find_value	(GtkType	 flags_type,
Packit Service fb6fa5
						 const gchar	*value_name);
Packit Service fb6fa5
Packit Service fb6fa5
#endif /* GTK_DISABLE_DEPRECATED */
Packit Service fb6fa5
Packit Service fb6fa5
G_END_DECLS
Packit Service fb6fa5
Packit Service fb6fa5
#endif /* __GTK_TYPE_UTILS_H__ */