diff options
author | Bill Haneman <billh@src.gnome.org> | 2006-07-24 23:12:39 +0000 |
---|---|---|
committer | Bill Haneman <billh@src.gnome.org> | 2006-07-24 23:12:39 +0000 |
commit | 414b577fa2f57105c2b5aef9fc7bc152b06036ce (patch) | |
tree | c1fe7bea9faaa6d2d5e0493abeebffeead9d9970 | |
parent | dbab1b8ce14c0fb9125232e6e3f995076bf1af50 (diff) |
Fix merge problems with 0.13.0 - reinstate the new get/setContrast API,
dist 0.13.1.
-rw-r--r-- | Makefile.am | 4 | ||||
-rw-r--r-- | NEWS | 6 | ||||
-rw-r--r-- | configure.in | 3 | ||||
-rw-r--r-- | idl/GNOME_Magnifier.idl | 43 | ||||
-rw-r--r-- | idl/Makefile.am | 1 | ||||
-rw-r--r-- | magnifier/Makefile.am | 11 | ||||
-rw-r--r-- | magnifier/zoom-region.c | 83 | ||||
-rw-r--r-- | magnifier/zoom-region.h | 1 | ||||
-rw-r--r-- | test/control-client.c | 14 |
9 files changed, 136 insertions, 30 deletions
diff --git a/Makefile.am b/Makefile.am index 09bb5f1..ce833a0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -14,6 +14,10 @@ doc_tarball_files = \ docs/reference/html DISTCLEANFILES = intltool-extract \ + intltool-merge \ + intltool-update + +DISTCLEANFILES = intltool-extract \ intltool-merge \ intltool-update @@ -19,6 +19,12 @@ What's new in gnome-mag-0.12.5: * Fixes for #338551, #341854, #341883, #341888. +What's new in gnome-mag-0.12.4: + +* Use doxygen to build idl docs, if available. +* Fixes to prevent unnecessary repaints, and reallocate the scaled pixbuf + if the source bounds change (from Carlos Diogenes), bug #171465. + What's new in gnome-mag-0.12.2: * Fix for serious update bug which made high magnification factors work diff --git a/configure.in b/configure.in index 485502e..69ef620 100644 --- a/configure.in +++ b/configure.in @@ -18,8 +18,9 @@ dnl below should change if the interface has additions, changes, removals. GNOME_MAG_CURRENT=`expr $GNOME_MAG_MINOR_VERSION - $GNOME_MAG_INTERFACE_AGE` dnl increment any time the source you release changes; set to -dnl 0 if you increment CURRENT; increment only after the cvs commit; +dnl 0 if you increment CURRENT GNOME_MAG_REVISION=1 + GNOME_MAG_MICRO_VERSION=$GNOME_MAG_REVISION dnl increment if any interfaces have been added; set to 0 diff --git a/idl/GNOME_Magnifier.idl b/idl/GNOME_Magnifier.idl index 8eedc36..9dd25bc 100644 --- a/idl/GNOME_Magnifier.idl +++ b/idl/GNOME_Magnifier.idl @@ -39,15 +39,6 @@ module GNOME { interface ZoomRegion : Bonobo::Unknown { - /** - * Enum of the possible align policies. - * These represents the possible align policies in the magnifier. - * The default is ALIGN_CENTER, i.e., the pointer will always stay - * in the center of the magnified area. ALIGN_MIN defines that the - * pointer will be in the left superior corner of the magnified - * area and ALIGN_MAX defines that the pointer will be in the right - * inferior corner of the magnified area. - */ enum AlignPolicy { ALIGN_CENTER, ALIGN_MIN, @@ -78,8 +69,8 @@ module GNOME { /** * Get the current x and y magnification ratios. * (Convenience method for getting mag-factor-x and mag-factor-y properties). - * @param magX the magnification factor in the x direction for the specified region. - * @param magY the magnification factor in the x direction for the specified region. + * @param magX: the magnification factor in the x direction for the specified region. + * @param magY: the magnification factor in the x direction for the specified region. **/ void getMagFactor (out float magX, out float magY); @@ -94,7 +85,7 @@ module GNOME { /** * Set the region of interest for the magnifier. - * @param bounds the ROI bounding box + * @param bounds: the ROI bounding box **/ oneway void setROI (in RectBounds bounds); @@ -102,7 +93,7 @@ module GNOME { * Mark the zoom region or a sub-region 'dirty' and in need of updating. * @note This region will be clipped to the area currently visible in * the target region. - * @param dirtyRegion the bounding box of the dirty region. + * @param dirtyRegion: the bounding box of the dirty region. **/ void markDirty (in RectBounds dirtyRegion); @@ -115,11 +106,24 @@ module GNOME { /** * Move and resize the specified zoom region on the target display. * (Convenience method for setting "viewport" property). - * @param bounds the bounding box, in target display coordinates, of the ZoomRegion's + * @param bounds: the bounding box, in target display coordinates, of the ZoomRegion's * display viewport. **/ void moveResize (in RectBounds bounds); + /** + * Remove the specified zoom region from the magnifier and destroy it. + **/ + void dispose (); + + /** + * Set the position where the mouse pointer is to be drawn + * in this zoom-region, in screen coordinates. + * @param mouse_x: the x screen coordinate of the pointer hotspot + * @param mouse_y: the y screen coordinate of the pointer hotspot + **/ + oneway void setPointerPos (in long mouse_x, in long mouse_y); + /** * Set the zoom region image contrast. * @param R the amount of red in the contrasted image. @@ -136,11 +140,6 @@ module GNOME { **/ void getContrast (out float R, out float G, out float B); - /** - * Remove the specified zoom region from the magnifier and destroy it. - **/ - void dispose (); - }; typedef sequence<ZoomRegion> ZoomRegionList; @@ -172,9 +171,9 @@ module GNOME { * Create a new zoom region for the magnifier. * The new region is initially 'unmanaged'; that is, it is not associated with * a particular sub-region of the "source" display. - * @param zx the scale factor in the x direction for the new zoom region - * @param zy the scale factor in the y direction for the new zoom region - * @param ROI the initial ROI of the zoom region. RectBounds of negative width/height + * @param zx: the scale factor in the x direction for the new zoom region + * @param zy: the scale factor in the y direction for the new zoom region + * @param ROI: the initial ROI of the zoom region. RectBounds of negative width/height * indicates that the zoom region has no initial ROI. * @param viewport: the initial bounds of the ZoomRegion's viewport, in * the target display coordinate system. diff --git a/idl/Makefile.am b/idl/Makefile.am index 451741b..9ef2c90 100644 --- a/idl/Makefile.am +++ b/idl/Makefile.am @@ -3,3 +3,4 @@ idl_DATA = GNOME_Magnifier.idl EXTRA_DIST=$(idl_DATA) +CLEANFILES =
\ No newline at end of file diff --git a/magnifier/Makefile.am b/magnifier/Makefile.am index 4d7e776..ad4e077 100644 --- a/magnifier/Makefile.am +++ b/magnifier/Makefile.am @@ -1,5 +1,3 @@ -NULL = - Cursorsdir = $(datadir)/gnome-mag lib_LTLIBRARIES = libgnome-mag.la @@ -21,7 +19,7 @@ libgnome_mag_la_LIBADD = $(LIBDEPS_LIBS) libgnomemagincludedir=$(includedir)/gnome-mag-1.0/magnifier libgnomemaginclude_HEADERS=GNOME_Magnifier.h -AM_CFLAGS = $(CFLAGS) $(DEPS_CFLAGS) +AM_CFLAGS = $(CFLAGS) $(DEPS_CFLAGS) $(X_FLAGS) magnifier_SOURCES = magnifier-main.c \ magnifier.c \ @@ -52,6 +50,7 @@ IDL = $(top_srcdir)/idl/GNOME_Magnifier.idl BUILT_SOURCES = $(IDL_OUT) CLEANFILES = $(IDL_OUT) +DISTCLEANFILES = $(IDL_OUT) magnifier.h : GNOME_Magnifier.h @@ -70,7 +69,11 @@ GNOME_Magnifier_module_la_LIBADD = $(ORBIT_LIBS) GNOME_Magnifier_module_la_SOURCES = \ GNOME_Magnifier-imodule.c -LDADD = $(DEPS_LIBS) libgnome-mag.la $(X_LIBS) $(POPT_LIBS) +# The X_LIBS must be searched first, since the DEPS_LIBS are setted by a call +# to pkg-config and can contain a path to X libraries, other way the +# functionalities finded during the test that setted X_LIBS can not be +# presented in the final link. +LDADD = $(X_LIBS) $(DEPS_LIBS) libgnome-mag.la $(POPT_LIBS) serverinfodir= $(libdir)/bonobo/servers $(server_in_files): $(server_in_files).in diff --git a/magnifier/zoom-region.c b/magnifier/zoom-region.c index c0e7f4d..c0e6409 100644 --- a/magnifier/zoom-region.c +++ b/magnifier/zoom-region.c @@ -59,6 +59,7 @@ static GObjectClass *parent_class = NULL; enum { ZOOM_REGION_MANAGED_PROP, + ZOOM_REGION_POLL_MOUSE_PROP, ZOOM_REGION_SMOOTHSCROLL_PROP, ZOOM_REGION_INVERT_PROP, ZOOM_REGION_SMOOTHING_PROP, @@ -83,6 +84,7 @@ enum { gchar* prop_names[ZOOM_REGION_EXIT_MAGNIFIER + 1] = { "MANAGED", + "POLLMOUSE" "SMOOTHSCROLL", "INVERT", "SMOOTHING", @@ -1397,7 +1399,8 @@ zoom_region_update_pointer (ZoomRegion *zoom_region, gboolean draw_cursor) #ifdef ZOOM_REGION_DEBUG g_assert (zoom_region->alive); #endif - if (!zoom_region->priv || !zoom_region->priv->parent) + if (!zoom_region->priv || !zoom_region->priv->parent + || !zoom_region->poll_mouse) return FALSE; magnifier = zoom_region->priv->parent; @@ -2225,6 +2228,9 @@ zoom_region_get_property (BonoboPropertyBag *bag, case ZOOM_REGION_MANAGED_PROP: BONOBO_ARG_SET_BOOLEAN (arg, zoom_region->is_managed); break; + case ZOOM_REGION_POLL_MOUSE_PROP: + BONOBO_ARG_SET_BOOLEAN (arg, zoom_region->poll_mouse); + break; case ZOOM_REGION_INVERT_PROP: BONOBO_ARG_SET_BOOLEAN (arg, zoom_region->invert); break; @@ -2308,6 +2314,25 @@ zoom_region_set_property (BonoboPropertyBag *bag, case ZOOM_REGION_MANAGED_PROP: zoom_region->is_managed = BONOBO_ARG_GET_BOOLEAN (arg); break; + case ZOOM_REGION_POLL_MOUSE_PROP: + zoom_region->poll_mouse = BONOBO_ARG_GET_BOOLEAN (arg); + if (zoom_region->poll_mouse) + { + g_message ("Adding polling timer"); + zoom_region->priv->update_pointer_id = + g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE, + 200, + zoom_region_update_pointer_timeout, + zoom_region, + NULL); + } + else if (zoom_region->priv->update_pointer_id) + { + g_message ("Removing polling timer"); + g_source_remove (zoom_region->priv->update_pointer_id); + zoom_region->priv->update_pointer_id = 0; + } + break; case ZOOM_REGION_INVERT_PROP: zoom_region->invert = BONOBO_ARG_GET_BOOLEAN (arg); zoom_region_update_current (zoom_region); @@ -2501,6 +2526,47 @@ zoom_region_pan_test (gpointer data) } static void +impl_zoom_region_set_pointer_pos (PortableServer_Servant servant, + const CORBA_long mouse_x, + const CORBA_long mouse_y, + CORBA_Environment *ev) +{ + ZoomRegion *zoom_region = + ZOOM_REGION (bonobo_object_from_servant (servant)); + GdkRectangle paint_area, *clip = NULL; + +#ifdef ZOOM_REGION_DEBUG + g_assert (zoom_region->alive); +#endif + DBG (fprintf (stderr, "Set Pointer: \t%ld,%ld\n", + (long) mouse_x, (long) mouse_y)); + + fprintf (stderr, "Set Pointer: \t%ld,%ld\n", + (long) mouse_x, (long) mouse_y); + + zoom_region_set_cursor_pos (zoom_region, (int) mouse_x, (int) mouse_y); + + if (GTK_IS_WIDGET (zoom_region->priv->w) && + GDK_IS_DRAWABLE (zoom_region->priv->w->window)) + { + gdk_drawable_get_size ( + GDK_DRAWABLE ( + zoom_region->priv->w->window), + &paint_area.width, &paint_area.height); + paint_area.x = 0; + paint_area.y = 0; + clip = &paint_area; + paint_area = zoom_region_clip_to_source ( + zoom_region, paint_area); + } + /* + * if we update the cursor now, it causes flicker if the client + * subsequently calls setROI, so we wait for a redraw. + * Perhaps we should cue a redraw on idle instead? + */ +} + +static void impl_zoom_region_set_contrast (PortableServer_Servant servant, const CORBA_float R, const CORBA_float G, @@ -2822,6 +2888,7 @@ zoom_region_class_init (ZoomRegionClass *klass) epv->getMagFactor = impl_zoom_region_get_mag_factor; epv->getProperties = impl_zoom_region_get_properties; epv->setROI = impl_zoom_region_set_roi; + epv->setPointerPos = impl_zoom_region_set_pointer_pos; epv->markDirty = impl_zoom_region_mark_dirty; epv->getROI = impl_zoom_region_get_roi; epv->moveResize = impl_zoom_region_move_resize; @@ -2862,6 +2929,19 @@ zoom_region_properties_init (ZoomRegion *zoom_region) Bonobo_PROPERTY_WRITEABLE); bonobo_arg_release (def); + def = bonobo_arg_new (BONOBO_ARG_BOOLEAN); + BONOBO_ARG_SET_BOOLEAN (def, TRUE); + + bonobo_property_bag_add (zoom_region->properties, + "poll-mouse", + ZOOM_REGION_POLL_MOUSE_PROP, + BONOBO_ARG_BOOLEAN, + NULL, + "If false, zoom region does not poll for pointer location, but is (exclusively) given it by the client", + Bonobo_PROPERTY_READABLE | + Bonobo_PROPERTY_WRITEABLE); + + bonobo_arg_release (def); def = bonobo_arg_new (BONOBO_ARG_SHORT); BONOBO_ARG_SET_SHORT (def, GNOME_Magnifier_ZoomRegion_SCROLL_FASTEST); @@ -3147,6 +3227,7 @@ zoom_region_init (ZoomRegion *zoom_region) zoom_region->x_align_policy = GNOME_Magnifier_ZoomRegion_ALIGN_CENTER; zoom_region->y_align_policy = GNOME_Magnifier_ZoomRegion_ALIGN_CENTER; zoom_region->coalesce_func = _coalesce_update_rects; + zoom_region->poll_mouse = TRUE; zoom_region->priv = g_malloc (sizeof (ZoomRegionPrivate)); zoom_region_private_init (zoom_region->priv); bonobo_object_add_interface (BONOBO_OBJECT (zoom_region), diff --git a/magnifier/zoom-region.h b/magnifier/zoom-region.h index aa012e7..e6a35a2 100644 --- a/magnifier/zoom-region.h +++ b/magnifier/zoom-region.h @@ -68,6 +68,7 @@ typedef struct { gboolean timing_output; gint timing_pan_rate; gboolean exit_magnifier; + gboolean poll_mouse; #ifdef ZOOM_REGION_DEBUG gboolean alive; #endif diff --git a/test/control-client.c b/test/control-client.c index 8182baa..194863f 100644 --- a/test/control-client.c +++ b/test/control-client.c @@ -130,7 +130,7 @@ int main(int argc, char ** argv){ CORBA_Environment ev; CORBA_any *rect_any; GNOME_Magnifier_RectBounds *rectangle; - + CORBA_boolean boo; CORBA_string target_disp = NULL; CORBA_string source_disp = NULL; @@ -252,8 +252,18 @@ int main(int argc, char ** argv){ Bonobo_PropertyBag_setValue (properties, "target-display-bounds", rect_any, NULL); bonobo_object_release_unref (properties, NULL); break; + case 'X': + if (zoom_region == CORBA_OBJECT_NIL) return -1; + printf ("toggle mouse polling\n"); + properties = GNOME_Magnifier_ZoomRegion_getProperties (zoom_region, &ev); + boo = bonobo_pbclient_get_boolean (properties, "poll-mouse", NULL); + bonobo_pbclient_set_boolean (properties, "poll-mouse", !boo, NULL); + bonobo_object_release_unref (properties, NULL); + GNOME_Magnifier_ZoomRegion_setPointerPos (zoom_region, + 50, 50, + &ev); + break; } - return 0; } |