Index: docs/typelib-format.txt
===================================================================
--- docs/typelib-format.txt	(revision 848)
+++ docs/typelib-format.txt	(working copy)
@@ -386,6 +386,7 @@
   guint          transfer_container_ownership : 1;
   guint          is_return_value              : 1;
   guint          reserved                     :24:
+  guint32        default_value;
 
   SimpleTypeBlob arg_type;
 }
@@ -435,6 +436,13 @@
 arg_type:
           Describes the type of the parameter. See details below.
 
+default_value:
+	  The default value for this function as a string.
+	  To specify a NULL value for a pointer, the "NULL" string is used.
+	  integer:  "0"
+	  float:    "0.0"
+	  long:     "0L"
+	  string:   "Foo"
 
 Types are specified by four bytes. If the three high bytes are zero,
 the low byte describes a basic type, otherwise the 32bit number is an
Index: girepository/girparser.c
===================================================================
--- girepository/girparser.c	(revision 848)
+++ girepository/girparser.c	(working copy)
@@ -700,6 +700,7 @@
   const gchar *optional;
   const gchar *allow_none;
   const gchar *transfer;
+  const gchar *default_value;
   GIrNodeParam *param;
       
   if (!(strcmp (element_name, "parameter") == 0 &&
@@ -713,6 +714,7 @@
   optional = find_attribute ("optional", attribute_names, attribute_values);
   allow_none = find_attribute ("allow-none", attribute_names, attribute_values);
   transfer = find_attribute ("transfer-ownership", attribute_names, attribute_values);
+  default_value = find_attribute ("default", attribute_names, attribute_values);
 
   if (name == NULL)
     name = "unknown";
@@ -760,6 +762,8 @@
   else
     param->allow_none = FALSE;
 
+  param->default_value = g_strdup (default_value);
+
   parse_param_transfer (param, transfer);
 
   ((GIrNode *)param)->name = g_strdup (name);
Index: girepository/ginfo.c
===================================================================
--- girepository/ginfo.c	(revision 848)
+++ girepository/ginfo.c	(working copy)
@@ -711,6 +711,18 @@
   return blob->allow_none;
 }
 
+gboolean
+g_arg_info_default_value (GIArgInfo *info)
+{
+  GIBaseInfo *base = (GIBaseInfo *)info;
+  ArgBlob *blob = (ArgBlob *)&base->typelib->data[base->offset];
+  
+  if (blob->default_value)
+    return g_typelib_get_string (base->typelib, blob->default_value);
+
+  return NULL;
+}
+
 GITransfer
 g_arg_info_get_ownership_transfer (GIArgInfo *info)
 {
Index: girepository/girwriter.c
===================================================================
--- girepository/girwriter.c	(revision 848)
+++ girepository/girwriter.c	(working copy)
@@ -187,6 +187,11 @@
 	    g_string_append (markup_s,
 			     g_markup_printf_escaped (" allow-none=\"1\""));
 	  
+	  if (param->default_value)
+	    g_string_append (markup_s,
+			     g_markup_printf_escaped (" default-value=\"%s\"",
+						      param->default_value));
+	  
 	  if (strcmp (direction, "in") != 0)
 	    g_string_append (markup_s,
 			     g_markup_printf_escaped (" direction=\"%s\"",
Index: girepository/gtypelib.c
===================================================================
--- girepository/gtypelib.c	(revision 848)
+++ girepository/gtypelib.c	(working copy)
@@ -161,7 +161,7 @@
   CHECK_SIZE (Header, 108);
   CHECK_SIZE (DirEntry, 12);
   CHECK_SIZE (SimpleTypeBlob, 4);
-  CHECK_SIZE (ArgBlob, 12);
+  CHECK_SIZE (ArgBlob, 16);
   CHECK_SIZE (SignatureBlob, 8);
   CHECK_SIZE (CommonBlob, 8);
   CHECK_SIZE (FunctionBlob, 16);
Index: girepository/gtypelib.h
===================================================================
--- girepository/gtypelib.h	(revision 848)
+++ girepository/gtypelib.h	(working copy)
@@ -134,6 +134,8 @@
   guint          return_value                 : 1;
   guint          reserved                     :24;
 
+  guint32        default_value; 
+
   SimpleTypeBlob arg_type;
 } ArgBlob;
 
Index: girepository/girnode.c
===================================================================
--- girepository/girnode.c	(revision 848)
+++ girepository/girnode.c	(working copy)
@@ -231,6 +231,7 @@
 	GIrNodeParam *param = (GIrNodeParam *)node;
 	
 	g_free (node->name);
+	g_free (param->default_value);
 	g_ir_node_free ((GIrNode *)param->type);
       }
       break;
@@ -419,7 +420,7 @@
       break;
 
     case G_IR_NODE_PARAM:
-      size = 12;
+      size = 16;
       break;
 
     case G_IR_NODE_TYPE:
@@ -582,9 +583,11 @@
       {
 	GIrNodeParam *param = (GIrNodeParam *)node;
 	
-	size = 12;
+	size = 16;
 	if (node->name)
 	  size += ALIGN_VALUE (strlen (node->name) + 1, 4);
+	if (param->default_value)
+	  size += ALIGN_VALUE (strlen (param->default_value) + 1, 4);
 	size += g_ir_node_get_full_size_internal (node, (GIrNode *)param->type);	
       }
       break;
@@ -1665,7 +1668,7 @@
 	ArgBlob *blob = (ArgBlob *)&data[*offset];
 	GIrNodeParam *param = (GIrNodeParam *)node;
 	
-	*offset += 8;
+	*offset += 12;
 
  	blob->name = write_string (node->name, strings, data, offset2);
  	blob->in = param->in;
@@ -1677,6 +1680,9 @@
 	blob->transfer_container_ownership = param->shallow_transfer;
 	blob->return_value = param->retval;
 	blob->reserved = 0;
+	if (param->default_value)
+	  blob->default_value = write_string (param->default_value,
+					      strings, data, offset2);
 
         g_ir_node_build_typelib ((GIrNode *)param->type, module, modules, 
 				 strings, types, data, offset, offset2);
Index: girepository/girnode.h
===================================================================
--- girepository/girnode.h	(revision 848)
+++ girepository/girnode.h	(working copy)
@@ -141,6 +141,7 @@
   gboolean allow_none;
   gboolean transfer;
   gboolean shallow_transfer;
+  gchar *default_value;
   
   GIrNodeType *type;
 };
Index: tests/scanner/annotation-1.0-expected.gir
===================================================================
--- tests/scanner/annotation-1.0-expected.gir	(revision 848)
+++ tests/scanner/annotation-1.0-expected.gir	(working copy)
@@ -204,6 +204,35 @@
           <type name="GObject.Object" c:type="GObject*"/>
         </return-value>
       </method>
+      <method name="default_params"
+              c:identifier="annotation_object_default_params">
+        <return-value transfer-ownership="none">
+          <type name="none" c:type="void"/>
+        </return-value>
+        <parameters>
+          <parameter name="param_int" transfer-ownership="none" default="0">
+            <type name="int" c:type="int"/>
+          </parameter>
+          <parameter name="param_float"
+                     transfer-ownership="none"
+                     default="0.0">
+            <type name="float" c:type="float"/>
+          </parameter>
+          <parameter name="param_long" transfer-ownership="none" default="0L">
+            <type name="long" c:type="long"/>
+          </parameter>
+          <parameter name="param_string"
+                     transfer-ownership="full"
+                     default="empty">
+            <type name="utf8" c:type="char*"/>
+          </parameter>
+          <parameter name="param_object"
+                     transfer-ownership="none"
+                     default="NULL">
+            <type name="GObject.Object" c:type="GObject*"/>
+          </parameter>
+        </parameters>
+      </method>
       <field name="parent_instance">
         <type name="GObject.Object" c:type="GObject"/>
       </field>
Index: tests/scanner/annotation.c
===================================================================
--- tests/scanner/annotation.c	(revision 848)
+++ tests/scanner/annotation.c	(working copy)
@@ -277,4 +277,25 @@
   return NULL;
 }
 
