[caribou: 7/23] Remove get_acc_geometry



commit 2cc662a32f10ac921426a861f6f4ba453d0c9edd
Author: Nohemi Fernandez <nf68 cornell edu>
Date:   Thu Aug 4 14:11:53 2011 -0500

    Remove get_acc_geometry

 modules/gtk2/Makefile.am             |    4 --
 modules/gtk2/vapi-fixes.vapi         |    1 -
 modules/gtk3/Makefile.am             |    4 --
 modules/gtk3/caribou-gtk-module.vala |   56 +--------------------------------
 modules/gtk3/vapi-fixes.vapi         |   10 ------
 5 files changed, 2 insertions(+), 73 deletions(-)
---
diff --git a/modules/gtk2/Makefile.am b/modules/gtk2/Makefile.am
index d47a6a4..57e9022 100644
--- a/modules/gtk2/Makefile.am
+++ b/modules/gtk2/Makefile.am
@@ -9,7 +9,6 @@ libcaribou_la_SOURCES = \
 libcaribou_la_VALAFLAGS = \
 	-h caribou-gtk-module.h \
     --vapidir=. \
-	--pkg vapi-fixes \
 	--pkg gtk+-2.0 \
 	-D GTK2 \
 	$(VALAGLAFS)
@@ -28,6 +27,3 @@ libcaribou_la_LDFLAGS = \
         -module \
         $(NULL)
 
-EXTRA_DIST = \
-	vapi-fixes.vapi \
-	$(NULL)
diff --git a/modules/gtk3/Makefile.am b/modules/gtk3/Makefile.am
index 6d95287..c25655c 100644
--- a/modules/gtk3/Makefile.am
+++ b/modules/gtk3/Makefile.am
@@ -9,7 +9,6 @@ libcaribou_la_SOURCES = \
 libcaribou_la_VALAFLAGS = \
 	-h caribou-gtk-module.h \
     --vapidir=. \
-	--pkg vapi-fixes \
 	--pkg gtk+-3.0 \
 	$(VALAGLAFS)
 
@@ -27,6 +26,3 @@ libcaribou_la_LDFLAGS = \
         -module \
         $(NULL)
 
-EXTRA_DIST = \
-	vapi-fixes.vapi \
-	$(NULL)
diff --git a/modules/gtk3/caribou-gtk-module.vala b/modules/gtk3/caribou-gtk-module.vala
index c662878..5c0f062 100644
--- a/modules/gtk3/caribou-gtk-module.vala
+++ b/modules/gtk3/caribou-gtk-module.vala
@@ -52,12 +52,11 @@ namespace Caribou {
             Gtk.Widget? widget = window.get_focus();
             uint32 timestamp = Gtk.get_current_event_time();
             if (widget != null && (widget is Gtk.Entry || widget is Gtk.TextView) && widget is Gtk.Editable) {
-                Atk.Object focus_object = widget.get_accessible();
                 Gdk.Window current_window = widget.get_window();
                 int x=0, y=0, w=0, h=0;
-                if (current_window != null && !get_acc_geometry (focus_object, out x, out y, out w, out h)) {
+                if (current_window != null)
                     get_origin_geometry (current_window, out x, out y, out w, out h);
-                }
+
                 try {
                     keyboard.show (timestamp);
                     keyboard.set_entry_location (x, y, w, h);
@@ -85,56 +84,5 @@ namespace Caribou {
 #endif
         }
 
-        private Atk.Object? find_focused_accessible (Atk.Object acc) {
-            Atk.StateSet state = acc.ref_state_set ();
-
-            bool match = (state.contains_state (Atk.StateType.EDITABLE) &&
-                          state.contains_state (Atk.StateType.FOCUSED) &&
-                          acc.get_n_accessible_children () == 0);
-
-            if (match)
-                return acc;
-
-            for (int i=0;i<acc.get_n_accessible_children ();i++) {
-                 Atk.Object child = acc.ref_accessible_child (i);
-                 Atk.Object focused_child = find_focused_accessible (child);
-                 if (focused_child != null)
-                     return focused_child;
-            }
-
-            return null;
-        }
-
-        private bool get_acc_geometry (Atk.Object acc,
-                                       out int x, out int y, out int w, out int h) {
-            Atk.Object child = null;
-
-
-            if (acc.get_role () == Atk.Role.REDUNDANT_OBJECT) {
-                /* It is probably Gecko */
-                child = Atk.get_focus_object ();
-            } else {
-                child = find_focused_accessible (acc);
-            }
-
-            if (child == null)
-                return false;
-
-            if (!(child is Atk.Component)) {
-                stderr.printf ("Accessible is not a component\n");
-                return false;
-            }
-
-            /* We don't want the keyboard on the paragraph in OOo */
-            if (child.get_role() == Atk.Role.PARAGRAPH)
-                child = child.get_parent();
-
-            Atk.component_get_extents ((Atk.Component) child,
-                                       out x, out y, out w, out h,
-                                       Atk.CoordType.SCREEN);
-
-            return true;
-        }
-
     }
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]