epoc32/include/stdapis/glib-2.0/gobject/genums.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
     1.1 --- a/epoc32/include/stdapis/glib-2.0/gobject/genums.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/stdapis/glib-2.0/gobject/genums.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,127 @@
     1.4 -genums.h
     1.5 +/* GObject - GLib Type, Object, Parameter and Signal Library
     1.6 + * Copyright (C) 1998-1999, 2000-2001 Tim Janik and Red Hat, Inc.
     1.7 + * Portions copyright (c) 2006 Nokia Corporation.  All rights reserved.
     1.8 + *
     1.9 + * This library is free software; you can redistribute it and/or
    1.10 + * modify it under the terms of the GNU Lesser General Public
    1.11 + * License as published by the Free Software Foundation; either
    1.12 + * version 2 of the License, or (at your option) any later version.
    1.13 + *
    1.14 + * This library is distributed in the hope that it will be useful,
    1.15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
    1.17 + * Lesser General Public License for more details.
    1.18 + *
    1.19 + * You should have received a copy of the GNU Lesser General
    1.20 + * Public License along with this library; if not, write to the
    1.21 + * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
    1.22 + * Boston, MA 02111-1307, USA.
    1.23 + */
    1.24 +#if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
    1.25 +#error "Only <glib-object.h> can be included directly."
    1.26 +#endif
    1.27 +
    1.28 +#ifndef __G_ENUMS_H__
    1.29 +#define __G_ENUMS_H__
    1.30 +
    1.31 +#include <_ansi.h>
    1.32 +#include <gobject/gtype.h>
    1.33 +
    1.34 +G_BEGIN_DECLS
    1.35 +
    1.36 +/* --- type macros --- */
    1.37 +#define G_TYPE_IS_ENUM(type)	       (G_TYPE_FUNDAMENTAL (type) == G_TYPE_ENUM)
    1.38 +#define G_ENUM_CLASS(class)	       (G_TYPE_CHECK_CLASS_CAST ((class), G_TYPE_ENUM, GEnumClass))
    1.39 +#define G_IS_ENUM_CLASS(class)	       (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_ENUM))
    1.40 +#define G_ENUM_CLASS_TYPE(class)       (G_TYPE_FROM_CLASS (class))
    1.41 +#define G_ENUM_CLASS_TYPE_NAME(class)  (g_type_name (G_ENUM_CLASS_TYPE (class)))
    1.42 +#define G_TYPE_IS_FLAGS(type)	       (G_TYPE_FUNDAMENTAL (type) == G_TYPE_FLAGS)
    1.43 +#define G_FLAGS_CLASS(class)	       (G_TYPE_CHECK_CLASS_CAST ((class), G_TYPE_FLAGS, GFlagsClass))
    1.44 +#define G_IS_FLAGS_CLASS(class)        (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_FLAGS))
    1.45 +#define G_FLAGS_CLASS_TYPE(class)      (G_TYPE_FROM_CLASS (class))
    1.46 +#define G_FLAGS_CLASS_TYPE_NAME(class) (g_type_name (G_FLAGS_CLASS_TYPE (class)))
    1.47 +#define G_VALUE_HOLDS_ENUM(value)      (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_ENUM))
    1.48 +#define G_VALUE_HOLDS_FLAGS(value)     (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_FLAGS))
    1.49 +
    1.50 +
    1.51 +/* --- enum/flag values & classes --- */
    1.52 +typedef struct _GEnumClass  GEnumClass;
    1.53 +typedef struct _GFlagsClass GFlagsClass;
    1.54 +typedef struct _GEnumValue  GEnumValue;
    1.55 +typedef struct _GFlagsValue GFlagsValue;
    1.56 +struct	_GEnumClass
    1.57 +{
    1.58 +  GTypeClass  g_type_class;
    1.59 +
    1.60 +  /*< public >*/  
    1.61 +  gint	      minimum;
    1.62 +  gint	      maximum;
    1.63 +  guint	      n_values;
    1.64 +  GEnumValue *values;
    1.65 +};
    1.66 +struct	_GFlagsClass
    1.67 +{
    1.68 +  GTypeClass   g_type_class;
    1.69 +  
    1.70 +  /*< public >*/  
    1.71 +  guint	       mask;
    1.72 +  guint	       n_values;
    1.73 +  GFlagsValue *values;
    1.74 +};
    1.75 +struct _GEnumValue
    1.76 +{
    1.77 +  gint	 value;
    1.78 +  gchar *value_name;
    1.79 +  gchar *value_nick;
    1.80 +};
    1.81 +struct _GFlagsValue
    1.82 +{
    1.83 +  guint	 value;
    1.84 +  gchar *value_name;
    1.85 +  gchar *value_nick;
    1.86 +};
    1.87 +
    1.88 +
    1.89 +/* --- prototypes --- */
    1.90 +IMPORT_C GEnumValue*	g_enum_get_value		(GEnumClass	*enum_class,
    1.91 +						 gint		 value);
    1.92 +IMPORT_C GEnumValue*	g_enum_get_value_by_name	(GEnumClass	*enum_class,
    1.93 +						 const gchar	*name);
    1.94 +IMPORT_C GEnumValue*	g_enum_get_value_by_nick	(GEnumClass	*enum_class,
    1.95 +						 const gchar	*nick);
    1.96 +IMPORT_C GFlagsValue*	g_flags_get_first_value		(GFlagsClass	*flags_class,
    1.97 +						 guint		 value);
    1.98 +IMPORT_C GFlagsValue*	g_flags_get_value_by_name	(GFlagsClass	*flags_class,
    1.99 +						 const gchar	*name);
   1.100 +IMPORT_C GFlagsValue*	g_flags_get_value_by_nick	(GFlagsClass	*flags_class,
   1.101 +						 const gchar	*nick);
   1.102 +IMPORT_C void            g_value_set_enum        	(GValue         *value,
   1.103 +						 gint            v_enum);
   1.104 +IMPORT_C gint            g_value_get_enum        	(const GValue   *value);
   1.105 +IMPORT_C void            g_value_set_flags       	(GValue         *value,
   1.106 +						 guint           v_flags);
   1.107 +IMPORT_C guint           g_value_get_flags       	(const GValue   *value);
   1.108 +
   1.109 +
   1.110 +
   1.111 +/* --- registration functions --- */
   1.112 +/* const_static_values is a NULL terminated array of enum/flags
   1.113 + * values that is taken over!
   1.114 + */
   1.115 +IMPORT_C GType	g_enum_register_static	   (const gchar	      *name,
   1.116 +				    const GEnumValue  *const_static_values);
   1.117 +IMPORT_C GType	g_flags_register_static	   (const gchar	      *name,
   1.118 +				    const GFlagsValue *const_static_values);
   1.119 +/* functions to complete the type information
   1.120 + * for enums/flags implemented by plugins
   1.121 + */
   1.122 +IMPORT_C void	g_enum_complete_type_info  (GType	       g_enum_type,
   1.123 +				    GTypeInfo	      *info,
   1.124 +				    const GEnumValue  *const_values);
   1.125 +IMPORT_C void	g_flags_complete_type_info (GType	       g_flags_type,
   1.126 +				    GTypeInfo	      *info,
   1.127 +				    const GFlagsValue *const_values);
   1.128 +
   1.129 +G_END_DECLS
   1.130 +
   1.131 +#endif /* __G_ENUMS_H__ */