+/**
+ * annotation_object_default_params: 
+ * @object: a #GObject
+ * @param_int: (default 0):
+ * @param_float: (default 0.0):
+ * @param_long: (default 0L):
+ * @param_string: (default "empty"):
+ * @param_object: (default NULL):
+ *
+ **/
+void
+annotation_object_default_params (AnnotationObject *object,
+				  int param_int,
+				  float param_float,
+				  long param_long,
+				  char *param_string,
+				  GObject *param_object)
+{
+
+}
+
 static char backslash_parsing_tester_2 = '\\';
Index: tests/scanner/annotation.h
===================================================================
--- tests/scanner/annotation.h	(revision 848)
+++ tests/scanner/annotation.h	(working copy)
@@ -69,5 +69,11 @@
 
 GObject* annotation_object_do_not_use   (AnnotationObject *object);
 
+void     annotation_object_default_params (AnnotationObject *object,
+					   int param_int,
+					   float param_float,
+					   long param_long,
+					   char *param_string,
+					   GObject *param_object);
 
 #endif /* __ANNOTATION_OBJECT_H__ */
Index: giscanner/transformer.py
===================================================================
--- giscanner/transformer.py	(revision 848)
+++ giscanner/transformer.py	(working copy)
@@ -524,6 +524,13 @@
                 param.direction = 'out'
             elif option == 'allow-none':
                 param.allow_none = True
+            elif option == 'default':
+                value = data[0]
+                if (len(value) >= 3 and
+                    ptype.name == 'utf8' and
+                    value[0] == '"' and value[-1] == '"'):
+                    value = value[1:-1]
+                param.default = value
             elif option.startswith(('element-type', 'array')):
                 pass
             elif option in ('transfer', 'transfer-inferred'):
Index: giscanner/girwriter.py
===================================================================
--- giscanner/girwriter.py	(revision 848)
+++ giscanner/girwriter.py	(working copy)
@@ -150,6 +150,8 @@
                      parameter.transfer))
         if parameter.allow_none:
             attrs.append(('allow-none', '1'))
+        if parameter.default is not None:
+            attrs.append(('default', parameter.default))
         with self.tagcontext('parameter', attrs):
             self._write_type(parameter.type)
 
Index: giscanner/ast.py
===================================================================
--- giscanner/ast.py	(revision 848)
+++ giscanner/ast.py	(working copy)
@@ -295,6 +295,7 @@
             self.direction = PARAM_DIRECTION_IN
 
         self.allow_none = not not allow_none
+        self.default = None
 
     def __repr__(self):
         return 'Parameter(%r, %r)' % (self.name, self.type)
