Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-mag/ChangeLog,v
retrieving revision 1.182
diff -u -r1.182 ChangeLog
--- ChangeLog	21 Jul 2006 00:12:48 -0000	1.182
+++ ChangeLog	26 Jul 2006 07:48:44 -0000
@@ -1,3 +1,10 @@
+2006-07-26  Christian Kirbach  <Christian.Kirbach@siemens.com>
+ 
+ 	* configure.in, magnifier-main.c:
+ 	  Do the transition from popt to glib's GOption, one of the current
+ 	  Gnome goals. Require glib>=2.11.1.
+ 	* magnifier.c: Remove obsolete dependency on <popt.h>.
+
 2006-07-20  Carlos Eduardo Rodrigues Diogenes <cerdiogenes@yahoo.com.br>
 
 	* configure.in: bug #341914: Should not force -I/opt/fdo/include
Index: configure.in
===================================================================
RCS file: /cvs/gnome/gnome-mag/configure.in,v
retrieving revision 1.113
diff -u -r1.113 configure.in
--- configure.in	24 Jul 2006 23:12:37 -0000	1.113
+++ configure.in	26 Jul 2006 07:48:45 -0000
@@ -178,7 +178,7 @@
 
 PKG_CHECK_MODULES(LIBDEPS, [
 	ORBit-2.0		>= 2.3.100
-	glib-2.0		>= 1.3.11
+	glib-2.0		>= 2.11.1
 	gmodule-2.0		>= 1.3.11
 	gobject-2.0		>= 1.3.11
 	gthread-2.0		>= 1.3.11
@@ -190,7 +190,7 @@
 	libloginhelper-1.0	>= 1.5.2
 	libbonobo-2.0		>= 1.107.0
 	ORBit-2.0		>= 2.3.100
-	glib-2.0		>= 1.3.11
+	glib-2.0		>= 2.11.1
 	gtk+-2.0		>= 2.1.0
 	gdk-pixbuf-2.0		>= 2.1.0
 	gdk-pixbuf-xlib-2.0	>= 2.1.0
@@ -235,21 +235,6 @@
 LIBBONOBO_IDL_DIR="`$PKG_CONFIG --variable=idldir libbonobo-2.0`"
 AC_SUBST(BONOBO_ACTIVATION_IDL_DIR)
 AC_SUBST(LIBBONOBO_IDL_DIR)
-
-AC_CHECK_LIB(popt, poptGetContext, [POPT_LIBS="-lpopt"],
-AC_MSG_ERROR([popt is required to build gnome-mag.
-You can download the latest version from ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/]))
-AC_SUBST(POPT_LIBS)
-AC_MSG_CHECKING([for POPT_ARG_FLOAT in popt.h])
-AC_TRY_CPP([#include <popt.h>
-#ifndef POPT_ARG_FLOAT
-#error popt too old
-#endif], AC_MSG_RESULT(yes), [
-  AC_MSG_RESULT(no)
-  AC_MSG_ERROR([A newer version of popt is required to build gnome-mag.
-You can download the latest version from ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/])
-])
-
 
 AC_OUTPUT([
 Makefile
Index: magnifier/magnifier-main.c
===================================================================
RCS file: /cvs/gnome/gnome-mag/magnifier/magnifier-main.c,v
retrieving revision 1.36
diff -u -r1.36 magnifier-main.c
--- magnifier/magnifier-main.c	14 Feb 2006 14:05:04 -0000	1.36
+++ magnifier/magnifier-main.c	26 Jul 2006 07:48:45 -0000
@@ -22,7 +22,6 @@
 
 #include <string.h>
 #include <stdlib.h>
-#include <popt.h>
 #include <sys/time.h>
 #include <gdk/gdkwindow.h>
 #include <gdk/gdkx.h>
@@ -100,36 +99,35 @@
 					   0
                                          };
 
-struct poptOption magnifier_options [] = {
-	{"target-display", 't', POPT_ARG_STRING, &global_options.target_display, 't', "specify display on which to show magnified view", NULL},
-	{"source-display", 's', POPT_ARG_STRING, &global_options.source_display, 's', "specify display to magnify", NULL},
-	{"cursor-set", '\0', POPT_ARG_STRING, &global_options.cursor_set, '\0', "cursor set to use in target display", NULL},
-	{"cursor-size", '\0', POPT_ARG_INT, &global_options.cursor_size, '\0', "cursor size to use (overrides cursor-scale-factor)", NULL},
-	{"cursor-scale-factor", '\0', POPT_ARG_FLOAT, &global_options.cursor_scale_factor, '\0', "cursor scale factor", NULL},
-	{"cursor-color", '\0', POPT_ARG_LONG, &global_options.cursor_color, '\0', "cursor color (applied to \'black\' pixels", NULL},
-	{"vertical", 'v', POPT_ARG_NONE, &global_options.vertical_split, 'v', "split screen vertically (if target display = source display)", NULL},
-	{"horizontal", 'h', POPT_ARG_NONE, &global_options.horizontal_split, 'h', "split screen horizontally (if target display = source display)", NULL},
-	{"mouse-follow", 'm', POPT_ARG_NONE, &global_options.mouse_follow, 'm', "track mouse movements", NULL},
-	{"refresh-time", 'r', POPT_ARG_INT, &global_options.refresh_time, 'r', "minimum refresh time for idle, in ms", NULL},
-	{"mouse-latency", '\0', POPT_ARG_INT, &global_options.mouse_poll_time, '\0', "maximum mouse latency time, in ms", NULL},
-	{"zoom-factor", 'z', POPT_ARG_FLOAT, &global_options.zoom_factor, 'z', "zoom (scale) factor used to magnify source display", NULL}, 
-	{"invert-image", 'i', POPT_ARG_NONE, &global_options.invert_image, 'i', "invert the image colormap", NULL}, 
-	{"no-initial-region", '\0', POPT_ARG_NONE, &global_options.no_initial_region, '\0', "don't create an initial zoom region", NULL},
-	{"timing-iterations", '\0', POPT_ARG_INT, &global_options.timing_iterations, '\0', "iterations to run timing benchmark test (0=continuous)", NULL},
-	{"timing-output", '\0', POPT_ARG_NONE, &global_options.timing_output, '\0', "display performance ouput", NULL},
-	{"timing-pan-rate", '\0', POPT_ARG_INT, &global_options.timing_pan_rate, '\0', "timing pan rate in lines per frame", NULL},
-	{"timing-delta-x", '\0', POPT_ARG_INT, &global_options.timing_delta_x, '\0', "pixels to pan in x-dimension each frame in timing update test", NULL},
-	{"timing-delta-y", '\0', POPT_ARG_INT, &global_options.timing_delta_y, '\0', "pixels to pan in y-dimension each frame in timing update test", NULL},
-	{"smoothing-type", '\0', POPT_ARG_STRING, &global_options.smoothing_type, '\0', "image smoothing algorithm to apply (bilinear-interpolation | none)", NULL},
-	{"fullscreen", 'f', POPT_ARG_NONE, &global_options.fullscreen, '\0', "fullscreen magnification, covers entire target display [REQUIRES --source-display and --target-display]", NULL},
-	{"smooth-scrolling", '\0', POPT_ARG_NONE, &global_options.smooth_scroll, '\0', "use smooth scrolling", NULL},
-	{"border-size", 'b', POPT_ARG_INT, &global_options.border_width, '\0', "width of border", NULL},
-	{"border-color", 'c', POPT_ARG_LONG, &global_options.border_color, '\0', "border color specified as (A)RGB 23-bit value, Alpha-MSB", NULL},
-	{"use-test-pattern", '\0', POPT_ARG_NONE, &global_options.test_pattern, '\0', "use test pattern as source", NULL},
-	{"override-redirect", '\0', POPT_ARG_NONE, &global_options.is_override_redirect, '\0', "make the magnifier window totally unmanaged by the window manager", NULL},
-	{"ignore-damage", '\0', POPT_ARG_NONE, &global_options.ignore_damage, '\0', "ignore the X server DAMAGE extension, if present", NULL},
-	POPT_AUTOHELP
-	{NULL, 0, 0, NULL, 0, 0}
+static GOptionEntry magnifier_options [] = {
+	{"target-display", 't', 0, G_OPTION_ARG_STRING, &global_options.target_display, "specify display on which to show magnified view", NULL},
+	{"source-display", 's', 0, G_OPTION_ARG_STRING, &global_options.source_display, "specify display to magnify", NULL},
+	{"cursor-set", '\0', 0, G_OPTION_ARG_STRING, &global_options.cursor_set, "cursor set to use in target display", NULL},
+	{"cursor-size", '\0', 0, G_OPTION_ARG_INT, &global_options.cursor_size, "cursor size to use (overrides cursor-scale-factor)", NULL},
+	{"cursor-scale-factor", '\0', 0, G_OPTION_ARG_DOUBLE, &global_options.cursor_scale_factor, "cursor scale factor", NULL},
+	{"cursor-color", '\0', 0, G_OPTION_ARG_INT64, &global_options.cursor_color, "cursor color (applied to \'black\' pixels", NULL},
+	{"vertical", 'v', 0, G_OPTION_ARG_NONE, &global_options.vertical_split, "split screen vertically (if target display = source display)", NULL},
+	{"horizontal", 'h', 0, G_OPTION_ARG_NONE, &global_options.horizontal_split, "split screen horizontally (if target display = source display)", NULL},
+	{"mouse-follow", 'm', 0, G_OPTION_ARG_NONE, &global_options.mouse_follow, "track mouse movements", NULL},
+	{"refresh-time", 'r', 0, G_OPTION_ARG_INT, &global_options.refresh_time, "minimum refresh time for idle, in ms", NULL},
+	{"mouse-latency", '\0', 0, G_OPTION_ARG_INT, &global_options.mouse_poll_time, "maximum mouse latency time, in ms", NULL},
+	{"zoom-factor", 'z', 0, G_OPTION_ARG_DOUBLE, &global_options.zoom_factor, "zoom (scale) factor used to magnify source display", NULL}, 
+	{"invert-image", 'i', 0, G_OPTION_ARG_NONE, &global_options.invert_image, "invert the image colormap", NULL}, 
+	{"no-initial-region", '\0', 0, G_OPTION_ARG_NONE, &global_options.no_initial_region, "don't create an initial zoom region", NULL},
+	{"timing-iterations", '\0', 0, G_OPTION_ARG_INT, &global_options.timing_iterations, "iterations to run timing benchmark test (0=continuous)", NULL},
+	{"timing-output", '\0', 0, G_OPTION_ARG_NONE, &global_options.timing_output, "display performance ouput", NULL},
+	{"timing-pan-rate", '\0', 0, G_OPTION_ARG_INT, &global_options.timing_pan_rate, "timing pan rate in lines per frame", NULL},
+	{"timing-delta-x", '\0', 0, G_OPTION_ARG_INT, &global_options.timing_delta_x, "pixels to pan in x-dimension each frame in timing update test", NULL},
+	{"timing-delta-y", '\0', 0, G_OPTION_ARG_INT, &global_options.timing_delta_y, "pixels to pan in y-dimension each frame in timing update test", NULL},
+	{"smoothing-type", '\0', 0, G_OPTION_ARG_STRING, &global_options.smoothing_type, "image smoothing algorithm to apply (bilinear-interpolation | none)", NULL},
+	{"fullscreen", 'f', 0, G_OPTION_ARG_NONE, &global_options.fullscreen, "fullscreen magnification, covers entire target display [REQUIRES --source-display and --target-display]", NULL},
+	{"smooth-scrolling", '\0', 0, G_OPTION_ARG_NONE, &global_options.smooth_scroll, "use smooth scrolling", NULL},
+	{"border-size", 'b', 0, G_OPTION_ARG_INT, &global_options.border_width, "width of border", NULL},
+	{"border-color", 'c', 0, G_OPTION_ARG_INT64, &global_options.border_color, "border color specified as (A)RGB 23-bit value, Alpha-MSB", NULL},
+	{"use-test-pattern", '\0', 0, G_OPTION_ARG_NONE, &global_options.test_pattern, "use test pattern as source", NULL},
+	{"override-redirect", '\0', 0, G_OPTION_ARG_NONE, &global_options.is_override_redirect, "make the magnifier window totally unmanaged by the window manager", NULL},
+	{"ignore-damage", '\0', 0, G_OPTION_ARG_NONE, &global_options.ignore_damage, "ignore the X server DAMAGE extension, if present", NULL},
+	{NULL}
 };
 
 static void
@@ -343,7 +341,7 @@
 int
 main (int argc, char** argv)
 {
-  poptContext ctx;
+  GOptionContext *context;
   GNOME_Magnifier_RectBounds *roi = GNOME_Magnifier_RectBounds__alloc();
   GNOME_Magnifier_RectBounds *viewport = GNOME_Magnifier_RectBounds__alloc();
   CORBA_any *viewport_any;
@@ -359,16 +357,10 @@
   }
   CORBA_exception_init (&ev);
   
-  ctx = poptGetContext ("magnifier",
-			argc,
-			(const char **)argv,
-			magnifier_options,
-			0);
-
-  while (poptGetNextOpt (ctx) >= 0)
-	/**/;
-
-  poptFreeContext (ctx);
+  context = g_option_context_new ("- screen magnifier");
+  g_option_context_add_main_entries(context, magnifier_options, "main options");
+  g_option_context_parse(context, &argc, &argv, NULL);
+  g_option_context_free(context);
 
   /** 
    * slight hack, we set $DISPLAY if --target-display is set.
Index: magnifier/magnifier.c
===================================================================
RCS file: /cvs/gnome/gnome-mag/magnifier/magnifier.c,v
retrieving revision 1.66
diff -u -r1.66 magnifier.c
--- magnifier/magnifier.c	17 Apr 2006 18:24:54 -0000	1.66
+++ magnifier/magnifier.c	26 Jul 2006 07:48:46 -0000
@@ -24,7 +24,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <strings.h>
-#include <popt.h>
 #include <gdk/gdk.h>
 #include <gdk-pixbuf/gdk-pixbuf-io.h>
 #include <libbonobo.h>
