00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include "config.h"
00024 #include "magnifier.h"
00025 #include "magnifier-private.h"
00026 #include "zoom-region.h"
00027 #include "gmag-graphical-server.h"
00028 #include "GNOME_Magnifier.h"
00029
00030 #include <string.h>
00031 #include <stdlib.h>
00032 #include <sys/time.h>
00033
00034 #include <gdk/gdkwindow.h>
00035 #include <gdk/gdkx.h>
00036 #include <gtk/gtk.h>
00037
00038 #include <libbonobo.h>
00039
00040 #define ENV_STRING_MAX_SIZE 128
00041
00042 GNOME_Magnifier_ZoomRegion zoom_region;
00043
00044 typedef struct {
00045 gchar *target_display;
00046 gchar *source_display;
00047 gchar *cursor_set;
00048 gchar *smoothing_type;
00049 gdouble zoom_factor;
00050 gdouble zoom_factor_x;
00051 gdouble zoom_factor_y;
00052 gint refresh_time;
00053 gint mouse_poll_time;
00054 gint cursor_size;
00055 gdouble cursor_scale_factor;
00056 gint64 cursor_color;
00057 gboolean vertical_split;
00058 gboolean horizontal_split;
00059 gboolean fullscreen;
00060 gboolean mouse_follow;
00061 gboolean invert_image;
00062 gboolean no_initial_region;
00063 gint timing_iterations;
00064 gboolean timing_output;
00065 gint timing_delta_x;
00066 gint timing_delta_y;
00067 gint timing_pan_rate;
00068 gboolean smooth_scroll;
00069 gint border_width;
00070 gint64 border_color;
00071 gboolean test_pattern;
00072 gboolean is_override_redirect;
00073 gboolean ignore_damage;
00074 #ifdef HAVE_COMPOSITE
00075 gboolean ignore_composite;
00076 #endif
00077 gboolean print_version;
00078 } MagnifierOptions;
00079
00080 static MagnifierOptions global_options = { NULL,
00081 NULL,
00082 "default",
00083 "none",
00084 2.0,
00085 0.0,
00086 0.0,
00087 500,
00088 50,
00089 0,
00090 0.0F,
00091 0xFF000000,
00092 0,
00093 0,
00094 0,
00095 0,
00096 0,
00097 0,
00098 0,
00099 0,
00100 10,
00101 10,
00102 0,
00103 1,
00104 0,
00105 0,
00106 0,
00107 0,
00108 0
00109 #ifdef HAVE_COMPOSITE
00110 ,0
00111 #endif
00112 ,0
00113 };
00114
00115 static GOptionEntry magnifier_options [] = {
00116 {"target-display", 't', 0, G_OPTION_ARG_STRING, &global_options.target_display, "specify display on which to show magnified view", NULL},
00117 {"source-display", 's', 0, G_OPTION_ARG_STRING, &global_options.source_display, "specify display to magnify", NULL},
00118 {"cursor-set", 0, 0, G_OPTION_ARG_STRING, &global_options.cursor_set, "cursor set to use in target display", NULL},
00119 {"cursor-size", 0, 0, G_OPTION_ARG_INT, &global_options.cursor_size, "cursor size to use (overrides cursor-scale-factor)", NULL},
00120 {"cursor-scale-factor", 0, 0, G_OPTION_ARG_DOUBLE, &global_options.cursor_scale_factor, "cursor scale factor", NULL},
00121 {"cursor-color", 0, 0, G_OPTION_ARG_INT64, &global_options.cursor_color, "cursor color (applied to \'black\' pixels)", NULL},
00122 {"vertical", 'v', 0, G_OPTION_ARG_NONE, &global_options.vertical_split, "split screen vertically (if target display = source display)", NULL},
00123 {"horizontal", 'h', 0, G_OPTION_ARG_NONE, &global_options.horizontal_split, "split screen horizontally (if target display = source display)", NULL},
00124 {"mouse-follow", 'm', 0, G_OPTION_ARG_NONE, &global_options.mouse_follow, "track mouse movements", NULL},
00125 {"refresh-time", 'r', 0, G_OPTION_ARG_INT, &global_options.refresh_time, "minimum refresh time for idle, in ms", NULL},
00126 {"mouse-latency", 0, 0, G_OPTION_ARG_INT, &global_options.mouse_poll_time, "maximum mouse latency time, in ms", NULL},
00127 {"zoom-factor", 'z', 0, G_OPTION_ARG_DOUBLE, &global_options.zoom_factor, "zoom (scale) factor used to magnify source display", NULL},
00128 {"invert-image", 'i', 0, G_OPTION_ARG_NONE, &global_options.invert_image, "invert the image colormap", NULL},
00129 {"no-initial-region", 0, 0, G_OPTION_ARG_NONE, &global_options.no_initial_region, "don't create an initial zoom region", NULL},
00130 {"timing-iterations", 0, 0, G_OPTION_ARG_INT, &global_options.timing_iterations, "iterations to run timing benchmark test (0=continuous)", NULL},
00131 {"timing-output", 0, 0, G_OPTION_ARG_NONE, &global_options.timing_output, "display performance ouput", NULL},
00132 {"timing-pan-rate", 0, 0, G_OPTION_ARG_INT, &global_options.timing_pan_rate, "timing pan rate in lines per frame", NULL},
00133 {"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},
00134 {"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},
00135 {"smoothing-type", 0, 0, G_OPTION_ARG_STRING, &global_options.smoothing_type, "image smoothing algorithm to apply (bilinear-interpolation | none)", NULL},
00136 {"fullscreen", 'f', 0, G_OPTION_ARG_NONE, &global_options.fullscreen, "fullscreen magnification, covers entire target display [REQUIRES --source-display and --target-display]", NULL},
00137 {"smooth-scrolling", 0, 0, G_OPTION_ARG_NONE, &global_options.smooth_scroll, "use smooth scrolling", NULL},
00138 {"border-size", 'b', 0, G_OPTION_ARG_INT, &global_options.border_width, "width of border", NULL},
00139 {"border-color", 'c', 0, G_OPTION_ARG_INT64, &global_options.border_color, "border color specified as (A)RGB 23-bit value, Alpha-MSB", NULL},
00140 {"use-test-pattern", 0, 0, G_OPTION_ARG_NONE, &global_options.test_pattern, "use test pattern as source", NULL},
00141 {"override-redirect", 0, 0, G_OPTION_ARG_NONE, &global_options.is_override_redirect, "make the magnifier window totally unmanaged by the window manager", NULL},
00142 {"ignore-damage", 0, 0, G_OPTION_ARG_NONE, &global_options.ignore_damage, "ignore the X server DAMAGE extension, if present", NULL},
00143 #ifdef HAVE_COMPOSITE
00144 {"ignore-composite", 0, 0, G_OPTION_ARG_NONE, &global_options.ignore_composite, "ignore the X server COMPOSITE extension, if present", NULL},
00145 #endif
00146 {"version", 0, 0, G_OPTION_ARG_NONE, &global_options.print_version, "print version", NULL},
00147 {NULL}
00148 };
00149
00150 static void
00151 init_rect_bounds (GNOME_Magnifier_RectBounds *bounds,
00152 long x1, long y1, long x2, long y2)
00153 {
00154 bounds->x1 = x1;
00155 bounds->y1 = y1;
00156 bounds->x2 = x2;
00157 bounds->y2 = y2;
00158 }
00159
00160 static int screen_width, screen_height;
00161
00162 static int
00163 magnifier_main_test_image (gpointer data)
00164 {
00165 static long timing_counter = 0;
00166 static int timing_x_pos = 0;
00167 static int timing_y_pos = 0;
00168 static int x_direction = 1;
00169 static int y_direction = 1;
00170 Magnifier *magnifier = (Magnifier *) data;
00171 GNOME_Magnifier_ZoomRegionList *zoom_regions;
00172 Bonobo_PropertyBag properties;
00173 CORBA_Environment ev;
00174 GNOME_Magnifier_RectBounds roi;
00175 int x_roi, y_roi;
00176
00177
00178 if (global_options.timing_iterations > 0) {
00179 if (timing_counter > global_options.timing_iterations) {
00180 CORBA_exception_init (&ev);
00181 properties = GNOME_Magnifier_ZoomRegion_getProperties (zoom_region, &ev);
00182 if (BONOBO_EX (&ev))
00183 fprintf (stderr, "EXCEPTION\n");
00184
00185 bonobo_pbclient_set_boolean (properties, "exit-magnifier",
00186 TRUE, &ev);
00187 }
00188 }
00189
00190 CORBA_exception_init (&ev);
00191
00192 x_roi = global_options.timing_delta_x * timing_x_pos;
00193 roi.x1 = x_roi;
00194 roi.x2 = (screen_width / global_options.zoom_factor) + roi.x1;
00195 x_roi = global_options.timing_delta_x * (timing_x_pos + x_direction);
00196
00197
00198 if (x_roi + (screen_width / global_options.zoom_factor) > screen_width)
00199 x_direction = -1;
00200 else if (x_roi < 0)
00201 x_direction = 1;
00202
00203 timing_x_pos += x_direction;
00204
00205 y_roi = global_options.timing_delta_y * timing_y_pos;
00206
00207
00208 if (global_options.horizontal_split)
00209 roi.y1 = y_roi + screen_height;
00210 else
00211 roi.y1 = y_roi;
00212 roi.y2 = (screen_height / global_options.zoom_factor) + roi.y1;
00213
00214 y_roi = global_options.timing_delta_y * (timing_y_pos + y_direction);
00215
00216
00217 if (y_roi + (screen_height / global_options.zoom_factor) > screen_height) {
00218 timing_counter++;
00219 y_direction = -1;
00220 }
00221 else if (y_roi < 0) {
00222 timing_counter++;
00223 y_direction = 1;
00224 }
00225
00226 timing_y_pos += y_direction;
00227
00228 if (!IS_MAGNIFIER (magnifier))
00229 return FALSE;
00230
00231 magnifier->priv->cursor_x = (roi.x2 + roi.x1) / 2;
00232 magnifier->priv->cursor_y = (roi.y2 + roi.y1) / 2;
00233
00234 zoom_regions =
00235 GNOME_Magnifier_Magnifier_getZoomRegions (
00236 BONOBO_OBJREF (magnifier),
00237 &ev);
00238
00239 if (zoom_regions && (zoom_regions->_length > 0)) {
00240
00241 GNOME_Magnifier_ZoomRegion_setROI (
00242 zoom_regions->_buffer[0], &roi, &ev);
00243 }
00244
00245 return TRUE;
00246 }
00247
00248 static int last_x = 0, last_y = 0;
00249
00250 static int
00251 magnifier_main_pan_image (gpointer data)
00252 {
00253 Magnifier *magnifier = (Magnifier *) data;
00254 GNOME_Magnifier_ZoomRegionList *zoom_regions;
00255 GNOME_Magnifier_ZoomRegion zoom_region;
00256 CORBA_Environment ev;
00257 GNOME_Magnifier_RectBounds roi;
00258 int mouse_x_return, mouse_y_return;
00259 int w, h;
00260 GdkModifierType mask_return;
00261
00262 CORBA_exception_init (&ev);
00263
00264 if (global_options.mouse_follow && IS_MAGNIFIER (magnifier))
00265 {
00266 gdk_window_get_pointer (
00267 magnifier_get_root (magnifier),
00268 &mouse_x_return,
00269 &mouse_y_return,
00270 &mask_return);
00271
00272 if (last_x != mouse_x_return || last_y != mouse_y_return)
00273 {
00274 last_x = mouse_x_return;
00275 last_y = mouse_y_return;
00276 w = (magnifier->target_bounds.x2 - magnifier->target_bounds.x1);
00277 h = (magnifier->target_bounds.y2 - magnifier->target_bounds.y1);
00278 roi.x1 = mouse_x_return;
00279 roi.y1 = mouse_y_return;
00280 roi.x2 = roi.x1 + 1;
00281 roi.y2 = roi.y1 + 1;
00282
00283 zoom_regions =
00284 GNOME_Magnifier_Magnifier_getZoomRegions (
00285 BONOBO_OBJREF (magnifier),
00286 &ev);
00287 if (zoom_regions && (zoom_regions->_length > 0))
00288 {
00289 int i;
00290 for (i = 0; i < zoom_regions->_length; ++i)
00291 {
00292
00293 zoom_region =
00294 CORBA_Object_duplicate (
00295 ( (CORBA_Object *)
00296 (zoom_regions->_buffer))[i], &ev);
00297 if (zoom_region != CORBA_OBJECT_NIL) {
00298 GNOME_Magnifier_ZoomRegion_setROI (zoom_region,
00299 &roi,
00300 &ev);
00301 } else fprintf (stderr, "nil region!\n");
00302 }
00303 }
00304 }
00305 return TRUE;
00306 }
00307
00308 return FALSE;
00309 }
00310
00311 static int
00312 magnifier_main_refresh_all (gpointer data)
00313 {
00314 int i;
00315 Magnifier *magnifier = data;
00316 CORBA_any *dirty_bounds_any;
00317 CORBA_Environment ev;
00318 Bonobo_PropertyBag properties;
00319 GNOME_Magnifier_RectBounds *dirty_bounds;
00320 GNOME_Magnifier_ZoomRegionList *regions;
00321
00322 CORBA_exception_init (&ev);
00323
00324 if (!IS_MAGNIFIER (magnifier))
00325 return FALSE;
00326
00327 regions = GNOME_Magnifier_Magnifier_getZoomRegions (
00328 BONOBO_OBJREF (magnifier),
00329 &ev);
00330
00331 #ifdef DEBUG_REFRESH
00332 fprintf (stderr, "refreshing %d regions\n", regions->_length);
00333 #endif
00334
00335 properties = GNOME_Magnifier_Magnifier_getProperties (BONOBO_OBJREF (magnifier), &ev);
00336
00337 dirty_bounds_any = Bonobo_PropertyBag_getValue (properties, "source-display-bounds", &ev);
00338 if (BONOBO_EX (&ev)) {
00339 g_warning ("Error getting source-display-bounds");
00340 bonobo_main_quit ();
00341 return FALSE;
00342 }
00343
00344 dirty_bounds = (GNOME_Magnifier_RectBounds *) dirty_bounds_any->_value;
00345
00346 fprintf (stderr, "region to update: %d %d %d %d\n",
00347 dirty_bounds->x1, dirty_bounds->y1, dirty_bounds->x2, dirty_bounds->y2);
00348
00349 for (i = 0; i < regions->_length; ++i)
00350 GNOME_Magnifier_ZoomRegion_markDirty (
00351 regions->_buffer [i], dirty_bounds, &ev);
00352
00353 bonobo_object_release_unref (properties, NULL);
00354
00355 return TRUE;
00356 }
00357
00358 int
00359 main (int argc, char** argv)
00360 {
00361 GOptionContext *context;
00362 GNOME_Magnifier_RectBounds *roi = GNOME_Magnifier_RectBounds__alloc();
00363 GNOME_Magnifier_RectBounds *viewport = GNOME_Magnifier_RectBounds__alloc();
00364 CORBA_any *viewport_any;
00365 int x = 0, y = 0, fullwidth, fullheight;
00366 guint pan_handle = 0, refresh_handle = 0;
00367 CORBA_Environment ev;
00368 Bonobo_PropertyBag properties;
00369
00370 Magnifier *magnifier;
00371
00372 if (!bonobo_init (&argc, argv)) {
00373 g_error ("Could not initialize Bonobo");
00374 }
00375 CORBA_exception_init (&ev);
00376
00377 context = g_option_context_new ("- a screen magnifier for Gnome");
00378 g_option_context_set_description (context, "Report bugs to http://bugzilla.gnome.org\n");
00379 g_option_context_add_main_entries (context, magnifier_options, "main options");
00380 g_option_context_set_ignore_unknown_options (context, TRUE);
00381 g_option_context_parse(context, &argc, &argv, NULL);
00382 g_option_context_free(context);
00383
00384 if (global_options.print_version) {
00385 g_print ("%s\n", VERSION);
00386 return 0;
00387 }
00388
00394 if (global_options.target_display) {
00395 gchar *string;
00396 string = g_strconcat ("DISPLAY=", global_options.target_display, NULL);
00397 putenv (string);
00398 } else {
00399 global_options.target_display = getenv ("DISPLAY");
00400 if (!global_options.target_display) {
00401 fprintf (stderr, _("Can't open display, DISPLAY is not set"));
00402 exit (1);
00403 }
00404 }
00405
00406 if (!global_options.source_display) {
00407 global_options.source_display = global_options.target_display;
00408 }
00409
00410 if (global_options.timing_pan_rate && global_options.timing_iterations == 0)
00411 {
00412 g_error ("Must specify timing_iterations when running pan test");
00413 }
00414
00415
00416 gtk_init (&argc, &argv);
00417
00418 if (global_options.ignore_damage)
00419 {
00420 g_setenv ("MAGNIFIER_IGNORE_DAMAGE", "1", TRUE);
00421 }
00422 #ifdef HAVE_COMPOSITE
00423 if (global_options.ignore_composite) {
00424 g_setenv ("MAGNIFIER_IGNORE_COMPOSITE", "1", TRUE);
00425 }
00426 #endif
00427
00428 magnifier = magnifier_new (global_options.is_override_redirect);
00429
00430 properties = GNOME_Magnifier_Magnifier_getProperties (
00431 BONOBO_OBJREF (magnifier), &ev);
00432 if (ev._major != CORBA_NO_EXCEPTION) fprintf (stderr, "EXCEPTION\n");
00433
00434 if (global_options.source_display)
00435 bonobo_pbclient_set_string (properties, "source-display-screen",
00436 global_options.source_display, NULL);
00437
00438 if (global_options.target_display)
00439 bonobo_pbclient_set_string (properties, "target-display-screen",
00440 global_options.target_display, NULL);
00441
00442 if (global_options.cursor_set)
00443 bonobo_pbclient_set_string (properties, "cursor-set",
00444 global_options.cursor_set, NULL);
00445
00446 if (global_options.cursor_size)
00447 bonobo_pbclient_set_long (properties, "cursor-size",
00448 global_options.cursor_size, NULL);
00449
00450 else if (global_options.cursor_scale_factor != 0.0F)
00451 bonobo_pbclient_set_float (properties, "cursor-scale-factor",
00452 global_options.cursor_scale_factor, NULL);
00453 else
00454 bonobo_pbclient_set_float (properties, "cursor-scale-factor",
00455 global_options.zoom_factor, NULL);
00456
00457 if (global_options.cursor_color)
00458 bonobo_pbclient_set_ulong (properties, "cursor-color",
00459 global_options.cursor_color,
00460 NULL);
00461
00462 fullwidth = screen_width = gdk_screen_get_width (
00463 gdk_display_get_screen (magnifier->target_display,
00464 magnifier->target_screen_num));
00465 fullheight = screen_height = gdk_screen_get_height (
00466 gdk_display_get_screen (magnifier->target_display,
00467 magnifier->target_screen_num));
00468
00469 if (global_options.vertical_split) {
00470 screen_width /= 2;
00471 x = screen_width;
00472 }
00473 if (global_options.horizontal_split) {
00474 screen_height /= 2;
00475 y = screen_height;
00476 }
00477
00478 fprintf (stderr, "initial viewport %d %d\n", (int) screen_width,
00479 (int) screen_height);
00480
00481
00482 if (global_options.vertical_split || global_options.horizontal_split ||
00483 global_options.fullscreen) {
00484 init_rect_bounds (viewport, x, y, x + screen_width,
00485 y + screen_height);
00486 viewport_any = bonobo_arg_new_from (TC_GNOME_Magnifier_RectBounds,
00487 viewport);
00488
00489 bonobo_pbclient_set_value (properties, "target-display-bounds",
00490 viewport_any, &ev);
00491 bonobo_arg_release (viewport_any);
00492 }
00493
00494 if (global_options.vertical_split || global_options.horizontal_split)
00495 {
00496 #ifdef HAVE_COMPOSITE
00497 if (!g_getenv ("MAGNIFIER_IGNORE_COMPOSITE"))
00498 init_rect_bounds (viewport, 0, 0, fullwidth, fullheight);
00499 else
00500 #endif
00501 init_rect_bounds (viewport, 0, 0, fullwidth-x, fullheight-y);
00502 viewport_any = bonobo_arg_new_from (TC_GNOME_Magnifier_RectBounds, viewport);
00503 bonobo_pbclient_set_value (properties, "source-display-bounds",
00504 viewport_any,
00505 &ev);
00506
00507 bonobo_arg_release (viewport_any);
00508 } else if (global_options.fullscreen) {
00509 init_rect_bounds (viewport, 0, 0, fullwidth, fullheight);
00510 viewport_any = bonobo_arg_new_from (TC_GNOME_Magnifier_RectBounds,
00511 viewport);
00512 bonobo_pbclient_set_value (properties, "source-display-bounds",
00513 viewport_any,
00514 &ev);
00515 bonobo_arg_release (viewport_any);
00516 }
00517
00518 bonobo_object_release_unref (properties, NULL);
00519 properties = NULL;
00520
00521 if (global_options.vertical_split ||
00522 global_options.horizontal_split ||
00523 global_options.fullscreen)
00524 {
00525 int scroll_policy;
00526
00527 init_rect_bounds (roi, 0, 0,
00528 screen_width / global_options.zoom_factor,
00529 screen_height / global_options.zoom_factor);
00530 init_rect_bounds (viewport, 0, 0, screen_width, screen_height);
00531 zoom_region =
00532 GNOME_Magnifier_Magnifier_createZoomRegion (
00533 BONOBO_OBJREF (magnifier),
00534 global_options.zoom_factor,
00535 global_options.zoom_factor,
00536 roi,
00537 viewport,
00538 &ev);
00539
00540 properties = GNOME_Magnifier_ZoomRegion_getProperties (zoom_region, &ev);
00541 if (BONOBO_EX (&ev))
00542 fprintf (stderr, "EXCEPTION\n");
00543
00544 scroll_policy = global_options.smooth_scroll ?
00545 GNOME_Magnifier_ZoomRegion_SCROLL_SMOOTHEST :
00546 GNOME_Magnifier_ZoomRegion_SCROLL_FASTEST;
00547
00548 bonobo_pbclient_set_long (properties, "timing-iterations",
00549 global_options.timing_iterations, &ev);
00550 bonobo_pbclient_set_boolean (properties, "timing-output",
00551 global_options.timing_output, &ev);
00552 bonobo_pbclient_set_long (properties, "timing-pan-rate",
00553 global_options.timing_pan_rate, &ev);
00554 bonobo_pbclient_set_long (properties, "border-size",
00555 global_options.border_width, &ev);
00556 bonobo_pbclient_set_long (properties, "border-color",
00557 global_options.border_color, &ev);
00558 bonobo_pbclient_set_short (properties, "smooth-scroll-policy",
00559 (short) scroll_policy, &ev);
00560 bonobo_pbclient_set_boolean (properties, "use-test-pattern",
00561 global_options.test_pattern, &ev);
00562
00563 if (strcmp (global_options.smoothing_type, "none"))
00564 bonobo_pbclient_set_string (properties, "smoothing-type",
00565 global_options.smoothing_type, &ev);
00566
00567 if (global_options.invert_image)
00568 bonobo_pbclient_set_boolean (properties, "inverse-video",
00569 global_options.invert_image, NULL);
00570
00571 GNOME_Magnifier_Magnifier_addZoomRegion (
00572 BONOBO_OBJREF (magnifier),
00573 zoom_region,
00574 &ev);
00575
00576 bonobo_object_release_unref (properties, &ev);
00577 properties = NULL;
00578 }
00579
00580 if (global_options.timing_pan_rate)
00581 {
00582 GNOME_Magnifier_ZoomRegionList *zoom_regions;
00583 GNOME_Magnifier_RectBounds roi;
00584 roi.x1 = 100;
00585 roi.x2 = 100 + (screen_width / global_options.zoom_factor);
00586 roi.y1 = 0;
00587 roi.y2 = screen_height / global_options.zoom_factor;
00588
00589 zoom_regions = GNOME_Magnifier_Magnifier_getZoomRegions (
00590 BONOBO_OBJREF (magnifier), &ev);
00591
00592 if (zoom_regions && (zoom_regions->_length > 0))
00593 {
00594 GNOME_Magnifier_ZoomRegion_setROI (
00595 zoom_regions->_buffer[0], &roi, &ev);
00596 }
00597 }
00598 else if (global_options.timing_iterations)
00599 {
00600 refresh_handle = g_timeout_add (global_options.refresh_time,
00601 magnifier_main_test_image,
00602 magnifier);
00603 }
00604 else
00605 {
00606 if (global_options.ignore_damage ||
00607 !gmag_gs_source_has_damage_extension (magnifier))
00608 {
00609 refresh_handle = g_timeout_add (
00610 global_options.refresh_time,
00611 magnifier_main_refresh_all, magnifier);
00612 }
00613
00614 pan_handle = g_timeout_add (
00615 global_options.mouse_poll_time,
00616 magnifier_main_pan_image, magnifier);
00617 }
00618
00619 bonobo_main ();
00620
00621 if (refresh_handle)
00622 g_source_remove (refresh_handle);
00623
00624 if (pan_handle)
00625 g_source_remove (pan_handle);
00626
00627 return 0;
00628 }