b039454ee1f59453a32538ba7da69ae3611953a2
diff --git a/docs/reference/gobject/gobject-sections.txt b/docs/reference/gobject/gobject-sections.txt
index 2d0ab6e..12eb83b 100644
--- a/docs/reference/gobject/gobject-sections.txt
+++ b/docs/reference/gobject/gobject-sections.txt
@@ -103,6 +103,10 @@ G_DEFINE_ABSTRACT_TYPE
 G_DEFINE_ABSTRACT_TYPE_WITH_CODE
 G_IMPLEMENT_INTERFACE
 G_DEFINE_TYPE_EXTENDED
+G_DEFINE_BOXED_TYPE
+G_DEFINE_BOXED_TYPE_WITH_CODE
+G_DEFINE_POINTER_TYPE
+G_DEFINE_POINTER_TYPE_WITH_CODE
 
 <SUBSECTION Private>
 G_TYPE_FUNDAMENTAL_SHIFT
diff --git a/docs/reference/gobject/tmpl/gtype.sgml b/docs/reference/gobject/tmpl/gtype.sgml
index 692c000..2d7120e 100644
--- a/docs/reference/gobject/tmpl/gtype.sgml
+++ b/docs/reference/gobject/tmpl/gtype.sgml
@@ -1639,6 +1639,60 @@ init functions.
 @Since: 2.4
 
 
+<!-- ##### MACRO G_DEFINE_BOXED_TYPE ##### -->
+<para>
+A convenience macro for boxed type implementations, which defines a 
+*_get_type() function registering the boxed type.
+</para>
+
+@TypeName: The name of the new type, in Camel case.
+@type_name: The name of the new type, in lowercase, with words 
+  separated by '_'.
+@copy_func: the #GBoxedCopyFunc for the new type
+@free_func: the #GBoxedFreeFunc for the new type
+@Since: 2.18
+
+
+<!-- ##### MACRO G_DEFINE_BOXED_TYPE_WITH_CODE ##### -->
+<para>
+A convenience macro for boxed type implementations.
+Similar to G_DEFINE_BOXED_TYPE(), but allows to insert custom code into the
+*_get_type() function, e.g. to register value transformations with
+g_value_register_transform_func().
+</para>
+
+@TypeName: The name of the new type, in Camel case.
+@type_name: The name of the new type, in lowercase, with words 
+  separated by '_'.
+@copy_func: the #GBoxedCopyFunc for the new type
+@free_func: the #GBoxedFreeFunc for the new type
+@Since: 2.18
+
+
+<!-- ##### MACRO G_DEFINE_POINTER_TYPE ##### -->
+<para>
+A convenience macro for pointer type implementations, which defines a
+*_get_type() function registering the pointer type.
+</para>
+
+@TypeName: The name of the new type, in Camel case.
+@type_name: The name of the new type, in lowercase, with words 
+  separated by '_'.
+@Since: 2.18
+
+
+<!-- ##### MACRO G_DEFINE_POINTER_TYPE_WITH_CODE ##### -->
+<para>
+A convenience macro for pointer type implementations.
+Similar to G_DEFINE_POINTER_TYPE(), but allows to insert custom code into the
+*_get_type() function.</para>
+
+@TypeName: The name of the new type, in Camel case.
+@type_name: The name of the new type, in lowercase, with words 
+  separated by '_'.
+@Since: 2.18
+
+
 <!-- ##### MACRO G_TYPE_INVALID ##### -->
 <para>
 An invalid #GType used as error return value in some functions which return
diff --git a/gobject/gtype.h b/gobject/gtype.h
index 5fa9860..5a717f5 100644
--- a/gobject/gtype.h
+++ b/gobject/gtype.h
@@ -388,6 +388,43 @@ type_name##_get_type (void) \
   return g_define_type_id__volatile;	\
 } /* closes type_name##_get_type() */
 
+/* convenience macros for boxed type registration:
+ * macro arguments: TypeName, copy_func, free_func
+ * example: G_DEFINE_BOXED_TYPE (GtkFoo, gtk_foo, gtk_foo_copy, gtk_foo_free)
+ */
+#define G_DEFINE_BOXED_TYPE(TypeName, type_name, copy_func, free_func)                  G_DEFINE_BOXED_TYPE_WITH_CODE (TypeName, type_name, copy_func, free_func, {})
+#define G_DEFINE_BOXED_TYPE_WITH_CODE(TypeName, type_name, copy_func, free_func, _C_)   _G_DEFINE_BOXED_TYPE_BEGIN (TypeName, type_name, copy_func, free_func) {_C_;} _G_DEFINE_TYPE_EXTENDED_END()
+
+#define _G_DEFINE_BOXED_TYPE_BEGIN(TypeName, type_name, copy_func, free_func) \
+GType \
+type_name##_get_type (void) \
+{ \
+  static volatile gsize g_define_type_id__volatile = 0; \
+  if (g_once_init_enter (&g_define_type_id__volatile))  \
+    { \
+      GType g_define_type_id = \
+        g_boxed_type_register_static (g_intern_static_string (#TypeName), \
+                                      (GBoxedCopyFunc) copy_func, \
+                                      (GBoxedFreeFunc) free_func); \
+      { /* custom code follows */
+
+/* convenience macros for pointer type registration:
+ * macro arguments: TypeName, type_name
+ * example: G_DEFINE_POINTER_TYPE (GtkFooPointer, gtk_foo_pointer)
+ */
+#define G_DEFINE_POINTER_TYPE(TypeName, type_name)                  G_DEFINE_POINTER_TYPE_WITH_CODE (TypeName, type_name, {})
+#define G_DEFINE_POINTER_TYPE_WITH_CODE(TypeName, type_name, _C_)   _G_DEFINE_POINTER_TYPE_BEGIN (TypeName, type_name) {_C_;} _G_DEFINE_TYPE_EXTENDED_END()
+
+#define _G_DEFINE_POINTER_TYPE_BEGIN(TypeName, type_name) \
+GType \
+type_name##_get_type (void) \
+{ \
+  static volatile gsize g_define_type_id__volatile = 0; \
+  if (g_once_init_enter (&g_define_type_id__volatile))  \
+    { \
+      GType g_define_type_id = \
+        g_pointer_type_register_static (g_intern_static_string (#TypeName)); \
+      { /* custom code follows */
 
 /* --- protected (for fundamental type implementations) --- */
 GTypePlugin*	 g_type_get_plugin		(GType		     type);
