? pygobject/test-option.py
? pygobject/examples/option.py
? pygobject/gobject/pygoptioncontext.c
? pygobject/gobject/pygoptiongroup.c
Index: pygobject/examples/Makefile.am
===================================================================
RCS file: /cvs/gnome/gnome-python/pygobject/examples/Makefile.am,v
retrieving revision 1.1
diff -u -p -r1.1 Makefile.am
--- pygobject/examples/Makefile.am	9 Jan 2006 12:26:45 -0000	1.1
+++ pygobject/examples/Makefile.am	14 Apr 2006 21:06:14 -0000
@@ -1 +1,2 @@
-EXTRA_DIST = properties.py signal.py
+EXTRA_DIST = properties.py signal.py option.py
+
Index: pygobject/gobject/Makefile.am
===================================================================
RCS file: /cvs/gnome/gnome-python/pygobject/gobject/Makefile.am,v
retrieving revision 1.7
diff -u -p -r1.7 Makefile.am
--- pygobject/gobject/Makefile.am	11 Apr 2006 15:14:36 -0000	1.7
+++ pygobject/gobject/Makefile.am	14 Apr 2006 21:06:14 -0000
@@ -34,7 +34,9 @@ _gobject_la_SOURCES = \
 	pygpointer.c \
 	pygiochannel.c \
 	pygsource.c \
-	pygtype.c
+	pygtype.c \
+	pygoptioncontext.c \
+	pygoptiongroup.c
 
 if PLATFORM_WIN32
 _gobject_la_CFLAGS += -DPLATFORM_WIN32
Index: pygobject/gobject/gobjectmodule.c
===================================================================
RCS file: /cvs/gnome/gnome-python/pygobject/gobject/gobjectmodule.c,v
retrieving revision 1.215
diff -u -p -r1.215 gobjectmodule.c
--- pygobject/gobject/gobjectmodule.c	11 Apr 2006 22:58:37 -0000	1.215
+++ pygobject/gobject/gobjectmodule.c	14 Apr 2006 21:06:18 -0000
@@ -3101,6 +3101,9 @@ init_gobject(void)
     REGISTER_TYPE(d, PyGTimeout_Type, "Timeout");
     REGISTER_TYPE(d, PyGPollFD_Type, "PollFD");
 
+    REGISTER_TYPE(d, PyGOptionContext_Type, "OptionContext");
+    REGISTER_TYPE(d, PyGOptionGroup_Type, "OptionGroup");
+
     /* glib version */
     tuple = Py_BuildValue ("(iii)", glib_major_version, glib_minor_version,
 			   glib_micro_version);
@@ -3167,7 +3170,34 @@ init_gobject(void)
     addint(IO_FLAG_GET_MASK);
     addint(IO_FLAG_SET_MASK);
 
+ 
+    addint(OPTION_ERROR_UNKNOWN_OPTION);
+    addint(OPTION_ERROR_BAD_VALUE);
+    addint(OPTION_ERROR_FAILED);
+     
+    addint(OPTION_ARG_NONE);
+    addint(OPTION_ARG_STRING);
+    addint(OPTION_ARG_INT);
+    addint(OPTION_ARG_CALLBACK);
+    addint(OPTION_ARG_FILENAME);
+    addint(OPTION_ARG_STRING_ARRAY);
+    addint(OPTION_ARG_FILENAME_ARRAY);
+
+    addint(OPTION_FLAG_HIDDEN);
+    addint(OPTION_FLAG_IN_MAIN);
+    addint(OPTION_FLAG_REVERSE);
+    addint(OPTION_FLAG_NO_ARG);
+    addint(OPTION_FLAG_FILENAME);
+    addint(OPTION_FLAG_OPTIONAL_ARG);
+    /* addint(OPTION_FLAG_NOALAIS); */
+ 
+    addint(OPTION_ERROR_UNKNOWN_OPTION);
+    addint(OPTION_ERROR_BAD_VALUE);
+    addint(OPTION_ERROR_FAILED);
+ 
 #undef addint
+  
+    PyModule_AddStringConstant(m, "OPTION_REMAINING", G_OPTION_REMAINING);
 
     PyModule_AddIntConstant(m, "SPAWN_LEAVE_DESCRIPTORS_OPEN",
 			    G_SPAWN_LEAVE_DESCRIPTORS_OPEN);
Index: pygobject/gobject/pygobject-private.h
===================================================================
RCS file: /cvs/gnome/gnome-python/pygobject/gobject/pygobject-private.h,v
retrieving revision 1.45
diff -u -p -r1.45 pygobject-private.h
--- pygobject/gobject/pygobject-private.h	11 Apr 2006 21:51:06 -0000	1.45
+++ pygobject/gobject/pygobject-private.h	14 Apr 2006 21:06:19 -0000
@@ -217,4 +217,28 @@ typedef struct
 } PyGPollFD;
 
 
+/* pygoption.c */
+extern PyTypeObject PyGOptionContext_Type;
+extern PyTypeObject PyGOptionGroup_Type;
+
+typedef struct {
+    PyObject_HEAD
+    GHashTable *arg_name_value_map, *arg_name_callback_map;
+    GOptionGroup *group;
+    gboolean other_owner, is_in_context;
+    PyObject *pre_hook, *post_hook, *hooks_arg,
+             *error_hook, *error_hook_arg,
+             *translate_func, *translate_func_arg;
+} PyGOptionGroup;
+
+typedef struct {
+    PyObject_HEAD
+    PyGOptionGroup *main_group;
+    GOptionContext *context;
+} PyGOptionContext;
+
+PyObject * pyg_option_context_new (GOptionContext * context);
+PyObject * pyg_option_group_new (GOptionGroup * group);
+GOptionGroup *pyg_option_group_transfer_group(PyGOptionGroup *self);
+
 #endif
