/*
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) version 3.
 *
 * This program 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with the program; if not, see <http://www.gnu.org/licenses/>
 *
 *
 * Authors:
 *		Bolian Yin <bolian.yin@sun.com>
 *
 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
 *
 */

#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION)
#error "Only <e-util/e-util.h> should be included directly."
#endif

/* Evolution Accessibility
*/

#ifndef _EA_FACTORY_H__
#define _EA_FACTORY_H__

#include <atk/atkobject.h>

#define EA_FACTORY_PARTA_GOBJECT(type, type_as_function, opt_create_accessible)	\
static AtkObject *								\
type_as_function ## _factory_create_accessible (GObject *obj)			\
{                                                                               \
  AtkObject *accessible;							\
  g_return_val_if_fail (G_IS_OBJECT (obj), NULL);				\
  accessible = opt_create_accessible (G_OBJECT (obj));				\
  return accessible;								\
}

#define EA_FACTORY_PARTA(type, type_as_function, opt_create_accessible)		\
static AtkObject *								\
type_as_function ## _factory_create_accessible (GObject *obj)			\
{                                                                               \
  GtkWidget *widget;								\
  AtkObject *accessible;							\
										\
  g_return_val_if_fail (GTK_IS_WIDGET (obj), NULL);				\
										\
  widget = GTK_WIDGET (obj);							\
										\
  accessible = opt_create_accessible (widget);					\
  return accessible;								\
}

#define EA_FACTORY_PARTB(type, type_as_function, opt_create_accessible)		\
										\
static GType									\
type_as_function ## _factory_get_accessible_type (void)				\
{										\
  return type;									\
}										\
										\
										\
static void									\
type_as_function ## _factory_class_init (AtkObjectFactoryClass *klass)		\
{										\
  klass->create_accessible   = type_as_function ## _factory_create_accessible;	\
  klass->get_accessible_type = type_as_function ## _factory_get_accessible_type;\
}										\
										\
static GType									\
type_as_function ## _factory_get_type (void)					\
{										\
  static GType t = 0;								\
										\
  if (!t)									\
  {										\
    gchar *name;									\
    static const GTypeInfo tinfo =						\
    {										\
      sizeof (AtkObjectFactoryClass),						\
      NULL, NULL, (GClassInitFunc) type_as_function ## _factory_class_init,	\
      NULL, NULL, sizeof (AtkObjectFactory), 0, NULL, NULL			\
    };										\
										\
    name = g_strconcat (g_type_name (type), "Factory", NULL);			\
    t = g_type_register_static (						\
	    ATK_TYPE_OBJECT_FACTORY, name, &tinfo, 0);				\
    g_free (name);								\
  }										\
										\
  return t;									\
}

#define EA_FACTORY(type, type_as_function, opt_create_accessible)		\
        EA_FACTORY_PARTA (type, type_as_function, opt_create_accessible)		\
        EA_FACTORY_PARTB (type, type_as_function, opt_create_accessible)

#define EA_FACTORY_GOBJECT(type, type_as_function, opt_create_accessible)	\
        EA_FACTORY_PARTA_GOBJECT (type, type_as_function, opt_create_accessible)	\
        EA_FACTORY_PARTB (type, type_as_function, opt_create_accessible)

