2 * AT-SPI - Assistive Technology Service Provider Interface
3 * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
5 * Copyright 2001 Sun Microsystems Inc.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
25 #include <libbonobo.h>
26 #include "Magnifier.h"
27 #include "mag_client.h"
29 static CORBA_Environment ev;
31 Accessibility_Magnifier
34 static Accessibility_Magnifier magnifier = NULL;
35 static gboolean is_error = FALSE;
39 if (!magnifier && !is_error)
41 CORBA_exception_init (&ev);
42 obj_id = "OAFIID:Accessibility_Util_Magnifier:proto0.1";
44 oclient = bonobo_activation_activate_from_id (obj_id, 0, NULL, &ev);
45 if (ev._major != CORBA_NO_EXCEPTION) {
47 ("Activation error: during magnifier activation: %s\n"),
48 CORBA_exception_id(&ev));
49 CORBA_exception_free(&ev);
53 if (CORBA_Object_is_nil (oclient, &ev))
55 g_error ("Could not locate magnifier");
59 magnifier = (Accessibility_Magnifier) oclient;
67 magnifier_set_roi(int zoom_region, int x, int y, int w, int h)
69 Accessibility_Magnifier magnifier = get_magnifier();
72 Accessibility_Magnifier_setROI (magnifier,
73 (const CORBA_short) zoom_region,
76 (const CORBA_long) x+w,
77 (const CORBA_long) y+h,
82 magnifier_set_magnification (int zoom_region, float mag_factor_x, float mag_factor_y)
84 Accessibility_Magnifier magnifier = get_magnifier();
87 Accessibility_Magnifier_setMagFactor (magnifier,
88 (const CORBA_short) zoom_region,
89 ((CORBA_float) mag_factor_x),
90 ((CORBA_float) mag_factor_y),