### Function Macro

# GObject DEFINE_BOXED_TYPE_WITH_CODE

since: 2.26

#### Declaration

    #define G_DEFINE_BOXED_TYPE_WITH_CODE (
      TypeName,
      type_name,
      copy_func,
      free_func,
      _C_
    )

#### Description

A convenience macro for boxed type implementations.

Similar to G_DEFINE_BOXED_TYPE(), but allows to insert custom code into the `type_name_get_type()` function, e.g. to register value transformations with g_value_register_transform_func(), for instance:

    G_DEFINE_BOXED_TYPE_WITH_CODE (GdkRectangle, gdk_rectangle,
                                   gdk_rectangle_copy,
                                   gdk_rectangle_free,
                                   register_rectangle_transform_funcs (g_define_type_id))

Similarly to the `G_DEFINE_TYPE_*` family of macros, the `GType` of the newly defined boxed type is exposed in the `g_define_type_id` variable.

Available since: 2.26

This function is not directly available to language bindings.

#### Parameters

`TypeName`

  Type: `-`

  The name of the new type, in Camel case.

`type_name`

  Type: `-`

  The name of the new type, in lowercase, with words separated by `_`

`copy_func`

  Type: `-`

  The `GBoxedCopyFunc` for the new type.

`free_func`

  Type: `-`

  The `GBoxedFreeFunc` for the new type.

`_C_`

  Type: `-`

  Custom code that gets inserted in the `*_get_type()` function.