#define EA_SET_FACTORY(obj_type, type_as_function)				\
{                                                                               \
	if (atk_get_root ()) {                                                  \
		atk_registry_set_factory_type (atk_get_default_registry (),     \
				      obj_type,                                 \
				      type_as_function ## _factory_get_type ());\
	}									\
}

#endif /* _EA_FACTORY_H__ */
 value='gnome-3.22'>gnome-3.22</option>
<option value='gnome-3.24' selected='selected'>gnome-3.24</option>
<option value='gnome-3.26'>gnome-3.26</option>
<option value='gnome-3.28'>gnome-3.28</option>
<option value='gnome-3.32'>gnome-3.32</option>
<option value='gnome-3.36'>gnome-3.36</option>
<option value='gstreamer'>gstreamer</option>
<option value='gstreamer-1.16'>gstreamer-1.16</option>
<option value='gstreamer0.10-removal'>gstreamer0.10-removal</option>
<option value='main'>main</option>
<option value='master'>master</option>
<option value='mate-1.16'>mate-1.16</option>
<option value='mate-1.18'>mate-1.18</option>
<option value='mate-1.20'>mate-1.20</option>
<option value='mate-1.22'>mate-1.22</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>FreeBSD GNOME current development ports (https://github.com/freebsd/freebsd-ports-gnome)</td><td class='sub right'></td></tr></table>
<table class='tabs'><tr><td>
<a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/about/?h=gnome-3.24'>about</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/?h=gnome-3.24'>summary</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/refs/?h=gnome-3.24&amp;id=78921398765b93db7f3269e4ef12e627772f38a6'>refs</a><a class='active' href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/lang/jakarta-commons-jelly?h=gnome-3.24'>log</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/tree/lang/jakarta-commons-jelly?h=gnome-3.24&amp;id=78921398765b93db7f3269e4ef12e627772f38a6'>tree</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/lang/jakarta-commons-jelly?h=gnome-3.24&amp;id=78921398765b93db7f3269e4ef12e627772f38a6'>commit</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/diff/lang/jakarta-commons-jelly?h=gnome-3.24&amp;id=78921398765b93db7f3269e4ef12e627772f38a6'>diff</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/stats/lang/jakarta-commons-jelly?h=gnome-3.24'>stats</a></td><td class='form'><form class='right' method='get' action='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/lang/jakarta-commons-jelly'>
<input type='hidden' name='h' value='gnome-3.24'/><input type='hidden' name='id' value='78921398765b93db7f3269e4ef12e627772f38a6'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/?h=gnome-3.24&amp;id=78921398765b93db7f3269e4ef12e627772f38a6'>root</a>/<a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/lang?h=gnome-3.24&amp;id=78921398765b93db7f3269e4ef12e627772f38a6'>lang</a>/<a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/lang/jakarta-commons-jelly?h=gnome-3.24&amp;id=78921398765b93db7f3269e4ef12e627772f38a6'>jakarta-commons-jelly</a></div><div class='content'><table class='list nowrap'><tr class='nohover'><th></th><th class='left'>Commit message (<a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/lang/jakarta-commons-jelly?h=gnome-3.24&amp;id=78921398765b93db7f3269e4ef12e627772f38a6&amp;showmsg=1'>Expand</a>)</th><th class='left'>Author</th><th class='left'>Age</th><th class='left'>Files</th><th class='left'>Lines</th></tr>
<tr><td class='commitgraph'>* </td><td><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/lang/jakarta-commons-jelly?h=gnome-3.24&amp;id=d843ecd4966c8a5bed60cf3aaeb27edb6b5b2389'>Cleanup DIST* variables.</a></td><td>mat</td><td><span title='2015-05-12 02:34:57 +0800'>2015-05-12</span></td><td>1</td><td><span class='deletions'>-1</span>/<span class='insertions'>+1</span></td></tr>
<tr><td class='commitgraph'>* </td><td><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/lang/jakarta-commons-jelly?h=gnome-3.24&amp;id=23cb85ecfb1a0c7aeb4f601764a7ca41a1bbbfe7'>- Simplify MASTER_SITES</a></td><td>amdmi3</td><td><span title='2015-03-12 19:16:01 +0800'>2015-03-12</span></td><td>1</td><td><span class='deletions'>-3</span>/<span class='insertions'>+3</span></td></tr>
<tr><td class='commitgraph'>* </td><td><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/lang/jakarta-commons-jelly?h=gnome-3.24&amp;id=788e4b297cb91511d27d0a65e8187997967f41f5'>- Add staging support</a></td><td>pawel</td><td><span title='2014-06-01 19:49:31 +0800'>2014-06-01</span>